/*! * AngularJS Material Design * https://github.com/angular/material * @license MIT * v1.1.18-master-97a1616 */ !function(t,d){"use strict";function e(t){return'"}i.$inject=["$$rAF","$mdUtil","$mdConstant","$parse","$rootScope","$window","$scope","$element","$attrs"],n.$inject=["$scope","$element","$attrs","$browser","$document","$rootScope","$$rAF","$mdUtil"],s.$inject=["$parse"],d.module("material.components.virtualRepeat",["material.core","material.components.showHide"]).directive("mdVirtualRepeatContainer",function(){return{controller:i,template:e,compile:function(t,e){t.addClass("md-virtual-repeat-container").addClass(e.hasOwnProperty("mdOrientHorizontal")?"md-orient-horizontal":"md-orient-vertical")}}}).directive("mdVirtualRepeat",s).directive("mdForceHeight",r);function i(t,i,e,s,n,o,r,h,l){this.$rootScope=n,this.$scope=r,this.$element=h,this.$attrs=l,this.size=0,this.scrollSize=0,this.scrollOffset=0,this.horizontal=this.$attrs.hasOwnProperty("mdOrientHorizontal"),this.repeater=null,this.autoShrink=this.$attrs.hasOwnProperty("mdAutoShrink"),this.autoShrinkMin=parseInt(this.$attrs.mdAutoShrinkMin,10)||0,this.originalSize=null,this.offsetSize=parseInt(this.$attrs.mdOffsetSize,10)||0,this.oldElementSize=null,this.maxElementPixels=e.ELEMENT_MAX_PIXELS,this.$attrs.mdTopIndex?(this.bindTopIndex=s(this.$attrs.mdTopIndex),this.topIndex=this.bindTopIndex(this.$scope),d.isDefined(this.topIndex)||(this.topIndex=0,this.bindTopIndex.assign(this.$scope,0)),this.$scope.$watch(this.bindTopIndex,d.bind(this,function(t){t!==this.topIndex&&this.scrollToIndex(t)}))):this.topIndex=0,this.scroller=h[0].querySelector(".md-virtual-repeat-scroller"),this.sizer=this.scroller.querySelector(".md-virtual-repeat-sizer"),this.offsetter=this.scroller.querySelector(".md-virtual-repeat-offsetter");var a=d.bind(this,this.updateSize);t(d.bind(this,function(){a();var t=i.debounce(a,10,null,!1),e=d.element(o);this.size||t(),e.on("resize",t),r.$on("$destroy",function(){e.off("resize",t)}),r.$emit("$md-resize-enable"),r.$on("$md-resize",a)}))}function s(s){return{controller:n,priority:1e3,require:["mdVirtualRepeat","^^mdVirtualRepeatContainer"],restrict:"A",terminal:!0,transclude:"element",compile:function(t,e){var i=e.mdVirtualRepeat.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/),o=i[1],r=s(i[2]),h=e.mdExtraName&&s(e.mdExtraName);return function(t,e,i,s,n){s[0].link_(s[1],n,o,r,h)}}}}function n(t,e,i,s,n,o,r,h){this.$scope=t,this.$element=e,this.$attrs=i,this.$browser=s,this.$document=n,this.$mdUtil=h,this.$rootScope=o,this.$$rAF=r,this.onDemand=h.parseAttributeBoolean(i.mdOnDemand),this.browserCheckUrlChange=s.$$checkUrlChange,this.newStartIndex=0,this.newEndIndex=0,this.newVisibleEnd=0,this.startIndex=0,this.endIndex=0,this.itemSize=t.$eval(i.mdItemSize)||null,this.isFirstRender=!0,this.isVirtualRepeatUpdating_=!1,this.itemsLength=0,this.unwatchItemSize_=d.noop,this.blocks={},this.pooledBlocks=[],t.$on("$destroy",d.bind(this,this.cleanupBlocks_))}function o(t){if(!d.isFunction(t.getItemAtIndex)||!d.isFunction(t.getLength))throw Error("When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement functions getItemAtIndex() and getLength().");this.model=t}function r(t){return{restrict:"A",link:function(t,e,i){var s=t.$eval(i.mdForceHeight)||null;s&&e&&(e[0].style.height=s)}}}i.prototype.register=function(t){this.repeater=t,d.element(this.scroller).on("scroll wheel touchmove touchend",d.bind(this,this.handleScroll_))},i.prototype.isHorizontal=function(){return this.horizontal},i.prototype.getSize=function(){return this.size},i.prototype.setSize_=function(t){var e=this.getDimensionName_();this.size=t,this.$element[0].style[e]=t+"px"},i.prototype.unsetSize_=function(){this.$element[0].style[this.getDimensionName_()]=this.oldElementSize,this.oldElementSize=null},i.prototype.updateSize=function(){if(!this.originalSize){var t=this.isHorizontal()?this.$element[0].clientWidth:this.$element[0].clientHeight;t&&(this.size=t),this.handleScroll_(),this.repeater&&this.repeater.containerUpdated()}},i.prototype.getScrollSize=function(){return this.scrollSize},i.prototype.getDimensionName_=function(){return this.isHorizontal()?"width":"height"},i.prototype.sizeScroller_=function(t){var e=this.getDimensionName_(),i=this.isHorizontal()?"height":"width";if(this.sizer.innerHTML="",tthis.scrollSize-this.size&&(e=this.scrollSize-this.size),e!==this.scrollOffset)){var i=this.repeater.getItemSize();if(i){var s=Math.max(0,Math.floor(e/i)-3),n=(this.isHorizontal()?"translateX(":"translateY(")+(!this.isHorizontal()||t?s*i:-s*i)+"px)";if(this.scrollOffset=e,this.offsetter.style.webkitTransform=n,this.offsetter.style.transform=n,this.bindTopIndex){var o=Math.floor(e/i);o!==this.topIndex&&othis.container.getScrollSize())&&(this.items instanceof o&&this.items.$$includeIndexes(this.newStartIndex,this.newEndIndex),this.virtualRepeatUpdate_(this.items,this.items))},n.prototype.getItemSize=function(){return this.itemSize},n.prototype.getItemCount=function(){return this.itemsLength},n.prototype.virtualRepeatUpdate_=function(t,e){this.isVirtualRepeatUpdating_=!0;var i=t&&t.length||0,s=!1;if(this.items&&i=this.newEndIndex)&&this.poolBlock_(e)},this),this.$browser.$$checkUrlChange=d.noop;var o,r,h=[],l=[];for(o=this.newStartIndex;o