!function(n,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():n.EvEmitter=t()}(this,function(){function t(){}var n=t.prototype;return n.on=function(n,t){if(n&&t){var i=this._events=this._events||{},r=i[n]=i[n]||[];return-1==r.indexOf(t)&&r.push(t),this}},n.once=function(n,t){if(n&&t){this.on(n,t);var i=this._onceEvents=this._onceEvents||{},r=i[n]=i[n]||[];return r[t]=!0,this}},n.off=function(n,t){var i=this._events&&this._events[n],r;if(i&&i.length)return r=i.indexOf(t),-1!=r&&i.splice(r,1),this},n.emitEvent=function(n,t){var r=this._events&&this._events[n],u,i,f,e;if(r&&r.length){for(u=0,i=r[u],t=t||[],f=this._onceEvents&&this._onceEvents[n];i;)e=f&&f[i],e&&(this.off(n,i),delete f[i]),i.apply(this,t),u+=e?0:1,i=r[u];return this}},t}),function(n,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(n,i)}):"object"==typeof module&&module.exports?module.exports=t(n,require("ev-emitter")):n.imagesLoaded=t(n,n.EvEmitter)}(window,function(n,t){function e(n,t){for(var i in t)n[i]=t[i];return n}function h(n){var t=[],i;if(Array.isArray(n))t=n;else if("number"==typeof n.length)for(i=0;i<n.length;i++)t.push(n[i]);else t.push(n);return t}function i(n,t,r){return this instanceof i?("string"==typeof n&&(n=document.querySelectorAll(n)),this.elements=h(n),this.options=e({},this.options),"function"==typeof t?r=t:e(this.options,t),r&&this.on("always",r),this.getImages(),f&&(this.jqDeferred=new f.Deferred),void setTimeout(function(){this.check()}.bind(this))):new i(n,t,r)}function r(n){this.img=n}function u(n,t){this.url=n;this.element=t;this.img=new Image}var f=n.jQuery,o=n.console,s;return i.prototype=Object.create(t.prototype),i.prototype.options={},i.prototype.getImages=function(){this.images=[];this.elements.forEach(this.addElementImages,this)},i.prototype.addElementImages=function(n){var i,r,t,f,u,e;if("IMG"==n.nodeName&&this.addImage(n),this.options.background===!0&&this.addElementBackgroundImages(n),i=n.nodeType,i&&s[i]){for(r=n.querySelectorAll("img"),t=0;t<r.length;t++)f=r[t],this.addImage(f);if("string"==typeof this.options.background)for(u=n.querySelectorAll(this.options.background),t=0;t<u.length;t++)e=u[t],this.addElementBackgroundImages(e)}},s={1:!0,9:!0,11:!0},i.prototype.addElementBackgroundImages=function(n){var i=getComputedStyle(n),r,t,u;if(i)for(r=/url\((['"])?(.*?)\1\)/gi,t=r.exec(i.backgroundImage);null!==t;)u=t&&t[2],u&&this.addBackground(u,n),t=r.exec(i.backgroundImage)},i.prototype.addImage=function(n){var t=new r(n);this.images.push(t)},i.prototype.addBackground=function(n,t){var i=new u(n,t);this.images.push(i)},i.prototype.check=function(){function n(n,i,r){setTimeout(function(){t.progress(n,i,r)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",n);t.check()}):void this.complete()},i.prototype.progress=function(n,t,i){this.progressedCount++;this.hasAnyBroken=this.hasAnyBroken||!n.isLoaded;this.emitEvent("progress",[this,n,t]);this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,n);this.progressedCount==this.images.length&&this.complete();this.options.debug&&o&&o.log("progress: "+i,n,t)},i.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done",n;(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred)&&(n=this.hasAnyBroken?"reject":"resolve",this.jqDeferred[n](this))},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var n=this.getIsImageComplete();return n?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},r.prototype.confirm=function(n,t){this.isLoaded=n;this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(n){var t="on"+n.type;this[t]&&this[t](n)},r.prototype.onload=function(){this.confirm(!0,"onload");this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror");this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this);this.proxyImage.removeEventListener("error",this);this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)},u.prototype=Object.create(r.prototype),u.prototype.check=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);this.img.src=this.url;var n=this.getIsImageComplete();n&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},u.prototype.unbindEvents=function(){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)},u.prototype.confirm=function(n,t){this.isLoaded=n;this.emitEvent("progress",[this,this.element,t])},i.makeJQueryPlugin=function(t){t=t||n.jQuery;t&&(f=t,f.fn.imagesLoaded=function(n,t){var r=new i(this,n,t);return r.jqDeferred.promise(f(this))})},i.makeJQueryPlugin(),i})