"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

require("./style.sass");

var _context = require("../../context");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var mobileBar = /*#__PURE__*/_react["default"].createContext(null);

var Center = function Center(props) {
  var toggleView = function toggleView() {
    var _mobileBar$current, _mobileBar$current$cl, _mobileBar$current2, _mobileBar$current2$c, _mobileBar$current3, _mobileBar$current3$c;

    if (mobileBar !== null && mobileBar !== void 0 && (_mobileBar$current = mobileBar.current) !== null && _mobileBar$current !== void 0 && (_mobileBar$current$cl = _mobileBar$current.className) !== null && _mobileBar$current$cl !== void 0 && _mobileBar$current$cl.match('change')) mobileBar === null || mobileBar === void 0 ? void 0 : (_mobileBar$current2 = mobileBar.current) === null || _mobileBar$current2 === void 0 ? void 0 : (_mobileBar$current2$c = _mobileBar$current2.classList) === null || _mobileBar$current2$c === void 0 ? void 0 : _mobileBar$current2$c.remove('change');else mobileBar === null || mobileBar === void 0 ? void 0 : (_mobileBar$current3 = mobileBar.current) === null || _mobileBar$current3 === void 0 ? void 0 : (_mobileBar$current3$c = _mobileBar$current3.classList) === null || _mobileBar$current3$c === void 0 ? void 0 : _mobileBar$current3$c.add('change');
  };

  return /*#__PURE__*/_react["default"].createElement(_context.MainContext.Consumer, null, function (data) {
    var _data$headerLinks, _data$headerLinks2;

    return /*#__PURE__*/_react["default"].createElement("nav", {
      className: "wizrd-site-navigation wizrd-site-navigation-center ".concat((data === null || data === void 0 ? void 0 : (_data$headerLinks = data.headerLinks) === null || _data$headerLinks === void 0 ? void 0 : _data$headerLinks.length) > 4 && 'wizrd-site-navigation-extra')
    }, /*#__PURE__*/_react["default"].createElement("ul", null, data === null || data === void 0 ? void 0 : (_data$headerLinks2 = data.headerLinks) === null || _data$headerLinks2 === void 0 ? void 0 : _data$headerLinks2.map(function (headerLink) {
      return /*#__PURE__*/_react["default"].createElement("li", null, headerLink);
    })));
  });
};

var _default = Center;
exports["default"] = _default;