(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[89],{VjoN:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return r}));var a=n("7yoQ");function s(e){return encodeURIComponent(Object(a.b)(JSON.stringify(e)))}const r={created(){for(const e of this.$options.urlState)this.restoreStateFromUrl(e),this.$watch(e,t=>this.saveStateToUrl(e,t),{deep:!0})},methods:{saveStateToUrl(e,t=this[e]){const n=Object.assign({},this.$route.query);n[e]=s(t),this.$router.push({name:this.$route.name,query:n}).catch(e=>{if(!(""+e.message).includes("redundant navigation"))throw e})},restoreStateFromUrl(e){if(!this.$route.query[e])return null;try{const t=function(e){return JSON.parse(Object(a.a)(decodeURIComponent(e)))}(this.$route.query[e]);return this.$set(this,e,t),t}catch(t){return console.warn(`Could not restore state ${e} from URL parameter ${e}`,t),null}}}}},ouaV:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n("ZoCn"),s=n("N8I4"),r=n("sdSa");function o(e,t){Object(r.a)(2,arguments);var n=Object(s.a)(e),o=Object(a.a)(t);if(isNaN(o))return new Date(NaN);if(!o)return n;var i=n.getDate(),l=new Date(n.getTime());l.setMonth(n.getMonth()+o+1,0);var c=l.getDate();return i>=c?l:(n.setFullYear(l.getFullYear(),l.getMonth(),i),n)}},rTFI:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tb-w-nearby-events"},[e.loading?n("tb-w-loader"):e.nearbyEvents.length?n("tb-w-section",{attrs:{wide:""},scopedSlots:e._u([{key:"content",fn:function(){return[n("tb-w-slider",[e._l(e.nearbyEvents.slice(0,6),(function(t){return n("tb-w-slider-item",{key:t.id},[n("tb-w-teaser-card",{attrs:{background:e.buildImageUri(t.id,"event",[null,376]),href:e.buildUrl({name:"event.detail",params:{id:t.id}}),type:"stacked","open-in-new-tab":""},scopedSlots:e._u([{key:"topline",fn:function(){return[e._v("\n                            "+e._s(t.category.name)+"\n                        ")]},proxy:!0},{key:"labels",fn:function(){return[n("span",[e._v(e._s(e.getDatesToDisplay(t)))])]},proxy:!0}],null,!0)},[e._v(" "),e._v("\n\n                        "+e._s(t.name)+"\n                    ")])],1)})),e._v(" "),e.showMoreLink?n("tb-w-show-all",{attrs:{href:e.buildUrl({name:"event.list",query:{params:e.getLocationFilterParams()}})}},[e._v("\n                    "+e._s(e.$t("message.showAll"))+"\n                ")]):e._e()],2)]},proxy:!0}])},[e._v("\n        "+e._s(e.$t("message.eventsNearby"))+"\n\n        ")]):e._e()],1)};a._withStripped=!0;var s=n("vqf1"),r=n("VjoN"),o=n("g8pp"),i=n("ouaV"),l=n("6dQ1"),c={name:"TbWNearbyEvents",mixins:[s.a],props:{article:{type:Object,required:!0}},data:()=>({loading:!0,nearbyEvents:[],params:{},inOneMonth:Object(o.a)(Object(i.a)(new Date,1),"y-M-d"),showMoreLink:!1}),async created(){var e,t,n;if(!Object(l.a)()){const e=await this.articleRepository.fetch(this.article.id+"/nearbyEvents",{filter:{clientIncludingManaged:"current"},language:this.$store.state.language});this.nearbyEvents=e.payload,this.loading=!1}(null===(e=this.nearbyEvents)||void 0===e?void 0:e.length)>6&&null!==(t=this.article.geocoordinates)&&void 0!==t&&t.latitude&&null!==(n=this.article.geocoordinates)&&void 0!==n&&n.longitude&&(this.showMoreLink=!0);const a={sorting:{property:"date"},filter:{distanceFrom:{latitude:this.article.geocoordinates.latitude,longitude:this.article.geocoordinates.longitude},date:{before:this.inOneMonth}}};this.params=a},methods:{getLocationFilterParams(){return Object(r.b)(this.params)}},i18n:{fallbackLocale:"de",silentFallbackWarn:"undefined"==typeof window,messages:{de:{message:{eventsNearby:"Events in der Nähe",showAll:"Alle anzeigen"}},en:{message:{eventsNearby:"Events nearby",showAll:"Show all"}},fr:{message:{eventsNearby:"Événements à proximité",showAll:"Montre tout"}},it:{message:{eventsNearby:"Eventi nelle vicinanze",showAll:"Mostra tutto"}},es:{message:{eventsNearby:"Eventos cercanos",showAll:"Mostrar todos"}},nl:{message:{eventsNearby:"Evenementen in de buurt",showAll:"Toon alles"}},cz:{message:{eventsNearby:"Události v okolí",showAll:"Ukázat vše"}}}}},d=n("KHd+"),u=Object(d.a)(c,a,[],!1,null,null,null);u.options.__file="node_modules/@newland/toubiz-widget/src/components/tb-w-nearby-events.vue";t.default=u.exports},vqf1:function(e,t,n){"use strict";var a=n("g8pp"),s=n("N8I4"),r=n("sdSa");t.a={methods:{getDatesToDisplay:e=>e.firstDate.id===e.lastDate.id?Object(a.a)(new Date(e.firstDate.date),"d.M.Y"):function(e,t){Object(r.a)(2,arguments);var n=Object(s.a)(e),a=Object(s.a)(t);return n.getFullYear()===a.getFullYear()}(new Date(e.firstDate.date),new Date(e.lastDate.date))?`${Object(a.a)(new Date(e.firstDate.date),"d.M.")} - ${Object(a.a)(new Date(e.lastDate.date),"d.M.Y")}`:`${Object(a.a)(new Date(e.firstDate.date),"d.M.Y")} - ${Object(a.a)(new Date(e.lastDate.date),"d.M.Y")}`}}}}]);