(window["webpackJsonpLIS"] = window["webpackJsonpLIS"] || []).push([["vendors~micromodal"],{

/***/ "./node_modules/micromodal/dist/micromodal.es.js":
/*!*******************************************************!*\
  !*** ./node_modules/micromodal/dist/micromodal.es.js ***!
  \*******************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\nfunction _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\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, descriptor.key, descriptor);\n  }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  return Constructor;\n}\n\nfunction _toConsumableArray(arr) {\n  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n  if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n  if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\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(n);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n  return arr2;\n}\n\nfunction _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar MicroModal = function () {\n\n  var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^=\"-\"])'];\n\n  var Modal = /*#__PURE__*/function () {\n    function Modal(_ref) {\n      var targetModal = _ref.targetModal,\n          _ref$triggers = _ref.triggers,\n          triggers = _ref$triggers === void 0 ? [] : _ref$triggers,\n          _ref$onShow = _ref.onShow,\n          onShow = _ref$onShow === void 0 ? function () {} : _ref$onShow,\n          _ref$onClose = _ref.onClose,\n          onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,\n          _ref$openTrigger = _ref.openTrigger,\n          openTrigger = _ref$openTrigger === void 0 ? 'data-micromodal-trigger' : _ref$openTrigger,\n          _ref$closeTrigger = _ref.closeTrigger,\n          closeTrigger = _ref$closeTrigger === void 0 ? 'data-micromodal-close' : _ref$closeTrigger,\n          _ref$openClass = _ref.openClass,\n          openClass = _ref$openClass === void 0 ? 'is-open' : _ref$openClass,\n          _ref$disableScroll = _ref.disableScroll,\n          disableScroll = _ref$disableScroll === void 0 ? false : _ref$disableScroll,\n          _ref$disableFocus = _ref.disableFocus,\n          disableFocus = _ref$disableFocus === void 0 ? false : _ref$disableFocus,\n          _ref$awaitCloseAnimat = _ref.awaitCloseAnimation,\n          awaitCloseAnimation = _ref$awaitCloseAnimat === void 0 ? false : _ref$awaitCloseAnimat,\n          _ref$awaitOpenAnimati = _ref.awaitOpenAnimation,\n          awaitOpenAnimation = _ref$awaitOpenAnimati === void 0 ? false : _ref$awaitOpenAnimati,\n          _ref$debugMode = _ref.debugMode,\n          debugMode = _ref$debugMode === void 0 ? false : _ref$debugMode;\n\n      _classCallCheck(this, Modal);\n\n      // Save a reference of the modal\n      this.modal = document.getElementById(targetModal); // Save a reference to the passed config\n\n      this.config = {\n        debugMode: debugMode,\n        disableScroll: disableScroll,\n        openTrigger: openTrigger,\n        closeTrigger: closeTrigger,\n        openClass: openClass,\n        onShow: onShow,\n        onClose: onClose,\n        awaitCloseAnimation: awaitCloseAnimation,\n        awaitOpenAnimation: awaitOpenAnimation,\n        disableFocus: disableFocus\n      }; // Register click events only if pre binding eventListeners\n\n      if (triggers.length > 0) this.registerTriggers.apply(this, _toConsumableArray(triggers)); // pre bind functions for event listeners\n\n      this.onClick = this.onClick.bind(this);\n      this.onKeydown = this.onKeydown.bind(this);\n    }\n    /**\n     * Loops through all openTriggers and binds click event\n     * @param  {array} triggers [Array of node elements]\n     * @return {void}\n     */\n\n\n    _createClass(Modal, [{\n      key: \"registerTriggers\",\n      value: function registerTriggers() {\n        var _this = this;\n\n        for (var _len = arguments.length, triggers = new Array(_len), _key = 0; _key < _len; _key++) {\n          triggers[_key] = arguments[_key];\n        }\n\n        triggers.filter(Boolean).forEach(function (trigger) {\n          trigger.addEventListener('click', function (event) {\n            return _this.showModal(event);\n          });\n        });\n      }\n    }, {\n      key: \"showModal\",\n      value: function showModal() {\n        var _this2 = this;\n\n        var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n        this.activeElement = document.activeElement;\n        this.modal.setAttribute('aria-hidden', 'false');\n        this.modal.classList.add(this.config.openClass);\n        this.scrollBehaviour('disable');\n        this.addEventListeners();\n\n        if (this.config.awaitOpenAnimation) {\n          var handler = function handler() {\n            _this2.modal.removeEventListener('animationend', handler, false);\n\n            _this2.setFocusToFirstNode();\n          };\n\n          this.modal.addEventListener('animationend', handler, false);\n        } else {\n          this.setFocusToFirstNode();\n        }\n\n        this.config.onShow(this.modal, this.activeElement, event);\n      }\n    }, {\n      key: \"closeModal\",\n      value: function closeModal() {\n        var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n        var modal = this.modal;\n        this.modal.setAttribute('aria-hidden', 'true');\n        this.removeEventListeners();\n        this.scrollBehaviour('enable');\n\n        if (this.activeElement && this.activeElement.focus) {\n          this.activeElement.focus();\n        }\n\n        this.config.onClose(this.modal, this.activeElement, event);\n\n        if (this.config.awaitCloseAnimation) {\n          var openClass = this.config.openClass; // <- old school ftw\n\n          this.modal.addEventListener('animationend', function handler() {\n            modal.classList.remove(openClass);\n            modal.removeEventListener('animationend', handler, false);\n          }, false);\n        } else {\n          modal.classList.remove(this.config.openClass);\n        }\n      }\n    }, {\n      key: \"closeModalById\",\n      value: function closeModalById(targetModal) {\n        this.modal = document.getElementById(targetModal);\n        if (this.modal) this.closeModal();\n      }\n    }, {\n      key: \"scrollBehaviour\",\n      value: function scrollBehaviour(toggle) {\n        if (!this.config.disableScroll) return;\n        var body = document.querySelector('body');\n\n        switch (toggle) {\n          case 'enable':\n            Object.assign(body.style, {\n              overflow: ''\n            });\n            break;\n\n          case 'disable':\n            Object.assign(body.style, {\n              overflow: 'hidden'\n            });\n            break;\n        }\n      }\n    }, {\n      key: \"addEventListeners\",\n      value: function addEventListeners() {\n        this.modal.addEventListener('touchstart', this.onClick);\n        this.modal.addEventListener('click', this.onClick);\n        document.addEventListener('keydown', this.onKeydown);\n      }\n    }, {\n      key: \"removeEventListeners\",\n      value: function removeEventListeners() {\n        this.modal.removeEventListener('touchstart', this.onClick);\n        this.modal.removeEventListener('click', this.onClick);\n        document.removeEventListener('keydown', this.onKeydown);\n      }\n    }, {\n      key: \"onClick\",\n      value: function onClick(event) {\n        if (event.target.hasAttribute(this.config.closeTrigger)) {\n          this.closeModal(event);\n        }\n      }\n    }, {\n      key: \"onKeydown\",\n      value: function onKeydown(event) {\n        if (event.keyCode === 27) this.closeModal(event); // esc\n\n        if (event.keyCode === 9) this.retainFocus(event); // tab\n      }\n    }, {\n      key: \"getFocusableNodes\",\n      value: function getFocusableNodes() {\n        var nodes = this.modal.querySelectorAll(FOCUSABLE_ELEMENTS);\n        return Array.apply(void 0, _toConsumableArray(nodes));\n      }\n      /**\n       * Tries to set focus on a node which is not a close trigger\n       * if no other nodes exist then focuses on first close trigger\n       */\n\n    }, {\n      key: \"setFocusToFirstNode\",\n      value: function setFocusToFirstNode() {\n        var _this3 = this;\n\n        if (this.config.disableFocus) return;\n        var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n        if (focusableNodes.length === 0) return; // remove nodes on whose click, the modal closes\n        // could not think of a better name :(\n\n        var nodesWhichAreNotCloseTargets = focusableNodes.filter(function (node) {\n          return !node.hasAttribute(_this3.config.closeTrigger);\n        });\n        if (nodesWhichAreNotCloseTargets.length > 0) nodesWhichAreNotCloseTargets[0].focus();\n        if (nodesWhichAreNotCloseTargets.length === 0) focusableNodes[0].focus();\n      }\n    }, {\n      key: \"retainFocus\",\n      value: function retainFocus(event) {\n        var focusableNodes = this.getFocusableNodes(); // no focusable nodes\n\n        if (focusableNodes.length === 0) return;\n        /**\n         * Filters nodes which are hidden to prevent\n         * focus leak outside modal\n         */\n\n        focusableNodes = focusableNodes.filter(function (node) {\n          return node.offsetParent !== null;\n        }); // if disableFocus is true\n\n        if (!this.modal.contains(document.activeElement)) {\n          focusableNodes[0].focus();\n        } else {\n          var focusedItemIndex = focusableNodes.indexOf(document.activeElement);\n\n          if (event.shiftKey && focusedItemIndex === 0) {\n            focusableNodes[focusableNodes.length - 1].focus();\n            event.preventDefault();\n          }\n\n          if (!event.shiftKey && focusableNodes.length > 0 && focusedItemIndex === focusableNodes.length - 1) {\n            focusableNodes[0].focus();\n            event.preventDefault();\n          }\n        }\n      }\n    }]);\n\n    return Modal;\n  }();\n  /**\n   * Modal prototype ends.\n   * Here on code is responsible for detecting and\n   * auto binding event handlers on modal triggers\n   */\n  // Keep a reference to the opened modal\n\n\n  var activeModal = null;\n  /**\n   * Generates an associative array of modals and it's\n   * respective triggers\n   * @param  {array} triggers     An array of all triggers\n   * @param  {string} triggerAttr The data-attribute which triggers the module\n   * @return {array}\n   */\n\n  var generateTriggerMap = function generateTriggerMap(triggers, triggerAttr) {\n    var triggerMap = [];\n    triggers.forEach(function (trigger) {\n      var targetModal = trigger.attributes[triggerAttr].value;\n      if (triggerMap[targetModal] === undefined) triggerMap[targetModal] = [];\n      triggerMap[targetModal].push(trigger);\n    });\n    return triggerMap;\n  };\n  /**\n   * Validates whether a modal of the given id exists\n   * in the DOM\n   * @param  {number} id  The id of the modal\n   * @return {boolean}\n   */\n\n\n  var validateModalPresence = function validateModalPresence(id) {\n    if (!document.getElementById(id)) {\n      console.warn(\"MicroModal: \\u2757Seems like you have missed %c'\".concat(id, \"'\"), 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'ID somewhere in your code. Refer example below to resolve it.');\n      console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"<div class=\\\"modal\\\" id=\\\"\".concat(id, \"\\\"></div>\"));\n      return false;\n    }\n  };\n  /**\n   * Validates if there are modal triggers present\n   * in the DOM\n   * @param  {array} triggers An array of data-triggers\n   * @return {boolean}\n   */\n\n\n  var validateTriggerPresence = function validateTriggerPresence(triggers) {\n    if (triggers.length <= 0) {\n      console.warn(\"MicroModal: \\u2757Please specify at least one %c'micromodal-trigger'\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.');\n      console.warn(\"%cExample:\", 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', \"<a href=\\\"#\\\" data-micromodal-trigger=\\\"my-modal\\\"></a>\");\n      return false;\n    }\n  };\n  /**\n   * Checks if triggers and their corresponding modals\n   * are present in the DOM\n   * @param  {array} triggers   Array of DOM nodes which have data-triggers\n   * @param  {array} triggerMap Associative array of modals and their triggers\n   * @return {boolean}\n   */\n\n\n  var validateArgs = function validateArgs(triggers, triggerMap) {\n    validateTriggerPresence(triggers);\n    if (!triggerMap) return true;\n\n    for (var id in triggerMap) {\n      validateModalPresence(id);\n    }\n\n    return true;\n  };\n  /**\n   * Binds click handlers to all modal triggers\n   * @param  {object} config [description]\n   * @return void\n   */\n\n\n  var init = function init(config) {\n    // Create an config object with default openTrigger\n    var options = Object.assign({}, {\n      openTrigger: 'data-micromodal-trigger'\n    }, config); // Collects all the nodes with the trigger\n\n    var triggers = _toConsumableArray(document.querySelectorAll(\"[\".concat(options.openTrigger, \"]\"))); // Makes a mappings of modals with their trigger nodes\n\n\n    var triggerMap = generateTriggerMap(triggers, options.openTrigger); // Checks if modals and triggers exist in dom\n\n    if (options.debugMode === true && validateArgs(triggers, triggerMap) === false) return; // For every target modal creates a new instance\n\n    for (var key in triggerMap) {\n      var value = triggerMap[key];\n      options.targetModal = key;\n      options.triggers = _toConsumableArray(value);\n      activeModal = new Modal(options); // eslint-disable-line no-new\n    }\n  };\n  /**\n   * Shows a particular modal\n   * @param  {string} targetModal [The id of the modal to display]\n   * @param  {object} config [The configuration object to pass]\n   * @return {void}\n   */\n\n\n  var show = function show(targetModal, config) {\n    var options = config || {};\n    options.targetModal = targetModal; // Checks if modals and triggers exist in dom\n\n    if (options.debugMode === true && validateModalPresence(targetModal) === false) return; // clear events in case previous modal wasn't close\n\n    if (activeModal) activeModal.removeEventListeners(); // stores reference to active modal\n\n    activeModal = new Modal(options); // eslint-disable-line no-new\n\n    activeModal.showModal();\n  };\n  /**\n   * Closes the active modal\n   * @param  {string} targetModal [The id of the modal to close]\n   * @return {void}\n   */\n\n\n  var close = function close(targetModal) {\n    targetModal ? activeModal.closeModalById(targetModal) : activeModal.closeModal();\n  };\n\n  return {\n    init: init,\n    show: show,\n    close: close\n  };\n}();\nwindow.MicroModal = MicroModal;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (MicroModal);\n\n\n//# sourceURL=webpack://LIS/./node_modules/micromodal/dist/micromodal.es.js?");

/***/ })

}]);