{"version":3,"sources":["webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/universalModuleDefinition","webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/bootstrap","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"}","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.motion\"],\"amd\":\"./foundation.util.motion\",\"commonjs\":\"./foundation.util.motion\",\"commonjs2\":\"./foundation.util.motion\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/js/entries/plugins/foundation.util.triggers.js","webpack://__FOUNDATION_EXTERNAL__.[name]/js/foundation.util.triggers.js","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__foundation_core__","__WEBPACK_EXTERNAL_MODULE__foundation_util_motion__","__WEBPACK_EXTERNAL_MODULE_jquery__","installedModules","__webpack_require__","m","r","__webpack_exports__","_foundation_core__WEBPACK_IMPORTED_MODULE_0__","d","jquery__WEBPACK_IMPORTED_MODULE_1__","jquery__WEBPACK_IMPORTED_MODULE_1___default","n","_foundation_util_triggers__WEBPACK_IMPORTED_MODULE_2__","Triggers","init","$","Foundation","jquery__WEBPACK_IMPORTED_MODULE_0__","jquery__WEBPACK_IMPORTED_MODULE_0___default","_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__","_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__","triggers","el","type","data","split","forEach","id","concat","MutationObserver","prefixes","i","length","Listeners","Basic","Global","Initializers","debounceGlobalListener","debounce","trigger","listener","timer","args","Array","prototype","slice","call","arguments","off","on","e","clearTimeout","setTimeout","apply","openListener","this","closeListener","toggleListener","closeableListener","animation","stopPropagation","Motion","animateOut","fadeOut","toggleFocusListener","triggerHandler","addOpenListener","$elem","addCloseListener","addToggleListener","addCloseableListener","addToggleFocusListener","resizeListener","$nodes","each","attr","scrollListener","closeMeListener","pluginId","plugin","namespace","not","_this","addClosemeListener","pluginName","yetiBoxes","plugNames","push","_typeof","console","error","listeners","map","name","join","addResizeListener","addScrollListener","addMutationEventsListener","listeningElementsMutation","mutationRecordsList","$target","target","attributeName","pageYOffset","closest","find","observe","attributes","childList","characterData","subtree","attributeFilter","addSimpleListeners","$document","document","addGlobalListeners","onLoad","triggersInitialized","IHearYou","c","getter","o","Object","defineProperty","enumerable","get","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","object","property","hasOwnProperty","p","s","moduleId","l","modules"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,qBAAAA,QAAA,4BAAAA,QAAA,WACA,mBAAAC,QAAAA,OAAAC,IACAD,OAAA,CAAA,oBAAA,2BAAA,UAAAJ,GACA,iBAAAC,QACAA,QAAA,4BAAAD,EAAAG,QAAA,qBAAAA,QAAA,4BAAAA,QAAA,YAEAJ,EAAA,wBAAAA,EAAA,yBAAA,GAAyEA,EAAA,wBAAA,4BAAAC,EAAAD,EAAA,wBAAA,mBAAAA,EAAA,wBAAA,0BAAAA,EAAA,SARzE,CASCO,OAAA,SAAAC,EAAAC,EAAAC,GACD,OCTAC,EAAA,GA4BAC,EAAAC,uCC7BAV,EAAAD,QAAAM,4CCAAL,EAAAD,QAAAO,mFCAAG,EAAAE,EAAAC,GAAA,IAAAC,EAAAJ,EAAA,qBAAAA,EAAAK,EAAAF,EAAA,aAAA,WAAA,OAAAC,EAAA,aAAA,IAAAE,EAAAN,EAAA,UAAAO,EAAAP,EAAAQ,EAAAF,GAAAG,EAAAT,EAAA,oCAAAA,EAAAK,EAAAF,EAAA,WAAA,WAAA,OAAAM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AAA,IAAA,IAAAM,KAAAN,EAAA7H,EAAAK,EAAA4H,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAjI,EAAAQ,EAAA,SAAAjB,GACA,IAAA8H,EAAA9H,GAAAA,EAAAyI,WACA,WAA2B,OAAAzI,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAS,EAAAK,EAAAgH,EAAA,IAAAA,GACAA,GAIArH,EAAAsH,EAAA,SAAAe,EAAAC,GAAsD,OAAAf,OAAA9E,UAAA8F,eAAA5F,KAAA0F,EAAAC,IAGtDtI,EAAAwI,EAAA,GAIAxI,EAAAA,EAAAyI,EAAA,IA9EA,SAAAzI,EAAA0I,GAGA,GAAA3I,EAAA2I,GACA,OAAA3I,EAAA2I,GAAApJ,QAGA,IAAAC,EAAAQ,EAAA2I,GAAA,CACA9G,EAAA8G,EACAC,GAAA,EACArJ,QAAA,IAUA,OANAsJ,EAAAF,GAAA/F,KAAApD,EAAAD,QAAAC,EAAAA,EAAAD,QAAAU,GAGAT,EAAAoJ,GAAA,EAGApJ,EAAAD,cAvBAS","file":"foundation.util.triggers.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"./foundation.util.motion\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.util.motion\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.util.triggers\"] = factory(require(\"./foundation.core\"), require(\"./foundation.util.motion\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.triggers\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.motion\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 29);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_motion__;","import { Foundation } from './foundation.core';\nimport $ from 'jquery';\n\nimport { Triggers } from '../../foundation.util.triggers';\nTriggers.init($, Foundation);\n\nexport { Foundation, Triggers };\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad } from './foundation.core.utils';\nimport { Motion } from './foundation.util.motion';\n\nconst MutationObserver = (function () {\n var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];\n for (var i=0; i < prefixes.length; i++) {\n if (`${prefixes[i]}MutationObserver` in window) {\n return window[`${prefixes[i]}MutationObserver`];\n }\n }\n return false;\n}());\n\nconst triggers = (el, type) => {\n el.data(type).split(' ').forEach(id => {\n $(`#${id}`)[ type === 'close' ? 'trigger' : 'triggerHandler'](`${type}.zf.trigger`, [el]);\n });\n};\n\nvar Triggers = {\n Listeners: {\n Basic: {},\n Global: {}\n },\n Initializers: {}\n}\n\nTriggers.Listeners.Basic = {\n openListener: function() {\n triggers($(this), 'open');\n },\n closeListener: function() {\n let id = $(this).data('close');\n if (id) {\n triggers($(this), 'close');\n }\n else {\n $(this).trigger('close.zf.trigger');\n }\n },\n toggleListener: function() {\n let id = $(this).data('toggle');\n if (id) {\n triggers($(this), 'toggle');\n } else {\n $(this).trigger('toggle.zf.trigger');\n }\n },\n closeableListener: function(e) {\n let animation = $(this).data('closable');\n\n // Only close the first closable element. See https://git.io/zf-7833\n e.stopPropagation();\n\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() {\n let id = $(this).data('toggle-focus');\n $(`#${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 = ($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 = ($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 = ($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 = ($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 = ($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\n\n// More Global/complex listeners and triggers\nTriggers.Listeners.Global = {\n resizeListener: function($nodes) {\n if(!MutationObserver){//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($nodes) {\n if(!MutationObserver){//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(e, pluginId){\n let plugin = e.namespace.split('.')[0];\n let plugins = $(`[data-${plugin}]`).not(`[data-yeti-box=\"${pluginId}\"]`);\n\n plugins.each(function(){\n let _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\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 let listeners = plugNames.map((name) => {\n return `closeme.zf.${name}`;\n }).join(' ');\n\n $(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);\n }\n}\n\nfunction debounceGlobalListener(debounce, trigger, listener) {\n let timer, args = Array.prototype.slice.call(arguments, 3);\n $(window).off(trigger).on(trigger, function(e) {\n if (timer) { clearTimeout(timer); }\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 let $nodes = $('[data-resize]');\n if($nodes.length){\n debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);\n }\n}\n\nTriggers.Initializers.addScrollListener = function(debounce){\n let $nodes = $('[data-scroll]');\n if($nodes.length){\n debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);\n }\n}\n\nTriggers.Initializers.addMutationEventsListener = function($elem) {\n if(!MutationObserver){ return false; }\n let $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');\n\n //element callback\n var listeningElementsMutation = function (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\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\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], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: [\"data-events\", \"style\"] });\n }\n }\n}\n\nTriggers.Initializers.addSimpleListeners = function() {\n let $document = $(document);\n\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\n}\n\nTriggers.Initializers.addGlobalListeners = function() {\n let $document = $(document);\n Triggers.Initializers.addMutationEventsListener($document);\n Triggers.Initializers.addResizeListener();\n Triggers.Initializers.addScrollListener();\n Triggers.Initializers.addClosemeListener();\n}\n\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\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\nexport {Triggers};\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"]}