{"version":3,"sources":["webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/universalModuleDefinition","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/js/entries/plugins/foundation.util.keyboard.js","webpack://__FOUNDATION_EXTERNAL__.[name]/js/foundation.util.keyboard.js","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/bootstrap"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__foundation_core__","__WEBPACK_EXTERNAL_MODULE_jquery__","__webpack_require__","r","__webpack_exports__","_foundation_core__WEBPACK_IMPORTED_MODULE_0__","d","_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__","Foundation","Keyboard","jquery__WEBPACK_IMPORTED_MODULE_0__","jquery__WEBPACK_IMPORTED_MODULE_0___default","n","_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__","keyCodes","9","13","27","32","35","36","37","38","39","40","commands","findFocusable","$element","find","filter","$","this","is","attr","sort","a","b","aTabIndex","parseInt","bTabIndex","parseKey","event","key","which","keyCode","String","fromCharCode","toUpperCase","replace","shiftKey","concat","ctrlKey","altKey","keys","kcs","kc","k","hasOwnProperty","getKeyCodes","handleKey","component","functions","commandList","console","warn","zfIsKeyHandled","fn","ltr","Rtl","extend","rtl","returnValue","apply","handled","unhandled","register","componentName","cmds","trapFocus","$focusable","$firstFocusable","eq","$lastFocusable","on","target","preventDefault","focus","releaseFocus","off","installedModules","m","modules","c","name","getter","o","Object","defineProperty","enumerable","get","Symbol","toStringTag","value","t","mode","__esModule","ns","create","bind","object","property","prototype","call","p","s","moduleId","i","l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AAAI,MAAAA,IACzC,EAAAE,GAAA,iBAAAF,EAAA,IAAA,IAAA5D,KAAA4D,EAAApG,EAAAI,EAAAoG,EAAAhE,EAAA,SAAAA,GAAgH,OAAA4D,EAAA5D,IAAqBkE,KAAA,KAAAlE,IACrI,OAAAgE,GAIAxG,EAAAU,EAAA,SAAAjB,GACA,IAAAmG,EAAAnG,GAAAA,EAAA8G,WACA,WAA2B,OAAA9G,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAO,EAAAI,EAAAwF,EAAA,IAAAA,GACAA,GAIA5F,EAAA6F,EAAA,SAAAc,EAAAC,GAAsD,OAAAd,OAAAe,UAAAtD,eAAAuD,KAAAH,EAAAC,IAGtD5G,EAAA+G,EAAA,GAIA/G,EAAAA,EAAAgH,EAAA,IA9EA,SAAAhH,EAAAiH,GAGA,GAAA1B,EAAA0B,GACA,OAAA1B,EAAA0B,GAAAzH,QAGA,IAAAC,EAAA8F,EAAA0B,GAAA,CACAC,EAAAD,EACAE,GAAA,EACA3H,QAAA,IAUA,OANAiG,EAAAwB,GAAAH,KAAArH,EAAAD,QAAAC,EAAAA,EAAAD,QAAAQ,GAGAP,EAAA0H,GAAA,EAGA1H,EAAAD,Q,MAvBA+F","file":"foundation.util.keyboard.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.util.keyboard\"] = factory(require(\"./foundation.core\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.keyboard\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","import { Foundation } from './foundation.core';\nimport { Keyboard } from '../../foundation.util.keyboard';\n\nFoundation.Keyboard = Keyboard;\n\nexport { Foundation, Keyboard };\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 ******************************************/\n\nimport $ from 'jquery';\nimport { rtl as Rtl } from './foundation.core.utils';\n\nconst 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}\n\nvar commands = {}\n\n// Functions pulled out to be referenceable from internals\nfunction findFocusable($element) {\n if(!$element) {return false; }\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) { return false; } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n })\n .sort( function( a, b ) {\n if ($(a).attr('tabindex') == $(b).attr('tabindex')) {\n return 0;\n }\n let aTabIndex = parseInt($(a).attr('tabindex')),\n bTabIndex = parseInt($(b).attr('tabindex'));\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}\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\n if (event.shiftKey) key = `SHIFT_${key}`;\n if (event.ctrlKey) key = `CTRL_${key}`;\n if (event.altKey) key = `ALT_${key}`;\n\n // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)\n key = key.replace(/_$/, '');\n\n return key;\n}\n\nvar Keyboard = {\n keys: getKeyCodes(keyCodes),\n\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 /**\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(event, component, functions) {\n var commandList = commands[component],\n keyCode = this.parseKey(event),\n cmds,\n command,\n fn;\n\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 { // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa\n if (Rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);\n\n else cmds = $.extend({}, commandList.rtl, commandList.ltr);\n }\n command = cmds[keyCode];\n\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 /**\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 /**\n * Returns the component name name\n * @param {Object} component - Foundation component, e.g. Slider or Reveal\n * @return String componentName\n */\n\n register(componentName, cmds) {\n commands[componentName] = cmds;\n },\n\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($element) {\n var $focusable = findFocusable($element),\n $firstFocusable = $focusable.eq(0),\n $lastFocusable = $focusable.eq(-1);\n\n $element.on('keydown.zf.trapfocus', function(event) {\n if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {\n event.preventDefault();\n $firstFocusable.focus();\n }\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($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) k[kcs[kc]] = kcs[kc];\n return k;\n}\n\nexport {Keyboard};\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"," \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 = 23);\n"]}