import { ElementRef , SimpleChange } from '@angular/core' ; export function resolveContainerElement ( selector , scrollWindow , defaultElement , fromRoot ) { const hasWindow = window && ! ! window . document && window . document . documentElement ; let container = hasWindow && scrollWindow ? window : defaultElement ; if ( selector ) { const containerIsString = selector && hasWindow && typeof selector === 'string' ; container = containerIsString ? findElement ( selector , defaultElement . nativeElement , fromRoot ) : selector ; if ( ! container ) { throw new Error ( 'ngx-infinite-scroll {resolveContainerElement()}: selector for' ) ; } } return container ; } export function findElement ( selector , customRoot , fromRoot ) { const rootEl = fromRoot ? window . document : customRoot ; return rootEl . querySelector ( selector ) ; } export function inputPropChanged ( prop ) { return prop && ! prop . firstChange ; } export function hasWindowDefined ( ) { return typeof window !== 'undefined' ; }