1"use strict";(self.webpackChunkmg_motors_europe=self.webpackChunkmg_motors_europe||[]).push([[520],{7520:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(7757),s=n.n(r),a=n(9669),o=n.n(a);function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t,n,r,s,a,o){try{var c=e[a](o),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,s)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,s){var a=e.apply(t,n);function o(e){i(a,r,s,o,c,"next",e)}function c(e){i(a,r,s,o,c,"throw",e)}o(void 0)}))}}const p={props:{siteHandle:{value:String},newsEndpoint:{value:String}},data:function(){return{news:[],areNewsParsed:!1,httpClient:null,postsPerPage:3}},watch:{news:function(e){this.areNewsParsed=Boolean(e.length)}},mounted:function(){this.handleSetNews()},methods:{handleSetNews:function(){var e=this;return g(s().mark((function t(){var n,r,a,c,u,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.getPostsEndpoint(),r=e.getPressEndpoint(),!(!n||!r)){t.next=5;break}return t.abrupt("return");case 5:return t.prev=5,t.next=8,o().get(n);case 8:return a=t.sent,c=a.data,t.next=12,o().get(r);case 12:return u=t.sent,i=u.data,t.next=16,e.parseNews(e.handleSortAndSliceNewsData(c,i));case 16:e.news=t.sent,t.next=22;break;case 19:t.prev=19,t.t0=t.catch(5),e.news=[];case 22:case"end":return t.stop()}}),t,null,[[5,19]])})))()},handleParseNewsData:function(e){return e.map((function(e){return{title:e.title.rendered,description:e.yoast_head_json.description,image:e.yoast_head_json.og_image[0].url,url:e.link,date:new Date(e.date_gmt).getTime()}}))},handleSortAndSliceNewsData:function(e,t){return[].concat(c(this.handleParseNewsData(e)),c(this.handleParseNewsData(t))).sort((function(e,t){return t.date-e.date})).slice(0,3)},getPostsEndpoint:function(){switch(this.siteHandle){case"default":return"news/posts?perPage=".concat(this.postsPerPage);case"mgMotorsNorway":return"news/posts?language=no&perPage=".concat(this.postsPerPage);case"mgMotorsFrance":return"news/posts?language=fr&perPage=".concat(this.postsPerPage);case"mgMotorsNetherlands":return"news/posts?language=nl&perPage=".concat(this.postsPerPage);case"mgMotorsAustria":return"news/posts?language=at&perPage=".concat(this.postsPerPage);case"mgMotorsItaly":return"news/posts?language=it&perPage=".concat(this.postsPerPage);case"mgMotorsSpain":return"news/posts?language=es&perPage=".concat(this.postsPerPage);case"mgMotorsSweden":return"news/posts?language=sv&perPage=".concat(this.postsPerPage);case"mgMotorsBelgiumNl":return"news/posts?language=be-nl&perPage=".concat(this.postsPerPage);case"mgMotorsBelgiumFr":return"news/posts?language=be-fr&perPage=".concat(this.postsPerPage);case"mgMotorsPoland":return"news/posts?language=pl&perPage=".concat(this.postsPerPage);default:return null}},getPressEndpoint:function(){switch(this.siteHandle){case"default":return"news/press?perPage=".concat(this.postsPerPage);case"mgMotorsNorway":return"news/press?language=no&perPage=".concat(this.postsPerPage);case"mgMotorsFrance":return"news/press?language=fr&perPage=".concat(this.postsPerPage);case"mgMotorsNetherlands":return"news/press?language=nl&perPage=".concat(this.postsPerPage);case"mgMotorsAustria":return"news/press?language=at&perPage=".concat(this.postsPerPage);case"mgMotorsItaly":return"news/press?language=it&perPage=".concat(this.postsPerPage);case"mgMotorsSpain":return"news/press?language=es&perPage=".concat(this.postsPerPage);case"mgMotorsSweden":return"news/press?language=sv&perPage=".concat(this.postsPerPage);case"mgMotorsBelgiumNl":return"news/press?language=be-nl&perPage=".concat(this.postsPerPage);case"mgMotorsBelgiumFr":return"news/press?language=be-fr&perPage=".concat(this.postsPerPage);case"mgMotorsPoland":return"news/press?language=pl&perPage=".concat(this.postsPerPage);default:return null}},getAllNewsEndpoint:function(){switch(this.siteHandle){case"default":return"".concat(this.newsEndpoint);case"mgMotorsNorway":return"".concat(this.newsEndpoint,"/no");case"mgMotorsFrance":return"".concat(this.newsEndpoint,"/fr");case"mgMotorsNetherlands":return"".concat(this.newsEndpoint,"/nl");case"mgMotorsAustria":return"".concat(this.newsEndpoint,"/at");case"mgMotorsItaly":return"".concat(this.newsEndpoint,"/it");
1case"mgMotorsSpain":return"".concat(this.newsEndpoint,"/es");case"mgMotorsSweden":return"".concat(this.newsEndpoint,"/sv");case"mgMotorsBelgiumNl":return"".concat(this.newsEndpoint,"/be-nl");case"mgMotorsBelgiumFr":return"".concat(this.newsEndpoint,"/be-fr");case"mgMotorsPoland":return"".concat(this.newsEndpoint,"/pl");default:return null}},parseNews:function(e){var t=this;return g(s().mark((function n(){var r;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.all(e.map((function(e){var n=e.image;return t.getTransformedImage(n)})));case 2:return r=n.sent,e.forEach((function(e,t){return e.image=r[t]})),n.abrupt("return",e);case 5:case"end":return n.stop()}}),n)})))()},getTransformedImage:function(e){return g(s().mark((function t(){var n,r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o().post("/image-transform/news",{imageUrl:e});case 3:return n=t.sent,r=n.data,t.abrupt("return",{jpegSrcSet:r.srcSetJpeg.split(","),webpSrcSet:r.srcSetWebp.split(",")});case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",{});case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))()}}}}}]); 2//# sourceMappingURL=520.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.