text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  Object.defineProperty(exports, "LayoutStyle", {
    enumerable: true,
    get: function get() {
      return _style.LayoutStyle;
    }
  });
  Object.defineProperty(exports, "LayoutContainer", {
    enumerable: true,
    get: function get() {
      return _style.LayoutContainer;
    }
  });
  Object.defineProperty(exports, "LayoutContent", {
    enumerable: true,
    get: function get() {
      return _style.LayoutContent;
    }
  });
  Object.defineProperty(exports, "LayoutColumns", {
    enumerable: true,
    get: function get() {
      return _style.LayoutColumns;
    }
  });
  Object.defineProperty(exports, "LayoutColumn", {
    enumerable: true,
    get: function get() {
      return _style.LayoutColumn;
    }
  });
  Object.defineProperty(exports, "LayoutContext", {
    enumerable: true,
    get: function get() {
      return _layoutContext["default"];
    }
  });
  exports.LayoutFooter = exports.LayoutHeader = exports.Layout = void 0;
  
  var _react = _interopRequireDefault(require("react"));
  
  var _style = require("./style");
  
  var _layoutContext = _interopRequireDefault(require("./layout-context"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  
  function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
  
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  
  function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  
  var LayoutHeader = function LayoutHeader(props) {
    var className = props.className ? props.className.split(' ') : [];
    props.fixed && className.push('fixed');
    return /*#__PURE__*/_react["default"].createElement(_style.HeaderStyle, {
      className: className.join(' ')
    }, /*#__PURE__*/_react["default"].createElement("nav", null, props.children));
  };
  
  exports.LayoutHeader = LayoutHeader;
  
  var LayoutFooter = function LayoutFooter(props) {
    return /*#__PURE__*/_react["default"].createElement(_style.FooterStyle, props, /*#__PURE__*/_react["default"].createElement("nav", null, props.children));
  };
  
  exports.LayoutFooter = LayoutFooter;
  
  var _ref = /*#__PURE__*/_react["default"].createElement("div", {
    id: "overlay-container"
  });
  
  var Layout = function Layout(props) {
    var _React$useState = _react["default"].useState(props.className ? _toConsumableArray(props.className.split(' ')) : []),
        _React$useState2 = _slicedToArray(_React$useState, 2),
        className = _React$useState2[0],
        setClassName = _React$useState2[1];
  
    var scrollRef = _react["default"].useRef(null);
  
    var addClass = function addClass(cssClass) {
      var updatedClass = _toConsumableArray(className);
  
      updatedClass.push.apply(updatedClass, _toConsumableArray(cssClass));
      setClassName(updatedClass);
    };
  
    _react["default"].useEffect(function () {
      if ((props.withScroll || props.windowMode) && !className.includes('with-scroll')) {
        addClass(['with-scroll']);
        document.body.style.overflow = 'hidden';
      } else {
        document.body.style.overflow = 'initial';
      }
    }, [props.withScroll]);
  
    var removeClass = function removeClass(cssClass) {
      var updatedClass = _toConsumableArray(className);
  
      var _iterator = _createForOfIteratorHelper(updatedClass.keys()),
          _step;
  
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done;) {
          var i = _step.value;
  
          if (cssClass.includes(updatedClass[i])) {
            updatedClass.splice(i, 1);
          }
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
  
      setClassName(updatedClass);
    };
  
    var addEventListener = function addEventListener(event, listener) {
      var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'scrollArea';
  
      switch (target) {
        case 'Layout':
          document.getElementById('oah-layout').addEventListener(event, listener);
          break;
  
        default:
          if ((props.withScroll || props.windowMode) && scrollRef.current) {
            scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current.addEventListener(event, listener);
          } else {
            window.addEventListener(event, listener);
          }
  
          break;
      }
    };
  
    var removeEventListener = function removeEventListener(event, listener) {
      var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'scrollArea';
  
      switch (target) {
        case 'Layout':
          document.getElementById('oah-layout').removeEventListener(event, listener);
          break;
  
        default:
          if ((props.withScroll || props.windowMode) && scrollRef.current) {
            scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current.removeEventListener(event, listener);
          } else {
            window.removeEventListener(event, listener);
          }
  
          break;
      }
    };
  
    return /*#__PURE__*/_react["default"].createElement(_style.LayoutStyle, {
      id: "oah-layout",
      className: className.join(' '),
      style: props.style,
      withScroll: props.withScroll,
      windowMode: props.windowMode,
      withSubHeader: props.withSubHeader
    }, /*#__PURE__*/_react["default"].createElement(_layoutContext["default"].Provider, {
      value: {
        addClass: addClass,
        removeClass: removeClass,
        removeEventListener: removeEventListener,
        addEventListener: addEventListener,
        dir: props.dir,
        evaIcons: props.evaIcons
      }
    }, /*#__PURE__*/_react["default"].createElement("div", {
      ref: scrollRef,
      className: "scrollable-container"
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "layout"
    }, props.children)), _ref));
  };
  
  exports.Layout = Layout;
  Layout.defaultProps = {
    dir: 'ltr'
  };