import React__default, { useRef, useEffect } from 'react';
import ADSponsoredResources from './ADSponsoredResources.js';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import LeftNav from './LeftNav.js';
import SideFooter from './SideFooter.js';
import { C as ConferenceBanner } from './ConferenceBanner-8792ebd2.js';
import PageFilter from './PageFilter.js';
import { m as main_43 } from './main-1894c974.js';
import './slicedToArray-6ebcbfea.js';
import './_commonjsHelpers-0c4b6f40.js';
import './web.dom.iterable-ab4dea5c.js';
import './core.get-iterator-method-ea258bb1.js';
import './AdSlot.js';
import './extends-6d8e3924.js';
import './_object-pie-133f504a.js';
import 'prop-types';
import './index-f0fc23eb.js';
import './events-6c3a7a63.js';
import './debounce-533d9748.js';
import './isSymbol-a7e9aafe.js';
import './toNumber-5aeba6e7.js';
import './Beam.js';
import './stringify-2b084bee.js';
import './asyncToGenerator-958ef5fc.js';
import './_library-528f1934.js';
import './_iter-detect-98db3b07.js';
import './Segment.js';
import 'react-bootstrap/ListGroup';
import './ADWebcast.js';
import './checkSisterSite-baa4fb6b.js';
import './react-social-icons-9be47857.js';
import './get-3c308da4.js';
import './eq-bdcbf886.js';
import 'react-bootstrap';

var Column3 = function Column3(props) {
  var leftItems = props.leftItems,
      rightItems = props.rightItems,
      title = props.title,
      website = props.website,
      showFilter = props.showFilter,
      getParams = props.getParams,
      filters = props.filters,
      defaultFilter = props.defaultFilter,
      showRightAd = props.showRightAd,
      logo = props.logo;

  var adRef = useRef(null);

  useEffect(function () {
    if (!main_43 && window.innerWidth >= 768) {
      var navbar = document.querySelector('.navbar');
      var AdOffsetTop = adRef.current.getBoundingClientRect().top;
      window.addEventListener('scroll', function () {
        if (window.pageYOffset + (AdOffsetTop - navbar.offsetHeight) > AdOffsetTop) {
          if (adRef.current && adRef.current.style) {
            adRef.current.style.position = 'fixed';
            adRef.current.style.top = '60px';
          }
        } else {
          if (adRef.current && adRef.current.style) {
            adRef.current.style.position = 'relative';
            adRef.current.style.top = '';
          }
        }
      });
    }
  }, []);

  return React__default.createElement(
    'section',
    null,
    React__default.createElement(
      Row,
      { className: 'justify-content-md-center' },
      React__default.createElement(
        Col,
        { md: true, className: 'leftCol', style: { width: '200px' } },
        React__default.createElement(LeftNav, { leftItems: leftItems }),
        website && website.sponsoredAd && React__default.createElement(ADSponsoredResources, { sponsoredAd: website.sponsoredAd }),
        website && website.sideFooterContent && website.sideFooterContent.length && website.showFooterOnLeftSide && React__default.createElement(SideFooter, { website: website, cache: website.cache, logo: logo })
      ),
      React__default.createElement(
        Col,
        { md: true, className: 'middleCol', style: { maxWidth: '640px', marginTop: !title && '10px' } },
        showFilter ? React__default.createElement(
          'div',
          { className: 'title-wrap' },
          React__default.createElement(
            'h1',
            { className: 'title' },
            title
          ),
          React__default.createElement(
            'div',
            { className: 'filter-box' },
            React__default.createElement(PageFilter, { getParams: getParams, filters: filters, defaultFilter: defaultFilter })
          )
        ) : title && React__default.createElement(
          'h1',
          { className: 'title' },
          title
        ),
        props.children
      ),
      React__default.createElement(
        'style',
        { jsx: 'true' },
        '\n            .filter-box {\n              float: right;\n              padding-top: 6px;\n              padding-right: 18px;\n            }\n            @media only screen and (min-width: 768px) {\n              .title-wrap {\n                display: flex;\n                justify-content: space-between;\n              }\n            }\n            @media only screen and (max-width: 767px) {\n              /* .filter-box {\n                float: right;\n                display: flex;\n                justify-content: flex-end;\n              } */\n              .title-wrap {\n                display: flex;\n                flex-direction: column;\n                margin-bottom: 10px;\n              }\n            }\n          '
      ),
      (!main_43 || showRightAd) && React__default.createElement(
        Col,
        { xs: 12, className: 'rightCol' },
        website && website.conferenceBannerContent && React__default.createElement(ConferenceBanner, { website: website }),
        React__default.createElement(
          'div',
          { ref: adRef },
          rightItems && rightItems.map(function (row, index) {
            return React__default.createElement(
              'div',
              { key: index },
              row.component
            );
          }),
          website && website.sideFooterContent && website.sideFooterContent.length && !website.showFooterOnLeftSide && React__default.createElement(SideFooter, { website: website, cache: website.cache, logo: logo })
        )
      )
    )
  );
};

export { Column3, Column3 as default };
