// source --> https://www.deepriverfriends.com/wp-content/themes/saved/framework/js/responsive-embeds.js?ver=2.2.1 
/**
 * Responsive Embeds
 */

// Use FitVids.js for responsive videos and other embeds
// Note: Rdio and Spotify are correct when loading at final size ( browser resize is bad demo )
ctfw_embed_fitvids_selectors = [

	// Default (from fitVids.js)
	// We redefine these here so they can be hidden prior to FitVids.js
	"iframe[src*='player.vimeo.com']",
	"iframe[src*='youtube.com']",
	"iframe[src*='youtube-nocookie.com']",
	"iframe[src*='kickstarter.com'][src*='video.html']",
	"object",
	"embed",

	// Custom
	"iframe[src*='youtu.be']",
	"iframe[src*='blip.tv']",
	"iframe[src*='hulu.com']",
	"iframe[src*='dailymotion.com']",
	"iframe[src*='revision3.com']",
	"iframe[src*='slideshare.net']",
	"iframe[src*='scribed.com']",
	"iframe[src*='viddler.com']",
	"iframe[src*='rd.io']",
	"iframe[src*='rdio.com']",
	//"iframe[src*='spotify.com']", // has issues, not needed (see https://dev.churchthemes.local/exodus/sermons/tes/)
	"iframe[src*='soundcloud.com']:not([width$='%'])", // Jetpack soundcloud shortcode is already responsive with %, so exclude
	"iframe[src*='snd.sc']",
	"iframe[src*='livestream.com']",
	"iframe[src*='soundfaith.com']",
	"iframe[src*='ustream.tv']",
	"iframe[src*='sermon.net']:not([src*='/main']):not([src*='.sermon.net/embed'])",
	"iframe[src*='read.amazon.com']",

];
ctfw_embed_fitvids_selectors_list = ctfw_embed_fitvids_selectors.join(', ');

// Other embedded media only need max-width: 100% ( height is static ) - MediaElement.js
// Important: when done via stylesheet, MediaElement.js volume control flickers
ctfw_embed_other_selectors_list = '.wp-video-shortcode, .wp-audio-shortcode';

// Hide videos before resizing
// This keeps them from showing briefly at small size before showing at full width
ctfw_embed_all_selectors_list = ctfw_embed_fitvids_selectors_list + ', ' + ctfw_embed_other_selectors_list;
jQuery('head').prepend('<style type="text/css" id="ctfw-hide-responsive-embeds">' + ctfw_embed_all_selectors_list + ' { visibility: hidden; }</style>' + "\n");

// Resize videos to 100% width
jQuery(document).ready(function ($) {

	// Ignore those already being made responsive with WordPress.
	if (ctfw_responsive_embeds.wp_responsive_embeds) {

		// Loop selectors
		jQuery.each(ctfw_embed_fitvids_selectors, function (i, selector) {

			// Ignore FitVids if WP already making responsive.
			if (jQuery(selector).parents('.wp-has-aspect-ratio').length) {

				// Loop each element matching selector.
				jQuery.each(jQuery(selector), function (i, element) {

					// Not sermon media element (problem when also have media in content).
					if (jQuery(element).parents('[id$=-sermon-video-player]').length) {
						return;
					}

					jQuery(element).addClass('fitvidsignore');

				});

			}

		});

	}

	// Remove <object> element from Blip.tv (use iframe only) - creates a gap w/FitVid
	$("embed[src*='blip.tv']").remove();

	// FitVids.js for most embeds
	$('body').fitVids({
		customSelector: ctfw_embed_fitvids_selectors,
	});

	// Other embeds (MediaElement.js)
	$(ctfw_embed_other_selectors_list).css('max-width', '100%');

	// Show embeds after resize
	$('#ctfw-hide-responsive-embeds').remove();


});
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/superfish.modified.js?ver=2.2.1 
/*
 * jQuery Superfish Menu Plugin - v1.7.10
 * Copyright (c) 2018 Joel Birch
 *
 * MODIFIED BY CT:
 * - HS 22275: Removed iOS-specific code per https://github.com/joeldbirch/superfish/issues/182#issuecomment-644838286
 *
 * Dual licensed under the MIT and GPL licenses:
 *	http://www.opensource.org/licenses/mit-license.php
 *	http://www.gnu.org/licenses/gpl.html
 */
!function (e, s) { "use strict"; var t, o, n, i, r, a, h, l, p, u, f, c, d, v, m, y, C, w = (o = "sf-breadcrumb", n = "sf-js-enabled", i = "sf-with-ul", r = "sf-arrows", a = function () { var s = /^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent); return s && e("html").css("cursor", "pointer").on("click", e.noop), s }(), h = "behavior" in (t = document.documentElement.style) && "fill" in t && /iemobile/i.test(navigator.userAgent), l = !!s.PointerEvent, p = function (e, s, t) { var o = n; s.cssArrows && (o += " " + r), e[t ? "addClass" : "removeClass"](o) }, u = function (e, s) { var t = s ? "addClass" : "removeClass"; e.children("a")[t](i) }, f = function (e) { var s = e.css("ms-touch-action"), t = e.css("touch-action"); t = "pan-y" === (t = t || s) ? "auto" : "pan-y", e.css({ "ms-touch-action": t, "touch-action": t }) }, c = function (e) { return e.closest("." + n) }, d = function (e) { return c(e).data("sfOptions") }, v = function () { var s = e(this), t = d(s); clearTimeout(t.sfTimer), s.siblings().superfish("hide").end().superfish("show") }, m = function (s) { s.retainPath = e.inArray(this[0], s.$path) > -1, this.superfish("hide"), this.parents("." + s.hoverClass).length || (s.onIdle.call(c(this)), s.$path.length && e.proxy(v, s.$path)()) }, y = function () { var s = e(this), t = d(s); clearTimeout(t.sfTimer), t.sfTimer = setTimeout(e.proxy(m, s, t), t.delay) }, C = function (s) { var t = e(this), o = d(t), n = t.siblings(s.data.popUpSelector); if (!1 === o.onHandleTouch.call(n)) return this; n.length > 0 && n.is(":hidden") && (t.one("click.superfish", !1), "MSPointerDown" === s.type || "pointerdown" === s.type ? t.trigger("focus") : e.proxy(v, t.parent("li"))()) }, { hide: function (s) { if (this.length) { var t = d(this); if (!t) return this; var o = !0 === t.retainPath ? t.$path : "", n = this.find("li." + t.hoverClass).add(this).not(o).removeClass(t.hoverClass).children(t.popUpSelector), i = t.speedOut; if (s && (n.show(), i = 0), t.retainPath = !1, !1 === t.onBeforeHide.call(n)) return this; n.stop(!0, !0).animate(t.animationOut, i, function () { var s = e(this); t.onHide.call(s) }) } return this }, show: function () { var e = d(this); if (!e) return this; var s = this.addClass(e.hoverClass).children(e.popUpSelector); return !1 === e.onBeforeShow.call(s) ? this : (s.stop(!0, !0).animate(e.animation, e.speed, function () { e.onShow.call(s) }), this) }, destroy: function () { return this.each(function () { var s, t = e(this), n = t.data("sfOptions"); if (!n) return !1; s = t.find(n.popUpSelector).parent("li"), clearTimeout(n.sfTimer), p(t, n), u(s), f(t), t.off(".superfish").off(".hoverIntent"), s.children(n.popUpSelector).attr("style", function (e, s) { if (void 0 !== s) return s.replace(/display[^;]+;?/g, "") }), n.$path.removeClass(n.hoverClass + " " + o).addClass(n.pathClass), t.find("." + n.hoverClass).removeClass(n.hoverClass), n.onDestroy.call(t), t.removeData("sfOptions") }) }, init: function (s) { return this.each(function () { var t = e(this); if (t.data("sfOptions")) return !1; var n = e.extend({}, e.fn.superfish.defaults, s), i = t.find(n.popUpSelector).parent("li"); n.$path = function (s, t) { return s.find("li." + t.pathClass).slice(0, t.pathLevels).addClass(t.hoverClass + " " + o).filter(function () { return e(this).children(t.popUpSelector).hide().show().length }).removeClass(t.pathClass) }(t, n), t.data("sfOptions", n), p(t, n, !0), u(i, !0), f(t), function (s, t) { var o = "li:has(" + t.popUpSelector + ")"; e.fn.hoverIntent && !t.disableHI ? s.hoverIntent(v, y, o) : s.on("mouseenter.superfish", o, v).on("mouseleave.superfish", o, y); var n = "MSPointerDown.superfish"; l && (n = "pointerdown.superfish"), a || (n += " touchend.superfish"), h && (n += " mousedown.superfish"), s.on("focusin.superfish", "li", v).on("focusout.superfish", "li", y).on(n, "a", t, C) }(t, n), i.not("." + o).superfish("hide", !0), n.onInit.call(this) }) } }); e.fn.superfish = function (s, t) { return w[s] ? w[s].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof s && s ? e.error("Method " + s + " does not exist on jQuery.fn.superfish") : w.init.apply(this, arguments) }, e.fn.superfish.defaults = { popUpSelector: "ul,.sf-mega", hoverClass: "sfHover", pathClass: "overrideThisToUse", pathLevels: 1, delay: 800, animation: { opacity: "show" }, animationOut: { opacity: "hide" }, speed: "normal", speedOut: "fast", cssArrows: !0, disableHI: !1, onInit: e.noop, onBeforeShow: e.noop, onShow: e.noop, onBeforeHide: e.noop, onHide: e.noop, onIdle: e.noop, onDestroy: e.noop, onHandleTouch: e.noop } }(jQuery, window);
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/supersubs.js?ver=2.2.1 

/*
 * Supersubs v0.3b - jQuery plugin
 * Copyright (c) 2013 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

;(function($){ // $ will refer to jQuery within this closure

	$.fn.supersubs = function(options){
		var opts = $.extend({}, $.fn.supersubs.defaults, options);
		// return original object to support chaining
		return this.each(function() {
			// cache selections
			var $$ = $(this);
			// support metadata
			var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
			// cache all ul elements and show them in preparation for measurements
			$ULs = $$.find('ul').show();
			// get the font size of menu.
			// .css('fontSize') returns various results cross-browser, so measure an em dash instead
			var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
				'padding' : 0,
				'position' : 'absolute',
				'top' : '-999em',
				'width' : 'auto'
			}).appendTo($$)[0].clientWidth; //clientWidth is faster than .width()
			// remove em dash
			$('#menu-fontsize').remove();
			// loop through each ul in menu
			$ULs.each(function(i) {	
				// cache this ul
				var $ul = $(this);
				// get all (li) children of this ul
				var $LIs = $ul.children();
				// get all anchor grand-children
				var $As = $LIs.children('a');
				// force content to one line and save current float property
				var liFloat = $LIs.css('white-space','nowrap').css('float');
				// remove width restrictions and floats so elements remain vertically stacked
				$ul.add($LIs).add($As).css({
					'float' : 'none',
					'width'	: 'auto'
				});
				// this ul will now be shrink-wrapped to longest li due to position:absolute
				// so save its width as ems.
				var emWidth = $ul[0].clientWidth / fontsize;
				// add more width to ensure lines don't turn over at certain sizes in various browsers
				emWidth += o.extraWidth;
				// restrict to at least minWidth and at most maxWidth
				if (emWidth > o.maxWidth)		{ emWidth = o.maxWidth; }
				else if (emWidth < o.minWidth)	{ emWidth = o.minWidth; }
				emWidth += 'em';
				// set ul to width in ems
				$ul.css('width',emWidth);
				// restore li floats to avoid IE bugs
				// set li width to full width of this ul
				// revert white-space to normal
				$LIs.css({
					'float' : liFloat,
					'width' : '100%',
					'white-space' : 'normal'
				})
				// update offset position of descendant ul to reflect new width of parent.
				// set it to 100% in case it isn't already set to this in the CSS
				.each(function(){
					var $childUl = $(this).children('ul');
					var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right';
					$childUl.css(offsetDirection,'100%');
				});
			}).hide();
			
		});
	};
	// expose defaults
	$.fn.supersubs.defaults = {
		minWidth		: 9,		// requires em unit.
		maxWidth		: 25,		// requires em unit.
		extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
	};
	
})(jQuery); // plugin code ends;
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/jquery.meanmenu.modified.js?ver=2.2.1 
/*!
* jQuery meanMenu v2.0.8
* @Copyright (C) 2012-2014 Chris Wharton @ MeanThemes (https://github.com/meanthemes/meanMenu)
*
* Jubilee Modifications:
* 1. Change menu close from slideUp to hide
* 2. Change click( to on('click' (jQuery deprecation)
* 3. Change resize( to on('resize' (jQuery deprecation)
* 4. Replace meanMenuOpen span tags to be compatible with newer jQuery
*/
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
* HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR
* FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE
* OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
* COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.COPYRIGHT HOLDERS WILL NOT
* BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL
* DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://gnu.org/licenses/>.
*
* Find more information at http://www.meanthemes.com/plugins/meanmenu/
*
*/
(function ($) {
	"use strict";
	$.fn.meanmenu = function (options) {
		var defaults = {
			meanMenuTarget: jQuery(this), // Target the current HTML markup you wish to replace
			meanMenuContainer: 'body', // Choose where meanmenu will be placed within the HTML
			meanMenuClose: "X", // single character you want to represent the close menu button
			meanMenuCloseSize: "18px", // set font size of close button
			//meanMenuOpen: "<span /><span /><span />", // text/markup you want when menu is closed
			meanMenuOpen: "<span></span><span></span><span></span>", // text/markup you want when menu is closed
			meanRevealPosition: "right", // left right or center positions
			meanRevealPositionDistance: "0", // Tweak the position of the menu
			meanRevealColour: "", // override CSS colours for the reveal background
			meanScreenWidth: "480", // set the screen width you want meanmenu to kick in at
			meanNavPush: "", // set a height here in px, em or % if you want to budge your layout now the navigation is missing.
			meanShowChildren: true, // true to show children in the menu, false to hide them
			meanExpandableChildren: true, // true to allow expand/collapse children
			meanExpand: "+", // single character you want to represent the expand for ULs
			meanContract: "-", // single character you want to represent the contract for ULs
			meanRemoveAttrs: false, // true to remove classes and IDs, false to keep them
			onePage: false, // set to true for one page sites
			meanDisplay: "block", // override display method for table cell based layouts e.g. table-cell
			removeElements: "" // set to hide page elements
		};
		options = $.extend(defaults, options);

		// get browser width
		var currentWidth = window.innerWidth || document.documentElement.clientWidth;

		return this.each(function () {
			var meanMenu = options.meanMenuTarget;
			var meanContainer = options.meanMenuContainer;
			var meanMenuClose = options.meanMenuClose;
			var meanMenuCloseSize = options.meanMenuCloseSize;
			var meanMenuOpen = options.meanMenuOpen;
			var meanRevealPosition = options.meanRevealPosition;
			var meanRevealPositionDistance = options.meanRevealPositionDistance;
			var meanRevealColour = options.meanRevealColour;
			var meanScreenWidth = options.meanScreenWidth;
			var meanNavPush = options.meanNavPush;
			var meanRevealClass = ".meanmenu-reveal";
			var meanShowChildren = options.meanShowChildren;
			var meanExpandableChildren = options.meanExpandableChildren;
			var meanExpand = options.meanExpand;
			var meanContract = options.meanContract;
			var meanRemoveAttrs = options.meanRemoveAttrs;
			var onePage = options.onePage;
			var meanDisplay = options.meanDisplay;
			var removeElements = options.removeElements;

			//detect known mobile/tablet usage
			var isMobile = false;
			if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/Blackberry/i)) || (navigator.userAgent.match(/Windows Phone/i))) {
				isMobile = true;
			}

			if ((navigator.userAgent.match(/MSIE 8/i)) || (navigator.userAgent.match(/MSIE 7/i))) {
				// add scrollbar for IE7 & 8 to stop breaking resize function on small content sites
				jQuery('html').css("overflow-y", "scroll");
			}

			var meanRevealPos = "";
			var meanCentered = function () {
				if (meanRevealPosition === "center") {
					var newWidth = window.innerWidth || document.documentElement.clientWidth;
					var meanCenter = ((newWidth / 2) - 22) + "px";
					meanRevealPos = "left:" + meanCenter + ";right:auto;";

					if (!isMobile) {
						jQuery('.meanmenu-reveal').css("left", meanCenter);
					} else {
						jQuery('.meanmenu-reveal').animate({
							left: meanCenter
						});
					}
				}
			};

			var menuOn = false;
			var meanMenuExist = false;


			if (meanRevealPosition === "right") {
				meanRevealPos = "right:" + meanRevealPositionDistance + ";left:auto;";
			}
			if (meanRevealPosition === "left") {
				meanRevealPos = "left:" + meanRevealPositionDistance + ";right:auto;";
			}
			// run center function
			meanCentered();

			// set all styles for mean-reveal
			var $navreveal = "";

			var meanInner = function () {
				// get last class name
				if (jQuery($navreveal).is(".meanmenu-reveal.meanclose")) {
					$navreveal.html(meanMenuClose);
				} else {
					$navreveal.html(meanMenuOpen);
				}
			};

			// re-instate original nav (and call this on window.width functions)
			var meanOriginal = function () {
				jQuery('.mean-bar,.mean-push').remove();
				jQuery(meanContainer).removeClass("mean-container");
				jQuery(meanMenu).css('display', meanDisplay);
				menuOn = false;
				meanMenuExist = false;
				jQuery(removeElements).removeClass('mean-remove');
			};

			// navigation reveal
			var showMeanMenu = function () {
				var meanStyles = "background:" + meanRevealColour + ";color:" + meanRevealColour + ";" + meanRevealPos;
				if (currentWidth <= meanScreenWidth) {
					jQuery(removeElements).addClass('mean-remove');
					meanMenuExist = true;
					// add class to body so we don't need to worry about media queries here, all CSS is wrapped in '.mean-container'
					jQuery(meanContainer).addClass("mean-container");
					jQuery('.mean-container').prepend('<div class="mean-bar"><a href="#nav" class="meanmenu-reveal" style="' + meanStyles + '">Show Navigation</a><nav class="mean-nav"></nav></div>');

					//push meanMenu navigation into .mean-nav
					var meanMenuContents = jQuery(meanMenu).html();
					jQuery('.mean-nav').html(meanMenuContents);

					// remove all classes from EVERYTHING inside meanmenu nav
					if (meanRemoveAttrs) {
						jQuery('nav.mean-nav ul, nav.mean-nav ul *').each(function () {
							// First check if this has mean-remove class
							if (jQuery(this).is('.mean-remove')) {
								jQuery(this).attr('class', 'mean-remove');
							} else {
								jQuery(this).removeAttr("class");
							}
							jQuery(this).removeAttr("id");
						});
					}

					// push in a holder div (this can be used if removal of nav is causing layout issues)
					jQuery(meanMenu).before('<div class="mean-push" />');
					jQuery('.mean-push').css("margin-top", meanNavPush);

					// hide current navigation and reveal mean nav link
					jQuery(meanMenu).hide();
					jQuery(".meanmenu-reveal").show();

					// turn 'X' on or off
					jQuery(meanRevealClass).html(meanMenuOpen);
					$navreveal = jQuery(meanRevealClass);

					//hide mean-nav ul
					jQuery('.mean-nav ul').hide();

					// hide sub nav
					if (meanShowChildren) {
						// allow expandable sub nav(s)
						if (meanExpandableChildren) {
							jQuery('.mean-nav ul ul').each(function () {
								if (jQuery(this).children().length) {
									jQuery(this, 'li:first').parent().append('<a class="mean-expand" href="#" style="font-size: ' + meanMenuCloseSize + '">' + meanExpand + '</a>');
								}
							});
							jQuery('.mean-expand').on("click", function (e) {
								e.preventDefault();
								if (jQuery(this).hasClass("mean-clicked")) {
									jQuery(this).text(meanExpand);
									jQuery(this).prev('ul').slideUp(300, function () { });
								} else {
									jQuery(this).text(meanContract);
									jQuery(this).prev('ul').slideDown(300, function () { });
								}
								jQuery(this).toggleClass("mean-clicked");
							});
						} else {
							jQuery('.mean-nav ul ul').show();
						}
					} else {
						jQuery('.mean-nav ul ul').hide();
					}

					// add last class to tidy up borders
					jQuery('.mean-nav ul li').last().addClass('mean-last');
					$navreveal.removeClass("meanclose");
					jQuery($navreveal).on('click', function (e) {
						e.preventDefault();
						if (menuOn === false) {
							$navreveal.css("text-align", "center");
							$navreveal.css("text-indent", "0");
							$navreveal.css("font-size", meanMenuCloseSize);

							// Jubilee Modification: Change slideDown to fadeIn
							//jQuery('.mean-nav ul:first').slideDown();
							jQuery('.mean-nav ul:first').show();

							menuOn = true;
						} else {

							// Jubilee Modification: Change slideUp to hide
							//jQuery('.mean-nav ul:first').slideUp();
							jQuery('.mean-nav ul:first').hide();

							menuOn = false;

						}
						$navreveal.toggleClass("meanclose");
						meanInner();
						jQuery(removeElements).addClass('mean-remove');
					});

					// for one page websites, reset all variables...
					if (onePage) {
						jQuery('.mean-nav ul > li > a:first-child').on("click", function () {
							jQuery('.mean-nav ul:first').slideUp();
							menuOn = false;
							jQuery($navreveal).toggleClass("meanclose").html(meanMenuOpen);
						});
					}
				} else {
					meanOriginal();
				}
			};

			if (!isMobile) {
				// reset menu on resize above meanScreenWidth
				jQuery(window).on('resize', function () {
					currentWidth = window.innerWidth || document.documentElement.clientWidth;
					if (currentWidth > meanScreenWidth) {
						meanOriginal();
					} else {
						meanOriginal();
					}
					if (currentWidth <= meanScreenWidth) {
						showMeanMenu();
						meanCentered();
					} else {
						meanOriginal();
					}
				});
			}

			jQuery(window).on('resize', function () {
				// get browser width
				currentWidth = window.innerWidth || document.documentElement.clientWidth;

				if (!isMobile) {
					meanOriginal();
					if (currentWidth <= meanScreenWidth) {
						showMeanMenu();
						meanCentered();
					}
				} else {
					meanCentered();
					if (currentWidth <= meanScreenWidth) {
						if (meanMenuExist === false) {
							showMeanMenu();
						}
					} else {
						meanOriginal();
					}
				}
			});

			// run main menuMenu function on load
			showMeanMenu();
		});
	};
})(jQuery);
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/jquery.waitforimages.min.js?ver=2.2.1 
/*! waitForImages jQuery Plugin 2017-02-20 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){var b="waitForImages",c=function(a){return a.srcset&&a.sizes}(new Image);a.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage","cursor"],hasImageAttributes:["srcset"]},a.expr[":"]["has-src"]=function(b){return a(b).is('img[src][src!=""]')},a.expr[":"].uncached=function(b){return!!a(b).is(":has-src")&&!b.complete},a.fn.waitForImages=function(){var d,e,f,g=0,h=0,i=a.Deferred(),j=this,k=[],l=a.waitForImages.hasImageProperties||[],m=a.waitForImages.hasImageAttributes||[],n=/url\(\s*(['"]?)(.*?)\1\s*\)/g;if(a.isPlainObject(arguments[0])?(f=arguments[0].waitForAll,e=arguments[0].each,d=arguments[0].finished):1===arguments.length&&"boolean"===a.type(arguments[0])?f=arguments[0]:(d=arguments[0],e=arguments[1],f=arguments[2]),d=d||a.noop,e=e||a.noop,f=!!f,!a.isFunction(d)||!a.isFunction(e))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var b=a(this);f?b.find("*").addBack().each(function(){var b=a(this);b.is("img:has-src")&&!b.is("[srcset]")&&k.push({src:b.attr("src"),element:b[0]}),a.each(l,function(a,c){var d,e=b.css(c);if(!e)return!0;for(;d=n.exec(e);)k.push({src:d[2],element:b[0]})}),a.each(m,function(a,c){var d=b.attr(c);return!d||void k.push({src:b.attr("src"),srcset:b.attr("srcset"),element:b[0]})})}):b.find("img:has-src").each(function(){k.push({src:this.src,element:this})})}),g=k.length,h=0,0===g&&(d.call(j),i.resolveWith(j)),a.each(k,function(f,k){var l=new Image,m="load."+b+" error."+b;a(l).one(m,function b(c){var f=[h,g,"load"==c.type];if(h++,e.apply(k.element,f),i.notifyWith(k.element,f),a(this).off(m,b),h==g)return d.call(j[0]),i.resolveWith(j[0]),!1}),c&&k.srcset&&(l.srcset=k.srcset,l.sizes=k.sizes),l.src=k.src}),i.promise()}});
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/jquery.smooth-scroll.min.js?ver=2.2.1 
/*!
 * jQuery Smooth Scroll - v2.2.0 - 2017-05-05
 * https://github.com/kswedberg/jquery-smooth-scroll
 * Copyright (c) 2017 Karl Swedberg
 * Licensed MIT
 */


!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(a){var b={},c={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,autoFocus:!1,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},d=function(b){var c=[],d=!1,e=b.dir&&"left"===b.dir?"scrollLeft":"scrollTop";return this.each(function(){var b=a(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(b[e]()>0?c.push(this):(b[e](1),d=b[e]()>0,d&&c.push(this),b[e](0))):(c.push(document.scrollingElement),!1)}),c.length||this.each(function(){this===document.documentElement&&"smooth"===a(this).css("scrollBehavior")&&(c=[this]),c.length||"BODY"!==this.nodeName||(c=[this])}),"first"===b.el&&c.length>1&&(c=[c[0]]),c},e=/^([\-\+]=)(\d+)/;a.fn.extend({scrollable:function(a){var b=d.call(this,{dir:a});return this.pushStack(b)},firstScrollable:function(a){var b=d.call(this,{el:"first",dir:a});return this.pushStack(b)},smoothScroll:function(b,c){if("options"===(b=b||{}))return c?this.each(function(){var b=a(this),d=a.extend(b.data("ssOpts")||{},c);a(this).data("ssOpts",d)}):this.first().data("ssOpts");var d=a.extend({},a.fn.smoothScroll.defaults,b),e=function(b){var c=function(a){return a.replace(/(:|\.|\/)/g,"\\$1")},e=this,f=a(this),g=a.extend({},d,f.data("ssOpts")||{}),h=d.exclude,i=g.excludeWithin,j=0,k=0,l=!0,m={},n=a.smoothScroll.filterPath(location.pathname),o=a.smoothScroll.filterPath(e.pathname),p=location.hostname===e.hostname||!e.hostname,q=g.scrollTarget||o===n,r=c(e.hash);if(r&&!a(r).length&&(l=!1),g.scrollTarget||p&&q&&r){for(;l&&j<h.length;)f.is(c(h[j++]))&&(l=!1);for(;l&&k<i.length;)f.closest(i[k++]).length&&(l=!1)}else l=!1;l&&(g.preventDefault&&b.preventDefault(),a.extend(m,g,{scrollTarget:g.scrollTarget||r,link:e}),a.smoothScroll(m))};return null!==b.delegateSelector?this.off("click.smoothscroll",b.delegateSelector).on("click.smoothscroll",b.delegateSelector,e):this.off("click.smoothscroll").on("click.smoothscroll",e),this}});var f=function(a){var b={relative:""},c="string"==typeof a&&e.exec(a);return"number"==typeof a?b.px=a:c&&(b.relative=c[1],b.px=parseFloat(c[2])||0),b},g=function(b){var c=a(b.scrollTarget);b.autoFocus&&c.length&&(c[0].focus(),c.is(document.activeElement)||(c.prop({tabIndex:-1}),c[0].focus())),b.afterScroll.call(b.link,b)};a.smoothScroll=function(c,d){if("options"===c&&"object"==typeof d)return a.extend(b,d);var e,h,i,j,k=f(c),l={},m=0,n="offset",o="scrollTop",p={},q={};k.px?e=a.extend({link:null},a.fn.smoothScroll.defaults,b):(e=a.extend({link:null},a.fn.smoothScroll.defaults,c||{},b),e.scrollElement&&(n="position","static"===e.scrollElement.css("position")&&e.scrollElement.css("position","relative")),d&&(k=f(d))),o="left"===e.direction?"scrollLeft":o,e.scrollElement?(h=e.scrollElement,k.px||/^(?:HTML|BODY)$/.test(h[0].nodeName)||(m=h[o]())):h=a("html, body").firstScrollable(e.direction),e.beforeScroll.call(h,e),l=k.px?k:{relative:"",px:a(e.scrollTarget)[n]()&&a(e.scrollTarget)[n]()[e.direction]||0},p[o]=l.relative+(l.px+m+e.offset),i=e.speed,"auto"===i&&(j=Math.abs(p[o]-h[o]()),i=j/e.autoCoefficient),q={duration:i,easing:e.easing,complete:function(){g(e)}},e.step&&(q.step=e.step),h.length?h.stop().animate(p,q):g(e)},a.smoothScroll.version="2.2.0",a.smoothScroll.filterPath=function(a){return a=a||"",a.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},a.fn.smoothScroll.defaults=c});
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/jquery.dropdown.min.js?ver=2.2.1 
/*
 * jQuery Dropdown (2.0.3): A simple dropdown plugin
 *
 * Contribute: https://github.com/claviska/jquery-dropdown
 *
 * @license: MIT license: http://opensource.org/licenses/MIT
 *
 */
jQuery&&function($){function t(t,e){var d=t?$(this):e,n=$(d.attr("data-jq-dropdown")),a=d.hasClass("jq-dropdown-open");if(t){if($(t.target).hasClass("jq-dropdown-ignore"))return;t.preventDefault(),t.stopPropagation()}else if(d!==e.target&&$(e.target).hasClass("jq-dropdown-ignore"))return;o(),a||d.hasClass("jq-dropdown-disabled")||(d.addClass("jq-dropdown-open"),n.data("jq-dropdown-trigger",d).show(),r(),n.trigger("show",{jqDropdown:n,trigger:d}))}function o(t){var o=t?$(t.target).parents().addBack():null;if(o&&o.is(".jq-dropdown")){if(!o.is(".jq-dropdown-menu"))return;if(!o.is("A"))return}var r=jQuery.Event("hide");$(document).find(".jq-dropdown:visible").each(function(){var t=$(this);t.hide().removeData("jq-dropdown-trigger").trigger("hide",{jqDropdown:t})}),r.isDefaultPrevented()||($(document).find(".jq-dropdown:visible").each(function(){var t=$(this);t.hide().removeData("jq-dropdown-trigger").trigger("hide",{jqDropdown:t})}),$(document).find(".jq-dropdown-open").removeClass("jq-dropdown-open"))}function r(){var t=$(".jq-dropdown:visible").eq(0),o=t.data("jq-dropdown-trigger"),r=o?parseInt(o.attr("data-horizontal-offset")||0,10):null,e=o?parseInt(o.attr("data-vertical-offset")||0,10):null;0!==t.length&&o&&(t.hasClass("jq-dropdown-relative")?t.css({left:t.hasClass("jq-dropdown-anchor-right")?o.position().left-(t.outerWidth(!0)-o.outerWidth(!0))-parseInt(o.css("margin-right"),10)+r:o.position().left+parseInt(o.css("margin-left"),10)+r,top:o.position().top+o.outerHeight(!0)-parseInt(o.css("margin-top"),10)+e}):t.css({left:t.hasClass("jq-dropdown-anchor-right")?o.offset().left-(t.outerWidth()-o.outerWidth())+r:o.offset().left+r,top:o.offset().top+o.outerHeight()+e}))}$.extend($.fn,{jqDropdown:function(r,e){switch(r){case"show":return t(null,$(this)),$(this);case"hide":return o(),$(this);case"attach":return $(this).attr("data-jq-dropdown",e);case"detach":return o(),$(this).removeAttr("data-jq-dropdown");case"disable":return $(this).addClass("jq-dropdown-disabled");case"enable":return o(),$(this).removeClass("jq-dropdown-disabled")}}}),$(document).on("click.jq-dropdown","[data-jq-dropdown]",t),$(document).on("click.jq-dropdown",o),$(window).on("resize",r)}(jQuery);
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/jquery.matchHeight-min.js?ver=2.2.1 
/*
* jquery-match-height 0.7.2 by @liabru
* http://brm.io/jquery-match-height/
* License MIT
*/
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,o=-1,n=function(t){return parseFloat(t)||0},a=function(e){var o=1,a=t(e),i=null,r=[];return a.each(function(){var e=t(this),a=e.offset().top-n(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):Math.floor(Math.abs(i-a))<=o?r[r.length-1]=s.add(e):r.push(e),i=a}),r},i=function(e){var o={
byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byRow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchHeight=function(e){var o=i(e);if(o.remove){var n=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(n)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null,
r._afterUpdate=null,r._rows=a,r._parse=n,r._parseOptions=i,r._apply=function(e,o){var s=i(o),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0",
"padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={
display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),
this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i;
}n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});
// source --> https://www.deepriverfriends.com/wp-content/themes/saved/js/lib/scrollreveal.min.js?ver=2.2.1 
/*! @license ScrollReveal v4.0.7

    Copyright 2020 Fisssion LLC.

    Licensed under the GNU General Public License 3.0
*/
var ScrollReveal = function () { "use strict"; var r = { delay: 0, distance: "0", duration: 600, easing: "cubic-bezier(0.5, 0, 0, 1)", interval: 0, opacity: 0, origin: "bottom", rotate: { x: 0, y: 0, z: 0 }, scale: 1, cleanup: !1, container: document.documentElement, desktop: !0, mobile: !0, reset: !1, useDelay: "always", viewFactor: 0, viewOffset: { top: 0, right: 0, bottom: 0, left: 0 }, afterReset: function () { }, afterReveal: function () { }, beforeReset: function () { }, beforeReveal: function () { } }; var n = { success: function () { document.documentElement.classList.add("sr"), document.body ? document.body.style.height = "100%" : document.addEventListener("DOMContentLoaded", function () { document.body.style.height = "100%" }) }, failure: function () { return document.documentElement.classList.remove("sr"), { clean: function () { }, destroy: function () { }, reveal: function () { }, sync: function () { }, get noop() { return !0 } } } }; function o(e) { return "object" == typeof window.Node ? e instanceof window.Node : null !== e && "object" == typeof e && "number" == typeof e.nodeType && "string" == typeof e.nodeName } function u(e, t) { if (void 0 === t && (t = document), e instanceof Array) return e.filter(o); if (o(e)) return [e]; if (n = e, i = Object.prototype.toString.call(n), "object" == typeof window.NodeList ? n instanceof window.NodeList : null !== n && "object" == typeof n && "number" == typeof n.length && /^\[object (HTMLCollection|NodeList|Object)\]$/.test(i) && (0 === n.length || o(n[0]))) return Array.prototype.slice.call(e); var n, i; if ("string" == typeof e) try { var r = t.querySelectorAll(e); return Array.prototype.slice.call(r) } catch (e) { return [] } return [] } function s(e) { return null !== e && e instanceof Object && (e.constructor === Object || "[object Object]" === Object.prototype.toString.call(e)) } function f(n, i) { if (s(n)) return Object.keys(n).forEach(function (e) { return i(n[e], e, n) }); if (n instanceof Array) return n.forEach(function (e, t) { return i(e, t, n) }); throw new TypeError("Expected either an array or object literal.") } function h(e) { for (var t = [], n = arguments.length - 1; 0 < n--;)t[n] = arguments[n + 1]; if (this.constructor.debug && console) { var i = "%cScrollReveal: " + e; t.forEach(function (e) { return i += "\n — " + e }), console.log(i, "color: #ea654b;") } } function t() { var n = this, i = { active: [], stale: [] }, t = { active: [], stale: [] }, r = { active: [], stale: [] }; try { f(u("[data-sr-id]"), function (e) { var t = parseInt(e.getAttribute("data-sr-id")); i.active.push(t) }) } catch (e) { throw e } f(this.store.elements, function (e) { -1 === i.active.indexOf(e.id) && i.stale.push(e.id) }), f(i.stale, function (e) { return delete n.store.elements[e] }), f(this.store.elements, function (e) { -1 === r.active.indexOf(e.containerId) && r.active.push(e.containerId), e.hasOwnProperty("sequence") && -1 === t.active.indexOf(e.sequence.id) && t.active.push(e.sequence.id) }), f(this.store.containers, function (e) { -1 === r.active.indexOf(e.id) && r.stale.push(e.id) }), f(r.stale, function (e) { var t = n.store.containers[e].node; t.removeEventListener("scroll", n.delegate), t.removeEventListener("resize", n.delegate), delete n.store.containers[e] }), f(this.store.sequences, function (e) { -1 === t.active.indexOf(e.id) && t.stale.push(e.id) }), f(t.stale, function (e) { return delete n.store.sequences[e] }) } function p(e) { var i, r = this; try { f(u(e), function (e) { var t = e.getAttribute("data-sr-id"); if (null !== t) { i = !0; var n = r.store.elements[t]; n.callbackTimer && window.clearTimeout(n.callbackTimer.clock), e.setAttribute("style", n.styles.inline.generated), e.removeAttribute("data-sr-id"), delete r.store.elements[t] } }) } catch (e) { return h.call(this, "Clean failed.", e.message) } if (i) try { t.call(this) } catch (e) { return h.call(this, "Clean failed.", e.message) } } function N(e) { if (e.constructor !== Array) throw new TypeError("Expected array."); if (16 === e.length) return e; if (6 !== e.length) throw new RangeError("Expected array with either 6 or 16 values."); var t = z(); return t[0] = e[0], t[1] = e[1], t[4] = e[2], t[5] = e[3], t[12] = e[4], t[13] = e[5], t } function z() { for (var e = [], t = 0; t < 16; t++)t % 5 == 0 ? e.push(1) : e.push(0); return e } function F(e, t) { for (var n = N(e), i = N(t), r = [], o = 0; o < 4; o++)for (var s = [n[o], n[o + 4], n[o + 8], n[o + 12]], a = 0; a < 4; a++) { var c = 4 * a, l = [i[c], i[c + 1], i[c + 2], i[c + 3]], d = s[0] * l[0] + s[1] * l[1] + s[2] * l[2] + s[3] * l[3]; r[o + c] = d } return r } function D(e, t) { var n = z(); return n[0] = e, n[5] = "number" == typeof t ? t : e, n } var S = function () { var n = {}, i = document.documentElement.style; function e(e, t) { if (void 0 === t && (t = i), e && "string" == typeof e) { if (n[e]) return n[e]; if ("string" == typeof t[e]) return n[e] = e; if ("string" == typeof t["-webkit-" + e]) return n[e] = "-webkit-" + e; throw new RangeError('Unable to find "' + e + '" style property.') } throw new TypeError("Expected a string.") } return e.clearCache = function () { return n = {} }, e }(); function m(e) { var t = window.getComputedStyle(e.node), n = t.position, i = e.config, r = {}, o = (e.node.getAttribute("style") || "").match(/[\w-]+\s*:\s*[^;]+\s*/gi) || []; r.computed = o ? o.map(function (e) { return e.trim() }).join("; ") + ";" : "", r.generated = o.some(function (e) { return e.match(/visibility\s?:\s?visible/i) }) ? r.computed : o.concat(["visibility: visible"]).map(function (e) { return e.trim() }).join("; ") + ";"; var s, a, c, l, d, u, f, h, p, m, y, v, g, b = parseFloat(t.opacity), w = isNaN(parseFloat(i.opacity)) ? parseFloat(t.opacity) : parseFloat(i.opacity), E = { computed: b !== w ? "opacity: " + b + ";" : "", generated: b !== w ? "opacity: " + w + ";" : "" }, j = []; if (parseFloat(i.distance)) { var T = "top" === i.origin || "bottom" === i.origin ? "Y" : "X", k = i.distance; "top" !== i.origin && "left" !== i.origin || (k = /^-/.test(k) ? k.substr(1) : "-" + k); var O = k.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g), x = O[0]; switch (O[1]) { case "em": k = parseInt(t.fontSize) * x; break; case "px": k = x; break; case "%": k = "Y" === T ? e.node.getBoundingClientRect().height * x / 100 : e.node.getBoundingClientRect().width * x / 100; break; default: throw new RangeError("Unrecognized or missing distance unit.") }"Y" === T ? j.push((c = k, (l = z())[13] = c, l)) : j.push((s = k, (a = z())[12] = s, a)) } i.rotate.x && j.push((d = i.rotate.x, u = Math.PI / 180 * d, (f = z())[5] = f[10] = Math.cos(u), f[6] = f[9] = Math.sin(u), f[9] *= -1, f)), i.rotate.y && j.push((h = i.rotate.y, p = Math.PI / 180 * h, (m = z())[0] = m[10] = Math.cos(p), m[2] = m[8] = Math.sin(p), m[2] *= -1, m)), i.rotate.z && j.push((y = i.rotate.z, v = Math.PI / 180 * y, (g = z())[0] = g[5] = Math.cos(v), g[1] = g[4] = Math.sin(v), g[4] *= -1, g)), 1 !== i.scale && (0 === i.scale ? j.push(D(2e-4)) : j.push(D(i.scale))); var A = {}; if (j.length) { A.property = S("transform"), A.computed = { raw: t[A.property], matrix: function (e) { if ("string" == typeof e) { var t = e.match(/matrix(3d)?\(([^)]+)\)/); if (t) return N(t[2].split(", ").map(parseFloat)) } return z() }(t[A.property]) }, j.unshift(A.computed.matrix); var R = j.reduce(F); A.generated = { initial: A.property + ": matrix3d(" + R.join(", ") + ");", final: A.property + ": matrix3d(" + A.computed.matrix.join(", ") + ");" } } else A.generated = { initial: "", final: "" }; var q = {}; if (E.generated || A.generated.initial) { q.property = S("transition"), q.computed = t[q.property], q.fragments = []; var P = i.delay, L = i.duration, M = i.easing; E.generated && q.fragments.push({ delayed: "opacity " + L / 1e3 + "s " + M + " " + P / 1e3 + "s", instant: "opacity " + L / 1e3 + "s " + M + " 0s" }), A.generated.initial && q.fragments.push({ delayed: A.property + " " + L / 1e3 + "s " + M + " " + P / 1e3 + "s", instant: A.property + " " + L / 1e3 + "s " + M + " 0s" }), q.computed && !q.computed.match(/all 0s|none 0s/) && q.fragments.unshift({ delayed: q.computed, instant: q.computed }); var I = q.fragments.reduce(function (e, t, n) { return e.delayed += 0 === n ? t.delayed : ", " + t.delayed, e.instant += 0 === n ? t.instant : ", " + t.instant, e }, { delayed: "", instant: "" }); q.generated = { delayed: q.property + ": " + I.delayed + ";", instant: q.property + ": " + I.instant + ";" } } else q.generated = { delayed: "", instant: "" }; return { inline: r, opacity: E, position: n, transform: A, transition: q } } function c(e, t) { void 0 === t && (t = {}); var n = t.pristine || this.pristine, i = "always" === e.config.useDelay || "onload" === e.config.useDelay && n || "once" === e.config.useDelay && !e.seen, r = e.visible && !e.revealed, o = !e.visible && e.revealed && e.config.reset; return t.reveal || r ? function (e, t) { var n = [e.styles.inline.generated, e.styles.opacity.computed, e.styles.transform.generated.final]; t ? n.push(e.styles.transition.generated.delayed) : n.push(e.styles.transition.generated.instant); e.revealed = e.seen = !0, e.node.setAttribute("style", n.filter(function (e) { return "" !== e }).join(" ")), a.call(this, e, t) }.call(this, e, i) : t.reset || o ? function (e) { var t = [e.styles.inline.generated, e.styles.opacity.generated, e.styles.transform.generated.initial, e.styles.transition.generated.instant]; e.revealed = !1, e.node.setAttribute("style", t.filter(function (e) { return "" !== e }).join(" ")), a.call(this, e) }.call(this, e) : void 0 } function a(e, t) { var n = this, i = t ? e.config.duration + e.config.delay : e.config.duration, r = e.revealed ? e.config.beforeReveal : e.config.beforeReset, o = e.revealed ? e.config.afterReveal : e.config.afterReset, s = 0; e.callbackTimer && (s = Date.now() - e.callbackTimer.start, window.clearTimeout(e.callbackTimer.clock)), r(e.node), e.callbackTimer = { start: Date.now(), clock: window.setTimeout(function () { o(e.node), e.callbackTimer = null, e.revealed && !e.config.reset && e.config.cleanup && p.call(n, e.node) }, i - s) } } var e, y = (e = 0, function () { return e++ }); function l(e, t) { if (void 0 === t && (t = this.pristine), !e.visible && e.revealed && e.config.reset) return c.call(this, e, { reset: !0 }); var n = this.store.sequences[e.sequence.id], i = e.sequence.index; if (n) { var r = new d(n, "visible", this.store), o = new d(n, "revealed", this.store); if (n.models = { visible: r, revealed: o }, !o.body.length) { var s = n.members[r.body[0]], a = this.store.elements[s]; if (a) return g.call(this, n, r.body[0], -1, t), g.call(this, n, r.body[0], 1, t), c.call(this, a, { reveal: !0, pristine: t }) } if (!n.blocked.head && i === [].concat(o.head).pop() && i >= [].concat(r.body).shift()) return g.call(this, n, i, -1, t), c.call(this, e, { reveal: !0, pristine: t }); if (!n.blocked.foot && i === [].concat(o.foot).shift() && i <= [].concat(r.body).pop()) return g.call(this, n, i, 1, t), c.call(this, e, { reveal: !0, pristine: t }) } } function v(e) { var t = Math.abs(e); if (isNaN(t)) throw new RangeError("Invalid sequence interval."); this.id = y(), this.interval = Math.max(t, 16), this.members = [], this.models = {}, this.blocked = { head: !1, foot: !1 } } function d(e, i, r) { var o = this; this.head = [], this.body = [], this.foot = [], f(e.members, function (e, t) { var n = r.elements[e]; n && n[i] && o.body.push(t) }), this.body.length && f(e.members, function (e, t) { var n = r.elements[e]; n && !n[i] && (t < o.body[0] ? o.head.push(t) : o.foot.push(t)) }) } function g(e, t, n, i) { var r = this, o = ["head", null, "foot"][1 + n], s = e.members[t + n], a = this.store.elements[s]; e.blocked[o] = !0, setTimeout(function () { e.blocked[o] = !1, a && l.call(r, a, i) }, e.interval) } function b() { var n = this; t.call(this), f(this.store.elements, function (e) { var t = [e.styles.inline.generated]; e.visible ? (t.push(e.styles.opacity.computed), t.push(e.styles.transform.generated.final), e.revealed = !0) : (t.push(e.styles.opacity.generated), t.push(e.styles.transform.generated.initial), e.revealed = !1), e.node.setAttribute("style", t.filter(function (e) { return "" !== e }).join(" ")) }), f(this.store.containers, function (e) { var t = e.node === document.documentElement ? window : e.node; t.addEventListener("scroll", n.delegate), t.addEventListener("resize", n.delegate) }), this.delegate(), this.initTimeout = null } function w(e) { return void 0 === e && (e = navigator.userAgent), /Android|iPhone|iPad|iPod/i.test(e) } function E(n) { for (var e = [], t = arguments.length - 1; 0 < t--;)e[t] = arguments[t + 1]; if (s(n)) return f(e, function (e) { f(e, function (e, t) { s(e) ? (n[t] && s(n[t]) || (n[t] = {}), E(n[t], e)) : n[t] = e }) }), n; throw new TypeError("Target must be an object literal.") } function i(e, a, t) { var c = this; void 0 === a && (a = {}), void 0 === t && (t = !1); var l, d = [], n = a.interval || r.interval; try { n && (l = new v(n)); var i = u(e); if (!i.length) throw new Error("Invalid reveal target."); f(i.reduce(function (e, t) { var n = {}, i = t.getAttribute("data-sr-id"); i ? (E(n, c.store.elements[i]), n.node.setAttribute("style", n.styles.inline.computed)) : (n.id = y(), n.node = t, n.seen = !1, n.revealed = !1, n.visible = !1); var r = E({}, n.config || c.defaults, a); if (!r.mobile && w() || !r.desktop && !w()) return i && p.call(c, n), e; var o, s = u(r.container)[0]; if (!s) throw new Error("Invalid container."); return s.contains(t) && (null === (o = function (t) { var e = [], n = arguments.length - 1; for (; 0 < n--;)e[n] = arguments[n + 1]; var i = null; return f(e, function (e) { f(e, function (e) { null === i && e.node === t && (i = e.id) }) }), i }(s, d, c.store.containers)) && (o = y(), d.push({ id: o, node: s })), n.config = r, n.containerId = o, n.styles = m(n), l && (n.sequence = { id: l.id, index: l.members.length }, l.members.push(n.id)), e.push(n)), e }, []), function (e) { (c.store.elements[e.id] = e).node.setAttribute("data-sr-id", e.id) }) } catch (e) { return h.call(this, "Reveal failed.", e.message) } f(d, function (e) { c.store.containers[e.id] = { id: e.id, node: e.node } }), l && (this.store.sequences[l.id] = l), !0 !== t && (this.store.history.push({ target: e, options: a }), this.initTimeout && window.clearTimeout(this.initTimeout), this.initTimeout = window.setTimeout(b.bind(this), 0)) } var j, T = Math.sign || function (e) { return (0 < e) - (e < 0) || +e }, k = (j = Date.now(), function (e) { var t = Date.now(); 16 < t - j ? e(j = t) : setTimeout(function () { return k(e) }, 0) }), O = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || k; function x(e, t) { for (var n = t ? e.node.clientHeight : e.node.offsetHeight, i = t ? e.node.clientWidth : e.node.offsetWidth, r = 0, o = 0, s = e.node; isNaN(s.offsetTop) || (r += s.offsetTop), isNaN(s.offsetLeft) || (o += s.offsetLeft), s = s.offsetParent;); return { bounds: { top: r, right: o + i, bottom: r + n, left: o }, height: n, width: i } } function A(e, t) { var i = this; void 0 === e && (e = { type: "init" }), void 0 === t && (t = this.store.elements), O(function () { var n = "init" === e.type || "resize" === e.type; f(i.store.containers, function (e) { n && (e.geometry = x.call(i, e, !0)); var t = function (e) { var t, n; return n = e.node === document.documentElement ? (t = window.pageYOffset, window.pageXOffset) : (t = e.node.scrollTop, e.node.scrollLeft), { top: t, left: n } }.call(i, e); e.scroll && (e.direction = { x: T(t.left - e.scroll.left), y: T(t.top - e.scroll.top) }), e.scroll = t }), f(t, function (e) { (n || void 0 === e.geometry) && (e.geometry = x.call(i, e)), e.visible = function (e) { void 0 === e && (e = {}); var t = this.store.containers[e.containerId]; if (t) { var n = Math.max(0, Math.min(1, e.config.viewFactor)), i = e.config.viewOffset, r = e.geometry.bounds.top + e.geometry.height * n, o = e.geometry.bounds.right - e.geometry.width * n, s = e.geometry.bounds.bottom - e.geometry.height * n, a = e.geometry.bounds.left + e.geometry.width * n, c = t.geometry.bounds.top + t.scroll.top + i.top, l = t.geometry.bounds.right + t.scroll.left - i.right, d = t.geometry.bounds.bottom + t.scroll.top - i.bottom, u = t.geometry.bounds.left + t.scroll.left + i.left; return r < d && u < o && c < s && a < l || "fixed" === e.styles.position } }.call(i, e) }), f(t, function (e) { e.sequence ? l.call(i, e) : c.call(i, e) }), i.pristine = !1 }) } var R, q, P, L, M, I, C, W, Y = "4.0.7"; function $(e) { var t; if (void 0 === e && (e = {}), void 0 === this || Object.getPrototypeOf(this) !== $.prototype) return new $(e); if (!$.isSupported()) return h.call(this, "Instantiation failed.", "This browser is not supported."), n.failure(); try { t = E({}, I || r, e) } catch (e) { return h.call(this, "Invalid configuration.", e.message), n.failure() } try { if (!u(t.container)[0]) throw new Error("Invalid container.") } catch (e) { return h.call(this, e.message), n.failure() } return !(I = t).mobile && w() || !I.desktop && !w() ? (h.call(this, "This device is disabled.", "desktop: " + I.desktop, "mobile: " + I.mobile), n.failure()) : (n.success(), this.store = { containers: {}, elements: {}, history: [], sequences: {} }, this.pristine = !0, R = R || A.bind(this), q = q || function () { var n = this; f(this.store.elements, function (e) { e.node.setAttribute("style", e.styles.inline.generated), e.node.removeAttribute("data-sr-id") }), f(this.store.containers, function (e) { var t = e.node === document.documentElement ? window : e.node; t.removeEventListener("scroll", n.delegate), t.removeEventListener("resize", n.delegate) }), this.store = { containers: {}, elements: {}, history: [], sequences: {} } }.bind(this), P = P || i.bind(this), L = L || p.bind(this), M = M || function () { var t = this; f(this.store.history, function (e) { i.call(t, e.target, e.options, !0) }), b.call(this) }.bind(this), Object.defineProperty(this, "delegate", { get: function () { return R } }), Object.defineProperty(this, "destroy", { get: function () { return q } }), Object.defineProperty(this, "reveal", { get: function () { return P } }), Object.defineProperty(this, "clean", { get: function () { return L } }), Object.defineProperty(this, "sync", { get: function () { return M } }), Object.defineProperty(this, "defaults", { get: function () { return I } }), Object.defineProperty(this, "version", { get: function () { return Y } }), Object.defineProperty(this, "noop", { get: function () { return !1 } }), W || (W = this)) } return $.isSupported = function () { return ("transform" in (t = document.documentElement.style) || "WebkitTransform" in t) && ("transition" in (e = document.documentElement.style) || "WebkitTransition" in e); var e, t }, Object.defineProperty($, "debug", { get: function () { return C || !1 }, set: function (e) { return C = "boolean" == typeof e ? e : C } }), $(), $ }();