import './_commonjsHelpers-0c4b6f40.js';
import './_to-object-ded78eb9.js';
import './es6.string.iterator-9b2af4a5.js';
import './_library-528f1934.js';
import './_iter-detect-59409a32.js';
import './core.get-iterator-method-54d2e411.js';
import './web.dom.iterable-8956f9a5.js';
import React__default, { useRef, useEffect } from 'react';
import Container from 'react-bootstrap/Container';
import './slicedToArray-7021e5df.js';
import './asyncToGenerator-7c654f36.js';
import './_set-species-cede29f8.js';
import Segment from './Segment.js';
import './iconBase-602d52fe.js';
import 'react-bootstrap/Button';
import 'react-bootstrap/Form';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import NavDropdown from 'react-bootstrap/NavDropdown';
import { M as MdEmail, a as MdMouse } from './index.esm-b08f4b04.js';
import 'react-bootstrap/FormControl';
import Search from './Search.js';

var NavNormal = function NavNormal(props) {
  var logo = props.logo,
      dataObject = props.dataObject,
      _props$website = props.website,
      website = _props$website === undefined ? {} : _props$website;


  var ref = useRef(null);

  useEffect(function () {

    setTimeout(function () {
      var segmentLinks = ref.current.querySelectorAll('a[needsegmentsupport="true"]');
      for (var i = 0; i < segmentLinks.length; i++) {
        var link = segmentLinks[i];
        var href = link.getAttribute('href');
        var newHref = Segment.getURL(href, { needSegmentSupport: true });
        link.setAttribute('href', newHref);
      }
    }, 1000);
  }, []);

  return React__default.createElement(
    'section',
    { ref: ref },
    React__default.createElement(
      Navbar,
      { expand: 'lg' },
      React__default.createElement(
        Container,
        null,
        React__default.createElement('img', { src: logo, style: { height: '50px' }, alt: website.title ? website.title : website.name ? website.name : 'Website Logo' }),
        React__default.createElement(
          'div',
          null,
          React__default.createElement(MdEmail, null),
          ' Subscribe',
          React__default.createElement('br', null),
          React__default.createElement(MdMouse, null),
          ' Login'
        )
      )
    ),
    React__default.createElement(
      Navbar,
      { variant: 'dark', expand: 'lg', bg: 'primary' },
      React__default.createElement(
        Container,
        null,
        React__default.createElement(Navbar.Toggle, { 'aria-controls': 'basic-navbar-nav' }),
        React__default.createElement(
          Navbar.Collapse,
          { id: 'basic-navbar-nav' },
          React__default.createElement(
            Nav,
            { className: 'mr-auto' },
            dataObject && dataObject.map(function (row) {
              if (row.type === 'dropdown') {
                return React__default.createElement(
                  NavDropdown,
                  { title: row.name, id: 'basic-nav-dropdown', renderMenuOnMount: true },
                  row.dropdown && row.dropdown.map(function (ddRow, ddItems) {
                    if (ddRow.type === 'divider') {
                      return React__default.createElement(NavDropdown.Divider, null);
                    } else {
                      return React__default.createElement(
                        NavDropdown.Item,
                        { href: ddRow.url, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', target: ddRow.blank ? '_blank' : '_self' },
                        ddRow.name
                      );
                    }
                  })
                );
              } else {
                // Link default
                return React__default.createElement(
                  Nav.Link,
                  { href: row.url, needsegmentsupport: row.needSegmentSupport ? 'true' : '', target: row.blank ? '_blank' : '_self' },
                  row.name
                );
              }
            })
          )
        ),
        React__default.createElement(Search, null)
      )
    ),
    React__default.createElement(
      'style',
      { jsx: 'true' },
      '\n        @media screen and (max-width: 991px) {\n          .dropdown-menu {\n            max-height: 315px;\n            overflow: auto;\n          }\n          ::-webkit-scrollbar {\n            width: 10px;\n          }\n          ::-webkit-scrollbar-thumb {\n            border-radius: 4px;\n            background-color: rgba(214, 214, 214, 0.8);\n            box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n            -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n          }\n        }\n      '
    )
  );
};

export default NavNormal;
export { NavNormal };
