text: "use strict";
  
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
  
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  
  function fixedAgenda() {
    var agenda = document.querySelector('#agenda');
    var header = document.querySelector('#header');
    var agendaHeight = agenda.getBoundingClientRect().height;
    var daysHeight = agenda.querySelector('.agenda__days').getBoundingClientRect().height;
    var theHeight = (agendaHeight - daysHeight) * -1;
  
    window.onscroll = function () {
      var agendaScroll = agenda.getBoundingClientRect().top;
  
      if (window.innerWidth < 750) {
        if (agendaScroll <= 80) {
          agenda.classList.add('fixed');
          header.classList.add('slide-up');
          fixDays();
        } else if (agendaScroll >= 80) {
          agenda.classList.remove('fixed');
          header.classList.remove('slide-up');
        }
      }
  
      if (agendaScroll <= -1) {
        agenda.classList.add('fixed');
        agenda.classList.remove('bottom');
        fixDays();
      } else {
        agenda.classList.remove('fixed');
        removeActive();
      }
  
      if (agendaScroll <= theHeight) {
        agenda.classList.add('bottom');
        agenda.classList.remove('fixed');
        removeActive();
      }
    };
  }
  
  function removeActive() {
    var agenda = document.querySelector('#agenda');
    var actives = agenda.querySelectorAll('.active');
  
    if (actives.length > 0) {
      actives.forEach(function (item) {
        item.classList.remove('active');
      });
    }
  }
  
  function fixDays() {
    var dayWrappers = document.querySelectorAll('.agenda__day-wrapper');
    var agendaDays = document.querySelectorAll('.agenda-day');
    var sweetSpot = document.querySelector('.agenda__header').getBoundingClientRect().height + document.querySelector('.agenda__events-header').getBoundingClientRect().height;
    dayWrappers.forEach(function (wrapper, i) {
      var top = wrapper.getBoundingClientRect().top;
      var bottom = wrapper.getBoundingClientRect().bottom;
      var wrapperDay = wrapper.getAttribute('data-day');
  
      if (top <= sweetSpot && bottom >= sweetSpot) {
        wrapper.classList.remove('bottom');
        wrapper.classList.add('active');
        agendaDays.forEach(function (day) {
          var theDay = day.getAttribute('data-day');
  
          if (wrapperDay == theDay) {
            day.classList.add('active');
          }
        });
      } else if (wrapper.classList.contains('active')) {
        wrapper.classList.remove('active');
        wrapper.classList.add('bottom');
        agendaDays.forEach(function (day) {
          var theDay = day.getAttribute('data-day');
  
          if (wrapperDay == theDay) {
            day.classList.remove('active');
          }
        });
      }
    });
  }
  
  function scrollAgenda() {
    var agendaDays = document.querySelectorAll('.agenda-day');
    var agenda = document.querySelector('#agenda');
    var dayWrappers = document.querySelectorAll('.agenda__day-wrapper');
    agendaDays.forEach(function (day, i) {
      day.addEventListener('click', function () {
        var theDay = day.getAttribute('data-day');
  
        function scrollAgenda(_x) {
          return _scrollAgenda.apply(this, arguments);
        }
  
        function _scrollAgenda() {
          _scrollAgenda = _asyncToGenerator(
          /*#__PURE__*/
          regeneratorRuntime.mark(function _callee(theDay) {
            return regeneratorRuntime.wrap(function _callee$(_context) {
              while (1) {
                switch (_context.prev = _context.next) {
                  case 0:
                    if (!agenda.classList.contains('fixed')) {
                      window.scroll({
                        behavior: 'smooth',
                        top: agenda.offsetTop
                      });
                    }
  
                  case 1:
                  case "end":
                    return _context.stop();
                }
              }
            }, _callee, this);
          }));
          return _scrollAgenda.apply(this, arguments);
        }
  
        scrollAgenda(theDay).then(function () {
          dayWrappers.forEach(function (wrapper) {
            var wrapperDay = wrapper.getAttribute('data-day');
  
            if (wrapperDay == theDay) {
              if (window.innerWidth < 750) {
                var mobileSweetSpot = document.querySelector('.agenda__events-header').getBoundingClientRect().height;
                window.scroll({
                  behavior: 'smooth',
                  top: wrapper.offsetTop + mobileSweetSpot
                });
              } else {
                var sweetSpot = document.querySelector('.agenda__header').getBoundingClientRect().height;
                window.scroll({
                  behavior: 'smooth',
                  top: wrapper.offsetTop - sweetSpot
                });
              }
            }
          });
        });
      });
    });
  }
  
  function showFilters() {
    var agendaHeader = document.querySelector('.agenda__header-search');
    var filterIcons = agendaHeader.querySelectorAll('.show-filters');
    var filterContainer = agendaHeader.querySelector('.agenda-filters');
    filterIcons.forEach(function (filter) {
      filter.addEventListener('click', function () {
        if (window.innerWidth < 750) {
          filterContainer.classList.toggle('slide');
        } else {
          filterContainer.classList.toggle('show');
        }
      });
    });
  }
  
  function filters() {
    var days = document.querySelectorAll('.agenda__day-wrapper');
    var inputs = document.querySelectorAll('.agenda-filter input');
    var isoArray = [];
    days.forEach(function (day) {
      var eventsWrapper = day.querySelector('.agenda__events');
      var iso = new Isotope(day, {
        itemSelector: '.event',
        layoutMode: 'vertical',
        stagger: 30
      });
      isoArray.push(iso);
    });
    inputs.forEach(function (input) {
      input.addEventListener('change', function () {
        var filters = [];
        var theFilters;
        inputs.forEach(function (checkbox) {
          if (checkbox.checked) {
            filters.push(checkbox.value);
          }
  
          theFilters = filters.join(', ');
        });
        isoArray.forEach(function (iso) {
          console.log(iso);
          iso.arrange({
            filter: theFilters
          });
        });
      });
    });
  }
  
  fixedAgenda();
  scrollAgenda();
  showFilters();
  filters();
  //# sourceMappingURL=agenda.min.js.map
  