import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
import { _ as _toIobject, a as _objectKeys, b as _descriptors, c as _export, d as _core } from './_to-object-ded78eb9.js';
import './es6.string.iterator-9b2af4a5.js';
import './_iter-detect-59409a32.js';
import { _ as _toConsumableArray } from './toConsumableArray-725434a0.js';
import './core.get-iterator-method-54d2e411.js';
import { _ as _objectPie } from './_object-pie-71ac75a4.js';
import { _ as _extends } from './extends-cc5da797.js';
import './define-property-de3fc946.js';
import './web.dom.iterable-8956f9a5.js';
import React__default, { useState, useEffect } from 'react';
import Container from 'react-bootstrap/Container';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import Card from 'react-bootstrap/Card';
import './moment-e2f9b20c.js';
import { useRouter } from 'next/router';
import { I as InfiniteScroll } from './index.es-29c1cef5.js';
import './main-5d1e4bd3.js';
import { _ as _JSON$stringify } from './stringify-008c8802.js';
import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-7021e5df.js';
import Button from 'react-bootstrap/Button';
import { _ as _defineProperty } from './defineProperty-b798470d.js';
import Spinner from 'react-bootstrap/Spinner';
import Form from 'react-bootstrap/Form';
import { m as momentTimezone } from './index-ef6d5dcf.js';
import { j as js_cookie } from './js.cookie-6874175c.js';

var isEnum = _objectPie.f;
var _objectToArray = function (isEntries) {
  return function (it) {
    var O = _toIobject(it);
    var keys = _objectKeys(O);
    var length = keys.length;
    var i = 0;
    var result = [];
    var key;
    while (length > i) {
      key = keys[i++];
      if (!_descriptors || isEnum.call(O, key)) {
        result.push(isEntries ? [key, O[key]] : O[key]);
      }
    }
    return result;
  };
};

// https://github.com/tc39/proposal-object-values-entries

var $entries = _objectToArray(true);

_export(_export.S, 'Object', {
  entries: function entries(it) {
    return $entries(it);
  }
});

var entries = _core.Object.entries;

var entries$1 = createCommonjsModule(function (module) {
module.exports = { "default": entries, __esModule: true };
});

var _Object$entries = unwrapExports(entries$1);

var clientId = process.env.CVENT_CLIENT_ID;
var clientSecret = process.env.CVENT_CLIENT_SECRET;
var currentTime = momentTimezone().toISOString();
var itemsPerPage = 200;

var EventsDeck = function EventsDeck(_ref) {
  var rightItems = _ref.rightItems,
      _ref$filter = _ref.filter,
      filter = _ref$filter === undefined ? 'start gt \'' + currentTime + '\' and status eq \'Active\'' : _ref$filter,
      _ref$hardCodedEvents = _ref.hardCodedEvents,
      hardCodedEvents = _ref$hardCodedEvents === undefined ? null : _ref$hardCodedEvents,
      _ref$cta = _ref.cta,
      cta = _ref$cta === undefined ? 'Register Now' : _ref$cta,
      advancedFilters = _ref.advancedFilters,
      showFilters = _ref.showFilters;

  var router = useRouter();

  var _useState = useState(true),
      _useState2 = _slicedToArray(_useState, 2),
      isLoading = _useState2[0],
      setIsLoading = _useState2[1];

  var _useState3 = useState(null),
      _useState4 = _slicedToArray(_useState3, 2),
      accessToken = _useState4[0],
      setAccessToken = _useState4[1];

  var _useState5 = useState([]),
      _useState6 = _slicedToArray(_useState5, 2),
      data = _useState6[0],
      setData = _useState6[1];

  var _useState7 = useState(null),
      _useState8 = _slicedToArray(_useState7, 2),
      nextPageLink = _useState8[0],
      setNextPageLink = _useState8[1];

  var _useState9 = useState(true),
      _useState10 = _slicedToArray(_useState9, 2),
      scrolling = _useState10[0],
      setScrolling = _useState10[1];

  var _ref2 = advancedFilters ? useState(advancedFilters) : useState(null),
      _ref3 = _slicedToArray(_ref2, 2),
      deckAdvancedFilters = _ref3[0],
      setDeckAdvancedFilters = _ref3[1];

  var _useState11 = useState([]),
      _useState12 = _slicedToArray(_useState11, 2),
      advancedFiltersArray = _useState12[0],
      setAdvancedFiltersArray = _useState12[1];

  var _useState13 = useState(null),
      _useState14 = _slicedToArray(_useState13, 2),
      eventCards = _useState14[0],
      setEventCards = _useState14[1];

  var _useState15 = useState(true),
      _useState16 = _slicedToArray(_useState15, 2),
      firstLoad = _useState16[0],
      setFirstLoad = _useState16[1];

  var _useState17 = useState(false),
      _useState18 = _slicedToArray(_useState17, 2),
      mobileView = _useState18[0],
      setMobileView = _useState18[1];

  var getEvents = function getEvents(url) {
    fetch(url, {
      headers: {
        Accept: 'application/json',
        'x-api-key': clientId,
        Authorization: 'Bearer ' + accessToken,
        'Content-type': 'application/json'
      },
      body: _JSON$stringify({ filter: filter }),
      method: 'POST'
    }).then(function (response) {
      return response.json();
    }).then(function (events) {
      setIsLoading(false);

      if (hardCodedEvents) {
        var temp = [].concat(_toConsumableArray(events.data));
        if (filter.indexOf('start') >= 0 && hardCodedEvents.upcomingEvents.length > 0) {
          for (var event in hardCodedEvents.upcomingEvents) {
            temp.push(hardCodedEvents.upcomingEvents[event]);
          }
        }
        if (filter.indexOf('end') >= 0 && hardCodedEvents.pastEvents.length > 0) {
          for (var _event in hardCodedEvents.pastEvents) {
            temp.push(hardCodedEvents.pastEvents[_event]);
          }
        }
        events.data = temp;
      }

      if (events.data && events.data.length > 0) {
        var filteredEventsByTestMode = events.data.filter(function (event) {
          return event.testMode === false;
        });
        var sortedEventsByStartData = filteredEventsByTestMode.sort(function (a, b) {
          if (a.start.indexOf('TBD') >= 0 || b.start.indexOf('TBD') >= 0) {
            return -1;
          }
          if (momentTimezone(a.start).isAfter(b.start)) {
            return 1;
          } else if (momentTimezone(a.start).isBefore(b.start)) {
            return -1;
          }
          return 0;
        });
        if (filter.indexOf('end') >= 0) {
          sortedEventsByStartData.reverse();
        }
        setData(function (prevData) {
          return [].concat(_toConsumableArray(prevData), _toConsumableArray(sortedEventsByStartData));
        });
        setNextPageLink(events.paging._links.next ? events.paging._links.next.href : null);
        setScrolling(events.paging._links.next ? true : false);
      } else {
        setScrolling(false);
      }
    }).catch(function (e) {
      console.error(e);
    });
  };

  useEffect(function () {
    // load initial data
    if (accessToken) {
      var initailUrl = 'https://api-platform.cvent.com/event/v1/events/filter?limit=' + itemsPerPage;
      getEvents(initailUrl);
    }
  }, [accessToken, filter]);

  var loadMore = function loadMore() {
    // load more events
    if (accessToken && nextPageLink) {
      getEvents(nextPageLink);
    }
  };

  useEffect(function () {
    // reset state when filter changes
    setIsLoading(true);
    setData([]);
    if (!firstLoad) {
      if (advancedFilters) {
        setDeckAdvancedFilters(function (prevState) {
          var temp = _extends({}, prevState);
          var _iteratorNormalCompletion = true;
          var _didIteratorError = false;
          var _iteratorError = undefined;

          try {
            for (var _iterator = _getIterator(_Object$entries(temp)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
              var _ref4 = _step.value;

              var _ref5 = _slicedToArray(_ref4, 2);

              var key = _ref5[0];
              var value = _ref5[1];

              temp[key].value = '';
              temp[key].selected = false;
              temp[key].param = value.param;
            }
          } catch (err) {
            _didIteratorError = true;
            _iteratorError = err;
          } finally {
            try {
              if (!_iteratorNormalCompletion && _iterator.return) {
                _iterator.return();
              }
            } finally {
              if (_didIteratorError) {
                throw _iteratorError;
              }
            }
          }

          return temp;
        });
      }
    }
    setFirstLoad(false);
  }, [filter]);

  useEffect(function () {
    if (window && window.innerWidth <= 1991) {
      setMobileView(true);
    }
    // get access token
    var cventAccessToken = js_cookie.get('cvent_access_token');
    if (cventAccessToken && cventAccessToken !== 'undefined') {
      setAccessToken(cventAccessToken);
    } else {
      /*const encodedData = window.btoa(clientId + ':' + clientSecret)
      //const url = `${corsProxy}https://api-platform.cvent.com/ea/oauth2/token`
      const url = `https://api-platform.cvent.com/ea/oauth2/token`
      fetch(url, {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          Authorization: `Basic ${encodedData}`
        },
        method: 'POST',
        body: `grant_type=client_credentials&client_id=${clientId}`
      })
        .then((response) => response.json())
        .then((json) => {
          const inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000)
          Cookies.set('cvent_access_token', json.access_token, { expires: inOneHour })
          setAccessToken(json.access_token)
        })
        .catch((e) => console.log(e))*/
      // hello
      var url = 'https://beam.mjhlifesciences.com/api/cvent/token';
      fetch(url, {
        headers: {
          'Content-Type': 'application/json',
          Accept: 'application/json'
        },
        method: 'post',
        credentials: 'include',
        body: _JSON$stringify({
          clientId: clientId,
          clientSecret: clientSecret
        })
      }).then(function (response) {
        return response.json();
      }).then(function (json) {
        var inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000);
        js_cookie.set('cvent_access_token', json.access_token, { expires: inOneHour });
        setAccessToken(json.access_token);
      }).catch(function (e) {
        return console.log(e);
      });
    }
  }, []);

  var renderRegisterButton = function renderRegisterButton(links) {
    return React__default.createElement(
      'a',
      { rel: 'noopener', href: links.summary.href || '#', target: '_blank' },
      React__default.createElement(
        Button,
        { size: 'sm', className: 'registration-button', style: { borderRadius: '8px' } },
        cta
      )
    );
  };
  var renderLearnMoreButton = function renderLearnMoreButton(links) {
    return React__default.createElement(
      'a',
      { rel: 'noopener', href: links.summary.href || '#', target: '_blank' },
      React__default.createElement(
        Button,
        { size: 'sm', className: 'registration-button', style: { borderRadius: '8px' } },
        'Learn More'
      )
    );
  };

  var handleFilterSelected = function handleFilterSelected(evt) {
    evt.preventDefault();
    evt.stopPropagation();
    evt.persist();
    setDeckAdvancedFilters(function (prevState) {
      console.dir(prevState);
      return _extends({}, prevState, _defineProperty({}, evt.target.dataset['filtername'], {
        value: evt.target.value,
        selected: evt.target.value.length > 0 ? true : false,
        param: prevState[evt.target.dataset['filtername']].param
      }));
    });
  };

  var grabAdvancedFilters = function grabAdvancedFilters() {
    console.log('grabAdvancedFilters');
    if (data.length <= 0) {
      return;
    }

    var valuesArray = _Object$entries(deckAdvancedFilters).map(function (_ref6, index) {
      var _ref7 = _slicedToArray(_ref6, 2),
          key = _ref7[0],
          value = _ref7[1];

      var temp = [];
      for (var evt in data) {
        for (var field in data[evt].customFields) {
          if (data[evt].customFields[field].name === key) {
            if (!temp.includes(data[evt].customFields[field].value[0])) {
              temp[evt] = data[evt].customFields[field].value[0];
              break;
            }
          }
        }
      }
      return temp;
    });
    if (valuesArray.length > 0 && advancedFiltersArray.length <= 0) {
      setAdvancedFiltersArray(valuesArray);
    }
    var _iteratorNormalCompletion2 = true;
    var _didIteratorError2 = false;
    var _iteratorError2 = undefined;

    try {
      for (var _iterator2 = _getIterator(valuesArray), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
        var _filter = _step2.value;

        _filter.sort();
      }
    } catch (err) {
      _didIteratorError2 = true;
      _iteratorError2 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion2 && _iterator2.return) {
          _iterator2.return();
        }
      } finally {
        if (_didIteratorError2) {
          throw _iteratorError2;
        }
      }
    }

    return valuesArray.length > 0 ? React__default.createElement(
      React__default.Fragment,
      null,
      React__default.createElement(
        'h5',
        { className: 'filterTitle' },
        'Filters:'
      ),
      React__default.createElement(
        Form,
        null,
        _Object$entries(deckAdvancedFilters).map(function (_ref8, index) {
          var _ref9 = _slicedToArray(_ref8, 2),
              key = _ref9[0],
              value = _ref9[1];

          return React__default.createElement(
            Form.Group,
            null,
            React__default.createElement(
              Form.Label,
              null,
              key
            ),
            React__default.createElement(
              Form.Control,
              { as: 'select', 'data-filterName': key, onChange: function onChange(evt) {
                  return handleFilterSelected(evt);
                } },
              React__default.createElement(
                React__default.Fragment,
                null,
                React__default.createElement(
                  'option',
                  null,
                  ' '
                ),
                valuesArray[index].map(function (text, index) {
                  if (value.value.toLowerCase() === text.toLowerCase()) {
                    return React__default.createElement(
                      'option',
                      { selected: true },
                      text
                    );
                  }
                  return React__default.createElement(
                    'option',
                    null,
                    text
                  );
                })
              )
            )
          );
        })
      ),
      React__default.createElement(
        'style',
        { jsx: true },
        '\n          .filterTitle {\n            font-weight: 400;\n          }\n        '
      )
    ) : null;
  };

  try {
    useEffect(function () {
      grabFilteredData();
    }, [_JSON$stringify(deckAdvancedFilters)]);
  } catch (e) {}

  var grabFilteredData = function grabFilteredData() {
    var tempData = [];
    var filtersSelected = 0;
    if (!advancedFilters) {
      tempData = data;
    } else {
      if (_Object$entries(deckAdvancedFilters).length > 0) {
        var _iteratorNormalCompletion3 = true;
        var _didIteratorError3 = false;
        var _iteratorError3 = undefined;

        try {
          for (var _iterator3 = _getIterator(_Object$entries(deckAdvancedFilters)), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
            var _ref10 = _step3.value;

            var _ref11 = _slicedToArray(_ref10, 2);

            var key = _ref11[0];
            var value = _ref11[1];

            if (value !== '' && value !== undefined) {
              filtersSelected++;
            }
          }
        } catch (err) {
          _didIteratorError3 = true;
          _iteratorError3 = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion3 && _iterator3.return) {
              _iterator3.return();
            }
          } finally {
            if (_didIteratorError3) {
              throw _iteratorError3;
            }
          }
        }
      }

      if (filtersSelected > 0) {
        for (var i in data) {
          var filterEvent = [];
          for (var field in data[i].customFields) {
            var _iteratorNormalCompletion4 = true;
            var _didIteratorError4 = false;
            var _iteratorError4 = undefined;

            try {
              for (var _iterator4 = _getIterator(_Object$entries(deckAdvancedFilters)), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
                var _ref12 = _step4.value;

                var _ref13 = _slicedToArray(_ref12, 2);

                var _key = _ref13[0];
                var _value = _ref13[1];

                if (_value.selected) {
                  if (data[i].customFields[field].name === _key && data[i].customFields[field].value[0] === _value.value && !tempData.includes(data[i].id)) {
                    filterEvent.push(true);
                  } else if (data[i].customFields[field].name === _key && data[i].customFields[field].value[0] !== _value.value) {
                    filterEvent.push(false);
                  }
                }
              }
            } catch (err) {
              _didIteratorError4 = true;
              _iteratorError4 = err;
            } finally {
              try {
                if (!_iteratorNormalCompletion4 && _iterator4.return) {
                  _iterator4.return();
                }
              } finally {
                if (_didIteratorError4) {
                  throw _iteratorError4;
                }
              }
            }

            if (field >= data[i].customFields.length - 1 && !filterEvent.includes(false)) {
              tempData.push(data[i]);
            }
          }
        }
        var newPath = '?event=' + (filter.indexOf('start') >= 0 ? 'upcoming' : 'past');
        var _iteratorNormalCompletion5 = true;
        var _didIteratorError5 = false;
        var _iteratorError5 = undefined;

        try {
          for (var _iterator5 = _getIterator(_Object$entries(deckAdvancedFilters)), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
            var _ref14 = _step5.value;

            var _ref15 = _slicedToArray(_ref14, 2);

            var _key2 = _ref15[0];
            var _value2 = _ref15[1];

            if (_value2.value.length > 0) {
              console.log(_value2);
              newPath += '&' + _value2.param + '=' + _value2.value.replace(/ /g, '_');
            }
          }
        } catch (err) {
          _didIteratorError5 = true;
          _iteratorError5 = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion5 && _iterator5.return) {
              _iterator5.return();
            }
          } finally {
            if (_didIteratorError5) {
              throw _iteratorError5;
            }
          }
        }

        if (router.asPath.split(router.pathname)[1] !== newPath) {
          router.push(router.pathname, newPath, {
            shallow: true
          });
        }
      } else {
        tempData = data;
      }
    }

    setEventCards(cardLoader(tempData));
  };

  useEffect(function () {
    if (!advancedFilters) {
      setEventCards(cardLoader(data));
    } else {
      grabFilteredData();
    }
  }, [_JSON$stringify(data)]);

  var cardLoader = function cardLoader(localData) {
    var numberOfItemsBeforeAd = 5;
    var filteredData = localData;

    if (filteredData.length <= 0) {
      return React__default.createElement(
        'div',
        null,
        React__default.createElement(
          'div',
          null,
          'No events found '
        )
      );
    }

    return React__default.createElement(
      Container,
      { style: { padding: 1 } },
      filteredData && filteredData.map(function (row, index) {
        var speakerInfo = [];
        if (row.customFields) {
          speakerInfo = row.customFields.filter(function (x) {
            if (x.name == 'KOL or Featured Speaker') {
              return x;
            }
          });
        }
        var isHardcoded = row.hardCoded;
        var start = row.start,
            end = row.end,
            venues = row.venues,
            _links = row._links,
            timezone = row.timezone,
            _row$showEndDate = row.showEndDate,
            showEndDate = _row$showEndDate === undefined ? true : _row$showEndDate;

        var now = momentTimezone().tz(timezone);
        var isRegister = momentTimezone(now).isBefore(end);
        var discussionTopic = row.customFields ? row.customFields.reduce(function (result, item) {
          if (item.name === 'Discussion Topic' && item.value) {
            result = item.value[0];
            return result;
          }
          return result;
        }, '') : row.title;
        var eventRegion = row.customFields ? row.customFields.reduce(function (result, item) {
          if (item.name === 'Event Region' && item.value) {
            result = item.value[0];
            return result;
          }
          return result;
        }, '') : '';
        var startDay = momentTimezone(start).tz(timezone).format();
        var endDay = momentTimezone(end).tz(timezone).format();
        var showEndTime = momentTimezone(startDay.split('T')[0]).isBefore(endDay.split('T')[0]) ? ' to ' + momentTimezone(end).tz(timezone).format('LLL zz') : null;
        var isCompleted = row.status === 'Completed';
        return React__default.createElement(
          React__default.Fragment,
          { key: index },
          React__default.createElement(
            Card,
            null,
            isHardcoded ? _links && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                renderLearnMoreButton(_links)
              )
            ) : isRegister && _links && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                renderRegisterButton(_links)
              )
            ),
            isCompleted && _links && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                renderLearnMoreButton(_links)
              )
            ),
            discussionTopic && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                React__default.createElement('h5', { className: 'topic', style: { fontWeight: '500', marginBottom: 0 }, dangerouslySetInnerHTML: { __html: discussionTopic } })
              )
            ),
            start && timezone && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                start.indexOf('TBD') >= 0 ? React__default.createElement(
                  'p',
                  { className: 'start-time', style: { padding: 0, margin: 0 } },
                  start
                ) : React__default.createElement(
                  'p',
                  { className: 'start-time', style: { padding: 0, margin: 0 } },
                  start.indexOf('T') >= 0 ? momentTimezone(start).tz(timezone).format('LLL zz') : momentTimezone(start).format('LL'),
                  showEndDate && showEndTime
                )
              )
            ),
            eventRegion && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                React__default.createElement(
                  'p',
                  { className: 'event-region', style: { padding: 0, margin: 0 } },
                  eventRegion
                )
              )
            ),
            venues && venues.length && venues[0].name && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                React__default.createElement(
                  'p',
                  { className: 'venue', style: { padding: 0, margin: 0 } },
                  venues[0].name
                )
              )
            ),
            speakerInfo && speakerInfo.length > 0 && React__default.createElement(
              Row,
              null,
              React__default.createElement(
                Col,
                null,
                React__default.createElement(
                  'div',
                  { className: 'speaker-section', style: { border: '1px solid', borderRadius: '8px', padding: '8px' } },
                  speakerInfo.map(function (info, index) {
                    return React__default.createElement(
                      'p',
                      { key: index, style: { marginBottom: '0' } },
                      info.value.map(function (speaker, index) {
                        return React__default.createElement(
                          'b',
                          { key: index, className: 'kol-speaker' },
                          speaker,
                          info.value.length > index + 1 ? ', ' : ''
                        );
                      })
                    );
                  })
                )
              )
            )
          ),
          mobileView && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
            'div',
            { style: { margin: '0 auto' } },
            renderMobileAd(index, numberOfItemsBeforeAd)
          )
        );
      }),
      React__default.createElement(
        'style',
        { jsx: 'true' },
        '\n          .card {\n            -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);\n            box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);\n            border-radius: 8px;\n            padding: 12px;\n          }\n          .row {\n            margin-bottom: 8px;\n          }\n        '
      )
    );
  };

  var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd) {
    var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
    return React__default.createElement(
      Col,
      { md: 12, style: { display: 'flex', flex: '1 0 auto' } },
      rightItems[i].component
    );
  };

  if (isLoading) {
    return React__default.createElement(
      'div',
      { style: { display: 'flex', justifyContent: 'center', marginTop: '48px' } },
      React__default.createElement(
        Spinner,
        { animation: 'border', role: 'status' },
        React__default.createElement(
          'span',
          { className: 'sr-only' },
          'Loading...'
        )
      )
    );
  }

  if (data.length > 0) {
    return React__default.createElement(
      React__default.Fragment,
      null,
      data && advancedFilters && React__default.createElement(
        'div',
        { className: 'advancedFilters ' + (showFilters ? 'show' : 'hide') },
        grabAdvancedFilters()
      ),
      React__default.createElement(
        'div',
        { className: 'cvent-events' },
        React__default.createElement(
          InfiniteScroll,
          { dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
          eventCards
        )
      ),
      React__default.createElement(
        'style',
        { jsx: true },
        '\n          .advancedFilters {\n            overflow: hidden;\n            border-radius: 5px;\n            padding: 1rem;\n            margin-bottom: 1rem;\n            box-shadow: #00000075 0 0 5px 2px;\n          }\n          .form-label {\n            margin-bottom: 0;\n          }\n          .hide {\n            opacity: 0;\n            height: 0;\n            display: none;\n          }\n          .show {\n            opacity: 1;\n            min-height: 50px;\n            height: auto;\n            display: block;\n          }\n        '
      )
    );
  } else {
    return React__default.createElement(
      'div',
      null,
      React__default.createElement(
        'div',
        null,
        'No events found '
      )
    );
  }
};

export default EventsDeck;
