'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

require('./_commonjsHelpers-06173234.js');
require('./_to-object-329a650b.js');
require('./es6.string.iterator-cc0bbaa4.js');
require('./_library-dd23b178.js');
require('./_iter-detect-60b2f026.js');
require('./core.get-iterator-method-f62321d4.js');
require('./_object-pie-68c5bcbc.js');
require('./extends-60837c34.js');
require('./define-property-f4d12f4e.js');
require('./web.dom.iterable-a0e279c1.js');
var React = require('react');
var React__default = _interopDefault(React);
require('./index-8bf6c863.js');
require('prop-types');
var Row = _interopDefault(require('react-bootstrap/Row'));
var Col = _interopDefault(require('react-bootstrap/Col'));
require('./isSymbol-04666465.js');
require('./debounce-eb287781.js');
var main = require('./main-02daeefe.js');
require('./slicedToArray-8f385299.js');
require('./stringify-7c5aff47.js');
require('./asyncToGenerator-533d476a.js');
require('./_set-species-f92c67c5.js');
require('./Segment.js');
require('./Beam.js');
require('./AdSlot.js');
require('./get-68c52cb1.js');
require('./react-social-icons-f7f48f71.js');
require('react-bootstrap');
require('./defineProperty-55548b25.js');
var SideFooter = require('./SideFooter.js');
var ConferenceBanner = require('./ConferenceBanner-4a16fddc.js');
var ADSponsoredResources = require('./ADSponsoredResources.js');
require('react-bootstrap/ListGroup');
require('./ADWebcast.js');
var LeftNav = require('./LeftNav.js');
var PageFilter = require('./PageFilter.js');

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 = React.useRef(null);

  React.useEffect(function () {
    if (!main.main_36 && 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.default, { 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.main_36 || showRightAd) && React__default.createElement(
        Col,
        { xs: 12, className: 'rightCol' },
        website && website.conferenceBannerContent && React__default.createElement(ConferenceBanner.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 })
        )
      )
    )
  );
};

exports.Column3 = Column3;
exports.default = Column3;
