{"version":3,"sources":["webpack:////Users/owenli/Documents/workspace/awi-woolmark-fe/node_modules/ev-emitter/ev-emitter.js","webpack:///./widgets/gridContainerBlock.js","webpack:////Users/owenli/Documents/workspace/awi-woolmark-fe/node_modules/imagesloaded/imagesloaded.js"],"names":["window","EvEmitter","proto","prototype","on","eventName","listener","events","this","_events","listeners","indexOf","push","once","onceEvents","_onceEvents","off","length","index","splice","emitEvent","args","slice","onceListeners","i","apply","allOff","CLS","GridContainerBlock","el","_this","_classCallCheck","$el","$","$loadMoreBtn","find","concat","$rows","$item","$background","$loadMoreWrapper","skipCount","parseInt","data","totalItem","hideItems","handleLoadMoreBtn","onImageLoaded","_","debounce","key","value","_this2","addClass","removeClass","each","item","attr","_this3","visibleItemsCount","$showItem","setTimeout","animate","scrollTop","offset","top","utils","checkBP","setMobileHieght","setDesktopHeight","row","$row","rowH","ImagesLoaded","background","instances","images","imgObj","img","height","css","h","getWindowWidth","factory","jQuery","console","extend","a","b","prop","arraySlice","Array","elem","options","onAlways","obj","queryElem","document","querySelectorAll","elements","isArray","call","getImages","jqDeferred","Deferred","check","bind","error","Object","create","forEach","addElementImages","nodeName","addImage","addElementBackgroundImages","nodeType","elementNodeTypes","childImgs","children","child","1","9","11","LoadingImage","Background","url","element","Image","style","getComputedStyle","reURL","matches","exec","backgroundImage","addBackground","loadingImage","onProgress","image","message","progress","progressedCount","hasAnyBroken","complete","isLoaded","notify","debug","log","isComplete","jqMethod","getIsImageComplete","confirm","naturalWidth","proxyImage","addEventListener","src","handleEvent","event","method","type","onload","unbindEvents","onerror","removeEventListener","makeJQueryPlugin","fn","imagesLoaded","callback","promise"],"mappings":"oFAAA,QAsBoB,oBAAVA,QAAwBA,YATf,0BAAf,EAS6C,WAEjD,aAEA,SAASC,KAET,IAAIC,EAAQD,EAAUE,UAiFtB,OA/EAD,EAAME,GAAK,SAAUC,EAAWC,GAC9B,GAAMD,GAAcC,EAApB,CAIA,IAAIC,EAASC,KAAKC,QAAUD,KAAKC,SAA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IACxCA,EAASA,GAAUpF,EAAOoF,WAK1BnD,EAAImD,GAEFgF,GAAGC,aAAe,SAAUxE,EAASyE,GAErC,OADe,IAAI7F,EAAcjE,KAAMqF,EAASyE,GAChC/D,WAAWgE,QAAStI,EAAEzB,UAI1CiE,EAAa0F,mBAIN1F,EAtWMU,CAASnF,EAAQC,IACzB,iCAXL,CA0BsB,oBAAXD,OAAyBA,OAASQ","file":"35.js","sourcesContent":["/**\n * EvEmitter v1.1.0\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( typeof define == 'function' && define.amd ) {\n // AMD - RequireJS\n define( factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS - Browserify, Webpack\n module.exports = factory();\n } else {\n // Browser globals\n global.EvEmitter = factory();\n }\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\"use strict\";\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice(0);\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( var i=0; i < listeners.length; i++ ) {\n var listener = listeners[i]\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n};\n\nreturn EvEmitter;\n\n}));\n","/* eslint-disable max-len */\n// CONSTANTS are all caps.\nconst NS = 'GridContainerBlock';\nconst CLS = 'gridContainerBlock';\nconst CLS_HIDE = 'd-none';\nconst CLS_ITEM = 'gridItemBlock';\nconst MB_IMG_RATIO = 7/6; // mobile image's height ratio\n\nimport ImagesLoaded from 'imagesloaded';\nimport utils from '../utils';\nimport _ from 'lodash';\n\nexport class GridContainerBlock {\n\tconstructor(el) {\n\t\tthis.el = el;\n\t\tthis.$el = $(el);\n\t\tthis.$loadMoreBtn = this.$el.find(`.${CLS}-loadMoreBtn`);\n\t\tthis.$rows = this.$el.find(`.${CLS}-row`);\n\t\tthis.$item = this.$el.find(`.${CLS}-item`);\n\t\tthis.$background = this.$el.find(`.${CLS_ITEM}-background`);\n\t\tthis.$loadMoreWrapper = this.$el.find(`.${CLS}-loadMoreWrapper`);\n\n\t\tthis.skipCount = parseInt(this.$el.data('load-skip')) || 0;\n\t\tthis.totalItem = this.$rows.length;\n\n\t\tthis.hideItems();\n\t\tthis.handleLoadMoreBtn();\n\t\tthis.onImageLoaded();\n\n\t\t$(window).on('resize', _.debounce(() => {\n\t\t\tthis.onImageLoaded();\n\t\t}, 300));\n\t}\n\n\thideItems() {\n\t\tif (this.skipCount === 0) {\n\t\t\tthis.$loadMoreBtn.addClass(CLS_HIDE);\n\t\t\tthis.$loadMoreWrapper.removeClass('py-3');\n\t\t\tthis.$el.addClass('show');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.$rows.each((i, item) => {\n\t\t\tlet $item = $(item);\n\t\t\t$item.attr('data-index', i);\n\n\t\t\t// hide items\n\t\t\tif (i + 1 > this.skipCount) {\n\t\t\t\t$item.addClass(CLS_HIDE);\n\t\t\t}\n\t\t});\n\n\t\t// hide load more button\n\t\tif (this.totalItem <= this.skipCount) {\n\t\t\tthis.$loadMoreBtn.addClass(CLS_HIDE);\n\t\t\tthis.$loadMoreWrapper.removeClass('py-3');\n\t\t}\n\n\t\tthis.$el.addClass('show');\n\t}\n\n\thandleLoadMoreBtn() {\n\t\tthis.$loadMoreBtn.on('click', () => {\n\t\t\tlet visibleItemsCount = this.$el.find(`.${CLS}-row:visible`).length;\n\n\t\t\tif (visibleItemsCount >= this.totalItem) {\n\t\t\t\tthis.$loadMoreBtn.addClass(CLS_HIDE);\n\t\t\t\tthis.$loadMoreWrapper.removeClass('py-3');\n\t\t\t} else {\n\t\t\t\tlet $showItem = this.$el.find(`.${CLS}-row[data-index=\"${visibleItemsCount}\"]`);\n\t\t\t\t$showItem.removeClass(CLS_HIDE);\n\n\t\t\t\t// hide load more button if last index\n\t\t\t\tif (visibleItemsCount === this.totalItem - 1) {\n\t\t\t\t\tthis.$loadMoreBtn.addClass(CLS_HIDE);\n\t\t\t\t\tthis.$loadMoreWrapper.removeClass('py-3');\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t$('html, body').animate({\n\t\t\t\t\t\tscrollTop: $showItem.offset().top,\n\t\t\t\t\t}, 500);\n\t\t\t\t}, 250);\n\t\t\t}\n\t\t});\n\t}\n\n\tonImageLoaded() {\n\t\tif (utils.checkBP('ml')) {\n\t\t\tthis.setMobileHieght();\n\t\t} else {\n\t\t\tthis.setDesktopHeight();\n\t\t}\n\t}\n\n\tsetDesktopHeight() {\n\t\tthis.$rows.each((i, row) => {\n\t\t\tlet $row = $(row);\n\t\t\tlet $background = $row.find(`.${CLS_ITEM}-background`);\n\t\t\tlet rowH = 0;\n\t\t\tlet opts = {\n\t\t\t\tbackground: true,\n\t\t\t};\n\n\t\t\tnew ImagesLoaded($background, opts, (instances) => {\n\t\t\t\t$.each(instances.images, (i, imgObj) => {\n\t\t\t\t\trowH = imgObj.img.height > rowH ? imgObj.img.height : rowH;\n\t\t\t\t});\n\n\t\t\t\t$row.find(`.${CLS}-item`).css('height', `${rowH}px`);\n\t\t\t});\n\t\t});\n\t}\n\n\tsetMobileHieght() {\n\t\tlet w = utils.getWindowWidth();\n\t\tlet h = w * MB_IMG_RATIO;\n\n\t\tthis.$item.css('height', `${h}px`);\n\t}\n}\n","/*!\n * imagesLoaded v4.1.4\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n\n( function( window, factory ) { 'use strict';\n // universal module definition\n\n /*global define: false, module: false, require: false */\n\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'ev-emitter/ev-emitter'\n ], function( EvEmitter ) {\n return factory( window, EvEmitter );\n });\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('ev-emitter')\n );\n } else {\n // browser global\n window.imagesLoaded = factory(\n window,\n window.EvEmitter\n );\n }\n\n})( typeof window !== 'undefined' ? window : this,\n\n// -------------------------- factory -------------------------- //\n\nfunction factory( window, EvEmitter ) {\n\n'use strict';\n\nvar $ = window.jQuery;\nvar console = window.console;\n\n// -------------------------- helpers -------------------------- //\n\n// extend objects\nfunction extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}\n\nvar arraySlice = Array.prototype.slice;\n\n// turn element or nodeList into an array\nfunction makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}\n\n// -------------------------- imagesLoaded -------------------------- //\n\n/**\n * @param {Array, Element, NodeList, String} elem\n * @param {Object or Function} options - if function, use as callback\n * @param {Function} onAlways - callback function\n */\nfunction ImagesLoaded( elem, options, onAlways ) {\n // coerce ImagesLoaded() without new, to be new ImagesLoaded()\n if ( !( this instanceof ImagesLoaded ) ) {\n return new ImagesLoaded( elem, options, onAlways );\n }\n // use elem as selector string\n var queryElem = elem;\n if ( typeof elem == 'string' ) {\n queryElem = document.querySelectorAll( elem );\n }\n // bail if bad element\n if ( !queryElem ) {\n console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) );\n return;\n }\n\n this.elements = makeArray( queryElem );\n this.options = extend( {}, this.options );\n // shift arguments if no options set\n if ( typeof options == 'function' ) {\n onAlways = options;\n } else {\n extend( this.options, options );\n }\n\n if ( onAlways ) {\n this.on( 'always', onAlways );\n }\n\n this.getImages();\n\n if ( $ ) {\n // add jQuery Deferred object\n this.jqDeferred = new $.Deferred();\n }\n\n // HACK check async to allow time to bind listeners\n setTimeout( this.check.bind( this ) );\n}\n\nImagesLoaded.prototype = Object.create( EvEmitter.prototype );\n\nImagesLoaded.prototype.options = {};\n\nImagesLoaded.prototype.getImages = function() {\n this.images = [];\n\n // filter & find items if we have an item selector\n this.elements.forEach( this.addElementImages, this );\n};\n\n/**\n * @param {Node} element\n */\nImagesLoaded.prototype.addElementImages = function( elem ) {\n // filter siblings\n if ( elem.nodeName == 'IMG' ) {\n this.addImage( elem );\n }\n // get background image on element\n if ( this.options.background === true ) {\n this.addElementBackgroundImages( elem );\n }\n\n // find children\n // no non-element nodes, #143\n var nodeType = elem.nodeType;\n if ( !nodeType || !elementNodeTypes[ nodeType ] ) {\n return;\n }\n var childImgs = elem.querySelectorAll('img');\n // concat childElems to filterFound array\n for ( var i=0; i < childImgs.length; i++ ) {\n var img = childImgs[i];\n this.addImage( img );\n }\n\n // get child background images\n if ( typeof this.options.background == 'string' ) {\n var children = elem.querySelectorAll( this.options.background );\n for ( i=0; i < children.length; i++ ) {\n var child = children[i];\n this.addElementBackgroundImages( child );\n }\n }\n};\n\nvar elementNodeTypes = {\n 1: true,\n 9: true,\n 11: true\n};\n\nImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {\n var style = getComputedStyle( elem );\n if ( !style ) {\n // Firefox returns null if in a hidden iframe https://bugzil.la/548397\n return;\n }\n // get url inside url(\"...\")\n var reURL = /url\\((['\"])?(.*?)\\1\\)/gi;\n var matches = reURL.exec( style.backgroundImage );\n while ( matches !== null ) {\n var url = matches && matches[2];\n if ( url ) {\n this.addBackground( url, elem );\n }\n matches = reURL.exec( style.backgroundImage );\n }\n};\n\n/**\n * @param {Image} img\n */\nImagesLoaded.prototype.addImage = function( img ) {\n var loadingImage = new LoadingImage( img );\n this.images.push( loadingImage );\n};\n\nImagesLoaded.prototype.addBackground = function( url, elem ) {\n var background = new Background( url, elem );\n this.images.push( background );\n};\n\nImagesLoaded.prototype.check = function() {\n var _this = this;\n this.progressedCount = 0;\n this.hasAnyBroken = false;\n // complete if no images\n if ( !this.images.length ) {\n this.complete();\n return;\n }\n\n function onProgress( image, elem, message ) {\n // HACK - Chrome triggers event before object properties have changed. #83\n setTimeout( function() {\n _this.progress( image, elem, message );\n });\n }\n\n this.images.forEach( function( loadingImage ) {\n loadingImage.once( 'progress', onProgress );\n loadingImage.check();\n });\n};\n\nImagesLoaded.prototype.progress = function( image, elem, message ) {\n this.progressedCount++;\n this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;\n // progress event\n this.emitEvent( 'progress', [ this, image, elem ] );\n if ( this.jqDeferred && this.jqDeferred.notify ) {\n this.jqDeferred.notify( this, image );\n }\n // check if completed\n if ( this.progressedCount == this.images.length ) {\n this.complete();\n }\n\n if ( this.options.debug && console ) {\n console.log( 'progress: ' + message, image, elem );\n }\n};\n\nImagesLoaded.prototype.complete = function() {\n var eventName = this.hasAnyBroken ? 'fail' : 'done';\n this.isComplete = true;\n this.emitEvent( eventName, [ this ] );\n this.emitEvent( 'always', [ this ] );\n if ( this.jqDeferred ) {\n var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';\n this.jqDeferred[ jqMethod ]( this );\n }\n};\n\n// -------------------------- -------------------------- //\n\nfunction LoadingImage( img ) {\n this.img = img;\n}\n\nLoadingImage.prototype = Object.create( EvEmitter.prototype );\n\nLoadingImage.prototype.check = function() {\n // If complete is true and browser supports natural sizes,\n // try to check for image status manually.\n var isComplete = this.getIsImageComplete();\n if ( isComplete ) {\n // report based on naturalWidth\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\n return;\n }\n\n // If none of the checks above matched, simulate loading on detached element.\n this.proxyImage = new Image();\n this.proxyImage.addEventListener( 'load', this );\n this.proxyImage.addEventListener( 'error', this );\n // bind to image as well for Firefox. #191\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n this.proxyImage.src = this.img.src;\n};\n\nLoadingImage.prototype.getIsImageComplete = function() {\n // check for non-zero, non-undefined naturalWidth\n // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671\n return this.img.complete && this.img.naturalWidth;\n};\n\nLoadingImage.prototype.confirm = function( isLoaded, message ) {\n this.isLoaded = isLoaded;\n this.emitEvent( 'progress', [ this, this.img, message ] );\n};\n\n// ----- events ----- //\n\n// trigger specified handler for event type\nLoadingImage.prototype.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\nLoadingImage.prototype.onload = function() {\n this.confirm( true, 'onload' );\n this.unbindEvents();\n};\n\nLoadingImage.prototype.onerror = function() {\n this.confirm( false, 'onerror' );\n this.unbindEvents();\n};\n\nLoadingImage.prototype.unbindEvents = function() {\n this.proxyImage.removeEventListener( 'load', this );\n this.proxyImage.removeEventListener( 'error', this );\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n};\n\n// -------------------------- Background -------------------------- //\n\nfunction Background( url, element ) {\n this.url = url;\n this.element = element;\n this.img = new Image();\n}\n\n// inherit LoadingImage prototype\nBackground.prototype = Object.create( LoadingImage.prototype );\n\nBackground.prototype.check = function() {\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n this.img.src = this.url;\n // check if image is already complete\n var isComplete = this.getIsImageComplete();\n if ( isComplete ) {\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\n this.unbindEvents();\n }\n};\n\nBackground.prototype.unbindEvents = function() {\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n};\n\nBackground.prototype.confirm = function( isLoaded, message ) {\n this.isLoaded = isLoaded;\n this.emitEvent( 'progress', [ this, this.element, message ] );\n};\n\n// -------------------------- jQuery -------------------------- //\n\nImagesLoaded.makeJQueryPlugin = function( jQuery ) {\n jQuery = jQuery || window.jQuery;\n if ( !jQuery ) {\n return;\n }\n // set local variable\n $ = jQuery;\n // $().imagesLoaded()\n $.fn.imagesLoaded = function( options, callback ) {\n var instance = new ImagesLoaded( this, options, callback );\n return instance.jqDeferred.promise( $(this) );\n };\n};\n// try making plugin\nImagesLoaded.makeJQueryPlugin();\n\n// -------------------------- -------------------------- //\n\nreturn ImagesLoaded;\n\n});\n"],"sourceRoot":""}