{"version":3,"file":"application-Dtw4GDKq.js","sources":["../../../app/frontend/javascripts/polyfils.js","../../../app/frontend/javascripts/jquery.js","../../../node_modules/@rails/ujs/app/assets/javascripts/rails-ujs.esm.js","../../../app/frontend/javascripts/rails.js","../../../node_modules/foundation-sites/dist/js/foundation.esm.js","../../../node_modules/jquery-ui/ui/widget.js","../../../node_modules/jquery-ui/ui/widgets/datepicker.js","../../../app/frontend/javascripts/cookies.js","../../../app/frontend/javascripts/annual_survey.js","../../../node_modules/clipboard/dist/clipboard.js","../../../app/frontend/javascripts/api_keys.js","../../../node_modules/d3-array/src/ascending.js","../../../node_modules/d3-array/src/descending.js","../../../node_modules/d3-array/src/bisector.js","../../../node_modules/d3-array/src/number.js","../../../node_modules/d3-array/src/bisect.js","../../../node_modules/d3-array/src/extent.js","../../../node_modules/d3-array/src/ticks.js","../../../node_modules/d3-axis/src/identity.js","../../../node_modules/d3-axis/src/axis.js","../../../node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/d3-selection/src/namespaces.js","../../../node_modules/d3-selection/src/namespace.js","../../../node_modules/d3-selection/src/creator.js","../../../node_modules/d3-selection/src/selector.js","../../../node_modules/d3-selection/src/selection/select.js","../../../node_modules/d3-selection/src/array.js","../../../node_modules/d3-selection/src/selectorAll.js","../../../node_modules/d3-selection/src/selection/selectAll.js","../../../node_modules/d3-selection/src/matcher.js","../../../node_modules/d3-selection/src/selection/selectChild.js","../../../node_modules/d3-selection/src/selection/selectChildren.js","../../../node_modules/d3-selection/src/selection/filter.js","../../../node_modules/d3-selection/src/selection/sparse.js","../../../node_modules/d3-selection/src/selection/enter.js","../../../node_modules/d3-selection/src/constant.js","../../../node_modules/d3-selection/src/selection/data.js","../../../node_modules/d3-selection/src/selection/exit.js","../../../node_modules/d3-selection/src/selection/join.js","../../../node_modules/d3-selection/src/selection/merge.js","../../../node_modules/d3-selection/src/selection/order.js","../../../node_modules/d3-selection/src/selection/sort.js","../../../node_modules/d3-selection/src/selection/call.js","../../../node_modules/d3-selection/src/selection/nodes.js","../../../node_modules/d3-selection/src/selection/node.js","../../../node_modules/d3-selection/src/selection/size.js","../../../node_modules/d3-selection/src/selection/empty.js","../../../node_modules/d3-selection/src/selection/each.js","../../../node_modules/d3-selection/src/selection/attr.js","../../../node_modules/d3-selection/src/window.js","../../../node_modules/d3-selection/src/selection/style.js","../../../node_modules/d3-selection/src/selection/property.js","../../../node_modules/d3-selection/src/selection/classed.js","../../../node_modules/d3-selection/src/selection/text.js","../../../node_modules/d3-selection/src/selection/html.js","../../../node_modules/d3-selection/src/selection/raise.js","../../../node_modules/d3-selection/src/selection/lower.js","../../../node_modules/d3-selection/src/selection/append.js","../../../node_modules/d3-selection/src/selection/insert.js","../../../node_modules/d3-selection/src/selection/remove.js","../../../node_modules/d3-selection/src/selection/clone.js","../../../node_modules/d3-selection/src/selection/datum.js","../../../node_modules/d3-selection/src/selection/on.js","../../../node_modules/d3-selection/src/selection/dispatch.js","../../../node_modules/d3-selection/src/selection/iterator.js","../../../node_modules/d3-selection/src/selection/index.js","../../../node_modules/d3-selection/src/select.js","../../../node_modules/d3-color/src/define.js","../../../node_modules/d3-color/src/color.js","../../../node_modules/d3-interpolate/src/constant.js","../../../node_modules/d3-interpolate/src/color.js","../../../node_modules/d3-interpolate/src/rgb.js","../../../node_modules/d3-interpolate/src/numberArray.js","../../../node_modules/d3-interpolate/src/array.js","../../../node_modules/d3-interpolate/src/date.js","../../../node_modules/d3-interpolate/src/number.js","../../../node_modules/d3-interpolate/src/object.js","../../../node_modules/d3-interpolate/src/string.js","../../../node_modules/d3-interpolate/src/value.js","../../../node_modules/d3-interpolate/src/round.js","../../../node_modules/d3-interpolate/src/transform/decompose.js","../../../node_modules/d3-interpolate/src/transform/parse.js","../../../node_modules/d3-interpolate/src/transform/index.js","../../../node_modules/d3-timer/src/timer.js","../../../node_modules/d3-timer/src/timeout.js","../../../node_modules/d3-transition/src/transition/schedule.js","../../../node_modules/d3-transition/src/interrupt.js","../../../node_modules/d3-transition/src/selection/interrupt.js","../../../node_modules/d3-transition/src/transition/tween.js","../../../node_modules/d3-transition/src/transition/interpolate.js","../../../node_modules/d3-transition/src/transition/attr.js","../../../node_modules/d3-transition/src/transition/attrTween.js","../../../node_modules/d3-transition/src/transition/delay.js","../../../node_modules/d3-transition/src/transition/duration.js","../../../node_modules/d3-transition/src/transition/ease.js","../../../node_modules/d3-transition/src/transition/easeVarying.js","../../../node_modules/d3-transition/src/transition/filter.js","../../../node_modules/d3-transition/src/transition/merge.js","../../../node_modules/d3-transition/src/transition/on.js","../../../node_modules/d3-transition/src/transition/remove.js","../../../node_modules/d3-transition/src/transition/select.js","../../../node_modules/d3-transition/src/transition/selectAll.js","../../../node_modules/d3-transition/src/transition/selection.js","../../../node_modules/d3-transition/src/transition/style.js","../../../node_modules/d3-transition/src/transition/styleTween.js","../../../node_modules/d3-transition/src/transition/text.js","../../../node_modules/d3-transition/src/transition/textTween.js","../../../node_modules/d3-transition/src/transition/transition.js","../../../node_modules/d3-transition/src/transition/end.js","../../../node_modules/d3-transition/src/transition/index.js","../../../node_modules/d3-ease/src/cubic.js","../../../node_modules/d3-transition/src/selection/transition.js","../../../node_modules/d3-transition/src/selection/index.js","../../../node_modules/d3-path/src/path.js","../../../node_modules/d3-format/src/formatDecimal.js","../../../node_modules/d3-format/src/exponent.js","../../../node_modules/d3-format/src/formatGroup.js","../../../node_modules/d3-format/src/formatNumerals.js","../../../node_modules/d3-format/src/formatSpecifier.js","../../../node_modules/d3-format/src/formatTrim.js","../../../node_modules/d3-format/src/formatPrefixAuto.js","../../../node_modules/d3-format/src/formatRounded.js","../../../node_modules/d3-format/src/formatTypes.js","../../../node_modules/d3-format/src/identity.js","../../../node_modules/d3-format/src/locale.js","../../../node_modules/d3-format/src/defaultLocale.js","../../../node_modules/d3-format/src/precisionFixed.js","../../../node_modules/d3-format/src/precisionPrefix.js","../../../node_modules/d3-format/src/precisionRound.js","../../../node_modules/d3-scale/src/init.js","../../../node_modules/d3-scale/src/constant.js","../../../node_modules/d3-scale/src/number.js","../../../node_modules/d3-scale/src/continuous.js","../../../node_modules/d3-scale/src/tickFormat.js","../../../node_modules/d3-scale/src/linear.js","../../../node_modules/d3-shape/src/constant.js","../../../node_modules/d3-shape/src/path.js","../../../node_modules/d3-shape/src/array.js","../../../node_modules/d3-shape/src/curve/linear.js","../../../node_modules/d3-shape/src/point.js","../../../node_modules/d3-shape/src/line.js","../../../node_modules/d3-shape/src/area.js","../../../node_modules/d3-zoom/src/transform.js","../../../node_modules/nouislider/dist/nouislider.mjs","../../../app/frontend/javascripts/area_chart.js","../../../app/frontend/javascripts/banner.js","../../../app/frontend/javascripts/dropdown_menu.js","../../../app/frontend/javascripts/explore.js","../../../app/frontend/javascripts/external_links.js","../../../app/frontend/javascripts/mobile-nav.js","../../../app/frontend/javascripts/new_user_record.js","../../../app/frontend/javascripts/recaptcha.js","../../../app/frontend/javascripts/user_images.js","../../../app/frontend/javascripts/user_records.js","../../../app/frontend/entrypoints/application.js"],"sourcesContent":["if (!String.prototype.includes) {\n String.prototype.includes = function (search, start) {\n \"use strict\";\n if (typeof start !== \"number\") {\n start = 0;\n }\n\n if (start + search.length > this.length) {\n return false;\n } else {\n return this.indexOf(search, start) !== -1;\n }\n };\n}\n\nif (typeof Array.prototype.forEach != \"function\") {\n Array.prototype.forEach = function (callback) {\n for (var i = 0; i < this.length; i++) {\n callback.apply(this, [this[i], i, this]);\n }\n };\n}\n\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = Array.prototype.forEach;\n}\n\n// https://webplatform.news/issues/2019-04-19\n// https://github.com/calvellido/focus-options-polyfill/blob/master/index.js\n// focus - focusOptions - preventScroll polyfill\n(function () {\n if (\n typeof window === \"undefined\" ||\n typeof document === \"undefined\" ||\n typeof HTMLElement === \"undefined\"\n ) {\n return;\n }\n\n var supportsPreventScrollOption = false;\n try {\n var focusElem = document.createElement(\"div\");\n focusElem.addEventListener(\n \"focus\",\n function (event) {\n event.preventDefault();\n event.stopPropagation();\n },\n true\n );\n focusElem.focus(\n Object.defineProperty({}, \"preventScroll\", {\n get: function () {\n supportsPreventScrollOption = true;\n },\n })\n );\n } catch (e) {}\n\n if (\n HTMLElement.prototype.nativeFocus === undefined &&\n !supportsPreventScrollOption\n ) {\n HTMLElement.prototype.nativeFocus = HTMLElement.prototype.focus;\n\n var calcScrollableElements = function (element) {\n var parent = element.parentNode;\n var scrollableElements = [];\n var rootScrollingElement =\n document.scrollingElement || document.documentElement;\n\n while (parent && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push([\n parent,\n parent.scrollTop,\n parent.scrollLeft,\n ]);\n }\n parent = parent.parentNode;\n }\n parent = rootScrollingElement;\n scrollableElements.push([parent, parent.scrollTop, parent.scrollLeft]);\n\n return scrollableElements;\n };\n\n var restoreScrollPosition = function (scrollableElements) {\n for (var i = 0; i < scrollableElements.length; i++) {\n scrollableElements[i][0].scrollTop = scrollableElements[i][1];\n scrollableElements[i][0].scrollLeft = scrollableElements[i][2];\n }\n scrollableElements = [];\n };\n\n var patchedFocus = function (args) {\n if (args && args.preventScroll) {\n var evScrollableElements = calcScrollableElements(this);\n this.nativeFocus();\n if (typeof setTimeout === \"function\") {\n setTimeout(function () {\n restoreScrollPosition(evScrollableElements);\n }, 0);\n } else {\n restoreScrollPosition(evScrollableElements);\n }\n } else {\n this.nativeFocus();\n }\n };\n\n HTMLElement.prototype.focus = patchedFocus;\n }\n})();\n","import jQuery from \"jquery\";\nObject.assign(window, { $: jQuery, jQuery });\n","/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/javascript\nReleased under the MIT license\n */\nconst linkClickSelector = \"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]\";\n\nconst buttonClickSelector = {\n selector: \"button[data-remote]:not([form]), button[data-confirm]:not([form])\",\n exclude: \"form button\"\n};\n\nconst inputChangeSelector = \"select[data-remote], input[data-remote], textarea[data-remote]\";\n\nconst formSubmitSelector = \"form:not([data-turbo=true])\";\n\nconst formInputClickSelector = \"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])\";\n\nconst formDisableSelector = \"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled\";\n\nconst formEnableSelector = \"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled\";\n\nconst fileInputSelector = \"input[name][type=file]:not([disabled])\";\n\nconst linkDisableSelector = \"a[data-disable-with], a[data-disable]\";\n\nconst buttonDisableSelector = \"button[data-remote][data-disable-with], button[data-remote][data-disable]\";\n\nlet nonce = null;\n\nconst loadCSPNonce = () => {\n const metaTag = document.querySelector(\"meta[name=csp-nonce]\");\n return nonce = metaTag && metaTag.content;\n};\n\nconst cspNonce = () => nonce || loadCSPNonce();\n\nconst m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nconst matches = function(element, selector) {\n if (selector.exclude) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n};\n\nconst EXPANDO = \"_ujsData\";\n\nconst getData = (element, key) => element[EXPANDO] ? element[EXPANDO][key] : undefined;\n\nconst setData = function(element, key, value) {\n if (!element[EXPANDO]) {\n element[EXPANDO] = {};\n }\n return element[EXPANDO][key] = value;\n};\n\nconst $ = selector => Array.prototype.slice.call(document.querySelectorAll(selector));\n\nconst isContentEditable = function(element) {\n var isEditable = false;\n do {\n if (element.isContentEditable) {\n isEditable = true;\n break;\n }\n element = element.parentElement;\n } while (element);\n return isEditable;\n};\n\nconst csrfToken = () => {\n const meta = document.querySelector(\"meta[name=csrf-token]\");\n return meta && meta.content;\n};\n\nconst csrfParam = () => {\n const meta = document.querySelector(\"meta[name=csrf-param]\");\n return meta && meta.content;\n};\n\nconst CSRFProtection = xhr => {\n const token = csrfToken();\n if (token) {\n return xhr.setRequestHeader(\"X-CSRF-Token\", token);\n }\n};\n\nconst refreshCSRFTokens = () => {\n const token = csrfToken();\n const param = csrfParam();\n if (token && param) {\n return $('form input[name=\"' + param + '\"]').forEach((input => input.value = token));\n }\n};\n\nconst AcceptHeaders = {\n \"*\": \"*/*\",\n text: \"text/plain\",\n html: \"text/html\",\n xml: \"application/xml, text/xml\",\n json: \"application/json, text/javascript\",\n script: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n};\n\nconst ajax = options => {\n options = prepareOptions(options);\n var xhr = createXHR(options, (function() {\n const response = processResponse(xhr.response != null ? xhr.response : xhr.responseText, xhr.getResponseHeader(\"Content-Type\"));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : undefined;\n }));\n if (options.beforeSend && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n};\n\nvar prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === \"GET\" && options.data) {\n if (options.url.indexOf(\"?\") < 0) {\n options.url += \"?\" + options.data;\n } else {\n options.url += \"&\" + options.data;\n }\n }\n if (!(options.dataType in AcceptHeaders)) {\n options.dataType = \"*\";\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== \"*\") {\n options.accept += \", */*; q=0.01\";\n }\n return options;\n};\n\nvar createXHR = function(options, done) {\n const xhr = new XMLHttpRequest;\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader(\"Accept\", options.accept);\n if (typeof options.data === \"string\") {\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n};\n\nvar processResponse = function(response, type) {\n if (typeof response === \"string\" && typeof type === \"string\") {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n const script = document.createElement(\"script\");\n script.setAttribute(\"nonce\", cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n const parser = new DOMParser;\n type = type.replace(/;.+/, \"\");\n try {\n response = parser.parseFromString(response, type);\n } catch (error1) {}\n }\n }\n return response;\n};\n\nconst href = element => element.href;\n\nconst isCrossDomain = function(url) {\n const originAnchor = document.createElement(\"a\");\n originAnchor.href = location.href;\n const urlAnchor = document.createElement(\"a\");\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === \":\") && !urlAnchor.host || originAnchor.protocol + \"//\" + originAnchor.host === urlAnchor.protocol + \"//\" + urlAnchor.host);\n } catch (e) {\n return true;\n }\n};\n\nlet preventDefault;\n\nlet {CustomEvent: CustomEvent} = window;\n\nif (typeof CustomEvent !== \"function\") {\n CustomEvent = function(event, params) {\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n ({preventDefault: preventDefault} = CustomEvent.prototype);\n CustomEvent.prototype.preventDefault = function() {\n const result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, \"defaultPrevented\", {\n get() {\n return true;\n }\n });\n }\n return result;\n };\n}\n\nconst fire = (obj, name, data) => {\n const event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n};\n\nconst stopEverything = e => {\n fire(e.target, \"ujs:everythingStopped\");\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n};\n\nconst delegate = (element, selector, eventType, handler) => element.addEventListener(eventType, (function(e) {\n let {target: target} = e;\n while (!!(target instanceof Element) && !matches(target, selector)) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n}));\n\nconst toArray = e => Array.prototype.slice.call(e);\n\nconst serializeElement = (element, additionalParam) => {\n let inputs = [ element ];\n if (matches(element, \"form\")) {\n inputs = toArray(element.elements);\n }\n const params = [];\n inputs.forEach((function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, \"fieldset[disabled] *\")) {\n return;\n }\n if (matches(input, \"select\")) {\n toArray(input.options).forEach((function(option) {\n if (option.selected) {\n params.push({\n name: input.name,\n value: option.value\n });\n }\n }));\n } else if (input.checked || [ \"radio\", \"checkbox\", \"submit\" ].indexOf(input.type) === -1) {\n params.push({\n name: input.name,\n value: input.value\n });\n }\n }));\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map((function(param) {\n if (param.name) {\n return `${encodeURIComponent(param.name)}=${encodeURIComponent(param.value)}`;\n } else {\n return param;\n }\n })).join(\"&\");\n};\n\nconst formElements = (form, selector) => {\n if (matches(form, \"form\")) {\n return toArray(form.elements).filter((el => matches(el, selector)));\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n};\n\nconst handleConfirmWithRails = rails => function(e) {\n if (!allowAction(this, rails)) {\n stopEverything(e);\n }\n};\n\nconst confirm = (message, element) => window.confirm(message);\n\nvar allowAction = function(element, rails) {\n let callback;\n const message = element.getAttribute(\"data-confirm\");\n if (!message) {\n return true;\n }\n let answer = false;\n if (fire(element, \"confirm\")) {\n try {\n answer = rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, \"confirm:complete\", [ answer ]);\n }\n return answer && callback;\n};\n\nconst handleDisabledElement = function(e) {\n const element = this;\n if (element.disabled) {\n stopEverything(e);\n }\n};\n\nconst enableElement = e => {\n let element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (isContentEditable(element)) {\n return;\n }\n if (matches(element, linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, buttonDisableSelector) || matches(element, formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, formSubmitSelector)) {\n return enableFormElements(element);\n }\n};\n\nconst disableElement = e => {\n const element = e instanceof Event ? e.target : e;\n if (isContentEditable(element)) {\n return;\n }\n if (matches(element, linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, buttonDisableSelector) || matches(element, formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, formSubmitSelector)) {\n return disableFormElements(element);\n }\n};\n\nvar disableLinkElement = function(element) {\n if (getData(element, \"ujs:disabled\")) {\n return;\n }\n const replacement = element.getAttribute(\"data-disable-with\");\n if (replacement != null) {\n setData(element, \"ujs:enable-with\", element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener(\"click\", stopEverything);\n return setData(element, \"ujs:disabled\", true);\n};\n\nvar enableLinkElement = function(element) {\n const originalText = getData(element, \"ujs:enable-with\");\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, \"ujs:enable-with\", null);\n }\n element.removeEventListener(\"click\", stopEverything);\n return setData(element, \"ujs:disabled\", null);\n};\n\nvar disableFormElements = form => formElements(form, formDisableSelector).forEach(disableFormElement);\n\nvar disableFormElement = function(element) {\n if (getData(element, \"ujs:disabled\")) {\n return;\n }\n const replacement = element.getAttribute(\"data-disable-with\");\n if (replacement != null) {\n if (matches(element, \"button\")) {\n setData(element, \"ujs:enable-with\", element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, \"ujs:enable-with\", element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, \"ujs:disabled\", true);\n};\n\nvar enableFormElements = form => formElements(form, formEnableSelector).forEach((element => enableFormElement(element)));\n\nvar enableFormElement = function(element) {\n const originalText = getData(element, \"ujs:enable-with\");\n if (originalText != null) {\n if (matches(element, \"button\")) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, \"ujs:enable-with\", null);\n }\n element.disabled = false;\n return setData(element, \"ujs:disabled\", null);\n};\n\nvar isXhrRedirect = function(event) {\n const xhr = event.detail ? event.detail[0] : undefined;\n return xhr && xhr.getResponseHeader(\"X-Xhr-Redirect\");\n};\n\nconst handleMethodWithRails = rails => function(e) {\n const link = this;\n const method = link.getAttribute(\"data-method\");\n if (!method) {\n return;\n }\n if (isContentEditable(this)) {\n return;\n }\n const href = rails.href(link);\n const csrfToken$1 = csrfToken();\n const csrfParam$1 = csrfParam();\n const form = document.createElement(\"form\");\n let formContent = ``;\n if (csrfParam$1 && csrfToken$1 && !isCrossDomain(href)) {\n formContent += ``;\n }\n formContent += '';\n form.method = \"post\";\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = \"none\";\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n stopEverything(e);\n};\n\nconst isRemote = function(element) {\n const value = element.getAttribute(\"data-remote\");\n return value != null && value !== \"false\";\n};\n\nconst handleRemoteWithRails = rails => function(e) {\n let data, method, url;\n const element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, \"ajax:before\")) {\n fire(element, \"ajax:stopped\");\n return false;\n }\n if (isContentEditable(element)) {\n fire(element, \"ajax:stopped\");\n return false;\n }\n const withCredentials = element.getAttribute(\"data-with-credentials\");\n const dataType = element.getAttribute(\"data-type\") || \"script\";\n if (matches(element, formSubmitSelector)) {\n const button = getData(element, \"ujs:submit-button\");\n method = getData(element, \"ujs:submit-button-formmethod\") || element.getAttribute(\"method\") || \"get\";\n url = getData(element, \"ujs:submit-button-formaction\") || element.getAttribute(\"action\") || location.href;\n if (method.toUpperCase() === \"GET\") {\n url = url.replace(/\\?.*$/, \"\");\n }\n if (element.enctype === \"multipart/form-data\") {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, \"ujs:submit-button\", null);\n setData(element, \"ujs:submit-button-formmethod\", null);\n setData(element, \"ujs:submit-button-formaction\", null);\n } else if (matches(element, buttonClickSelector) || matches(element, inputChangeSelector)) {\n method = element.getAttribute(\"data-method\");\n url = element.getAttribute(\"data-url\");\n data = serializeElement(element, element.getAttribute(\"data-params\"));\n } else {\n method = element.getAttribute(\"data-method\");\n url = rails.href(element);\n data = element.getAttribute(\"data-params\");\n }\n ajax({\n type: method || \"GET\",\n url: url,\n data: data,\n dataType: dataType,\n beforeSend(xhr, options) {\n if (fire(element, \"ajax:beforeSend\", [ xhr, options ])) {\n return fire(element, \"ajax:send\", [ xhr ]);\n } else {\n fire(element, \"ajax:stopped\");\n return false;\n }\n },\n success(...args) {\n return fire(element, \"ajax:success\", args);\n },\n error(...args) {\n return fire(element, \"ajax:error\", args);\n },\n complete(...args) {\n return fire(element, \"ajax:complete\", args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== \"false\"\n });\n stopEverything(e);\n};\n\nconst formSubmitButtonClick = function(e) {\n const button = this;\n const {form: form} = button;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, \"ujs:submit-button\", {\n name: button.name,\n value: button.value\n });\n }\n setData(form, \"ujs:formnovalidate-button\", button.formNoValidate);\n setData(form, \"ujs:submit-button-formaction\", button.getAttribute(\"formaction\"));\n return setData(form, \"ujs:submit-button-formmethod\", button.getAttribute(\"formmethod\"));\n};\n\nconst preventInsignificantClick = function(e) {\n const link = this;\n const method = (link.getAttribute(\"data-method\") || \"GET\").toUpperCase();\n const data = link.getAttribute(\"data-params\");\n const metaClick = e.metaKey || e.ctrlKey;\n const insignificantMetaClick = metaClick && method === \"GET\" && !data;\n const nonPrimaryMouseClick = e.button != null && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n e.stopImmediatePropagation();\n }\n};\n\nconst Rails = {\n $: $,\n ajax: ajax,\n buttonClickSelector: buttonClickSelector,\n buttonDisableSelector: buttonDisableSelector,\n confirm: confirm,\n cspNonce: cspNonce,\n csrfToken: csrfToken,\n csrfParam: csrfParam,\n CSRFProtection: CSRFProtection,\n delegate: delegate,\n disableElement: disableElement,\n enableElement: enableElement,\n fileInputSelector: fileInputSelector,\n fire: fire,\n formElements: formElements,\n formEnableSelector: formEnableSelector,\n formDisableSelector: formDisableSelector,\n formInputClickSelector: formInputClickSelector,\n formSubmitButtonClick: formSubmitButtonClick,\n formSubmitSelector: formSubmitSelector,\n getData: getData,\n handleDisabledElement: handleDisabledElement,\n href: href,\n inputChangeSelector: inputChangeSelector,\n isCrossDomain: isCrossDomain,\n linkClickSelector: linkClickSelector,\n linkDisableSelector: linkDisableSelector,\n loadCSPNonce: loadCSPNonce,\n matches: matches,\n preventInsignificantClick: preventInsignificantClick,\n refreshCSRFTokens: refreshCSRFTokens,\n serializeElement: serializeElement,\n setData: setData,\n stopEverything: stopEverything\n};\n\nconst handleConfirm = handleConfirmWithRails(Rails);\n\nRails.handleConfirm = handleConfirm;\n\nconst handleMethod = handleMethodWithRails(Rails);\n\nRails.handleMethod = handleMethod;\n\nconst handleRemote = handleRemoteWithRails(Rails);\n\nRails.handleRemote = handleRemote;\n\nconst start = function() {\n if (window._rails_loaded) {\n throw new Error(\"rails-ujs has already been loaded!\");\n }\n window.addEventListener(\"pageshow\", (function() {\n $(formEnableSelector).forEach((function(el) {\n if (getData(el, \"ujs:disabled\")) {\n enableElement(el);\n }\n }));\n $(linkDisableSelector).forEach((function(el) {\n if (getData(el, \"ujs:disabled\")) {\n enableElement(el);\n }\n }));\n }));\n delegate(document, linkDisableSelector, \"ajax:complete\", enableElement);\n delegate(document, linkDisableSelector, \"ajax:stopped\", enableElement);\n delegate(document, buttonDisableSelector, \"ajax:complete\", enableElement);\n delegate(document, buttonDisableSelector, \"ajax:stopped\", enableElement);\n delegate(document, linkClickSelector, \"click\", preventInsignificantClick);\n delegate(document, linkClickSelector, \"click\", handleDisabledElement);\n delegate(document, linkClickSelector, \"click\", handleConfirm);\n delegate(document, linkClickSelector, \"click\", disableElement);\n delegate(document, linkClickSelector, \"click\", handleRemote);\n delegate(document, linkClickSelector, \"click\", handleMethod);\n delegate(document, buttonClickSelector, \"click\", preventInsignificantClick);\n delegate(document, buttonClickSelector, \"click\", handleDisabledElement);\n delegate(document, buttonClickSelector, \"click\", handleConfirm);\n delegate(document, buttonClickSelector, \"click\", disableElement);\n delegate(document, buttonClickSelector, \"click\", handleRemote);\n delegate(document, inputChangeSelector, \"change\", handleDisabledElement);\n delegate(document, inputChangeSelector, \"change\", handleConfirm);\n delegate(document, inputChangeSelector, \"change\", handleRemote);\n delegate(document, formSubmitSelector, \"submit\", handleDisabledElement);\n delegate(document, formSubmitSelector, \"submit\", handleConfirm);\n delegate(document, formSubmitSelector, \"submit\", handleRemote);\n delegate(document, formSubmitSelector, \"submit\", (e => setTimeout((() => disableElement(e)), 13)));\n delegate(document, formSubmitSelector, \"ajax:send\", disableElement);\n delegate(document, formSubmitSelector, \"ajax:complete\", enableElement);\n delegate(document, formInputClickSelector, \"click\", preventInsignificantClick);\n delegate(document, formInputClickSelector, \"click\", handleDisabledElement);\n delegate(document, formInputClickSelector, \"click\", handleConfirm);\n delegate(document, formInputClickSelector, \"click\", formSubmitButtonClick);\n document.addEventListener(\"DOMContentLoaded\", refreshCSRFTokens);\n document.addEventListener(\"DOMContentLoaded\", loadCSPNonce);\n return window._rails_loaded = true;\n};\n\nRails.start = start;\n\nif (typeof jQuery !== \"undefined\" && jQuery && jQuery.ajax) {\n if (jQuery.rails) {\n throw new Error(\"If you load both jquery_ujs and rails-ujs, use rails-ujs only.\");\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter((function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n }));\n}\n\nexport { Rails as default };\n","import Rails from \"@rails/ujs\";\nif (!window._rails_loaded) {\n // for some reason, when we use bundled javascript, this has already loaded and errors\n Rails.start();\n}\n","import $ from 'jquery';\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _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, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return _assertThisInitialized(self);\n}\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return _possibleConstructorReturn(this, result);\n };\n}\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n return object;\n}\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get.bind();\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n return desc.value;\n };\n }\n return _get.apply(this, arguments);\n}\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\n// Core Foundation Utilities, utilized in a number of places.\n\n/**\n * Returns a boolean for RTL support\n */\nfunction rtl() {\n return $('html').attr('dir') === 'rtl';\n}\n\n/**\n * returns a random base-36 uid with namespacing\n * @function\n * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.\n * @param {String} namespace - name of plugin to be incorporated in uid, optional.\n * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.\n * @returns {String} - unique id\n */\nfunction GetYoDigits() {\n var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;\n var namespace = arguments.length > 1 ? arguments[1] : undefined;\n var str = '';\n var chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n var charsLength = chars.length;\n for (var i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * charsLength)];\n }\n return namespace ? \"\".concat(str, \"-\").concat(namespace) : str;\n}\n\n/**\n * Escape a string so it can be used as a regexp pattern\n * @function\n * @see https://stackoverflow.com/a/9310752/4317384\n *\n * @param {String} str - string to escape.\n * @returns {String} - escaped string\n */\nfunction RegExpEscape(str) {\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\nfunction transitionend($elem) {\n var transitions = {\n 'transition': 'transitionend',\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'otransitionend'\n };\n var elem = document.createElement('div'),\n end;\n for (var transition in transitions) {\n if (typeof elem.style[transition] !== 'undefined') {\n end = transitions[transition];\n }\n }\n if (end) {\n return end;\n } else {\n setTimeout(function () {\n $elem.triggerHandler('transitionend', [$elem]);\n }, 1);\n return 'transitionend';\n }\n}\n\n/**\n * Return an event type to listen for window load.\n *\n * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered.\n * If `handler` is passed, attach it to the event on `$elem`.\n * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself.\n * @function\n *\n * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed.\n * @param {Function} [] handler - function to attach to the event.\n * @returns {String} - event type that should or will be triggered.\n */\nfunction onLoad($elem, handler) {\n var didLoad = document.readyState === 'complete';\n var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad';\n var cb = function cb() {\n return $elem.triggerHandler(eventType);\n };\n if ($elem) {\n if (handler) $elem.one(eventType, handler);\n if (didLoad) setTimeout(cb);else $(window).one('load', cb);\n }\n return eventType;\n}\n\n/**\n * Retuns an handler for the `mouseleave` that ignore disappeared mouses.\n *\n * If the mouse \"disappeared\" from the document (like when going on a browser UI element, See https://git.io/zf-11410),\n * the event is ignored.\n * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window\n * (like by switching to an other window with [Alt]+[Tab]).\n * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document\n * outside of the element it left.\n *\n * @function\n *\n * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch.\n * @param {Object} [] options - object of options:\n * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows.\n * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left.\n * @returns {Function} - filtered handler to use to listen on the `mouseleave` event.\n */\nfunction ignoreMousedisappear(handler) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow,\n ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo,\n _ref$ignoreReappear = _ref.ignoreReappear,\n ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear;\n return function leaveEventHandler(eLeave) {\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n var callback = handler.bind.apply(handler, [this, eLeave].concat(rest));\n\n // The mouse left: call the given callback if the mouse entered elsewhere\n if (eLeave.relatedTarget !== null) {\n return callback();\n }\n\n // Otherwise, check if the mouse actually left the window.\n // In firefox if the user switched between windows, the window sill have the focus by the time\n // the event is triggered. We have to debounce the event to test this case.\n setTimeout(function leaveEventDebouncer() {\n if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) {\n return callback();\n }\n\n // Otherwise, wait for the mouse to reeapear outside of the element,\n if (!ignoreReappear) {\n $(document).one('mouseenter', function reenterEventHandler(eReenter) {\n if (!$(eLeave.currentTarget).has(eReenter.target).length) {\n // Fill where the mouse finally entered.\n eLeave.relatedTarget = eReenter.target;\n callback();\n }\n });\n }\n }, 0);\n };\n}\n\nvar foundation_core_utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n rtl: rtl,\n GetYoDigits: GetYoDigits,\n RegExpEscape: RegExpEscape,\n transitionend: transitionend,\n onLoad: onLoad,\n ignoreMousedisappear: ignoreMousedisappear\n});\n\n// Default set of media queries\n// const defaultQueries = {\n// 'default' : 'only screen',\n// landscape : 'only screen and (orientation: landscape)',\n// portrait : 'only screen and (orientation: portrait)',\n// retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +\n// 'only screen and (min--moz-device-pixel-ratio: 2),' +\n// 'only screen and (-o-min-device-pixel-ratio: 2/1),' +\n// 'only screen and (min-device-pixel-ratio: 2),' +\n// 'only screen and (min-resolution: 192dpi),' +\n// 'only screen and (min-resolution: 2dppx)'\n// };\n\n// matchMedia() polyfill - Test a CSS media type/query in JS.\n// Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license\n/* eslint-disable */\nwindow.matchMedia || (window.matchMedia = function () {\n\n // For browsers that support matchMedium api such as IE 9 and webkit\n var styleMedia = window.styleMedia || window.media;\n\n // For those that don't support matchMedium\n if (!styleMedia) {\n var style = document.createElement('style'),\n script = document.getElementsByTagName('script')[0],\n info = null;\n style.type = 'text/css';\n style.id = 'matchmediajs-test';\n if (!script) {\n document.head.appendChild(style);\n } else {\n script.parentNode.insertBefore(style, script);\n }\n\n // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers\n info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;\n styleMedia = {\n matchMedium: function matchMedium(media) {\n var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';\n\n // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers\n if (style.styleSheet) {\n style.styleSheet.cssText = text;\n } else {\n style.textContent = text;\n }\n\n // Test if media query is true or false\n return info.width === '1px';\n }\n };\n }\n return function (media) {\n return {\n matches: styleMedia.matchMedium(media || 'all'),\n media: media || 'all'\n };\n };\n}());\n/* eslint-enable */\n\nvar MediaQuery = {\n queries: [],\n current: '',\n /**\n * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.\n * @function\n * @private\n */\n _init: function _init() {\n // make sure the initialization is only done once when calling _init() several times\n if (this.isInitialized === true) {\n return this;\n } else {\n this.isInitialized = true;\n }\n var self = this;\n var $meta = $('meta.foundation-mq');\n if (!$meta.length) {\n $('').appendTo(document.head);\n }\n var extractedStyles = $('.foundation-mq').css('font-family');\n var namedQueries;\n namedQueries = parseStyleToObject(extractedStyles);\n self.queries = []; // reset\n\n for (var key in namedQueries) {\n if (namedQueries.hasOwnProperty(key)) {\n self.queries.push({\n name: key,\n value: \"only screen and (min-width: \".concat(namedQueries[key], \")\")\n });\n }\n }\n this.current = this._getCurrentSize();\n this._watcher();\n },\n /**\n * Reinitializes the media query helper.\n * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization.\n * @function\n * @private\n */\n _reInit: function _reInit() {\n this.isInitialized = false;\n this._init();\n },\n /**\n * Checks if the screen is at least as wide as a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.\n */\n atLeast: function atLeast(size) {\n var query = this.get(size);\n if (query) {\n return window.matchMedia(query).matches;\n }\n return false;\n },\n /**\n * Checks if the screen is within the given breakpoint.\n * If smaller than the breakpoint of larger than its upper limit it returns false.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise.\n */\n only: function only(size) {\n return size === this._getCurrentSize();\n },\n /**\n * Checks if the screen is within a breakpoint or smaller.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger.\n */\n upTo: function upTo(size) {\n var nextSize = this.next(size);\n\n // If the next breakpoint does not match, the screen is smaller than\n // the upper limit of this breakpoint.\n if (nextSize) {\n return !this.atLeast(nextSize);\n }\n\n // If there is no next breakpoint, the \"size\" breakpoint does not have\n // an upper limit and the screen will always be within it or smaller.\n return true;\n },\n /**\n * Checks if the screen matches to a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.\n */\n is: function is(size) {\n var parts = size.trim().split(' ').filter(function (p) {\n return !!p.length;\n });\n var _parts = _slicedToArray(parts, 2),\n bpSize = _parts[0],\n _parts$ = _parts[1],\n bpModifier = _parts$ === void 0 ? '' : _parts$;\n\n // Only the breakpont\n if (bpModifier === 'only') {\n return this.only(bpSize);\n }\n // At least the breakpoint (included)\n if (!bpModifier || bpModifier === 'up') {\n return this.atLeast(bpSize);\n }\n // Up to the breakpoint (included)\n if (bpModifier === 'down') {\n return this.upTo(bpSize);\n }\n throw new Error(\"\\n Invalid breakpoint passed to MediaQuery.is().\\n Expected a breakpoint name formatted like \\\" \\\", got \\\"\".concat(size, \"\\\".\\n \"));\n },\n /**\n * Gets the media query of a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to get.\n * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.\n */\n get: function get(size) {\n for (var i in this.queries) {\n if (this.queries.hasOwnProperty(i)) {\n var query = this.queries[i];\n if (size === query.name) return query.value;\n }\n }\n return null;\n },\n /**\n * Get the breakpoint following the given breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint.\n * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one.\n */\n next: function next(size) {\n var _this = this;\n var queryIndex = this.queries.findIndex(function (q) {\n return _this._getQueryName(q) === size;\n });\n if (queryIndex === -1) {\n throw new Error(\"\\n Unknown breakpoint \\\"\".concat(size, \"\\\" passed to MediaQuery.next().\\n Ensure it is present in your Sass \\\"$breakpoints\\\" setting.\\n \"));\n }\n var nextQuery = this.queries[queryIndex + 1];\n return nextQuery ? nextQuery.name : null;\n },\n /**\n * Returns the name of the breakpoint related to the given value.\n * @function\n * @private\n * @param {String|Object} value - Breakpoint name or query object.\n * @returns {String} Name of the breakpoint.\n */\n _getQueryName: function _getQueryName(value) {\n if (typeof value === 'string') return value;\n if (_typeof(value) === 'object') return value.name;\n throw new TypeError(\"\\n Invalid value passed to MediaQuery._getQueryName().\\n Expected a breakpoint name (String) or a breakpoint query (Object), got \\\"\".concat(value, \"\\\" (\").concat(_typeof(value), \")\\n \"));\n },\n /**\n * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).\n * @function\n * @private\n * @returns {String} Name of the current breakpoint.\n */\n _getCurrentSize: function _getCurrentSize() {\n var matched;\n for (var i = 0; i < this.queries.length; i++) {\n var query = this.queries[i];\n if (window.matchMedia(query.value).matches) {\n matched = query;\n }\n }\n return matched && this._getQueryName(matched);\n },\n /**\n * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.\n * @function\n * @private\n */\n _watcher: function _watcher() {\n var _this2 = this;\n $(window).on('resize.zf.trigger', function () {\n var newSize = _this2._getCurrentSize(),\n currentSize = _this2.current;\n if (newSize !== currentSize) {\n // Change the current media query\n _this2.current = newSize;\n\n // Broadcast the media query change on the window\n $(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);\n }\n });\n }\n};\n\n// Thank you: https://github.com/sindresorhus/query-string\nfunction parseStyleToObject(str) {\n var styleObject = {};\n if (typeof str !== 'string') {\n return styleObject;\n }\n str = str.trim().slice(1, -1); // browsers re-quote string style values\n\n if (!str) {\n return styleObject;\n }\n styleObject = str.split('&').reduce(function (ret, param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = parts[0];\n var val = parts[1];\n key = decodeURIComponent(key);\n\n // missing `=` should be `null`:\n // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n val = typeof val === 'undefined' ? null : decodeURIComponent(val);\n if (!ret.hasOwnProperty(key)) {\n ret[key] = val;\n } else if (Array.isArray(ret[key])) {\n ret[key].push(val);\n } else {\n ret[key] = [ret[key], val];\n }\n return ret;\n }, {});\n return styleObject;\n}\n\nvar FOUNDATION_VERSION = '6.8.1';\n\n// Global Foundation object\n// This is attached to the window, or used as a module for AMD/Browserify\nvar Foundation = {\n version: FOUNDATION_VERSION,\n /**\n * Stores initialized plugins.\n */\n _plugins: {},\n /**\n * Stores generated unique ids for plugin instances\n */\n _uuids: [],\n /**\n * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.\n * @param {Object} plugin - The constructor of the plugin.\n */\n plugin: function plugin(_plugin, name) {\n // Object key to use when adding to global Foundation object\n // Examples: Foundation.Reveal, Foundation.OffCanvas\n var className = name || functionName(_plugin);\n // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin\n // Examples: data-reveal, data-off-canvas\n var attrName = hyphenate(className);\n\n // Add to the Foundation object and the plugins list (for reflowing)\n this._plugins[attrName] = this[className] = _plugin;\n },\n /**\n * @function\n * Populates the _uuids array with pointers to each individual plugin instance.\n * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.\n * Also fires the initialization event for each plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @param {String} name - the name of the plugin, passed as a camelCased string.\n * @fires Plugin#init\n */\n registerPlugin: function registerPlugin(plugin, name) {\n var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();\n plugin.uuid = GetYoDigits(6, pluginName);\n if (!plugin.$element.attr(\"data-\".concat(pluginName))) {\n plugin.$element.attr(\"data-\".concat(pluginName), plugin.uuid);\n }\n if (!plugin.$element.data('zfPlugin')) {\n plugin.$element.data('zfPlugin', plugin);\n }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n plugin.$element.trigger(\"init.zf.\".concat(pluginName));\n this._uuids.push(plugin.uuid);\n return;\n },\n /**\n * @function\n * Removes the plugins uuid from the _uuids array.\n * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.\n * Also fires the destroyed event for the plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @fires Plugin#destroyed\n */\n unregisterPlugin: function unregisterPlugin(plugin) {\n var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));\n this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);\n plugin.$element.removeAttr(\"data-\".concat(pluginName)).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */.trigger(\"destroyed.zf.\".concat(pluginName));\n for (var prop in plugin) {\n if (typeof plugin[prop] === 'function') {\n plugin[prop] = null; //clean up script to prep for garbage collection.\n }\n }\n\n return;\n },\n /**\n * @function\n * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.\n * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`\n * @default If no argument is passed, reflow all currently active plugins.\n */\n reInit: function reInit(plugins) {\n var isJQ = plugins instanceof $;\n try {\n if (isJQ) {\n plugins.each(function () {\n $(this).data('zfPlugin')._init();\n });\n } else {\n var type = _typeof(plugins),\n _this = this,\n fns = {\n 'object': function object(plgs) {\n plgs.forEach(function (p) {\n p = hyphenate(p);\n $('[data-' + p + ']').foundation('_init');\n });\n },\n 'string': function string() {\n plugins = hyphenate(plugins);\n $('[data-' + plugins + ']').foundation('_init');\n },\n 'undefined': function undefined$1() {\n this.object(Object.keys(_this._plugins));\n }\n };\n fns[type](plugins);\n }\n } catch (err) {\n console.error(err);\n } finally {\n return plugins;\n }\n },\n /**\n * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.\n * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.\n * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.\n */\n reflow: function reflow(elem, plugins) {\n // If plugins is undefined, just grab everything\n if (typeof plugins === 'undefined') {\n plugins = Object.keys(this._plugins);\n }\n // If plugins is a string, convert it to an array with one item\n else if (typeof plugins === 'string') {\n plugins = [plugins];\n }\n var _this = this;\n\n // Iterate through each plugin\n $.each(plugins, function (i, name) {\n // Get the current plugin\n var plugin = _this._plugins[name];\n\n // Localize the search to all elements inside elem, as well as elem itself, unless elem === document\n var $elem = $(elem).find('[data-' + name + ']').addBack('[data-' + name + ']').filter(function () {\n return typeof $(this).data(\"zfPlugin\") === 'undefined';\n });\n\n // For each plugin found, initialize it\n $elem.each(function () {\n var $el = $(this),\n opts = {\n reflow: true\n };\n if ($el.attr('data-options')) {\n $el.attr('data-options').split(';').forEach(function (option) {\n var opt = option.split(':').map(function (el) {\n return el.trim();\n });\n if (opt[0]) opts[opt[0]] = parseValue(opt[1]);\n });\n }\n try {\n $el.data('zfPlugin', new plugin($(this), opts));\n } catch (er) {\n console.error(er);\n } finally {\n return;\n }\n });\n });\n },\n getFnName: functionName,\n addToJquery: function addToJquery() {\n // TODO: consider not making this a jQuery function\n // TODO: need way to reflow vs. re-initialize\n /**\n * The Foundation jQuery method.\n * @param {String|Array} method - An action to perform on the current jQuery object.\n */\n var foundation = function foundation(method) {\n var type = _typeof(method),\n $noJS = $('.no-js');\n if ($noJS.length) {\n $noJS.removeClass('no-js');\n }\n if (type === 'undefined') {\n //needs to initialize the Foundation object, or an individual plugin.\n MediaQuery._init();\n Foundation.reflow(this);\n } else if (type === 'string') {\n //an individual method to invoke on a plugin or group of plugins\n var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary\n var plugClass = this.data('zfPlugin'); //determine the class of plugin\n\n if (typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined') {\n //make sure both the class and method exist\n if (this.length === 1) {\n //if there's only one, call it directly.\n plugClass[method].apply(plugClass, args);\n } else {\n this.each(function (i, el) {\n //otherwise loop through the jQuery collection and invoke the method on each\n plugClass[method].apply($(el).data('zfPlugin'), args);\n });\n }\n } else {\n //error for no class or no method\n throw new ReferenceError(\"We're sorry, '\" + method + \"' is not an available method for \" + (plugClass ? functionName(plugClass) : 'this element') + '.');\n }\n } else {\n //error for invalid argument type\n throw new TypeError(\"We're sorry, \".concat(type, \" is not a valid parameter. You must use a string representing the method you wish to invoke.\"));\n }\n return this;\n };\n $.fn.foundation = foundation;\n return $;\n }\n};\nFoundation.util = {\n /**\n * Function for applying a debounce effect to a function call.\n * @function\n * @param {Function} func - Function to be called at end of timeout.\n * @param {Number} delay - Time in ms to delay the call of `func`.\n * @returns function\n */\n throttle: function throttle(func, delay) {\n var timer = null;\n return function () {\n var context = this,\n args = arguments;\n if (timer === null) {\n timer = setTimeout(function () {\n func.apply(context, args);\n timer = null;\n }, delay);\n }\n };\n }\n};\nwindow.Foundation = Foundation;\n\n// Polyfill for requestAnimationFrame\n(function () {\n if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () {\n return new Date().getTime();\n };\n var vendors = ['webkit', 'moz'];\n for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {\n var vp = vendors[i];\n window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];\n window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame'];\n }\n if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {\n var lastTime = 0;\n window.requestAnimationFrame = function (callback) {\n var now = Date.now();\n var nextTime = Math.max(lastTime + 16, now);\n return setTimeout(function () {\n callback(lastTime = nextTime);\n }, nextTime - now);\n };\n window.cancelAnimationFrame = clearTimeout;\n }\n /**\n * Polyfill for performance.now, required by rAF\n */\n if (!window.performance || !window.performance.now) {\n window.performance = {\n start: Date.now(),\n now: function now() {\n return Date.now() - this.start;\n }\n };\n }\n})();\nif (!Function.prototype.bind) {\n /* eslint-disable no-extend-native */\n Function.prototype.bind = function (oThis) {\n if (typeof this !== 'function') {\n // closest thing possible to the ECMAScript 5\n // internal IsCallable function\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n var aArgs = Array.prototype.slice.call(arguments, 1),\n fToBind = this,\n fNOP = function fNOP() {},\n fBound = function fBound() {\n return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n if (this.prototype) {\n // native functions don't have a prototype\n fNOP.prototype = this.prototype;\n }\n fBound.prototype = new fNOP();\n return fBound;\n };\n}\n// Polyfill to get the name of a function in IE9\nfunction functionName(fn) {\n if (typeof Function.prototype.name === 'undefined') {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n}\nfunction parseValue(str) {\n if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str);\n return str;\n}\n// Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nvar Box = {\n ImNotTouchingYou: ImNotTouchingYou,\n OverlapArea: OverlapArea,\n GetDimensions: GetDimensions,\n GetExplicitOffsets: GetExplicitOffsets\n};\n\n/**\n * Compares the dimensions of an element to a container and determines collision events with container.\n * @function\n * @param {jQuery} element - jQuery object to test for collisions.\n * @param {jQuery} parent - jQuery object to use as bounding container.\n * @param {Boolean} lrOnly - set to true to check left and right values only.\n * @param {Boolean} tbOnly - set to true to check top and bottom values only.\n * @default if no parent object passed, detects collisions with `window`.\n * @returns {Boolean} - true if collision free, false if a collision in any direction.\n */\nfunction ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {\n return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;\n}\nfunction OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {\n var eleDims = GetDimensions(element),\n topOver,\n bottomOver,\n leftOver,\n rightOver;\n if (parent) {\n var parDims = GetDimensions(parent);\n bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - parDims.offset.top;\n leftOver = eleDims.offset.left - parDims.offset.left;\n rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width);\n } else {\n bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - eleDims.windowDims.offset.top;\n leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;\n rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);\n }\n bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);\n topOver = Math.min(topOver, 0);\n leftOver = Math.min(leftOver, 0);\n rightOver = Math.min(rightOver, 0);\n if (lrOnly) {\n return leftOver + rightOver;\n }\n if (tbOnly) {\n return topOver + bottomOver;\n }\n\n // use sum of squares b/c we care about overlap area.\n return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver);\n}\n\n/**\n * Uses native methods to return an object of dimension values.\n * @function\n * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.\n * @returns {Object} - nested object of integer pixel values\n * TODO - if element is window, return only those values.\n */\nfunction GetDimensions(elem) {\n elem = elem.length ? elem[0] : elem;\n if (elem === window || elem === document) {\n throw new Error(\"I'm sorry, Dave. I'm afraid I can't do that.\");\n }\n var rect = elem.getBoundingClientRect(),\n parRect = elem.parentNode.getBoundingClientRect(),\n winRect = document.body.getBoundingClientRect(),\n winY = window.pageYOffset,\n winX = window.pageXOffset;\n return {\n width: rect.width,\n height: rect.height,\n offset: {\n top: rect.top + winY,\n left: rect.left + winX\n },\n parentDims: {\n width: parRect.width,\n height: parRect.height,\n offset: {\n top: parRect.top + winY,\n left: parRect.left + winX\n }\n },\n windowDims: {\n width: winRect.width,\n height: winRect.height,\n offset: {\n top: winY,\n left: winX\n }\n }\n };\n}\n\n/**\n * Returns an object of top and left integer pixel values for dynamically rendered elements,\n * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where\n * you don't know alignment, but generally from\n * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.\n * @function\n * @param {jQuery} element - jQuery object for the element being positioned.\n * @param {jQuery} anchor - jQuery object for the element's anchor point.\n * @param {String} position - a string relating to the desired position of the element, relative to it's anchor\n * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.\n * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.\n * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.\n * TODO alter/rewrite to work with `em` values as well/instead of pixels\n */\nfunction GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {\n var $eleDims = GetDimensions(element),\n $anchorDims = anchor ? GetDimensions(anchor) : null;\n var topVal, leftVal;\n if ($anchorDims !== null) {\n // set position related attribute\n switch (position) {\n case 'top':\n topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);\n break;\n case 'bottom':\n topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;\n break;\n case 'left':\n leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);\n break;\n case 'right':\n leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;\n break;\n }\n\n // set alignment related attribute\n switch (position) {\n case 'top':\n case 'bottom':\n switch (alignment) {\n case 'left':\n leftVal = $anchorDims.offset.left + hOffset;\n break;\n case 'right':\n leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;\n break;\n case 'center':\n leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset;\n break;\n }\n break;\n case 'right':\n case 'left':\n switch (alignment) {\n case 'bottom':\n topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;\n break;\n case 'top':\n topVal = $anchorDims.offset.top + vOffset;\n break;\n case 'center':\n topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2;\n break;\n }\n break;\n }\n }\n return {\n top: topVal,\n left: leftVal\n };\n}\n\n/**\n * Runs a callback function when images are fully loaded.\n * @param {Object} images - Image(s) to check if loaded.\n * @param {Func} callback - Function to execute when image is fully loaded.\n */\nfunction onImagesLoaded(images, callback) {\n var unloaded = images.length;\n if (unloaded === 0) {\n callback();\n }\n images.each(function () {\n // Check if image is loaded\n if (this.complete && typeof this.naturalWidth !== 'undefined') {\n singleImageLoaded();\n } else {\n // If the above check failed, simulate loading on detached element.\n var image = new Image();\n // Still count image as loaded if it finalizes with an error.\n var events = \"load.zf.images error.zf.images\";\n $(image).one(events, function me() {\n // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.\n $(this).off(events, me);\n singleImageLoaded();\n });\n image.src = $(this).attr('src');\n }\n });\n function singleImageLoaded() {\n unloaded--;\n if (unloaded === 0) {\n callback();\n }\n }\n}\n\n/*******************************************\n * *\n * This util was created by Marius Olbertz *\n * Please thank Marius on GitHub /owlbertz *\n * or the web http://www.mariusolbertz.de/ *\n * *\n ******************************************/\nvar keyCodes = {\n 9: 'TAB',\n 13: 'ENTER',\n 27: 'ESCAPE',\n 32: 'SPACE',\n 35: 'END',\n 36: 'HOME',\n 37: 'ARROW_LEFT',\n 38: 'ARROW_UP',\n 39: 'ARROW_RIGHT',\n 40: 'ARROW_DOWN'\n};\nvar commands = {};\n\n// Functions pulled out to be referenceable from internals\nfunction findFocusable($element) {\n if (!$element) {\n return false;\n }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {\n if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) {\n return false;\n } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n }).sort(function (a, b) {\n if ($(a).attr('tabindex') === $(b).attr('tabindex')) {\n return 0;\n }\n var aTabIndex = parseInt($(a).attr('tabindex'), 10),\n bTabIndex = parseInt($(b).attr('tabindex'), 10);\n // Undefined is treated the same as 0\n if (typeof $(a).attr('tabindex') === 'undefined' && bTabIndex > 0) {\n return 1;\n }\n if (typeof $(b).attr('tabindex') === 'undefined' && aTabIndex > 0) {\n return -1;\n }\n if (aTabIndex === 0 && bTabIndex > 0) {\n return 1;\n }\n if (bTabIndex === 0 && aTabIndex > 0) {\n return -1;\n }\n if (aTabIndex < bTabIndex) {\n return -1;\n }\n if (aTabIndex > bTabIndex) {\n return 1;\n }\n });\n}\nfunction parseKey(event) {\n var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase();\n\n // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events\n key = key.replace(/\\W+/, '');\n if (event.shiftKey) key = \"SHIFT_\".concat(key);\n if (event.ctrlKey) key = \"CTRL_\".concat(key);\n if (event.altKey) key = \"ALT_\".concat(key);\n\n // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)\n key = key.replace(/_$/, '');\n return key;\n}\nvar Keyboard = {\n keys: getKeyCodes(keyCodes),\n /**\n * Parses the (keyboard) event and returns a String that represents its key\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n * @param {Event} event - the event generated by the event handler\n * @return String key - String that represents the key pressed\n */\n parseKey: parseKey,\n /**\n * Handles the given (keyboard) event\n * @param {Event} event - the event generated by the event handler\n * @param {String} component - Foundation component's name, e.g. Slider or Reveal\n * @param {Objects} functions - collection of functions that are to be executed\n */\n handleKey: function handleKey(event, component, functions) {\n var commandList = commands[component],\n keyCode = this.parseKey(event),\n cmds,\n command,\n fn;\n if (!commandList) return console.warn('Component not defined!');\n\n // Ignore the event if it was already handled\n if (event.zfIsKeyHandled === true) return;\n\n // This component does not differentiate between ltr and rtl\n if (typeof commandList.ltr === 'undefined') {\n cmds = commandList; // use plain list\n } else {\n // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa\n if (rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);else cmds = $.extend({}, commandList.rtl, commandList.ltr);\n }\n command = cmds[keyCode];\n fn = functions[command];\n // Execute the handler if found\n if (fn && typeof fn === 'function') {\n var returnValue = fn.apply();\n\n // Mark the event as \"handled\" to prevent future handlings\n event.zfIsKeyHandled = true;\n\n // Execute function when event was handled\n if (functions.handled || typeof functions.handled === 'function') {\n functions.handled(returnValue);\n }\n } else {\n // Execute function when event was not handled\n if (functions.unhandled || typeof functions.unhandled === 'function') {\n functions.unhandled();\n }\n }\n },\n /**\n * Finds all focusable elements within the given `$element`\n * @param {jQuery} $element - jQuery object to search within\n * @return {jQuery} $focusable - all focusable elements within `$element`\n */\n\n findFocusable: findFocusable,\n /**\n * Returns the component name name\n * @param {Object} component - Foundation component, e.g. Slider or Reveal\n * @return String componentName\n */\n register: function register(componentName, cmds) {\n commands[componentName] = cmds;\n },\n // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?\n //\n /**\n * Traps the focus in the given element.\n * @param {jQuery} $element jQuery object to trap the foucs into.\n */\n trapFocus: function trapFocus($element) {\n var $focusable = findFocusable($element),\n $firstFocusable = $focusable.eq(0),\n $lastFocusable = $focusable.eq(-1);\n $element.on('keydown.zf.trapfocus', function (event) {\n if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {\n event.preventDefault();\n $firstFocusable.focus();\n } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {\n event.preventDefault();\n $lastFocusable.focus();\n }\n });\n },\n /**\n * Releases the trapped focus from the given element.\n * @param {jQuery} $element jQuery object to release the focus for.\n */\n releaseFocus: function releaseFocus($element) {\n $element.off('keydown.zf.trapfocus');\n }\n};\n\n/*\n * Constants for easier comparing.\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n */\nfunction getKeyCodes(kcs) {\n var k = {};\n for (var kc in kcs) {\n if (kcs.hasOwnProperty(kc)) k[kcs[kc]] = kcs[kc];\n }\n return k;\n}\n\n/**\n * Motion module.\n * @module foundation.motion\n */\n\nvar initClasses = ['mui-enter', 'mui-leave'];\nvar activeClasses = ['mui-enter-active', 'mui-leave-active'];\nvar Motion = {\n animateIn: function animateIn(element, animation, cb) {\n animate(true, element, animation, cb);\n },\n animateOut: function animateOut(element, animation, cb) {\n animate(false, element, animation, cb);\n }\n};\nfunction Move(duration, elem, fn) {\n var anim,\n prog,\n start = null;\n if (duration === 0) {\n fn.apply(elem);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n return;\n }\n function move(ts) {\n if (!start) start = ts;\n prog = ts - start;\n fn.apply(elem);\n if (prog < duration) {\n anim = window.requestAnimationFrame(move, elem);\n } else {\n window.cancelAnimationFrame(anim);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n }\n }\n anim = window.requestAnimationFrame(move);\n}\n\n/**\n * Animates an element in or out using a CSS transition class.\n * @function\n * @private\n * @param {Boolean} isIn - Defines if the animation is in or out.\n * @param {Object} element - jQuery or HTML object to animate.\n * @param {String} animation - CSS class to use.\n * @param {Function} cb - Callback to run when animation is finished.\n */\nfunction animate(isIn, element, animation, cb) {\n element = $(element).eq(0);\n if (!element.length) return;\n var initClass = isIn ? initClasses[0] : initClasses[1];\n var activeClass = isIn ? activeClasses[0] : activeClasses[1];\n\n // Set up the animation\n reset();\n element.addClass(animation).css('transition', 'none');\n requestAnimationFrame(function () {\n element.addClass(initClass);\n if (isIn) element.show();\n });\n\n // Start the animation\n requestAnimationFrame(function () {\n // will trigger the browser to synchronously calculate the style and layout\n // also called reflow or layout thrashing\n // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a\n element[0].offsetWidth;\n element.css('transition', '').addClass(activeClass);\n });\n\n // Clean up the animation when it finishes\n element.one(transitionend(element), finish);\n\n // Hides the element (for out animations), resets the element, and runs a callback\n function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }\n\n // Resets transitions and removes motion-specific classes\n function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(\"\".concat(initClass, \" \").concat(activeClass, \" \").concat(animation));\n }\n}\n\nvar Nest = {\n Feather: function Feather(menu) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf';\n menu.attr('role', 'menubar');\n menu.find('a').attr({\n 'role': 'menuitem'\n });\n var items = menu.find('li').attr({\n 'role': 'none'\n }),\n subMenuClass = \"is-\".concat(type, \"-submenu\"),\n subItemClass = \"\".concat(subMenuClass, \"-item\"),\n hasSubClass = \"is-\".concat(type, \"-submenu-parent\"),\n applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes.\n\n items.each(function () {\n var $item = $(this),\n $sub = $item.children('ul');\n if ($sub.length) {\n $item.addClass(hasSubClass);\n if (applyAria) {\n var firstItem = $item.children('a:first');\n firstItem.attr({\n 'aria-haspopup': true,\n 'aria-label': firstItem.attr('aria-label') || firstItem.text()\n });\n // Note: Drilldowns behave differently in how they hide, and so need\n // additional attributes. We should look if this possibly over-generalized\n // utility (Nest) is appropriate when we rework menus in 6.4\n if (type === 'drilldown') {\n $item.attr({\n 'aria-expanded': false\n });\n }\n }\n $sub.addClass(\"submenu \".concat(subMenuClass)).attr({\n 'data-submenu': '',\n 'role': 'menubar'\n });\n if (type === 'drilldown') {\n $sub.attr({\n 'aria-hidden': true\n });\n }\n }\n if ($item.parent('[data-submenu]').length) {\n $item.addClass(\"is-submenu-item \".concat(subItemClass));\n }\n });\n return;\n },\n Burn: function Burn(menu, type) {\n var\n //items = menu.find('li'),\n subMenuClass = \"is-\".concat(type, \"-submenu\"),\n subItemClass = \"\".concat(subMenuClass, \"-item\"),\n hasSubClass = \"is-\".concat(type, \"-submenu-parent\");\n menu.find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li').removeClass(\"\".concat(subMenuClass, \" \").concat(subItemClass, \" \").concat(hasSubClass, \" is-submenu-item submenu is-active\")).removeAttr('data-submenu').css('display', '');\n }\n};\n\nfunction Timer(elem, options, cb) {\n var _this = this,\n duration = options.duration,\n //options is an object for easily adding features later.\n nameSpace = Object.keys(elem.data())[0] || 'timer',\n remain = -1,\n start,\n timer;\n this.isPaused = false;\n this.restart = function () {\n remain = -1;\n clearTimeout(timer);\n this.start();\n };\n this.start = function () {\n this.isPaused = false;\n // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n remain = remain <= 0 ? duration : remain;\n elem.data('paused', false);\n start = Date.now();\n timer = setTimeout(function () {\n if (options.infinite) {\n _this.restart(); //rerun the timer.\n }\n\n if (cb && typeof cb === 'function') {\n cb();\n }\n }, remain);\n elem.trigger(\"timerstart.zf.\".concat(nameSpace));\n };\n this.pause = function () {\n this.isPaused = true;\n //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n elem.data('paused', true);\n var end = Date.now();\n remain = remain - (end - start);\n elem.trigger(\"timerpaused.zf.\".concat(nameSpace));\n };\n}\n\nvar Touch = {};\nvar startPosX,\n startTime,\n elapsedTime,\n startEvent,\n isMoving = false,\n didMoved = false;\nfunction onTouchEnd(e) {\n this.removeEventListener('touchmove', onTouchMove);\n this.removeEventListener('touchend', onTouchEnd);\n\n // If the touch did not move, consider it as a \"tap\"\n if (!didMoved) {\n var tapEvent = $.Event('tap', startEvent || e);\n $(this).trigger(tapEvent);\n }\n startEvent = null;\n isMoving = false;\n didMoved = false;\n}\nfunction onTouchMove(e) {\n if (true === $.spotSwipe.preventDefault) {\n e.preventDefault();\n }\n if (isMoving) {\n var x = e.touches[0].pageX;\n // var y = e.touches[0].pageY;\n var dx = startPosX - x;\n // var dy = startPosY - y;\n var dir;\n didMoved = true;\n elapsedTime = new Date().getTime() - startTime;\n if (Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n dir = dx > 0 ? 'left' : 'right';\n }\n // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n // dir = dy > 0 ? 'down' : 'up';\n // }\n if (dir) {\n e.preventDefault();\n onTouchEnd.apply(this, arguments);\n $(this).trigger($.Event('swipe', Object.assign({}, e)), dir).trigger($.Event(\"swipe\".concat(dir), Object.assign({}, e)));\n }\n }\n}\nfunction onTouchStart(e) {\n if (e.touches.length === 1) {\n startPosX = e.touches[0].pageX;\n startEvent = e;\n isMoving = true;\n didMoved = false;\n startTime = new Date().getTime();\n this.addEventListener('touchmove', onTouchMove, {\n passive: true === $.spotSwipe.preventDefault\n });\n this.addEventListener('touchend', onTouchEnd, false);\n }\n}\nfunction init() {\n this.addEventListener && this.addEventListener('touchstart', onTouchStart, {\n passive: true\n });\n}\n\n// function teardown() {\n// this.removeEventListener('touchstart', onTouchStart);\n// }\nvar SpotSwipe = /*#__PURE__*/function () {\n function SpotSwipe() {\n _classCallCheck(this, SpotSwipe);\n this.version = '1.0.0';\n this.enabled = 'ontouchstart' in document.documentElement;\n this.preventDefault = false;\n this.moveThreshold = 75;\n this.timeThreshold = 200;\n this._init();\n }\n _createClass(SpotSwipe, [{\n key: \"_init\",\n value: function _init() {\n $.event.special.swipe = {\n setup: init\n };\n $.event.special.tap = {\n setup: init\n };\n $.each(['left', 'up', 'down', 'right'], function () {\n $.event.special[\"swipe\".concat(this)] = {\n setup: function setup() {\n $(this).on('swipe', $.noop);\n }\n };\n });\n }\n }]);\n return SpotSwipe;\n}();\n/****************************************************\n * As far as I can tell, both setupSpotSwipe and *\n * setupTouchHandler should be idempotent, *\n * because they directly replace functions & *\n * values, and do not add event handlers directly. *\n ****************************************************/\nTouch.setupSpotSwipe = function () {\n $.spotSwipe = new SpotSwipe($);\n};\n\n/****************************************************\n * Method for adding pseudo drag events to elements *\n ***************************************************/\nTouch.setupTouchHandler = function () {\n $.fn.addTouch = function () {\n this.each(function (i, el) {\n $(el).bind('touchstart touchmove touchend touchcancel', function (event) {\n //we pass the original event object because the jQuery event\n //object is normalized to w3c specs and does not provide the TouchList\n handleTouch(event);\n });\n });\n var handleTouch = function handleTouch(event) {\n var touches = event.changedTouches,\n first = touches[0],\n eventTypes = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup'\n },\n type = eventTypes[event.type],\n simulatedEvent;\n if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {\n simulatedEvent = new window.MouseEvent(type, {\n 'bubbles': true,\n 'cancelable': true,\n 'screenX': first.screenX,\n 'screenY': first.screenY,\n 'clientX': first.clientX,\n 'clientY': first.clientY\n });\n } else {\n simulatedEvent = document.createEvent('MouseEvent');\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 /*left*/, null);\n }\n first.target.dispatchEvent(simulatedEvent);\n };\n };\n};\nTouch.init = function () {\n if (typeof $.spotSwipe === 'undefined') {\n Touch.setupSpotSwipe($);\n Touch.setupTouchHandler($);\n }\n};\n\nvar MutationObserver = function () {\n var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];\n for (var i = 0; i < prefixes.length; i++) {\n if (\"\".concat(prefixes[i], \"MutationObserver\") in window) {\n return window[\"\".concat(prefixes[i], \"MutationObserver\")];\n }\n }\n return false;\n}();\nvar triggers = function triggers(el, type) {\n el.data(type).split(' ').forEach(function (id) {\n $(\"#\".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler'](\"\".concat(type, \".zf.trigger\"), [el]);\n });\n};\nvar Triggers = {\n Listeners: {\n Basic: {},\n Global: {}\n },\n Initializers: {}\n};\nTriggers.Listeners.Basic = {\n openListener: function openListener() {\n triggers($(this), 'open');\n },\n closeListener: function closeListener() {\n var id = $(this).data('close');\n if (id) {\n triggers($(this), 'close');\n } else {\n $(this).trigger('close.zf.trigger');\n }\n },\n toggleListener: function toggleListener() {\n var id = $(this).data('toggle');\n if (id) {\n triggers($(this), 'toggle');\n } else {\n $(this).trigger('toggle.zf.trigger');\n }\n },\n closeableListener: function closeableListener(e) {\n var animation = $(this).data('closable');\n\n // Only close the first closable element. See https://git.io/zf-7833\n e.stopPropagation();\n if (animation !== '') {\n Motion.animateOut($(this), animation, function () {\n $(this).trigger('closed.zf');\n });\n } else {\n $(this).fadeOut().trigger('closed.zf');\n }\n },\n toggleFocusListener: function toggleFocusListener() {\n var id = $(this).data('toggle-focus');\n $(\"#\".concat(id)).triggerHandler('toggle.zf.trigger', [$(this)]);\n }\n};\n\n// Elements with [data-open] will reveal a plugin that supports it when clicked.\nTriggers.Initializers.addOpenListener = function ($elem) {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);\n $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);\n};\n\n// Elements with [data-close] will close a plugin that supports it when clicked.\n// If used without a value on [data-close], the event will bubble, allowing it to close a parent component.\nTriggers.Initializers.addCloseListener = function ($elem) {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);\n $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);\n};\n\n// Elements with [data-toggle] will toggle a plugin that supports it when clicked.\nTriggers.Initializers.addToggleListener = function ($elem) {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);\n $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);\n};\n\n// Elements with [data-closable] will respond to close.zf.trigger events.\nTriggers.Initializers.addCloseableListener = function ($elem) {\n $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);\n $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);\n};\n\n// Elements with [data-toggle-focus] will respond to coming in and out of focus\nTriggers.Initializers.addToggleFocusListener = function ($elem) {\n $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);\n $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);\n};\n\n// More Global/complex listeners and triggers\nTriggers.Listeners.Global = {\n resizeListener: function resizeListener($nodes) {\n if (!MutationObserver) {\n //fallback for IE 9\n $nodes.each(function () {\n $(this).triggerHandler('resizeme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a resize event\n $nodes.attr('data-events', \"resize\");\n },\n scrollListener: function scrollListener($nodes) {\n if (!MutationObserver) {\n //fallback for IE 9\n $nodes.each(function () {\n $(this).triggerHandler('scrollme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a scroll event\n $nodes.attr('data-events', \"scroll\");\n },\n closeMeListener: function closeMeListener(e, pluginId) {\n var plugin = e.namespace.split('.')[0];\n var plugins = $(\"[data-\".concat(plugin, \"]\")).not(\"[data-yeti-box=\\\"\".concat(pluginId, \"\\\"]\"));\n plugins.each(function () {\n var _this = $(this);\n _this.triggerHandler('close.zf.trigger', [_this]);\n });\n }\n};\n\n// Global, parses whole document.\nTriggers.Initializers.addClosemeListener = function (pluginName) {\n var yetiBoxes = $('[data-yeti-box]'),\n plugNames = ['dropdown', 'tooltip', 'reveal'];\n if (pluginName) {\n if (typeof pluginName === 'string') {\n plugNames.push(pluginName);\n } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') {\n plugNames = plugNames.concat(pluginName);\n } else {\n console.error('Plugin names must be strings');\n }\n }\n if (yetiBoxes.length) {\n var listeners = plugNames.map(function (name) {\n return \"closeme.zf.\".concat(name);\n }).join(' ');\n $(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);\n }\n};\nfunction debounceGlobalListener(debounce, trigger, listener) {\n var timer,\n args = Array.prototype.slice.call(arguments, 3);\n $(window).on(trigger, function () {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(function () {\n listener.apply(null, args);\n }, debounce || 10); //default time to emit scroll event\n });\n}\n\nTriggers.Initializers.addResizeListener = function (debounce) {\n var $nodes = $('[data-resize]');\n if ($nodes.length) {\n debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);\n }\n};\nTriggers.Initializers.addScrollListener = function (debounce) {\n var $nodes = $('[data-scroll]');\n if ($nodes.length) {\n debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);\n }\n};\nTriggers.Initializers.addMutationEventsListener = function ($elem) {\n if (!MutationObserver) {\n return false;\n }\n var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');\n\n //element callback\n var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) {\n var $target = $(mutationRecordsList[0].target);\n\n //trigger the event handler for the element depending on type\n switch (mutationRecordsList[0].type) {\n case \"attributes\":\n if ($target.attr(\"data-events\") === \"scroll\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);\n }\n if ($target.attr(\"data-events\") === \"resize\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('resizeme.zf.trigger', [$target]);\n }\n if (mutationRecordsList[0].attributeName === \"style\") {\n $target.closest(\"[data-mutate]\").attr(\"data-events\", \"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n }\n break;\n case \"childList\":\n $target.closest(\"[data-mutate]\").attr(\"data-events\", \"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n break;\n default:\n return false;\n //nothing\n }\n };\n\n if ($nodes.length) {\n //for each element that needs to listen for resizing, scrolling, or mutation add a single observer\n for (var i = 0; i <= $nodes.length - 1; i++) {\n var elementObserver = new MutationObserver(listeningElementsMutation);\n elementObserver.observe($nodes[i], {\n attributes: true,\n childList: true,\n characterData: false,\n subtree: true,\n attributeFilter: [\"data-events\", \"style\"]\n });\n }\n }\n};\nTriggers.Initializers.addSimpleListeners = function () {\n var $document = $(document);\n Triggers.Initializers.addOpenListener($document);\n Triggers.Initializers.addCloseListener($document);\n Triggers.Initializers.addToggleListener($document);\n Triggers.Initializers.addCloseableListener($document);\n Triggers.Initializers.addToggleFocusListener($document);\n};\nTriggers.Initializers.addGlobalListeners = function () {\n var $document = $(document);\n Triggers.Initializers.addMutationEventsListener($document);\n Triggers.Initializers.addResizeListener(250);\n Triggers.Initializers.addScrollListener();\n Triggers.Initializers.addClosemeListener();\n};\nTriggers.init = function (__, Foundation) {\n onLoad($(window), function () {\n if ($.triggersInitialized !== true) {\n Triggers.Initializers.addSimpleListeners();\n Triggers.Initializers.addGlobalListeners();\n $.triggersInitialized = true;\n }\n });\n if (Foundation) {\n Foundation.Triggers = Triggers;\n // Legacy included to be backwards compatible for now.\n Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;\n }\n};\n\n// Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST\n// {function} _setup (replaces previous constructor),\n// {function} _destroy (replaces previous destroy)\nvar Plugin = /*#__PURE__*/function () {\n function Plugin(element, options) {\n _classCallCheck(this, Plugin);\n this._setup(element, options);\n var pluginName = getPluginName(this);\n this.uuid = GetYoDigits(6, pluginName);\n if (!this.$element.attr(\"data-\".concat(pluginName))) {\n this.$element.attr(\"data-\".concat(pluginName), this.uuid);\n }\n if (!this.$element.data('zfPlugin')) {\n this.$element.data('zfPlugin', this);\n }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n this.$element.trigger(\"init.zf.\".concat(pluginName));\n }\n _createClass(Plugin, [{\n key: \"destroy\",\n value: function destroy() {\n this._destroy();\n var pluginName = getPluginName(this);\n this.$element.removeAttr(\"data-\".concat(pluginName)).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */.trigger(\"destroyed.zf.\".concat(pluginName));\n for (var prop in this) {\n if (this.hasOwnProperty(prop)) {\n this[prop] = null; //clean up script to prep for garbage collection.\n }\n }\n }\n }]);\n return Plugin;\n}(); // Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate$1(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\nfunction getPluginName(obj) {\n return hyphenate$1(obj.className);\n}\n\n/**\n * Abide module.\n * @module foundation.abide\n */\nvar Abide = /*#__PURE__*/function (_Plugin) {\n _inherits(Abide, _Plugin);\n var _super = _createSuper(Abide);\n function Abide() {\n _classCallCheck(this, Abide);\n return _super.apply(this, arguments);\n }\n _createClass(Abide, [{\n key: \"_setup\",\n value:\n /**\n * Creates a new instance of Abide.\n * @class\n * @name Abide\n * @fires Abide#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n function _setup(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.$element = element;\n this.options = $.extend(true, {}, Abide.defaults, this.$element.data(), options);\n this.isEnabled = true;\n this.formnovalidate = null;\n this.className = 'Abide'; // ie9 back compat\n this._init();\n }\n\n /**\n * Initializes the Abide plugin and calls functions to get Abide functioning on load.\n * @private\n */\n }, {\n key: \"_init\",\n value: function _init() {\n var _this2 = this;\n this.$inputs = $.merge(\n // Consider as input to validate:\n this.$element.find('input').not('[type=\"submit\"]'),\n // * all input fields expect submit\n this.$element.find('textarea, select') // * all textareas and select fields\n );\n\n this.$submits = this.$element.find('[type=\"submit\"]');\n var $globalErrors = this.$element.find('[data-abide-error]');\n\n // Add a11y attributes to all fields\n if (this.options.a11yAttributes) {\n this.$inputs.each(function (i, input) {\n return _this2.addA11yAttributes($(input));\n });\n $globalErrors.each(function (i, error) {\n return _this2.addGlobalErrorA11yAttributes($(error));\n });\n }\n this._events();\n }\n\n /**\n * Initializes events for Abide.\n * @private\n */\n }, {\n key: \"_events\",\n value: function _events() {\n var _this3 = this;\n this.$element.off('.abide').on('reset.zf.abide', function () {\n _this3.resetForm();\n }).on('submit.zf.abide', function () {\n return _this3.validateForm();\n });\n this.$submits.off('click.zf.abide keydown.zf.abide').on('click.zf.abide keydown.zf.abide', function (e) {\n if (!e.key || e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n _this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null;\n _this3.$element.submit();\n }\n });\n if (this.options.validateOn === 'fieldChange') {\n this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {\n _this3.validateInput($(e.target));\n });\n }\n if (this.options.liveValidate) {\n this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {\n _this3.validateInput($(e.target));\n });\n }\n if (this.options.validateOnBlur) {\n this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {\n _this3.validateInput($(e.target));\n });\n }\n }\n\n /**\n * Calls necessary functions to update Abide upon DOM change\n * @private\n */\n }, {\n key: \"_reflow\",\n value: function _reflow() {\n this._init();\n }\n\n /**\n * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled\n * @returns {Boolean}\n * @private\n */\n }, {\n key: \"_validationIsDisabled\",\n value: function _validationIsDisabled() {\n if (this.isEnabled === false) {\n // whole validation disabled\n return true;\n } else if (typeof this.formnovalidate === 'boolean') {\n // triggered by $submit\n return this.formnovalidate;\n }\n // triggered by Enter in non-submit input\n return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;\n }\n\n /**\n * Enables the whole validation\n */\n }, {\n key: \"enableValidation\",\n value: function enableValidation() {\n this.isEnabled = true;\n }\n\n /**\n * Disables the whole validation\n */\n }, {\n key: \"disableValidation\",\n value: function disableValidation() {\n this.isEnabled = false;\n }\n\n /**\n * Checks whether or not a form element has the required attribute and if it's checked or not\n * @param {Object} element - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n }, {\n key: \"requiredCheck\",\n value: function requiredCheck($el) {\n if (!$el.attr('required')) return true;\n var isGood = true;\n switch ($el[0].type) {\n case 'checkbox':\n isGood = $el[0].checked;\n break;\n case 'select':\n case 'select-one':\n case 'select-multiple':\n var opt = $el.find('option:selected');\n if (!opt.length || !opt.val()) isGood = false;\n break;\n default:\n if (!$el.val() || !$el.val().length) isGood = false;\n }\n return isGood;\n }\n\n /**\n * Get:\n * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:\n * 1. The element's direct sibling('s).\n * 2. The element's parent's children.\n * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.\n *\n * This allows for multiple form errors per input, though if none are found, no form errors will be shown.\n *\n * @param {Object} $el - jQuery object to use as reference to find the form error selector.\n * @param {String[]} [failedValidators] - List of failed validators.\n * @returns {Object} jQuery object with the selector.\n */\n }, {\n key: \"findFormError\",\n value: function findFormError($el, failedValidators) {\n var _this4 = this;\n var id = $el.length ? $el[0].id : '';\n var $error = $el.siblings(this.options.formErrorSelector);\n if (!$error.length) {\n $error = $el.parent().find(this.options.formErrorSelector);\n }\n if (id) {\n $error = $error.add(this.$element.find(\"[data-form-error-for=\\\"\".concat(id, \"\\\"]\")));\n }\n if (!!failedValidators) {\n $error = $error.not('[data-form-error-on]');\n failedValidators.forEach(function (v) {\n $error = $error.add($el.siblings(\"[data-form-error-on=\\\"\".concat(v, \"\\\"]\")));\n $error = $error.add(_this4.$element.find(\"[data-form-error-for=\\\"\".concat(id, \"\\\"][data-form-error-on=\\\"\").concat(v, \"\\\"]\")));\n });\n }\n return $error;\n }\n\n /**\n * Get the first element in this order:\n * 2. The