exports.ids = [41];
exports.modules = {

/***/ 109:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Announcement.vue?vue&type=template&id=684cacca&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nuxt-link',{attrs:{"to":("/announcement/" + (_vm.announcement.id))}},[_c('v-alert',{staticClass:"mb-1",attrs:{"border":"left","type":"info","color":"primary","show-icon":""}},[_vm._v(_vm._s(_vm.announcement.title))])],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./components/Announcement.vue?vue&type=template&id=684cacca&lang=pug&

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(3);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./components/Announcement.vue?vue&type=script&lang=js&
//
//
//
//
//

/* harmony default export */ var Announcementvue_type_script_lang_js_ = ({
  props: {
    announcement: {
      type: Object,
      default: () => ({})
    }
  },
  computed: Object(external_vuex_["mapState"])(['announcements'])
});
// CONCATENATED MODULE: ./components/Announcement.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_Announcementvue_type_script_lang_js_ = (Announcementvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./components/Announcement.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Announcementvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "999dde52"
  
)

/* harmony default export */ var Announcement = __webpack_exports__["a"] = (component.exports);

/***/ }),

/***/ 110:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Search.vue?vue&type=template&id=207eb407&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',{staticClass:"pt-0 pt-md-2"},[(_vm.recurrentFilter && _vm.settings.allow_recurrent_event)?_c('v-switch',{staticClass:"mt-0",attrs:{"inset":"","color":"primary","hide-details":"","label":_vm.$t('event.show_recurrent')},model:{value:(_vm.showRecurrent),callback:function ($$v) {_vm.showRecurrent=$$v},expression:"showRecurrent"}}):_vm._e(),_c('v-autocomplete',{attrs:{"label":_vm.$t("common.search"),"items":_vm.keywords,"hide-details":"","value":_vm.selectedFilters,"clearable":"","search-input":_vm.search,"item-text":"label","return-object":"","chips":"","single-line":"","multiple":""},on:{"change":_vm.change,"update:searchInput":function($event){_vm.search=$event},"update:search-input":function($event){_vm.search=$event}},scopedSlots:_vm._u([{key:"selection",fn:function(data){return [_c('v-chip',_vm._b({attrs:{"close":"","input-value":data.selected},on:{"click:close":function($event){return _vm.remove(data.item)}}},'v-chip',data.attrs,false),[_c('v-avatar',{attrs:{"left":""}},[_c('v-icon',[_vm._v(_vm._s(data.item.type === 'place' ? 'mdi-map-marker' : 'mdi-tag'))])],1),_c('span',[_vm._v(_vm._s(data.item.label))])],1)]}},{key:"item",fn:function(ref){
var item = ref.item;
return [_c('v-list-item-avatar',[_c('v-icon',[_vm._v(_vm._s(item.type === 'place' ? 'mdi-map-marker' : 'mdi-tag'))])],1),_c('v-list-item-content',[_c('v-list-item-title',{domProps:{"textContent":_vm._s(item.label)}})],1)]}}])})],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./components/Search.vue?vue&type=template&id=207eb407&lang=pug&

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(3);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./components/Search.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ var Searchvue_type_script_lang_js_ = ({
  name: 'Search',
  props: {
    recurrentFilter: {
      type: Boolean,
      default: true
    },
    filters: {
      type: Object,
      default: () => {}
    }
  },

  data() {
    return {
      tmpfilter: null,
      search: ''
    };
  },

  computed: { ...Object(external_vuex_["mapState"])(['tags', 'places', 'settings']),
    showRecurrent: {
      get() {
        return this.filters.show_recurrent;
      },

      set(v) {
        const filters = {
          tags: this.filters.tags,
          places: this.filters.places,
          show_recurrent: v
        };
        this.$emit('update', filters);
      }

    },

    selectedFilters() {
      const tags = this.tags.filter(t => this.filters.tags.includes(t.tag)).map(t => ({
        type: 'tag',
        label: t.tag,
        weigth: t.weigth,
        id: t.tag
      }));
      const places = this.places.filter(p => this.filters.places.includes(p.id)).map(p => ({
        type: 'place',
        label: p.name,
        weigth: p.weigth,
        id: p.id
      }));
      const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth);
      return keywords;
    },

    keywords() {
      const tags = this.tags.map(t => ({
        type: 'tag',
        label: t.tag,
        weigth: t.weigth,
        id: t.tag
      }));
      const places = this.places.map(p => ({
        type: 'place',
        label: p.name,
        weigth: p.weigth,
        id: p.id
      }));
      const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth);
      return keywords;
    }

  },
  methods: {
    remove(item) {
      const filters = {
        tags: item.type === 'tag' ? this.filters.tags.filter(f => f !== item.id) : this.filters.tags,
        places: item.type === 'place' ? this.filters.places.filter(f => f !== item.id) : this.filters.places,
        show_recurrent: this.filters.show_recurrent
      };
      this.$emit('update', filters);
    },

    change(filters) {
      filters = {
        tags: filters.filter(t => t.type === 'tag').map(t => t.id),
        places: filters.filter(p => p.type === 'place').map(p => p.id),
        show_recurrent: this.filters.show_recurrent
      };
      this.$emit('update', filters);
    }

  }
});
// CONCATENATED MODULE: ./components/Search.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_Searchvue_type_script_lang_js_ = (Searchvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./components/Search.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Searchvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "9ac26a90"
  
)

/* harmony default export */ var Search = __webpack_exports__["a"] = (component.exports);

/***/ }),

/***/ 115:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(133);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(6).default
module.exports.__inject__ = function (context) {
  add("49cd375e", content, true, context)
};

/***/ }),

/***/ 132:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Calendar_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(115);
/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Calendar_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Calendar_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Calendar_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_cache_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_style_loader_index_js_ref_3_oneOf_1_1_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_2_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_3_oneOf_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Calendar_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 133:
/***/ (function(module, exports, __webpack_require__) {

// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(5);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".vc-opacity-0{opacity:.3!important}.past-event{opacity:.3}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;


/***/ }),

/***/ 135:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue?vue&type=template&id=513fa3ce&lang=pug&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-container',{attrs:{"id":"home","fluid":""}},[(_vm.announcements.length)?_c('div',{staticClass:"mx-1 mt-1",attrs:{"id":"announcements"}},_vm._l((_vm.announcements),function(announcement){return _c('Announcement',{key:("a_" + (announcement.id)),attrs:{"announcement":announcement}})}),1):_vm._e(),_c('v-row',{staticClass:"pt-0 pt-sm-2 pl-0 pl-sm-2"},[_c('div',{staticClass:"col-xl-5 col-lg-5 col-md-7 col-sm-12 col-xs-12 pa-4 pa-sm-3"},[_c('client-only',{attrs:{"placeholder":"Calendar unavailable without js"}},[_c('Calendar',{attrs:{"events":_vm.filteredEvents},on:{"dayclick":_vm.dayChange,"monthchange":_vm.monthChange}})],1)],1),_c('div',{staticClass:"col pt-0 pt-md-2"},[_c('Search',{attrs:{"filters":_vm.filters},on:{"update":_vm.updateFilters}}),(_vm.selectedDay)?_c('v-chip',{attrs:{"close":""},on:{"click:close":function($event){return _vm.dayChange({ date: _vm.selectedDay})}}},[_vm._v(_vm._s(_vm.selectedDay))]):_vm._e()],1)]),_c('div',{staticClass:"mb-2 mt-1 pl-1 pl-sm-2",attrs:{"id":"events"}},_vm._l((_vm.visibleEvents),function(event,idx){return _c('Event',{key:event.id,attrs:{"event":event},on:{"destroy":_vm.destroy,"tagclick":_vm.tagClick,"placeclick":_vm.placeClick}})}),1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./pages/index.vue?vue&type=template&id=513fa3ce&lang=pug&

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(3);

// EXTERNAL MODULE: external "lodash/intersection"
var intersection_ = __webpack_require__(67);
var intersection_default = /*#__PURE__*/__webpack_require__.n(intersection_);

// EXTERNAL MODULE: external "dayjs"
var external_dayjs_ = __webpack_require__(2);
var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Event.vue?vue&type=template&id=264145ab&lang=pug&
var Eventvue_type_template_id_264145ab_lang_pug_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-card',{staticClass:"h-event event d-flex",attrs:{"itemscope":"","itemtype":"https://schema.org/Event"}},[_c('nuxt-link',{attrs:{"to":("/event/" + (_vm.event.slug || _vm.event.id)),"itemprop":"url"}},[_c('img',{staticClass:"img u-featured",style:({ 'object-position': _vm.thumbnailPosition }),attrs:{"src":_vm.thumbnail,"alt":_vm.alt,"loading":"lazy","itemprop":"image"}}),(_vm.event.parentId)?_c('v-icon',{staticClass:"float-right mr-1",attrs:{"color":"success"}},[_vm._v("mdi-repeat")]):_vm._e(),_c('div',{staticClass:"title p-name",attrs:{"itemprop":"name"}},[_vm._v(_vm._s(_vm.event.title))])],1),_c('v-card-text',{staticClass:"body pt-0 pb-0"},[_c('time',{staticClass:"dt-start subtitle-1",attrs:{"datetime":_vm._f("unixFormat")(_vm.event.start_datetime,"YYYY-MM-DD HH:mm"),"itemprop":"startDate","content":_vm._f("unixFormat")(_vm.event.start_datetime,'YYYY-MM-DDTHH:mm')}},[_c('v-icon',[_vm._v("mdi-calendar")]),_vm._v(" "+_vm._s(_vm._f("when")(_vm.event)))],1),_c('div',{staticClass:"d-none dt-end",attrs:{"itemprop":"endDate","content":_vm._f("unixFormat")(_vm.event.end_datetime,'YYYY-MM-DDTHH:mm')}},[_vm._v(_vm._s(_vm._f("unixFormat")(_vm.event.end_datetime,'YYYY-MM-DD HH:mm')))]),_c('a',{staticClass:"place d-block p-location pl-0",attrs:{"text":"","color":"primary","itemprop":"location","content":_vm.event.place.name},on:{"click":function($event){return _vm.$emit('placeclick', _vm.event.place.id)}}},[_c('v-icon',[_vm._v("mdi-map-marker")]),_vm._v(" "+_vm._s(_vm.event.place.name))],1)]),_c('v-card-actions',{staticClass:"pt-0 actions justify-space-between"},[_c('div',{staticClass:"tags"},_vm._l((_vm.event.tags.slice(0,6)),function(tag){return _c('v-chip',{key:tag,staticClass:"ml-1 mt-1",attrs:{"small":"","outlined":"","color":"primary"},on:{"click":function($event){return _vm.$emit('tagclick', tag)}}},[_vm._v(_vm._s(tag))])}),1),_c('v-menu',{attrs:{"offset-y":""},scopedSlots:_vm._u([{key:"activator",fn:function(ref){
var on = ref.on;
return [_c('v-btn',_vm._g({staticClass:"align-self-end",attrs:{"icon":"","color":"primary","alt":"more"}},on),[_c('v-icon',[_vm._v("mdi-dots-vertical")])],1)]}}])},[_c('v-list',{attrs:{"dense":""}},[_c('v-list-item-group',[_c('v-list-item',{on:{"click":function($event){return _vm.clipboard(((_vm.settings.baseurl) + "/event/" + (_vm.event.slug || _vm.event.id)))}}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v("mdi-content-copy")])],1),_c('v-list-item-content',[_c('v-list-item-title',[_vm._v(_vm._s(_vm.$t('common.copy_link')))])],1)],1),_c('v-list-item',{attrs:{"href":("/api/event/" + (_vm.event.slug || _vm.event.id) + ".ics")}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v("mdi-calendar-export")])],1),_c('v-list-item-content',[_c('v-list-item-title',[_vm._v(_vm._s(_vm.$t('common.add_to_calendar')))])],1)],1),(_vm.is_mine)?_c('v-list-item',{attrs:{"to":("/add/" + (_vm.event.id))}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v("mdi-pencil")])],1),_c('v-list-item-content',[_c('v-list-item-title',[_vm._v(_vm._s(_vm.$t('common.edit')))])],1)],1):_vm._e(),(_vm.is_mine)?_c('v-list-item',{on:{"click":function($event){return _vm.remove(false)}}},[_c('v-list-item-icon',[_c('v-icon',{attrs:{"color":"error"}},[_vm._v("mdi-delete-forever")])],1),_c('v-list-item-content',[_c('v-list-item-title',[_vm._v(_vm._s(_vm.$t('common.remove')))])],1)],1):_vm._e()],1)],1)],1)],1)],1)}
var Eventvue_type_template_id_264145ab_lang_pug_staticRenderFns = []


// CONCATENATED MODULE: ./components/Event.vue?vue&type=template&id=264145ab&lang=pug&

// EXTERNAL MODULE: ./assets/clipboard.js
var clipboard = __webpack_require__(14);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./components/Event.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//


/* harmony default export */ var Eventvue_type_script_lang_js_ = ({
  props: {
    event: {
      type: Object,
      default: () => ({})
    }
  },
  mixins: [clipboard["a" /* default */]],
  computed: { ...Object(external_vuex_["mapState"])(['settings']),

    thumbnail() {
      let path;

      if (this.event.media && this.event.media.length) {
        path = '/media/thumb/' + this.event.media[0].url;
      } else {
        path = '/noimg.svg';
      }

      return path;
    },

    alt() {
      return this.event.media && this.event.media.length ? this.event.media[0].name : '';
    },

    thumbnailPosition() {
      if (this.event.media && this.event.media.length && this.event.media[0].focalpoint) {
        const focalpoint = this.event.media[0].focalpoint;
        return `${(focalpoint[0] + 1) * 50}% ${(focalpoint[1] + 1) * 50}%`;
      }

      return 'center center';
    },

    is_mine() {
      if (!this.$auth.user) {
        return false;
      }

      return this.event.userId === this.$auth.user.id || this.$auth.user.is_admin;
    }

  },
  methods: {
    async remove() {
      const ret = await this.$root.$confirm('event.remove_confirmation');

      if (!ret) {
        return;
      }

      await this.$axios.delete(`/event/${this.event.id}`);
      this.$emit('destroy', this.event.id);
    }

  }
});
// CONCATENATED MODULE: ./components/Event.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_Eventvue_type_script_lang_js_ = (Eventvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./components/Event.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Eventvue_type_script_lang_js_,
  Eventvue_type_template_id_264145ab_lang_pug_render,
  Eventvue_type_template_id_264145ab_lang_pug_staticRenderFns,
  false,
  null,
  null,
  "b4525a8c"
  
)

/* harmony default export */ var Event = (component.exports);
// EXTERNAL MODULE: ./components/Announcement.vue + 4 modules
var Announcement = __webpack_require__(109);

// EXTERNAL MODULE: ./components/Search.vue + 4 modules
var Search = __webpack_require__(110);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Calendar.vue?vue&type=template&id=1b702379&lang=pug&
var Calendarvue_type_template_id_1b702379_lang_pug_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"calendar"}},[_c('vc-calendar',{attrs:{"title-position":"left","is-dark":_vm.settings['theme.is_dark'],"columns":_vm.$screens({ sm: 2 }, 1),"locale":_vm.$i18n.locale,"attributes":_vm.attributes,"transition":"fade","aria-label":"Calendar","is-expanded":"","is-inline":""},on:{"update:from-page":_vm.updatePage,"dayclick":_vm.click}})],1)}
var Calendarvue_type_template_id_1b702379_lang_pug_staticRenderFns = []


// CONCATENATED MODULE: ./components/Calendar.vue?vue&type=template&id=1b702379&lang=pug&

// EXTERNAL MODULE: ./assets/helper.js
var helper = __webpack_require__(98);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./components/Calendar.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ var Calendarvue_type_script_lang_js_ = ({
  name: 'Calendar',
  props: {
    events: {
      type: Array,
      default: () => []
    }
  },

  data() {
    const month = external_dayjs_default()().month() + 1;
    const year = external_dayjs_default()().year();
    return {
      page: {
        month,
        year
      }
    };
  },

  computed: { ...Object(external_vuex_["mapState"])(['tags', 'filters', 'in_past', 'settings']),

    attributes() {
      return Object(helper["a" /* attributesFromEvents */])(this.events, this.tags);
    }

  },
  methods: { ...Object(external_vuex_["mapActions"])(['updateEvents', 'showPastEvents']),

    updatePage(page) {
      return new Promise((resolve, reject) => {
        this.$emit('monthchange', page);
      });
    },

    click(day) {
      this.$emit('dayclick', day);
    }

  }
});
// CONCATENATED MODULE: ./components/Calendar.vue?vue&type=script&lang=js&
 /* harmony default export */ var components_Calendarvue_type_script_lang_js_ = (Calendarvue_type_script_lang_js_); 
// CONCATENATED MODULE: ./components/Calendar.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(132)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var Calendar_component = Object(componentNormalizer["a" /* default */])(
  components_Calendarvue_type_script_lang_js_,
  Calendarvue_type_template_id_1b702379_lang_pug_render,
  Calendarvue_type_template_id_1b702379_lang_pug_staticRenderFns,
  false,
  injectStyles,
  null,
  "ae4a3164"
  
)

/* harmony default export */ var Calendar = (Calendar_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//







/* harmony default export */ var lib_vue_loader_options_pagesvue_type_script_lang_js_ = ({
  name: 'Index',
  components: {
    Event: Event,
    Search: Search["a" /* default */],
    Announcement: Announcement["a" /* default */],
    Calendar: Calendar
  },
  middleware: 'setup',

  async asyncData({
    params,
    $api,
    store
  }) {
    const events = await $api.getEvents({
      start: external_dayjs_default()().startOf('month').unix(),
      end: null,
      show_recurrent: true
    });
    return {
      events
    };
  },

  data({
    $store
  }) {
    return {
      first: true,
      isCurrentMonth: true,
      now: external_dayjs_default()().unix(),
      date: external_dayjs_default()().format('YYYY-MM-DD'),
      events: [],
      start: external_dayjs_default()().startOf('month').unix(),
      end: null,
      selectedDay: null
    };
  },

  head() {
    return {
      title: this.settings.title,
      meta: [// hid is used as unique identifier. Do not use `vmid` for it as it will not work
      {
        hid: 'description',
        name: 'description',
        content: this.settings.description
      }, {
        hid: 'og-description',
        name: 'og:description',
        content: this.settings.description
      }, {
        hid: 'og-title',
        property: 'og:title',
        content: this.settings.title
      }, {
        hid: 'og-url',
        property: 'og:url',
        content: this.settings.baseurl
      }, {
        property: 'og:image',
        content: this.settings.baseurl + '/logo.png'
      }],
      link: [{
        rel: 'alternate',
        type: 'application/rss+xml',
        title: this.settings.title,
        href: this.settings.baseurl + '/feed/rss'
      }]
    };
  },

  computed: { ...Object(external_vuex_["mapState"])(['settings', 'announcements', 'filters']),

    filteredEvents() {
      let events = this.events;

      if (!this.filters.places.length && !this.filters.tags.length) {
        if (this.filters.show_recurrent) {
          return this.events;
        }

        events = events.filter(e => !e.parentId);
      }

      return events.filter(e => {
        // check tags intersection
        if (this.filters.tags.length) {
          const ret = intersection_default()(this.filters.tags, e.tags);

          if (!ret.length) {
            return false;
          }
        } // check if place is in filtered places


        if (this.filters.places.length && !this.filters.places.includes(e.place.id)) {
          return false;
        }

        return true;
      });
    },

    visibleEvents() {
      const now = external_dayjs_default()().unix();

      if (this.selectedDay) {
        const min = external_dayjs_default()(this.selectedDay).startOf('day').unix();
        const max = external_dayjs_default()(this.selectedDay).endOf('day').unix();
        return this.filteredEvents.filter(e => e.start_datetime < max && e.start_datetime > min);
      } else if (this.isCurrentMonth) {
        return this.filteredEvents.filter(e => e.end_datetime ? e.end_datetime > now : e.start_datetime + 2 * 60 * 60 > now);
      } else {
        return this.filteredEvents;
      }
    }

  },
  methods: { // onIntersect (isIntersecting, eventId) {
    // this.intersecting[eventId] = isIntersecting
    // },
    ...Object(external_vuex_["mapActions"])(['setFilters']),

    destroy(id) {
      this.events = this.events.filter(e => e.id !== id);
    },

    updateEvents() {
      this.events = [];
      return this.$api.getEvents({
        start: this.start,
        end: this.end,
        show_recurrent: true
      }).then(events => {
        this.events = events;
        this.$nuxt.$loading.finish();
      });
    },

    placeClick(place_id) {
      if (this.filters.places.includes(place_id)) {
        this.setFilters({ ...this.filters,
          places: this.filters.places.filter(p_id => p_id !== place_id)
        });
      } else {
        this.setFilters({ ...this.filters,
          places: [].concat(this.filters.places, place_id)
        });
      }
    },

    tagClick(tag) {
      if (this.filters.tags.includes(tag)) {
        this.setFilters({ ...this.filters,
          tags: this.filters.tags.filter(t => t !== tag)
        });
      } else {
        this.setFilters({ ...this.filters,
          tags: [].concat(this.filters.tags, tag)
        });
      }
    },

    monthChange({
      year,
      month
    }) {
      // avoid first time monthChange event (onload)
      if (this.first) {
        this.first = false;
        return;
      }

      this.$nuxt.$loading.start(); // unselect current selected day

      this.selectedDay = null; // check if current month is selected

      if (month - 1 === external_dayjs_default()().month() && year === external_dayjs_default()().year()) {
        this.isCurrentMonth = true;
        this.start = external_dayjs_default()().startOf('month').unix();
        this.date = external_dayjs_default()().format('YYYY-MM-DD');
      } else {
        this.isCurrentMonth = false;
        this.date = '';
        this.start = external_dayjs_default()().year(year).month(month - 1).startOf('month').unix(); // .startOf('week').unix()
      } // TODO: check if calendar view is double


      this.end = external_dayjs_default()().year(year).month(month).endOf('month').unix(); // .endOf('week').unix()

      this.updateEvents();
    },

    updateFilters(filters) {
      this.setFilters(filters);
    },

    dayChange(day) {
      const date = external_dayjs_default()(day.date).format('YYYY-MM-DD');

      if (this.selectedDay === date) {
        this.selectedDay = null;
        return;
      }

      this.selectedDay = date;
    }

  }
});
// CONCATENATED MODULE: ./pages/index.vue?vue&type=script&lang=js&
 /* harmony default export */ var pagesvue_type_script_lang_js_ = (lib_vue_loader_options_pagesvue_type_script_lang_js_); 
// CONCATENATED MODULE: ./pages/index.vue





/* normalize component */

var pages_component = Object(componentNormalizer["a" /* default */])(
  pagesvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "4cbf9a44"
  
)

/* harmony default export */ var pages = __webpack_exports__["default"] = (pages_component.exports);

/***/ }),

/***/ 98:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return attributesFromEvents; });
/* harmony import */ var lodash_take__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63);
/* harmony import */ var lodash_take__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_take__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59);
/* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_2__);



function attributesFromEvents(_events, _tags) {
  const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray'];
  const tags = lodash_take__WEBPACK_IMPORTED_MODULE_0___default()(_tags, 10).map(t => t.tag);
  let attributes = [];
  attributes.push({
    key: 'today',
    dates: new Date(),
    bar: {
      color: 'green',
      fillMode: 'outline'
    }
  });
  const now = dayjs__WEBPACK_IMPORTED_MODULE_2___default()().unix();

  function getColor(event, where) {
    const color = {
      class: 'vc-rounded-full',
      color: 'blue',
      fillMode: where === 'base' ? 'light' : 'solid'
    };
    const tag = lodash_get__WEBPACK_IMPORTED_MODULE_1___default()(event, 'tags[0]');

    if (event.start_datetime < now) {
      if (event.multidate) {
        color.fillMode = where === 'base' ? 'light' : 'outline';

        if (where === 'base') {
          color.class += ' vc-past';
        }
      } else {
        color.class += ' vc-past';
      }
    }

    if (!tag) {
      return color;
    }

    const idx = tags.indexOf(tag);

    if (idx < 0) {
      return color;
    }

    color.color = colors[idx]; // if (event.start_datetime < now) { color.class += ' vc-past' }

    return color;
  }

  attributes = attributes.concat(_events.filter(e => !e.multidate).map(e => {
    return {
      key: e.id,
      dot: getColor(e),
      dates: new Date(e.start_datetime * 1000)
    };
  }));
  attributes = attributes.concat(_events.filter(e => e.multidate).map(e => ({
    key: e.id,
    highlight: {
      start: getColor(e),
      base: getColor(e, 'base'),
      end: getColor(e)
    },
    dates: {
      start: new Date(e.start_datetime * 1000),
      end: new Date(e.end_datetime * 1000)
    }
  })));
  return attributes;
}

/***/ })

};;
//# sourceMappingURL=index.js.map