/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.2-master-a9ba340
*/
function VirtualRepeatContainerDirective(){return{controller:VirtualRepeatContainerController,template:virtualRepeatContainerTemplate,compile:function(t,e){t.addClass("md-virtual-repeat-container").addClass(e.hasOwnProperty("mdOrientHorizontal")?"md-orient-horizontal":"md-orient-vertical")}}}function virtualRepeatContainerTemplate(t){return'
"}function VirtualRepeatContainerController(t,e,i,r,s,n,o,a,l){this.$rootScope=s,this.$scope=o,this.$element=a,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=i.ELEMENT_MAX_PIXELS,this.$attrs.mdTopIndex?(this.bindTopIndex=r(this.$attrs.mdTopIndex),this.topIndex=this.bindTopIndex(this.$scope),angular.isDefined(this.topIndex)||(this.topIndex=0,this.bindTopIndex.assign(this.$scope,0)),this.$scope.$watch(this.bindTopIndex,angular.bind(this,function(t){t!==this.topIndex&&this.scrollToIndex(t)}))):this.topIndex=0,this.scroller=a[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 h=angular.bind(this,this.updateSize);t(angular.bind(this,function(){h();var t=e.debounce(h,10,null,!1),i=angular.element(n);this.size||t(),i.on("resize",t),o.$on("$destroy",function(){i.off("resize",t)}),o.$emit("$md-resize-enable"),o.$on("$md-resize",h)}))}function VirtualRepeatDirective(t){return{controller:VirtualRepeatController,priority:1e3,require:["mdVirtualRepeat","^^mdVirtualRepeatContainer"],restrict:"A",terminal:!0,transclude:"element",compile:function(e,i){var r=i.mdVirtualRepeat,s=r.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/),n=s[1],o=t(s[2]),a=i.mdExtraName&&t(i.mdExtraName);return function(t,e,i,r,s){r[0].link_(r[1],s,n,o,a)}}}}function VirtualRepeatController(t,e,i,r,s,n,o,a){this.$scope=t,this.$element=e,this.$attrs=i,this.$browser=r,this.$document=s,this.$rootScope=n,this.$$rAF=o,this.onDemand=a.parseAttributeBoolean(i.mdOnDemand),this.browserCheckUrlChange=r.$$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_=angular.noop,this.blocks={},this.pooledBlocks=[],t.$on("$destroy",angular.bind(this,this.cleanupBlocks_))}function VirtualRepeatModelArrayLike(t){if(!angular.isFunction(t.getItemAtIndex)||!angular.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}goog.provide("ngmaterial.components.virtualRepeat"),goog.require("ngmaterial.components.showHide"),goog.require("ngmaterial.core"),VirtualRepeatContainerController.$inject=["$$rAF","$mdUtil","$mdConstant","$parse","$rootScope","$window","$scope","$element","$attrs"],VirtualRepeatController.$inject=["$scope","$element","$attrs","$browser","$document","$rootScope","$$rAF","$mdUtil"],VirtualRepeatDirective.$inject=["$parse"],angular.module("material.components.virtualRepeat",["material.core","material.components.showHide"]).directive("mdVirtualRepeatContainer",VirtualRepeatContainerDirective).directive("mdVirtualRepeat",VirtualRepeatDirective);var NUM_EXTRA=3;VirtualRepeatContainerController.prototype.register=function(t){this.repeater=t,angular.element(this.scroller).on("scroll wheel touchmove touchend",angular.bind(this,this.handleScroll_))},VirtualRepeatContainerController.prototype.isHorizontal=function(){return this.horizontal},VirtualRepeatContainerController.prototype.getSize=function(){return this.size},VirtualRepeatContainerController.prototype.setSize_=function(t){var e=this.getDimensionName_();this.size=t,this.$element[0].style[e]=t+"px"},VirtualRepeatContainerController.prototype.unsetSize_=function(){this.$element[0].style[this.getDimensionName_()]=this.oldElementSize,this.oldElementSize=null},VirtualRepeatContainerController.prototype.updateSize=function(){this.originalSize||(this.size=this.isHorizontal()?this.$element[0].clientWidth:this.$element[0].clientHeight,this.handleScroll_(),this.repeater&&this.repeater.containerUpdated())},VirtualRepeatContainerController.prototype.getScrollSize=function(){return this.scrollSize},VirtualRepeatContainerController.prototype.getDimensionName_=function(){return this.isHorizontal()?"width":"height"},VirtualRepeatContainerController.prototype.sizeScroller_=function(t){var e=this.getDimensionName_(),i=this.isHorizontal()?"height":"width";if(this.sizer.innerHTML="",ti&&(t=i-1),this.scrollTo(e*t)},VirtualRepeatContainerController.prototype.resetScroll=function(){this.scrollTo(0)},VirtualRepeatContainerController.prototype.handleScroll_=function(){var t="rtl"!=document.dir&&"rtl"!=document.body.dir;t||this.maxSize||(this.scroller.scrollLeft=this.scrollSize,this.maxSize=this.scroller.scrollLeft);var e=this.isHorizontal()?t?this.scroller.scrollLeft:this.maxSize-this.scroller.scrollLeft:this.scroller.scrollTop;if(!(e===this.scrollOffset||e>this.scrollSize-this.size)){var i=this.repeater.getItemSize();if(i){var r=Math.max(0,Math.floor(e/i)-NUM_EXTRA),s=(this.isHorizontal()?"translateX(":"translateY(")+(!this.isHorizontal()||t?r*i:-(r*i))+"px)";if(this.scrollOffset=e,this.offsetter.style.webkitTransform=s,this.offsetter.style.transform=s,this.bindTopIndex){var n=Math.floor(e/i);n!==this.topIndex&&nthis.container.getScrollSize())&&(this.items instanceof VirtualRepeatModelArrayLike&&this.items.$$includeIndexes(this.newStartIndex,this.newEndIndex),this.virtualRepeatUpdate_(this.items,this.items)))):(this.unwatchItemSize_&&this.unwatchItemSize_!==angular.noop&&this.unwatchItemSize_(),this.unwatchItemSize_=this.$scope.$watchCollection(this.repeatListExpression,angular.bind(this,function(t){t&&t.length&&this.readItemSize_()})),void(this.$rootScope.$$phase||this.$scope.$digest()))},VirtualRepeatController.prototype.getItemSize=function(){return this.itemSize},VirtualRepeatController.prototype.getItemCount=function(){return this.itemsLength},VirtualRepeatController.prototype.virtualRepeatUpdate_=function(t,e){this.isVirtualRepeatUpdating_=!0;var i=t&&t.length||0,r=!1;if(this.items&&i=this.newEndIndex)&&this.poolBlock_(e)},this),this.$browser.$$checkUrlChange=angular.noop;var o,a,l=[],h=[];for(o=this.newStartIndex;o