(window.webpackJsonpNewland_Toubiz_Poi_Neos=window.webpackJsonpNewland_Toubiz_Poi_Neos||[]).push([[326],{"KHd+":function(e,t,n){"use strict";function a(e,t,n,a,o,r,i,s){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),a&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),i?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):o&&(l=s?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return a}))},k7Cg:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.weather?n("div",{staticClass:"tb-w-ski-area-detail-weather"},[n("tb-w-section",{scopedSlots:e._u([{key:"content",fn:function(){return[n("tb-w-grid",{attrs:{columns:{xs:1,sm:1,md:2,lg:2,xl:2}}},[e.weatherResponse?n("tb-w-weather-overview",{attrs:{weather:e.weather}}):e._e()],1)]},proxy:!0}],null,!1,246211461)})],1):e._e()};function o(e,t,n){return`lat_${e}lon_${t}lang_${n}`}async function r(e,t,n,a,r){const i=o(t,n,r),s=e.state.openweathermap.weatherData;if(null!=s&&s[i]&&Date.now()<s[i].expires)return s[i];return await async function(e,t,n,a,r){const i=await async function(e,t,n,a){const o=`https://api.openweathermap.org/data/2.5/forecast/daily?lat=${e}&lon=${t}&cnt=${n}&units=metric&lang=${a}&appid=9f9f3f564bb5584644bf843212fe0270`,r=await fetch(o,{method:"GET"});if(200!==r.status)return null;return r.json()}(t,n,a,r),s=o(t,n,r);if(!i)return null;let l=Date.now()+36e5;const c={data:i,id:s,expires:l};return await e.dispatch("openweathermap/setWeatherDataEntry",c),e.state.openweathermap.weatherData[s]}(e,t,n,a,r)}a._withStripped=!0;var i={name:"TbWSkiAreaDetailWeather",data:()=>({weatherResponse:null}),props:{article:{type:Object,required:!0}},async created(){this.hasGeocoordinates&&(this.weatherResponse=await r(this.$store,this.article.geocoordinates.latitude,this.article.geocoordinates.longitude,7,this.$store.state.language))},computed:{hasGeocoordinates(){var e,t;return(null===(e=this.article.geocoordinates)||void 0===e?void 0:e.latitude)&&(null===(t=this.article.geocoordinates)||void 0===t?void 0:t.longitude)},weather(){var e;return null===(e=this.weatherResponse)||void 0===e?void 0:e.data}}},s=n("KHd+"),l=Object(s.a)(i,a,[],!1,null,null,null);l.options.__file="node_modules/@newland/toubiz-widget/src/components/ski-area-detail/tb-w-ski-area-detail-weather.vue";t.default=l.exports}}]);