{"version":3,"file":"rigby.min.js","sources":["../node_modules/cash-dom/dist/cash.esm.js","../node_modules/rellax/rellax.js","../node_modules/vanilla-modal/dist/index.js","rigby/modal.js","../node_modules/ellipsis.js/ellipsis.js","../node_modules/aos/dist/aos.js","../node_modules/stickyfilljs/dist/stickyfill.js","rigby.js"],"sourcesContent":["/* MIT https://github.com/kenwheeler/cash */\n\"use strict\";\n\nvar doc = document,\n win = window,\n _Array$prototype = Array.prototype,\n filter = _Array$prototype.filter,\n indexOf = _Array$prototype.indexOf,\n map = _Array$prototype.map,\n push = _Array$prototype.push,\n reverse = _Array$prototype.reverse,\n slice = _Array$prototype.slice,\n splice = _Array$prototype.splice;\nvar idRe = /^#[\\w-]*$/,\n classRe = /^\\.[\\w-]*$/,\n htmlRe = /<.+>/,\n tagRe = /^\\w+$/; // @require ./variables.js\n\nfunction find(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n return classRe.test(selector) ? context.getElementsByClassName(selector.slice(1)) : tagRe.test(selector) ? context.getElementsByTagName(selector) : context.querySelectorAll(selector);\n} // @require ./find.js\n// @require ./variables.js\n\n\nfunction Cash(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n if (!selector) return;\n if (selector.__cash) return selector;\n var eles = selector;\n\n if (isString(selector)) {\n if (context.__cash) context = context[0];\n eles = idRe.test(selector) ? context.getElementById(selector.slice(1)) : htmlRe.test(selector) ? parseHTML(selector) : find(selector, context);\n if (!eles) return;\n } else if (isFunction(selector)) {\n return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality\n }\n\n if (eles.nodeType || eles === win) eles = [eles];\n this.length = eles.length;\n\n for (var i = 0, l = this.length; i < l; i++) {\n this[i] = eles[i];\n }\n}\n\nfunction cash(selector, context) {\n return new Cash(selector, context);\n}\n/* PROTOTYPE */\n\n\nvar fn = cash.fn = cash.prototype = Cash.prototype = {\n constructor: cash,\n __cash: true,\n length: 0,\n splice: splice // Ensures a cash collection gets printed as array-like in Chrome\n\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.get = function (index) {\n if (index === undefined) return slice.call(this);\n return this[index < 0 ? index + this.length : index];\n}; // @require core/cash.js\n// @require ./get.js\n\n\nfn.eq = function (index) {\n return cash(this.get(index));\n}; // @require core/cash.js\n// @require ./eq.js\n\n\nfn.first = function () {\n return this.eq(0);\n}; // @require core/cash.js\n// @require ./eq.js\n\n\nfn.last = function () {\n return this.eq(-1);\n}; // @require core/cash.js\n// @require core/variables.js\n\n\nfn.map = function (callback) {\n return cash(map.call(this, function (ele, i) {\n return callback.call(ele, i, ele);\n }));\n}; // @require core/cash.js\n// @require core/variables.js\n\n\nfn.slice = function () {\n return cash(slice.apply(this, arguments));\n}; // @require ./cash.js\n\n\nvar camelCaseRe = /(?:^\\w|[A-Z]|\\b\\w)/g,\n camelCaseWhitespaceRe = /[\\s-_]+/g;\n\nfunction camelCase(str) {\n return str.replace(camelCaseRe, function (letter, index) {\n return letter[!index ? 'toLowerCase' : 'toUpperCase']();\n }).replace(camelCaseWhitespaceRe, '');\n}\n\n;\ncash.camelCase = camelCase; // @require ./cash.js\n\nfunction each(arr, callback) {\n for (var i = 0, l = arr.length; i < l; i++) {\n if (callback.call(arr[i], arr[i], i, arr) === false) break;\n }\n}\n\ncash.each = each; // @require core/cash.js\n// @require core/each.js\n\nfn.each = function (callback) {\n each(this, function (ele, i) {\n return callback.call(ele, i, ele);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\n\nfn.removeProp = function (prop) {\n return this.each(function (i, ele) {\n delete ele[prop];\n });\n}; // @require ./cash.js\n\n\nfunction extend(target) {\n if (target === void 0) {\n target = this;\n }\n\n var args = arguments,\n length = args.length;\n\n for (var i = length < 2 ? 0 : 1; i < length; i++) {\n for (var key in args[i]) {\n target[key] = args[i][key];\n }\n }\n\n return target;\n}\n\n;\ncash.extend = fn.extend = extend; // @require ./cash.js\n\nvar guid = 1;\ncash.guid = guid; // @require ./cash.js\n\nfunction matches(ele, selector) {\n var matches = ele && (ele.matches || ele.webkitMatchesSelector || ele.mozMatchesSelector || ele.msMatchesSelector || ele.oMatchesSelector);\n return !!matches && matches.call(ele, selector);\n}\n\ncash.matches = matches; // @require ./cash.js\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\ncash.isFunction = isFunction;\n\nfunction isString(x) {\n return typeof x === 'string';\n}\n\ncash.isString = isString;\n\nfunction isNumeric(x) {\n return !isNaN(parseFloat(x)) && isFinite(x);\n}\n\ncash.isNumeric = isNumeric;\nvar isArray = Array.isArray;\ncash.isArray = isArray; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n\nfn.prop = function (prop, value) {\n if (!prop) return;\n\n if (isString(prop)) {\n if (arguments.length < 2) return this[0] && this[0][prop];\n return this.each(function (i, ele) {\n ele[prop] = value;\n });\n }\n\n for (var key in prop) {\n this.prop(key, prop[key]);\n }\n\n return this;\n}; // @require ./matches.js\n// @require ./type_checking.js\n\n\nfunction getCompareFunction(selector) {\n return isString(selector) ? function (i, ele) {\n return matches(ele, selector);\n } : selector.__cash ? function (i, ele) {\n return selector.is(ele);\n } : function (i, ele, selector) {\n return ele === selector;\n };\n} // @require core/cash.js\n// @require core/get_compare_function.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/get.js\n\n\nfn.filter = function (selector) {\n if (!selector) return cash();\n var comparator = isFunction(selector) ? selector : getCompareFunction(selector);\n return cash(filter.call(this, function (ele, i) {\n return comparator.call(ele, i, ele, selector);\n }));\n}; // @require ./type_checking.js\n\n\nvar splitValuesRe = /\\S+/g;\n\nfunction getSplitValues(str) {\n return isString(str) ? str.match(splitValuesRe) || [] : [];\n} // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\n\nfn.hasClass = function (cls) {\n var classes = getSplitValues(cls);\n var check = false;\n\n if (classes.length) {\n this.each(function (i, ele) {\n check = ele.classList.contains(classes[0]);\n return !check;\n });\n }\n\n return check;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\n\nfn.removeAttr = function (attr) {\n var attrs = getSplitValues(attr);\n if (!attrs.length) return this;\n return this.each(function (i, ele) {\n each(attrs, function (a) {\n ele.removeAttribute(a);\n });\n });\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./remove_attr.js\n\n\nfn.attr = function (attr, value) {\n if (!attr) return;\n\n if (isString(attr)) {\n if (arguments.length < 2) {\n if (!this[0]) return;\n\n var _value = this[0].getAttribute(attr);\n\n return _value === null ? undefined : _value;\n }\n\n if (value === null) return this.removeAttr(attr);\n return this.each(function (i, ele) {\n ele.setAttribute(attr, value);\n });\n }\n\n for (var key in attr) {\n this.attr(key, attr[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\n\nfn.toggleClass = function (cls, force) {\n var classes = getSplitValues(cls),\n isForce = force !== undefined;\n if (!classes.length) return this;\n return this.each(function (i, ele) {\n each(classes, function (c) {\n if (isForce) {\n force ? ele.classList.add(c) : ele.classList.remove(c);\n } else {\n ele.classList.toggle(c);\n }\n });\n });\n}; // @require core/cash.js\n// @require ./toggle_class.js\n\n\nfn.addClass = function (cls) {\n return this.toggleClass(cls, true);\n}; // @require core/cash.js\n// @require ./attr.js\n// @require ./toggle_class.js\n\n\nfn.removeClass = function (cls) {\n return !arguments.length ? this.attr('class', '') : this.toggleClass(cls, false);\n}; // @optional ./add_class.js\n// @optional ./attr.js\n// @optional ./has_class.js\n// @optional ./prop.js\n// @optional ./remove_attr.js\n// @optional ./remove_class.js\n// @optional ./remove_prop.js\n// @optional ./toggle_class.js\n// @require ./cash.js\n\n\nfunction unique(arr) {\n return arr.filter(function (item, index, self) {\n return self.indexOf(item) === index;\n });\n}\n\ncash.unique = unique; // @require core/cash.js\n// @require core/unique.js\n// @require ./get.js\n\nfn.add = function (selector, context) {\n return cash(unique(this.get().concat(cash(selector, context).get())));\n}; // @require core/variables.js\n\n\nfunction computeStyle(ele, prop, isVariable) {\n if (ele.nodeType !== 1) return;\n var style = win.getComputedStyle(ele, null);\n return prop ? isVariable ? style.getPropertyValue(prop) : style[prop] : style;\n} // @require ./compute_style.js\n\n\nfunction computeStyleInt(ele, prop) {\n return parseInt(computeStyle(ele, prop), 10) || 0;\n}\n\nvar cssVariableRe = /^--/; // @require ./variables.js\n\nfunction isCSSVariable(prop) {\n return cssVariableRe.test(prop);\n} // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require ./is_css_variable.js\n\n\nvar prefixedProps = {},\n _doc$createElement = doc.createElement('div'),\n style = _doc$createElement.style,\n vendorsPrefixes = ['webkit', 'moz', 'ms', 'o'];\n\nfunction getPrefixedProp(prop, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n if (isVariable) return prop;\n\n if (!prefixedProps[prop]) {\n var propCC = camelCase(prop),\n propUC = \"\" + propCC.charAt(0).toUpperCase() + propCC.slice(1),\n props = (propCC + \" \" + vendorsPrefixes.join(propUC + \" \") + propUC).split(' ');\n each(props, function (p) {\n if (p in style) {\n prefixedProps[prop] = p;\n return false;\n }\n });\n }\n\n return prefixedProps[prop];\n}\n\n;\ncash.prefixedProp = getPrefixedProp; // @require core/type_checking.js\n// @require ./is_css_variable.js\n\nvar numericProps = {\n animationIterationCount: true,\n columnCount: true,\n flexGrow: true,\n flexShrink: true,\n fontWeight: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n widows: true,\n zIndex: true\n};\n\nfunction getSuffixedValue(prop, value, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n return !isVariable && !numericProps[prop] && isNumeric(value) ? value + \"px\" : value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/compute_style.js\n// @require ./helpers/get_prefixed_prop.js\n// @require ./helpers/get_suffixed_value.js\n// @require ./helpers/is_css_variable.js\n\n\nfn.css = function (prop, value) {\n if (isString(prop)) {\n var isVariable = isCSSVariable(prop);\n prop = getPrefixedProp(prop, isVariable);\n if (arguments.length < 2) return this[0] && computeStyle(this[0], prop, isVariable);\n if (!prop) return this;\n value = getSuffixedValue(prop, value, isVariable);\n return this.each(function (i, ele) {\n if (ele.nodeType !== 1) return;\n\n if (isVariable) {\n ele.style.setProperty(prop, value);\n } else {\n ele.style[prop] = value;\n }\n });\n }\n\n for (var key in prop) {\n this.css(key, prop[key]);\n }\n\n return this;\n}; // @optional ./css.js\n\n\nvar dataNamespace = '__cashData',\n dataAttributeRe = /^data-(.*)/; // @require core/cash.js\n// @require ./helpers/variables.js\n\ncash.hasData = function (ele) {\n return dataNamespace in ele;\n}; // @require ./variables.js\n\n\nfunction getDataCache(ele) {\n return ele[dataNamespace] = ele[dataNamespace] || {};\n} // @require attributes/attr.js\n// @require ./get_data_cache.js\n\n\nfunction getData(ele, key) {\n var cache = getDataCache(ele);\n\n if (key) {\n if (!(key in cache)) {\n var value = ele.dataset ? ele.dataset[key] || ele.dataset[camelCase(key)] : cash(ele).attr(\"data-\" + key);\n\n if (value !== undefined) {\n try {\n value = JSON.parse(value);\n } catch (e) {}\n\n cache[key] = value;\n }\n }\n\n return cache[key];\n }\n\n return cache;\n} // @require ./variables.js\n// @require ./get_data_cache.js\n\n\nfunction removeData(ele, key) {\n if (key === undefined) {\n delete ele[dataNamespace];\n } else {\n delete getDataCache(ele)[key];\n }\n} // @require ./get_data_cache.js\n\n\nfunction setData(ele, key, value) {\n getDataCache(ele)[key] = value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_data.js\n// @require ./helpers/set_data.js\n// @require ./helpers/variables.js\n\n\nfn.data = function (name, value) {\n var _this = this;\n\n if (!name) {\n if (!this[0]) return;\n each(this[0].attributes, function (attr) {\n var match = attr.name.match(dataAttributeRe);\n if (!match) return;\n\n _this.data(match[1]);\n });\n return getData(this[0]);\n }\n\n if (isString(name)) {\n if (value === undefined) return this[0] && getData(this[0], name);\n return this.each(function (i, ele) {\n return setData(ele, name, value);\n });\n }\n\n for (var key in name) {\n this.data(key, name[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n// @require ./helpers/remove_data.js\n\n\nfn.removeData = function (key) {\n return this.each(function (i, ele) {\n return removeData(ele, key);\n });\n}; // @optional ./data.js\n// @optional ./remove_data.js\n// @require css/helpers/compute_style_int.js\n\n\nfunction getExtraSpace(ele, xAxis) {\n return computeStyleInt(ele, \"border\" + (xAxis ? 'Left' : 'Top') + \"Width\") + computeStyleInt(ele, \"padding\" + (xAxis ? 'Left' : 'Top')) + computeStyleInt(ele, \"padding\" + (xAxis ? 'Right' : 'Bottom')) + computeStyleInt(ele, \"border\" + (xAxis ? 'Right' : 'Bottom') + \"Width\");\n} // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n\n\neach(['Width', 'Height'], function (prop) {\n fn[\"inner\" + prop] = function () {\n if (!this[0]) return;\n if (this[0] === win) return win[\"inner\" + prop];\n return this[0][\"client\" + prop];\n };\n}); // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style.js\n// @require css/helpers/get_suffixed_value.js\n// @require ./helpers/get_extra_space.js\n\neach(['width', 'height'], function (prop, index) {\n fn[prop] = function (value) {\n if (!this[0]) return value === undefined ? undefined : this;\n\n if (!arguments.length) {\n if (this[0] === win) return this[0][camelCase(\"outer-\" + prop)];\n return this[0].getBoundingClientRect()[prop] - getExtraSpace(this[0], !index);\n }\n\n value = parseInt(value, 10);\n return this.each(function (i, ele) {\n if (ele.nodeType !== 1) return;\n var boxSizing = computeStyle(ele, 'boxSizing');\n ele.style[prop] = getSuffixedValue(prop, value + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0));\n });\n };\n}); // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style_int.js\n\neach(['Width', 'Height'], function (prop, index) {\n fn[\"outer\" + prop] = function (includeMargins) {\n if (!this[0]) return;\n if (this[0] === win) return win[\"outer\" + prop];\n return this[0][\"offset\" + prop] + (includeMargins ? computeStyleInt(this[0], \"margin\" + (!index ? 'Left' : 'Top')) + computeStyleInt(this[0], \"margin\" + (!index ? 'Right' : 'Bottom')) : 0);\n };\n}); // @optional ./inner.js\n// @optional ./normal.js\n// @optional ./outer.js\n\nfunction hasNamespaces(ns1, ns2) {\n for (var i = 0, l = ns2.length; i < l; i++) {\n if (ns1.indexOf(ns2[i]) < 0) return false;\n }\n\n return true;\n} // @require core/each.js\n\n\nfunction removeEventListeners(cache, ele, name) {\n each(cache[name], function (_ref) {\n var namespaces = _ref[0],\n callback = _ref[1];\n ele.removeEventListener(name, callback);\n });\n delete cache[name];\n}\n\nvar eventsNamespace = '__cashEvents',\n eventsNamespacesSeparator = '.'; // @require ./variables.js\n\nfunction getEventsCache(ele) {\n return ele[eventsNamespace] = ele[eventsNamespace] || {};\n} // @require core/guid.js\n// @require events/helpers/get_events_cache.js\n\n\nfunction addEvent(ele, name, namespaces, callback) {\n callback.guid = callback.guid || guid++;\n var eventCache = getEventsCache(ele);\n eventCache[name] = eventCache[name] || [];\n eventCache[name].push([namespaces, callback]);\n ele.addEventListener(name, callback);\n} // @require ./variables.js\n\n\nfunction parseEventName(eventName) {\n var parts = eventName.split(eventsNamespacesSeparator);\n return [parts[0], parts.slice(1).sort()]; // [name, namespaces]\n} // @require core/guid.js\n// @require ./get_events_cache.js\n// @require ./has_namespaces.js\n// @require ./parse_event_name.js\n// @require ./remove_event_listeners.js\n\n\nfunction removeEvent(ele, name, namespaces, callback) {\n var cache = getEventsCache(ele);\n\n if (!name) {\n if (!namespaces || !namespaces.length) {\n for (name in cache) {\n removeEventListeners(cache, ele, name);\n }\n } else {\n for (name in cache) {\n removeEvent(ele, name, namespaces, callback);\n }\n }\n } else {\n var eventCache = cache[name];\n if (!eventCache) return;\n if (callback) callback.guid = callback.guid || guid++;\n cache[name] = eventCache.filter(function (_ref2) {\n var ns = _ref2[0],\n cb = _ref2[1];\n if (callback && cb.guid !== callback.guid || !hasNamespaces(ns, namespaces)) return true;\n ele.removeEventListener(name, cb);\n });\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\n\nfn.off = function (eventFullName, callback) {\n var _this2 = this;\n\n if (eventFullName === undefined) {\n this.each(function (i, ele) {\n return removeEvent(ele);\n });\n } else {\n each(getSplitValues(eventFullName), function (eventFullName) {\n var _parseEventName = parseEventName(eventFullName),\n name = _parseEventName[0],\n namespaces = _parseEventName[1];\n\n _this2.each(function (i, ele) {\n return removeEvent(ele, name, namespaces, callback);\n });\n });\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require core/guid.js\n// @require core/matches.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/variables.js\n// @require ./helpers/add_event.js\n// @require ./helpers/has_namespaces.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\n\nfn.on = function (eventFullName, selector, callback, _one) {\n var _this3 = this;\n\n if (!isString(eventFullName)) {\n for (var key in eventFullName) {\n this.on(key, selector, eventFullName[key]);\n }\n\n return this;\n }\n\n if (isFunction(selector)) {\n callback = selector;\n selector = false;\n }\n\n each(getSplitValues(eventFullName), function (eventFullName) {\n var _parseEventName2 = parseEventName(eventFullName),\n name = _parseEventName2[0],\n namespaces = _parseEventName2[1];\n\n _this3.each(function (i, ele) {\n var finalCallback = function finalCallback(event) {\n if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator))) return;\n var thisArg = ele;\n\n if (selector) {\n var target = event.target;\n\n while (!matches(target, selector)) {\n if (target === ele) return;\n target = target.parentNode;\n if (!target) return;\n }\n\n thisArg = target;\n }\n\n event.namespace = event.namespace || '';\n var returnValue = callback.call(thisArg, event, event.data);\n\n if (_one) {\n removeEvent(ele, name, namespaces, finalCallback);\n }\n\n if (returnValue === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n finalCallback.guid = callback.guid = callback.guid || guid++;\n addEvent(ele, name, namespaces, finalCallback);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require ./on.js\n\n\nfn.one = function (eventFullName, delegate, callback) {\n return this.on(eventFullName, delegate, callback, true);\n}; // @require core/cash.js\n// @require core/variables.js\n\n\nfn.ready = function (callback) {\n var finalCallback = function finalCallback() {\n return callback(cash);\n };\n\n if (doc.readyState !== 'loading') {\n setTimeout(finalCallback);\n } else {\n doc.addEventListener('DOMContentLoaded', finalCallback);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/variables.js\n\n\nfn.trigger = function (eventFullName, data) {\n var evt = eventFullName;\n\n if (isString(eventFullName)) {\n var _parseEventName3 = parseEventName(eventFullName),\n name = _parseEventName3[0],\n namespaces = _parseEventName3[1];\n\n evt = doc.createEvent('HTMLEvents');\n evt.initEvent(name, true, true);\n evt.namespace = namespaces.join(eventsNamespacesSeparator);\n }\n\n evt.data = data;\n return this.each(function (i, ele) {\n ele.dispatchEvent(evt);\n });\n}; // @optional ./off.js\n// @optional ./on.js\n// @optional ./one.js\n// @optional ./ready.js\n// @optional ./trigger.js\n// @require core/each.js\n\n\nfunction getValueSelectMultiple(ele) {\n var values = [];\n each(ele.options, function (option) {\n if (option.selected && !option.disabled && !option.parentNode.disabled) {\n values.push(option.value);\n }\n });\n return values;\n}\n\nfunction getValueSelectSingle(ele) {\n return ele.selectedIndex < 0 ? null : ele.options[ele.selectedIndex].value;\n} // @require ./get_value_select_single.js\n// @require ./get_value_select_multiple.js\n\n\nvar selectOneRe = /select-one/i,\n selectMultipleRe = /select-multiple/i;\n\nfunction getValue(ele) {\n var type = ele.type;\n if (selectOneRe.test(type)) return getValueSelectSingle(ele);\n if (selectMultipleRe.test(type)) return getValueSelectMultiple(ele);\n return ele.value;\n}\n\nvar queryEncodeSpaceRe = /%20/g;\n\nfunction queryEncode(prop, value) {\n return \"&\" + encodeURIComponent(prop) + \"=\" + encodeURIComponent(value).replace(queryEncodeSpaceRe, '+');\n} // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require ./helpers/get_value.js\n// @require ./helpers/query_encode.js\n\n\nvar skippableRe = /file|reset|submit|button|image/i,\n checkableRe = /radio|checkbox/i;\n\nfn.serialize = function () {\n var query = '';\n this.each(function (i, ele) {\n each(ele.elements || [ele], function (ele) {\n if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET') return;\n if (skippableRe.test(ele.type)) return;\n if (checkableRe.test(ele.type) && !ele.checked) return;\n var value = getValue(ele);\n if (value === undefined) return;\n var values = isArray(value) ? value : [value];\n each(values, function (value) {\n query += queryEncode(ele.name, value);\n });\n });\n });\n return query.substr(1);\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_value.js\n\n\nfn.val = function (value) {\n if (value === undefined) return this[0] && getValue(this[0]);\n return this.each(function (i, ele) {\n var isMultiple = selectMultipleRe.test(ele.type),\n eleValue = value === null ? isMultiple ? [] : '' : value;\n\n if (isMultiple && isArray(eleValue)) {\n each(ele.options, function (option) {\n option.selected = eleValue.indexOf(option.value) >= 0;\n });\n } else {\n ele.value = eleValue;\n }\n });\n}; // @optional ./serialize.js\n// @optional ./val.js\n// @require core/cash.js\n// @require collection/map.js\n\n\nfn.clone = function () {\n return this.map(function (i, ele) {\n return ele.cloneNode(true);\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\n\nfn.detach = function () {\n return this.each(function (i, ele) {\n if (ele.parentNode) {\n ele.parentNode.removeChild(ele);\n }\n });\n}; // @require ./cash.js\n// @require ./variables.js\n// @require ./type_checking.js\n// @require collection/get.js\n// @require manipulation/detach.js\n\n\nvar fragmentRe = /^\\s*<(\\w+)[^>]*>/,\n singleTagRe = /^\\s*<(\\w+)\\s*\\/?>(?:<\\/\\1>)?\\s*$/;\nvar containers;\n\nfunction initContainers() {\n if (containers) return;\n var table = doc.createElement('table'),\n tr = doc.createElement('tr');\n containers = {\n '*': doc.createElement('div'),\n tr: doc.createElement('tbody'),\n td: tr,\n th: tr,\n thead: table,\n tbody: table,\n tfoot: table\n };\n}\n\nfunction parseHTML(html) {\n initContainers();\n if (!isString(html)) return [];\n if (singleTagRe.test(html)) return [doc.createElement(RegExp.$1)];\n var fragment = fragmentRe.test(html) && RegExp.$1,\n container = containers[fragment] || containers['*'];\n container.innerHTML = html;\n return cash(container.childNodes).detach().get();\n}\n\ncash.parseHTML = parseHTML; // @optional ./camel_case.js\n// @optional ./each.js\n// @optional ./export.js\n// @optional ./extend.js\n// @optional ./find.js\n// @optional ./get_compare_function.js\n// @optional ./get_split_values.js\n// @optional ./guid.js\n// @optional ./matches.js\n// @optional ./parse_html.js\n// @optional ./unique.js\n// @optional ./variables.js\n// @require ./cash.js\n// @require ./type_checking.js\n// @require core/cash.js\n\nfn.empty = function () {\n var ele = this[0];\n\n if (ele) {\n while (ele.firstChild) {\n ele.removeChild(ele.firstChild);\n }\n }\n\n return this;\n};\n\nfunction insertElement(ele, child, prepend) {\n if (prepend) {\n ele.insertBefore(child, ele.childNodes[0]);\n } else {\n ele.appendChild(child);\n }\n} // @require core/each.js\n// @require core/type_checking.js\n// @require ./insert_element.js\n\n\nfunction insertContent(parent, child, prepend) {\n if (child === undefined) return;\n var isStr = isString(child);\n\n if (!isStr && child.length) {\n each(child, function (ele) {\n return insertContent(parent, ele, prepend);\n });\n } else {\n each(parent, isStr ? function (ele) {\n ele.insertAdjacentHTML(prepend ? 'afterbegin' : 'beforeend', child);\n } : function (ele, index) {\n return insertElement(ele, !index ? child : child.cloneNode(true), prepend);\n });\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\n\nfn.append = function () {\n var _this4 = this;\n\n each(arguments, function (content) {\n insertContent(_this4, content);\n });\n return this;\n}; // @require core/cash.js\n// @require ./helpers/insert_content.js\n\n\nfn.appendTo = function (parent) {\n insertContent(cash(parent), this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\n\nfn.html = function (content) {\n if (content === undefined) return this[0] && this[0].innerHTML;\n var source = content.nodeType ? content[0].outerHTML : content;\n return this.each(function (i, ele) {\n ele.innerHTML = source;\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\n\nfn.insertAfter = function (content) {\n var _this5 = this;\n\n cash(content).each(function (index, ele) {\n var parent = ele.parentNode;\n\n _this5.each(function (i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele.nextSibling);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./insert_after.js\n\n\nfn.after = function () {\n var _this6 = this;\n\n each(reverse.apply(arguments), function (content) {\n reverse.apply(cash(content).slice()).insertAfter(_this6);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\n\nfn.insertBefore = function (selector) {\n var _this7 = this;\n\n cash(selector).each(function (index, ele) {\n var parent = ele.parentNode;\n\n _this7.each(function (i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./insert_before.js\n\n\nfn.before = function () {\n var _this8 = this;\n\n each(arguments, function (content) {\n cash(content).insertBefore(_this8);\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\n\nfn.prepend = function () {\n var _this9 = this;\n\n each(arguments, function (content) {\n insertContent(_this9, content, true);\n });\n return this;\n}; // @require core/cash.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./helpers/insert_content.js\n\n\nfn.prependTo = function (parent) {\n insertContent(cash(parent), reverse.apply(this.slice()), true);\n return this;\n}; // @require core/cash.js\n// @require events/off.js\n// @require ./detach.js\n\n\nfn.remove = function () {\n return this.detach().off();\n}; // @require core/cash.js\n// @require collection/each.js\n// @require collection/slice.js\n// @require ./after.js\n// @require ./remove.js\n\n\nfn.replaceWith = function (content) {\n var _this10 = this;\n\n return this.each(function (i, ele) {\n var parent = ele.parentNode;\n if (!parent) return;\n var $eles = i ? cash(content).clone() : cash(content);\n\n if (!$eles[0]) {\n _this10.remove();\n\n return false;\n }\n\n parent.replaceChild($eles[0], ele);\n cash($eles[0]).after($eles.slice(1));\n });\n}; // @require core/cash.js\n// @require ./replace_with.js\n\n\nfn.replaceAll = function (content) {\n cash(content).replaceWith(this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\n\nfn.text = function (content) {\n if (content === undefined) return this[0] ? this[0].textContent : '';\n return this.each(function (i, ele) {\n ele.textContent = content;\n });\n}; // @optional ./after.js\n// @optional ./append.js\n// @optional ./append_to.js\n// @optional ./before.js\n// @optional ./clone.js\n// @optional ./detach.js\n// @optional ./empty.js\n// @optional ./html.js\n// @optional ./insert_after.js\n// @optional ./insert_before.js\n// @optional ./prepend.js\n// @optional ./prepend_to.js\n// @optional ./remove.js\n// @optional ./replace_all.js\n// @optional ./replace_with.js\n// @optional ./text.js\n// @require core/cash.js\n// @require core/variables.js\n\n\nvar docEle = doc.documentElement;\n\nfn.offset = function () {\n var ele = this[0];\n if (!ele) return;\n var rect = ele.getBoundingClientRect();\n return {\n top: rect.top + win.pageYOffset - docEle.clientTop,\n left: rect.left + win.pageXOffset - docEle.clientLeft\n };\n}; // @require core/cash.js\n\n\nfn.offsetParent = function () {\n return cash(this[0] && this[0].offsetParent);\n}; // @require core/cash.js\n\n\nfn.position = function () {\n var ele = this[0];\n if (!ele) return;\n return {\n left: ele.offsetLeft,\n top: ele.offsetTop\n };\n}; // @optional ./offset.js\n// @optional ./offset_parent.js\n// @optional ./position.js\n// @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require collection/each.js\n// @require collection/filter.js\n\n\nfn.children = function (selector) {\n var result = [];\n this.each(function (i, ele) {\n push.apply(result, ele.children);\n });\n result = cash(unique(result));\n if (!selector) return result;\n return result.filter(function (i, ele) {\n return matches(ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\n\nfn.contents = function () {\n var result = [];\n this.each(function (i, ele) {\n push.apply(result, ele.tagName === 'IFRAME' ? [ele.contentDocument] : ele.childNodes);\n });\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/unique.js\n// @require core/find.js\n// @require core/variables.js\n\n\nfn.find = function (selector) {\n var result = [];\n\n for (var i = 0, l = this.length; i < l; i++) {\n var found = find(selector, this[i]);\n\n if (found.length) {\n push.apply(result, found);\n }\n }\n\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/find.js\n// @require core/type_checking.js\n// @require collection/filter.js\n\n\nfn.has = function (selector) {\n var comparator = isString(selector) ? function (i, ele) {\n return !!find(selector, ele).length;\n } : function (i, ele) {\n return ele.contains(selector);\n };\n return this.filter(comparator);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/each.js\n\n\nfn.is = function (selector) {\n if (!selector || !this[0]) return false;\n var comparator = getCompareFunction(selector);\n var check = false;\n this.each(function (i, ele) {\n check = comparator(i, ele, selector);\n return !check;\n });\n return check;\n}; // @require core/cash.js\n\n\nfn.next = function () {\n return cash(this[0] && this[0].nextElementSibling);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/filter.js\n\n\nfn.not = function (selector) {\n if (!selector || !this[0]) return this;\n var comparator = getCompareFunction(selector);\n return this.filter(function (i, ele) {\n return !comparator(i, ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\n\nfn.parent = function () {\n var result = [];\n this.each(function (i, ele) {\n if (ele && ele.parentNode) {\n result.push(ele.parentNode);\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n// @require core/variables.js\n// @require traversal/children.js\n// @require traversal/parent.js\n// @require ./get.js\n//FIXME Ugly file name, is there a better option?\n\n\nfn.index = function (ele) {\n var child = ele ? cash(ele)[0] : this[0],\n collection = ele ? this : cash(child).parent().children();\n return indexOf.call(collection, child);\n}; // @optional ./add.js\n// @optional ./each.js\n// @optional ./eq.js\n// @optional ./filter.js\n// @optional ./first.js\n// @optional ./get.js\n// @optional ./indexFn.js\n// @optional ./last.js\n// @optional ./map.js\n// @optional ./slice.js\n// @require core/cash.js\n// @require collection/filter.js\n// @require ./is.js\n// @require ./parent.js\n\n\nfn.closest = function (selector) {\n if (!selector || !this[0]) return cash();\n if (this.is(selector)) return this.filter(selector);\n return this.parent().closest(selector);\n}; // @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require core/variables.js\n// @require collection/each.js\n\n\nfn.parents = function (selector) {\n var result = [];\n var last;\n this.each(function (i, ele) {\n last = ele;\n\n while (last && last.parentNode && last !== doc.body.parentNode) {\n last = last.parentNode;\n\n if (!selector || selector && matches(last, selector)) {\n result.push(last);\n }\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n\n\nfn.prev = function () {\n return cash(this[0] && this[0].previousElementSibling);\n}; // @require core/cash.js\n// @require collection/filter.js\n// @require ./children.js\n// @require ./parent.js\n\n\nfn.siblings = function () {\n var ele = this[0];\n return this.parent().children().filter(function (i, child) {\n return child !== ele;\n });\n}; // @optional ./children.js\n// @optional ./closest.js\n// @optional ./contents.js\n// @optional ./find.js\n// @optional ./has.js\n// @optional ./is.js\n// @optional ./next.js\n// @optional ./not.js\n// @optional ./parent.js\n// @optional ./parents.js\n// @optional ./prev.js\n// @optional ./siblings.js\n// @optional attributes/index.js\n// @optional collection/index.js\n// @optional css/index.js\n// @optional data/index.js\n// @optional dimensions/index.js\n// @optional events/index.js\n// @optional forms/index.js\n// @optional manipulation/index.js\n// @optional offset/index.js\n// @optional traversal/index.js\n// @require core/index.js\nexport default cash;\n","\n// ------------------------------------------\n// Rellax.js\n// Buttery smooth parallax library\n// Copyright (c) 2016 Moe Amaya (@moeamaya)\n// MIT license\n//\n// Thanks to Paraxify.js and Jaime Cabllero\n// for parallax concepts\n// ------------------------------------------\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.Rellax = factory();\n }\n}(typeof window !== \"undefined\" ? window : global, function () {\n var Rellax = function(el, options){\n \"use strict\";\n\n var self = Object.create(Rellax.prototype);\n\n var posY = 0;\n var screenY = 0;\n var posX = 0;\n var screenX = 0;\n var blocks = [];\n var pause = true;\n\n // check what requestAnimationFrame to use, and if\n // it's not supported, use the onscroll event\n var loop = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n function(callback){ return setTimeout(callback, 1000 / 60); };\n\n // store the id for later use\n var loopId = null;\n\n // check what cancelAnimation method to use\n var clearLoop = window.cancelAnimationFrame || window.mozCancelAnimationFrame || clearTimeout;\n\n // check which transform property to use\n var transformProp = window.transformProp || (function(){\n var testEl = document.createElement('div');\n if (testEl.style.transform === null) {\n var vendors = ['Webkit', 'Moz', 'ms'];\n for (var vendor in vendors) {\n if (testEl.style[ vendors[vendor] + 'Transform' ] !== undefined) {\n return vendors[vendor] + 'Transform';\n }\n }\n }\n return 'transform';\n })();\n\n // Default Settings\n self.options = {\n speed: -2,\n center: false,\n wrapper: null,\n relativeToWrapper: false,\n round: true,\n vertical: true,\n horizontal: false,\n callback: function() {},\n };\n\n // User defined options (might have more in the future)\n if (options){\n Object.keys(options).forEach(function(key){\n self.options[key] = options[key];\n });\n }\n\n // By default, rellax class\n if (!el) {\n el = '.rellax';\n }\n\n // check if el is a className or a node\n var elements = typeof el === 'string' ? document.querySelectorAll(el) : [el];\n\n // Now query selector\n if (elements.length > 0) {\n self.elems = elements;\n }\n\n // The elements don't exist\n else {\n throw new Error(\"The elements you're trying to select don't exist.\");\n }\n\n // Has a wrapper and it exists\n if (self.options.wrapper) {\n if (!self.options.wrapper.nodeType) {\n var wrapper = document.querySelector(self.options.wrapper);\n\n if (wrapper) {\n self.options.wrapper = wrapper;\n } else {\n throw new Error(\"The wrapper you're trying to use don't exist.\");\n }\n }\n }\n\n\n // Get and cache initial position of all elements\n var cacheBlocks = function() {\n for (var i = 0; i < self.elems.length; i++){\n var block = createBlock(self.elems[i]);\n blocks.push(block);\n }\n };\n\n\n // Let's kick this script off\n // Build array for cached element values\n var init = function() {\n for (var i = 0; i < blocks.length; i++){\n self.elems[i].style.cssText = blocks[i].style;\n }\n\n blocks = [];\n\n screenY = window.innerHeight;\n screenX = window.innerWidth;\n setPosition();\n\n cacheBlocks();\n\n // If paused, unpause and set listener for window resizing events\n if (pause) {\n window.addEventListener('resize', init);\n pause = false;\n }\n animate();\n };\n\n // We want to cache the parallax blocks'\n // values: base, top, height, speed\n // el: is dom object, return: el cache values\n var createBlock = function(el) {\n var dataPercentage = el.getAttribute( 'data-rellax-percentage' );\n var dataSpeed = el.getAttribute( 'data-rellax-speed' );\n var dataZindex = el.getAttribute( 'data-rellax-zindex' ) || 0;\n\n // initializing at scrollY = 0 (top of browser), scrollX = 0 (left of browser)\n // ensures elements are positioned based on HTML layout.\n //\n // If the element has the percentage attribute, the posY and posX needs to be\n // the current scroll position's value, so that the elements are still positioned based on HTML layout\n var wrapperPosY = self.options.wrapper ? self.options.wrapper.scrollTop : (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);\n // If the option relativeToWrapper is true, use the wrappers offset to top, subtracted from the current page scroll.\n if (self.options.relativeToWrapper) {\n var scrollPosY = (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);\n wrapperPosY = scrollPosY - self.options.wrapper.offsetTop;\n }\n var posY = self.options.vertical ? ( dataPercentage || self.options.center ? wrapperPosY : 0 ) : 0;\n var posX = self.options.horizontal ? ( dataPercentage || self.options.center ? (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft) : 0 ) : 0;\n\n var blockTop = posY + el.getBoundingClientRect().top;\n var blockHeight = el.clientHeight || el.offsetHeight || el.scrollHeight;\n\n var blockLeft = posX + el.getBoundingClientRect().left;\n var blockWidth = el.clientWidth || el.offsetWidth || el.scrollWidth;\n\n // apparently parallax equation everyone uses\n var percentageY = dataPercentage ? dataPercentage : (posY - blockTop + screenY) / (blockHeight + screenY);\n var percentageX = dataPercentage ? dataPercentage : (posX - blockLeft + screenX) / (blockWidth + screenX);\n if(self.options.center){ percentageX = 0.5; percentageY = 0.5; }\n\n // Optional individual block speed as data attr, otherwise global speed\n var speed = dataSpeed ? dataSpeed : self.options.speed;\n\n var bases = updatePosition(percentageX, percentageY, speed);\n\n // ~~Store non-translate3d transforms~~\n // Store inline styles and extract transforms\n var style = el.style.cssText;\n var transform = '';\n\n // Check if there's an inline styled transform\n if (style.indexOf('transform') >= 0) {\n // Get the index of the transform\n var index = style.indexOf('transform');\n\n // Trim the style to the transform point and get the following semi-colon index\n var trimmedStyle = style.slice(index);\n var delimiter = trimmedStyle.indexOf(';');\n\n // Remove \"transform\" string and save the attribute\n if (delimiter) {\n transform = \" \" + trimmedStyle.slice(11, delimiter).replace(/\\s/g,'');\n } else {\n transform = \" \" + trimmedStyle.slice(11).replace(/\\s/g,'');\n }\n }\n\n return {\n baseX: bases.x,\n baseY: bases.y,\n top: blockTop,\n left: blockLeft,\n height: blockHeight,\n width: blockWidth,\n speed: speed,\n style: style,\n transform: transform,\n zindex: dataZindex\n };\n };\n\n // set scroll position (posY, posX)\n // side effect method is not ideal, but okay for now\n // returns true if the scroll changed, false if nothing happened\n var setPosition = function() {\n var oldY = posY;\n var oldX = posX;\n\n posY = self.options.wrapper ? self.options.wrapper.scrollTop : (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset;\n posX = self.options.wrapper ? self.options.wrapper.scrollLeft : (document.documentElement || document.body.parentNode || document.body).scrollLeft || window.pageXOffset;\n // If option relativeToWrapper is true, use relative wrapper value instead.\n if (self.options.relativeToWrapper) {\n var scrollPosY = (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset;\n posY = scrollPosY - self.options.wrapper.offsetTop;\n }\n\n\n if (oldY != posY && self.options.vertical) {\n // scroll changed, return true\n return true;\n }\n\n if (oldX != posX && self.options.horizontal) {\n // scroll changed, return true\n return true;\n }\n\n // scroll did not change\n return false;\n };\n\n // Ahh a pure function, gets new transform value\n // based on scrollPosition and speed\n // Allow for decimal pixel values\n var updatePosition = function(percentageX, percentageY, speed) {\n var result = {};\n var valueX = (speed * (100 * (1 - percentageX)));\n var valueY = (speed * (100 * (1 - percentageY)));\n\n result.x = self.options.round ? Math.round(valueX) : Math.round(valueX * 100) / 100;\n result.y = self.options.round ? Math.round(valueY) : Math.round(valueY * 100) / 100;\n\n return result;\n };\n\n // Loop\n var update = function() {\n if (setPosition() && pause === false) {\n animate();\n }\n\n // loop again\n loopId = loop(update);\n };\n\n // Transform3d on parallax element\n var animate = function() {\n var positions;\n for (var i = 0; i < self.elems.length; i++){\n var percentageY = ((posY - blocks[i].top + screenY) / (blocks[i].height + screenY));\n var percentageX = ((posX - blocks[i].left + screenX) / (blocks[i].width + screenX));\n\n // Subtracting initialize value, so element stays in same spot as HTML\n positions = updatePosition(percentageX, percentageY, blocks[i].speed);// - blocks[i].baseX;\n var positionY = positions.y - blocks[i].baseY;\n var positionX = positions.x - blocks[i].baseX;\n\n var zindex = blocks[i].zindex;\n\n // Move that element\n // (Set the new translation and append initial inline transforms.)\n var translate = 'translate3d(' + (self.options.horizontal ? positionX : '0') + 'px,' + (self.options.vertical ? positionY : '0') + 'px,' + zindex + 'px) ' + blocks[i].transform;\n self.elems[i].style[transformProp] = translate;\n }\n self.options.callback(positions);\n };\n\n self.destroy = function() {\n for (var i = 0; i < self.elems.length; i++){\n self.elems[i].style.cssText = blocks[i].style;\n }\n\n // Remove resize event listener if not pause, and pause\n if (!pause) {\n window.removeEventListener('resize', init);\n pause = true;\n }\n\n // Clear the animation loop to prevent possible memory leak\n clearLoop(loopId);\n loopId = null;\n };\n\n // Init\n init();\n\n // Start the loop\n update();\n\n // Allow to recalculate the initial values whenever we want\n self.refresh = init;\n\n return self;\n };\n return Rellax;\n}));\n","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.VanillaModal = mod.exports;\n }\n})(this, function (exports) {\n 'use strict';\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n var defaults = {\n modal: '.modal',\n modalInner: '.modal-inner',\n modalContent: '.modal-content',\n open: '[data-modal-open]',\n close: '[data-modal-close]',\n page: 'body',\n class: 'modal-visible',\n loadClass: 'vanilla-modal',\n clickOutside: true,\n closeKeys: [27],\n transitions: true,\n transitionEnd: null,\n onBeforeOpen: null,\n onBeforeClose: null,\n onOpen: null,\n onClose: null\n };\n\n function throwError(message) {\n // eslint-disable-next-line no-console\n console.error('VanillaModal: ' + message);\n }\n\n function find(arr, callback) {\n return function (key) {\n var filteredArray = arr.filter(callback);\n return filteredArray[0] ? filteredArray[0][key] : undefined;\n };\n }\n\n function transitionEndVendorSniff() {\n var el = document.createElement('div');\n var transitions = [{ key: 'transition', value: 'transitionend' }, { key: 'OTransition', value: 'otransitionend' }, { key: 'MozTransition', value: 'transitionend' }, { key: 'WebkitTransition', value: 'webkitTransitionEnd' }];\n return find(transitions, function (_ref) {\n var key = _ref.key;\n return typeof el.style[key] !== 'undefined';\n })('value');\n }\n\n function isPopulatedArray(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]' && arr.length;\n }\n\n function getNode(selector, parent) {\n var targetNode = parent || document;\n var node = targetNode.querySelector(selector);\n if (!node) {\n throwError(selector + ' not found in document.');\n }\n return node;\n }\n\n function addClass(el, className) {\n if (!(el instanceof HTMLElement)) {\n throwError('Not a valid HTML element.');\n }\n el.setAttribute('class', el.className.split(' ').filter(function (cn) {\n return cn !== className;\n }).concat(className).join(' '));\n }\n\n function removeClass(el, className) {\n if (!(el instanceof HTMLElement)) {\n throwError('Not a valid HTML element.');\n }\n el.setAttribute('class', el.className.split(' ').filter(function (cn) {\n return cn !== className;\n }).join(' '));\n }\n\n function getElementContext(e) {\n if (e && typeof e.hash === 'string') {\n return document.querySelector(e.hash);\n } else if (typeof e === 'string') {\n return document.querySelector(e);\n }\n throwError('No selector supplied to open()');\n return null;\n }\n\n function applyUserSettings(settings) {\n return _extends({}, defaults, settings, {\n transitionEnd: transitionEndVendorSniff()\n });\n }\n\n function matches(e, selector) {\n var allMatches = (e.target.document || e.target.ownerDocument).querySelectorAll(selector);\n for (var i = 0; i < allMatches.length; i += 1) {\n var node = e.target;\n while (node && node !== document.body) {\n if (node === allMatches[i]) {\n return node;\n }\n node = node.parentNode;\n }\n }\n return null;\n }\n\n var VanillaModal = function () {\n function VanillaModal(settings) {\n _classCallCheck(this, VanillaModal);\n\n this.isOpen = false;\n this.current = null;\n this.isListening = false;\n\n this.settings = applyUserSettings(settings);\n this.dom = this.getDomNodes();\n\n this.open = this.open.bind(this);\n this.close = this.close.bind(this);\n this.closeKeyHandler = this.closeKeyHandler.bind(this);\n this.outsideClickHandler = this.outsideClickHandler.bind(this);\n this.delegateOpen = this.delegateOpen.bind(this);\n this.delegateClose = this.delegateClose.bind(this);\n this.listen = this.listen.bind(this);\n this.destroy = this.destroy.bind(this);\n\n this.addLoadedCssClass();\n this.listen();\n }\n\n _createClass(VanillaModal, [{\n key: 'getDomNodes',\n value: function getDomNodes() {\n var _settings = this.settings,\n modal = _settings.modal,\n page = _settings.page,\n modalInner = _settings.modalInner,\n modalContent = _settings.modalContent;\n\n return {\n modal: getNode(modal),\n page: getNode(page),\n modalInner: getNode(modalInner, getNode(modal)),\n modalContent: getNode(modalContent, getNode(modal))\n };\n }\n }, {\n key: 'addLoadedCssClass',\n value: function addLoadedCssClass() {\n addClass(this.dom.page, this.settings.loadClass);\n }\n }, {\n key: 'setOpenId',\n value: function setOpenId(id) {\n var page = this.dom.page;\n\n page.setAttribute('data-current-modal', id || 'anonymous');\n }\n }, {\n key: 'removeOpenId',\n value: function removeOpenId() {\n var page = this.dom.page;\n\n page.removeAttribute('data-current-modal');\n }\n }, {\n key: 'open',\n value: function open(allMatches, e) {\n var page = this.dom.page;\n var _settings2 = this.settings,\n onBeforeOpen = _settings2.onBeforeOpen,\n onOpen = _settings2.onOpen;\n\n this.closeModal(e);\n if (!(this.current instanceof HTMLElement === false)) {\n throwError('VanillaModal target must exist on page.');\n return;\n }\n this.releaseNode(this.current);\n this.current = getElementContext(allMatches);\n if (typeof onBeforeOpen === 'function') {\n onBeforeOpen.call(this, e);\n }\n this.captureNode(this.current);\n addClass(page, this.settings.class);\n this.setOpenId(this.current.id);\n this.isOpen = true;\n if (typeof onOpen === 'function') {\n onOpen.call(this, e);\n }\n }\n }, {\n key: 'detectTransition',\n value: function detectTransition() {\n var modal = this.dom.modal;\n\n var css = window.getComputedStyle(modal, null);\n return Boolean(['transitionDuration', 'oTransitionDuration', 'MozTransitionDuration', 'webkitTransitionDuration'].filter(function (i) {\n return typeof css[i] === 'string' && parseFloat(css[i]) > 0;\n }).length);\n }\n }, {\n key: 'close',\n value: function close(e) {\n var _settings3 = this.settings,\n transitions = _settings3.transitions,\n transitionEnd = _settings3.transitionEnd,\n onBeforeClose = _settings3.onBeforeClose;\n\n var hasTransition = this.detectTransition();\n if (this.isOpen) {\n this.isOpen = false;\n if (typeof onBeforeClose === 'function') {\n onBeforeClose.call(this, e);\n }\n removeClass(this.dom.page, this.settings.class);\n if (transitions && transitionEnd && hasTransition) {\n this.closeModalWithTransition(e);\n } else {\n this.closeModal(e);\n }\n }\n }\n }, {\n key: 'closeModal',\n value: function closeModal(e) {\n var onClose = this.settings.onClose;\n\n this.removeOpenId(this.dom.page);\n this.releaseNode(this.current);\n this.isOpen = false;\n this.current = null;\n if (typeof onClose === 'function') {\n onClose.call(this, e);\n }\n }\n }, {\n key: 'closeModalWithTransition',\n value: function closeModalWithTransition(e) {\n var _this = this;\n\n var modal = this.dom.modal;\n var transitionEnd = this.settings.transitionEnd;\n\n var closeTransitionHandler = function closeTransitionHandler() {\n modal.removeEventListener(transitionEnd, closeTransitionHandler);\n _this.closeModal(e);\n };\n modal.addEventListener(transitionEnd, closeTransitionHandler);\n }\n }, {\n key: 'captureNode',\n value: function captureNode(node) {\n var modalContent = this.dom.modalContent;\n\n while (node.childNodes.length) {\n modalContent.appendChild(node.childNodes[0]);\n }\n }\n }, {\n key: 'releaseNode',\n value: function releaseNode(node) {\n var modalContent = this.dom.modalContent;\n\n while (modalContent.childNodes.length) {\n node.appendChild(modalContent.childNodes[0]);\n }\n }\n }, {\n key: 'closeKeyHandler',\n value: function closeKeyHandler(e) {\n var closeKeys = this.settings.closeKeys;\n\n if (isPopulatedArray(closeKeys) && closeKeys.indexOf(e.which) > -1 && this.isOpen === true) {\n e.preventDefault();\n this.close(e);\n }\n }\n }, {\n key: 'outsideClickHandler',\n value: function outsideClickHandler(e) {\n var clickOutside = this.settings.clickOutside;\n var modalInner = this.dom.modalInner;\n\n if (clickOutside) {\n var node = e.target;\n while (node && node !== document.body) {\n if (node === modalInner) {\n return;\n }\n node = node.parentNode;\n }\n this.close(e);\n }\n }\n }, {\n key: 'delegateOpen',\n value: function delegateOpen(e) {\n var open = this.settings.open;\n\n var matchedNode = matches(e, open);\n if (matchedNode) {\n e.preventDefault();\n this.open(matchedNode, e);\n }\n }\n }, {\n key: 'delegateClose',\n value: function delegateClose(e) {\n var close = this.settings.close;\n\n if (matches(e, close)) {\n e.preventDefault();\n this.close(e);\n }\n }\n }, {\n key: 'listen',\n value: function listen() {\n var modal = this.dom.modal;\n\n if (!this.isListening) {\n modal.addEventListener('click', this.outsideClickHandler, false);\n document.addEventListener('keydown', this.closeKeyHandler, false);\n document.addEventListener('click', this.delegateOpen, false);\n document.addEventListener('click', this.delegateClose, false);\n this.isListening = true;\n } else {\n throwError('Event listeners already applied.');\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var modal = this.dom.modal;\n\n if (this.isListening) {\n this.close();\n modal.removeEventListener('click', this.outsideClickHandler);\n document.removeEventListener('keydown', this.closeKeyHandler);\n document.removeEventListener('click', this.delegateOpen);\n document.removeEventListener('click', this.delegateClose);\n this.isListening = false;\n } else {\n throwError('Event listeners already removed.');\n }\n }\n }]);\n\n return VanillaModal;\n }();\n\n exports.default = VanillaModal;\n});\n","import $ from \"cash-dom\";\nimport VanillaModal from 'vanilla-modal';\n\nvar modalContainer = document.createElement(\"div\");\nmodalContainer.className = \"modal\";\nmodalContainer.setAttribute(\"role\", \"dialog\");\nmodalContainer.setAttribute(\"aria-label\", \"Dialog Window (Press escape to close)\");\n// modalContainer.setAttribute(\"tabindex\", \"-1\");\nmodalContainer.innerHTML = \"\\\n