(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[118],{DTD7:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tb-w-nearby-articles"},[e.loading?i("tb-w-loader"):e.nearbyArticles.length?i("tb-w-section",{attrs:{wide:""},scopedSlots:e._u([{key:"content",fn:function(){return[i("tb-w-slider",[e._l(e.nearbyArticles.slice(0,6),(function(t){return i("tb-w-slider-item",{key:t.id},[i("tb-w-teaser-card",{attrs:{background:e.buildImageUri(t.id,"article",[null,376]),href:e.buildUrl({name:"article.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.primaryCategory.name)+"\n                        ")]},proxy:!0},e.$eq.medium&&t.openingTimes&&(t.openingTimes.definitions||[]).length?{key:"info",fn:function(){return[i("tb-w-opening-times-parser",{attrs:{"opening-times-format":"toubizV1","opening-times-definition":t.openingTimes},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.openingTimes;return[i("tb-w-opening-times-line-preview",{attrs:{"opening-times":t,"for-date-and-time":new Date}})]}}],null,!0)})]},proxy:!0}:null],null,!0)},[e._v("\n\n                        "+e._s(t.name)+"\n\n                        ")])],1)})),e._v(" "),e.nearbyArticles.length>6?i("tb-w-show-all",{attrs:{href:e.buildUrl({name:"article.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.discoveriesNearby"))+"\n\n        ")]):e._e()],1)};n._withStripped=!0;var r=i("VjoN"),a=i("6dQ1"),s={name:"TbWArticleDetailNearbyArticles",eq:{breakpoints:{medium:{minWidth:768}}},props:{article:{type:Object,required:!0}},data:()=>({nearbyArticles:[],loading:!0}),async created(){if(!Object(a.a)()){const e=await this.articleRepository.fetch(this.article.id+"/nearbyArticles",{filter:{clientIncludingManaged:"current"},language:this.$store.state.language});this.nearbyArticles=e.payload,this.nearbyArticles.length&&(this.nearbyArticles.splice(8),await this.articleRepository.enrichListWithIncludes(this.nearbyArticles,["openingTimes"],{language:this.$store.state.language})),this.loading=!1}},methods:{getLocationFilterParams(){return this.article.geocoordinates?Object(r.b)({filter:{location:{latitude:this.article.geocoordinates.latitude,longitude:this.article.geocoordinates.longitude,radiusMeters:1e3}}}):{}}}},o=i("KHd+"),l=Object(o.a)(s,n,[],!1,null,null,null);l.options.__file="node_modules/@newland/toubiz-widget/src/components/article-detail/tb-w-article-detail-nearby-articles.vue";t.default=l.exports},VjoN:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return a}));var n=i("7yoQ");function r(e){return encodeURIComponent(Object(n.b)(JSON.stringify(e)))}const a={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 i=Object.assign({},this.$route.query);i[e]=r(t),this.$router.push({name:this.$route.name,query:i}).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(n.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}}}}}}]);