/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.mobile.scrollview.min",["kendo.fx.min","kendo.data.min","kendo.draganddrop.min"],e)}(function(){return function(e,t){var n,i,s,a,o,h,r,g,c=window.kendo,p=c.mobile,l=p.ui,u=e.proxy,d=c.effects.Transition,f=c.ui.Pane,m=c.ui.PaneDimensions,v=l.DataBoundWidget,_=c.data.DataSource,P=c.data.Buffer,w=c.data.BatchBuffer,b=Math,y=b.abs,x=b.ceil,S=b.round,T=b.max,C=b.min,z=b.floor,E="change",O="changing",k="refresh",R="km-current-page",D="km-virtual-page",M="function",V="itemChange",W="cleanup",B=3,H=-1,I=0,U=1,A=-1,j=0,q=1,F=c.Class.extend({init:function(t){var n=this,i=e("<ol class='km-pages'/>");t.element.append(i),this._changeProxy=u(n,"_change"),this._refreshProxy=u(n,"_refresh"),t.bind(E,this._changeProxy),t.bind(k,this._refreshProxy),e.extend(n,{element:i,scrollView:t})},items:function(){return this.element.children()},_refresh:function(e){var t,n="";for(t=0;t<e.pageCount;t++)n+="<li/>";this.element.html(n),this.items().eq(e.page).addClass(R)},_change:function(e){this.items().removeClass(R).eq(e.page).addClass(R)},destroy:function(){this.scrollView.unbind(E,this._changeProxy),this.scrollView.unbind(k,this._refreshProxy),this.element.remove()}});c.mobile.ui.ScrollViewPager=F,n="transitionEnd",i="dragStart",s="dragEnd",a=c.Observable.extend({init:function(t,a){var o,h,r,g,p,l,u=this;c.Observable.fn.init.call(this),this.element=t,this.container=t.parent(),o=new c.ui.Movable(u.element),h=new d({axis:"x",movable:o,onEnd:function(){u.trigger(n)}}),r=new c.UserEvents(t,{fastTap:!0,start:function(e){2*y(e.x.velocity)>=y(e.y.velocity)?r.capture():r.cancel(),u.trigger(i,e),h.cancel()},allowSelection:!0,end:function(e){u.trigger(s,e)}}),g=new m({element:u.element,container:u.container}),p=g.x,p.bind(E,function(){u.trigger(E)}),l=new f({dimensions:g,userEvents:r,movable:o,elastic:!0}),e.extend(u,{duration:a&&a.duration||1,movable:o,transition:h,userEvents:r,dimensions:g,dimension:p,pane:l}),this.bind([n,i,s,E],a)},size:function(){return{width:this.dimensions.x.getSize(),height:this.dimensions.y.getSize()}},total:function(){return this.dimension.getTotal()},offset:function(){return-this.movable.x},updateDimension:function(){this.dimension.update(!0)},refresh:function(){this.dimensions.refresh()},moveTo:function(e){this.movable.moveAxis("x",-e)},transitionTo:function(e,t,n){n?this.moveTo(-e):this.transition.moveTo({location:e,duration:this.duration,ease:t})}}),c.mobile.ui.ScrollViewElasticPane=a,o=c.Observable.extend({init:function(e,t,n){var i=this;c.Observable.fn.init.call(this),i.element=e,i.pane=t,i._getPages(),this.page=0,this.pageSize=n.pageSize||1,this.contentHeight=n.contentHeight,this.enablePager=n.enablePager,this.pagerOverlay=n.pagerOverlay},scrollTo:function(e,t){this.page=e,this.pane.transitionTo(-e*this.pane.size().width,d.easeOutExpo,t)},paneMoved:function(e,t,n,i){var s,a,o=this,h=o.pane,r=h.size().width*o.pageSize,g=S,c=t?d.easeOutBack:d.easeOutExpo;e===A?g=x:e===q&&(g=z),a=g(h.offset()/r),s=T(o.minSnap,C(-a*r,o.maxSnap)),a!=o.page&&n&&n({currentPage:o.page,nextPage:a})&&(s=-o.page*h.size().width),h.transitionTo(s,c,i)},updatePage:function(){var e=this.pane,t=S(e.offset()/e.size().width);return t!=this.page&&(this.page=t,!0)},forcePageUpdate:function(){return this.updatePage()},resizeTo:function(e){var t,n,i=this.pane,s=e.width;this.pageElements.width(s),"100%"===this.contentHeight&&(t=this.element.parent().height(),this.enablePager===!0&&(n=this.element.parent().find("ol.km-pages"),!this.pagerOverlay&&n.length&&(t-=c._outerHeight(n,!0))),this.element.css("height",t),this.pageElements.css("height",t)),i.updateDimension(),this._paged||(this.page=z(i.offset()/s)),this.scrollTo(this.page,!0),this.pageCount=x(i.total()/s),this.minSnap=-(this.pageCount-1)*s,this.maxSnap=0},_getPages:function(){this.pageElements=this.element.find(c.roleSelector("page")),this._paged=this.pageElements.length>0}}),c.mobile.ui.ScrollViewContent=o,h=c.Observable.extend({init:function(e,t,n){var i=this;c.Observable.fn.init.call(this),i.element=e,i.pane=t,i.options=n,i._templates(),i.page=n.page||0,i.pages=[],i._initPages(),i.resizeTo(i.pane.size()),i.pane.dimension.forceEnabled()},setDataSource:function(e){this.dataSource=_.create(e),this._buffer(),this._pendingPageRefresh=!1,this._pendingWidgetRefresh=!1},_viewShow:function(){var e=this;e._pendingWidgetRefresh&&(setTimeout(function(){e._resetPages()},0),e._pendingWidgetRefresh=!1)},_buffer:function(){var e=this.options.itemsPerPage;this.buffer&&this.buffer.destroy(),this.buffer=e>1?new w(this.dataSource,e):new P(this.dataSource,3*e),this._resizeProxy=u(this,"_onResize"),this._resetProxy=u(this,"_onReset"),this._endReachedProxy=u(this,"_onEndReached"),this.buffer.bind({resize:this._resizeProxy,reset:this._resetProxy,endreached:this._endReachedProxy})},_templates:function(){var e=this.options.template,t=this.options.emptyTemplate,n={},i={};typeof e===M&&(n.template=e,e="#=this.template(data)#"),this.template=u(c.template(e),n),typeof t===M&&(i.emptyTemplate=t,t="#=this.emptyTemplate(data)#"),this.emptyTemplate=u(c.template(t),i)},_initPages:function(){var e,t,n=this.pages,i=this.element;for(t=0;t<B;t++)e=new r(i),n.push(e);this.pane.updateDimension()},resizeTo:function(e){var t,n,i,s=this.pages,a=this.pane;for(t=0;t<s.length;t++)s[t].setWidth(e.width);"auto"===this.options.contentHeight?this.element.css("height",this.pages[1].element.height()):"100%"===this.options.contentHeight&&(n=this.element.parent().height(),this.options.enablePager===!0&&(i=this.element.parent().find("ol.km-pages"),!this.options.pagerOverlay&&i.length&&(n-=c._outerHeight(i,!0))),this.element.css("height",n),s[0].element.css("height",n),s[1].element.css("height",n),s[2].element.css("height",n)),a.updateDimension(),this._repositionPages(),this.width=e.width},scrollTo:function(e){var t,n=this.buffer;n.syncDataSource(),t=n.at(e),t&&(this._updatePagesContent(e),this.page=e)},paneMoved:function(e,t,n,i){var s,a=this,o=a.pane,h=o.size().width,r=o.offset(),g=Math.abs(r)>=h/3,p=t?c.effects.Transition.easeOutBack:c.effects.Transition.easeOutExpo,l=a.page+2>a.buffer.total(),u=0;e===q?0!==a.page&&(u=-1):e!==A||l?r>0&&g&&!l?u=1:r<0&&g&&0!==a.page&&(u=-1):u=1,s=a.page,u&&(s=u>0?s+1:s-1),n&&n({currentPage:a.page,nextPage:s})&&(u=0),0===u?a._cancelMove(p,i):u===-1?a._moveBackward(i):1===u&&a._moveForward(i)},updatePage:function(){var e=this.pages;return 0!==this.pane.offset()&&(this.pane.offset()>0?(e.push(this.pages.shift()),this.page++,this.setPageContent(e[2],this.page+1)):(e.unshift(this.pages.pop()),this.page--,this.setPageContent(e[0],this.page-1)),this._repositionPages(),this._resetMovable(),!0)},forcePageUpdate:function(){var e=this.pane.offset(),t=3*this.pane.size().width/4;return y(e)>t&&this.updatePage()},_resetMovable:function(){this.pane.moveTo(0)},_moveForward:function(e){this.pane.transitionTo(-this.width,c.effects.Transition.easeOutExpo,e)},_moveBackward:function(e){this.pane.transitionTo(this.width,c.effects.Transition.easeOutExpo,e)},_cancelMove:function(e,t){this.pane.transitionTo(0,e,t)},_resetPages:function(){this.page=this.options.page||0,this._updatePagesContent(this.page),this._repositionPages(),this.trigger("reset")},_onResize:function(){this.pageCount=x(this.dataSource.total()/this.options.itemsPerPage),this._pendingPageRefresh&&(this._updatePagesContent(this.page),this._pendingPageRefresh=!1),this.trigger("resize")},_onReset:function(){this.pageCount=x(this.dataSource.total()/this.options.itemsPerPage),this._resetPages()},_onEndReached:function(){this._pendingPageRefresh=!0},_repositionPages:function(){var e=this.pages;e[0].position(H),e[1].position(I),e[2].position(U)},_updatePagesContent:function(e){var t=this.pages,n=e||0;this.setPageContent(t[0],n-1),this.setPageContent(t[1],n),this.setPageContent(t[2],n+1)},setPageContent:function(t,n){var i=this.buffer,s=this.template,a=this.emptyTemplate,o=null;n>=0&&(o=i.at(n),e.isArray(o)&&!o.length&&(o=null)),this.trigger(W,{item:t.element}),t.content(null!==o?s(o):a({})),c.mobile.init(t.element),this.trigger(V,{item:t.element,data:o,ns:c.mobile.ui})}}),c.mobile.ui.VirtualScrollViewContent=h,r=c.Class.extend({init:function(t){this.element=e("<div class='"+D+"'></div>"),this.width=t.width(),this.element.width(this.width),t.append(this.element)},content:function(e){this.element.html(e)},position:function(e){this.element.css("transform","translate3d("+this.width*e+"px, 0, 0)")},setWidth:function(e){this.width=e,this.element.width(e)}}),c.mobile.ui.VirtualPage=r,g=v.extend({init:function(e,t){var n,i,s,r=this;v.fn.init.call(r,e,t),t=r.options,e=r.element,c.stripWhitespace(e[0]),e.wrapInner("<div/>").addClass("km-scrollview"),this.options.enablePager&&(this.pager=new F(this),this.options.pagerOverlay&&e.addClass("km-scrollview-overlay")),r.inner=e.children().first(),r.page=0,r.inner.css("height",t.contentHeight),r.pane=new a(r.inner,{duration:this.options.duration,transitionEnd:u(this,"_transitionEnd"),dragStart:u(this,"_dragStart"),dragEnd:u(this,"_dragEnd"),change:u(this,k)}),r.bind("resize",function(){r.pane.refresh()}),r.page=t.page,n=0===this.inner.children().length,i=n?new h(r.inner,r.pane,t):new o(r.inner,r.pane,t),i.page=r.page,i.bind("reset",function(){this._pendingPageRefresh=!1,r._syncWithContent(),r.trigger(k,{pageCount:i.pageCount,page:i.page})}),i.bind("resize",function(){r.trigger(k,{pageCount:i.pageCount,page:i.page})}),i.bind(V,function(e){r.trigger(V,e),r.angular("compile",function(){return{elements:e.item,data:[{dataItem:e.data}]}})}),i.bind(W,function(e){r.angular("cleanup",function(){return{elements:e.item}})}),r._content=i,r.setDataSource(t.dataSource),s=r.container(),s.nullObject?(r.viewInit(),r.viewShow()):s.bind("show",u(this,"viewShow")).bind("init",u(this,"viewInit"))},options:{name:"ScrollView",page:0,duration:400,velocityThreshold:.8,contentHeight:"auto",pageSize:1,itemsPerPage:1,bounceVelocityThreshold:1.6,enablePager:!0,pagerOverlay:!1,autoBind:!0,template:"",emptyTemplate:""},events:[O,E,k],destroy:function(){v.fn.destroy.call(this),c.destroy(this.element)},viewInit:function(){this.options.autoBind&&this._content.scrollTo(this._content.page,!0)},viewShow:function(){this.pane.refresh()},refresh:function(){var e=this._content;e.resizeTo(this.pane.size()),this.page=e.page,this.trigger(k,{pageCount:e.pageCount,page:e.page})},content:function(e){this.element.children().first().html(e),this._content._getPages(),this.pane.refresh()},value:function(e){var n=this.dataSource;return e?(this.scrollTo(n.indexOf(e),!0),t):n.at(this.page)},scrollTo:function(e,t){this._content.scrollTo(e,t),this._syncWithContent()},prev:function(){var e=this,n=e.page-1;e._content instanceof h?e._content.paneMoved(q,t,function(t){return e.trigger(O,t)}):n>-1&&e.scrollTo(n)},next:function(){var e=this,n=e.page+1;e._content instanceof h?e._content.paneMoved(A,t,function(t){return e.trigger(O,t)}):n<e._content.pageCount&&e.scrollTo(n)},setDataSource:function(e){if(this._content instanceof h){var t=!e;this.dataSource=_.create(e),this._content.setDataSource(this.dataSource),this.options.autoBind&&!t&&this.dataSource.fetch()}},items:function(){return this.element.find("."+D)},_syncWithContent:function(){var e,n,i=this._content.pages,s=this._content.buffer;this.page=this._content.page,e=s?s.at(this.page):t,e instanceof Array||(e=[e]),n=i?i[1].element:t,this.trigger(E,{page:this.page,element:n,data:e})},_dragStart:function(){this._content.forcePageUpdate()&&this._syncWithContent()},_dragEnd:function(e){var t=this,n=e.x.velocity,i=this.options.velocityThreshold,s=j,a=y(n)>this.options.bounceVelocityThreshold;n>i?s=q:n<-i&&(s=A),this._content.paneMoved(s,a,function(e){return t.trigger(O,e)})},_transitionEnd:function(){this._content.updatePage()&&this._syncWithContent()}}),l.plugin(g)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.mobile.scrollview.min.js.map
