(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{221:function(t,e,r){"use strict";r.r(e);var i=r(2),c=r(0),u=r(4);function n(e,t){var r,i=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)),i}function a(i){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach(function(t){var e,r;e=i,r=o[t=t],(t=function(t){t=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(o,t))})}return i}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.default={template:i.a.views.group,data:function(){var t=Object(c.db)(this,"cache.group"),e=t&&t.is404?null:t,r=(this.$store.commit("invalidateCache","group"),this.getGroup(e)),i=this.getFilterObj(),o=Object(c.db)(this,"bc.settings.additionalFunctions.defaultSort");return{is404:t&&t.is404,cache:e,loading:!e,products:e&&e.products||null,filteredProducts:this.getFilteredProducts(e&&e.products,i)||null,showFilters:!1,group:r,filterObj:i,priceFilter:void 0,defaultSort:o||Object(c.O)()&&window.groupDefaultSort||"auto"}},computed:{queryUrl:function(){return this.$route.query},breadcrumb:function(){var t=[{text:Object(c.db)(this,"i18n.breadcrumb.homepage"),url:"/"}],e=Object(c.db)(this,"lang"),r=this.group.isManufacturer;return"object"===s(this.group)&&t.push({text:this.group.name[e],url:(r?"/m/":"/g/")+this.group.url[e]}),t},description:function(){var t=Object(c.db)(this,"lang");try{return this.group&&this.group.description?this.group.description[t]:""}catch(t){}return""},description2:function(){var t=Object(c.db)(this,"lang");try{return this.group&&this.group.description2?this.group.description2[t]:""}catch(t){}return""},hideFiltering:function(){return Object(c.db)(this,"bc.settings.additionalFunctions.categoryPage.hideFiltering")}},serverPrefetch:function(){return this.fetch()},methods:{webpHTML:function(t){return c.ib.bind(this)(t)},getFilteredProducts:function(t,e){e=a(a({},e||this.filterObj),{},{price:this.priceFilter});return Object(c.db)(this,"bc.settings.additionalFunctions.categoryPage.hideZeroStockOnListings")&&(e.availability=[!0]),c.k.bind(this)(e,t||this.products)},updatePriceFilter:function(t){this.priceFilter=t,this.filteredProducts=this.getFilteredProducts()},getFilterObj:function(){return c.s.bind(this)()},fetch:function(){var n=this;return new Promise(function(e,r){var i,o=Object(c.db)(n,"lang");n.loading=!0,n.group=n.getGroup(),"string"==typeof n.group?(i=n.$route.fullPath.includes("/m/"),Object(u.u)(n.group,n.$store,n.$ssrContext&&n.$ssrContext.cookies,n.$ssrContext&&n.$ssrContext.port,i).then(function(t){if(t)n.group=t,n.fetchProducts(e),n.is404=!1;else{t="";try{t=n.$route.params.url}catch(t){}Object(u.H)((i?"/m/":"/g/")+t,i?"none":o,n.$ssrContext&&n.$ssrContext.cookies,n.$ssrContext&&n.$ssrContext.port).then(function(t){return t&&t.redirect?Object(c.P)()?void r({redirect:t.redirect}):(n.$router.push({path:t.redirect}),e()):(Object(c.P)()&&(n.$ssrContext.statusCode=404,n.$store.commit("cache",{key:"group",value:{is404:!0}})),n.is404=!0,e())})}})):n.fetchProducts(e)})},fetchProducts:function(n){var s=this,t=Object(c.db)(this,"lang");Object(u.z)(this.group.products,t,this.$ssrContext&&this.$ssrContext.cookies,this.$ssrContext&&this.$ssrContext.port).then(function(t){var e=s.group,r=e.smartIdx,i=void 0===r?{}:r,r=e.sortObj,o=void 0===r?{}:r,e=(s.products=t.map(function(t){return t.smartIdx=i[t._id],t.idx=o[t._id],t}),s.filteredProducts=s.getFilteredProducts(),s.loading=!1,s.getMetaObj());c.Z.bind(s)(e),c.c.bind(s)(e),c.R.bind(s)({},!1),Object(c.P)()&&s.$store.commit("cache",{key:"group",value:a(a({},s.group),{},{products:s.products})}),Object(c.O)()&&setTimeout(function(){var t=window.fromPath&&document.querySelector('[href="'+window.fromPath+'"]');t&&t.scrollIntoView({block:"end"})},0),n()}).catch(function(){c.Z.bind(s)({}),c.c.bind(s)({}),s.loading=!1,n()})},getMetaObj:function(){var t=Object(c.db)(this,"lang"),e=this.$route.query.page;return{title:Object(c.jb)(this.group.name[t],e,Object(c.db)(this,"i18n.pagination.pageSuffix")),meta:{description:e&&1<e?" ":this.group.seoMetaDescription&&this.group.seoMetaDescription[t],title:this.group.seoMetaTitle&&Object(c.jb)(this.group.seoMetaTitle[t],e,Object(c.db)(this,"i18n.pagination.pageSuffix"))},ogDesc:this.group.seoMetaDescription&&this.group.seoMetaDescription[t],canonicalOverride:this.group.canonical&&this.group.canonical[t]}},getGroup:function(t){var e="";try{e=this.$route.params.url}catch(t){}return t||e},buidJsonLd:function(t){var r=Object(c.db)(this,"lang");return{"@context":"http://schema.org","@type":"ItemList",itemListElement:t.map(function(t,e){return{"@type":"ListItem",position:e,url:(Object(c.O)()?location.protocol+"//"+location.host:"")+"/p/"+t.url[r]}})}},routeChange:function(){this.showFilters=!1,this.priceFilter=void 0,this.products=this.filteredProducts=null,this.fetch()}},watch:{$route:function(t,e){this.filterObj=this.getFilterObj(),t.path!==e.path?this.routeChange():(this.filteredProducts=this.getFilteredProducts(),Object(c.X)(this.scrollPos),t=this.getMetaObj(),c.Z.bind(this)(t),c.c.bind(this)(t))}},mounted:function(){this.cache||null===this.cache?this.cache=!1:this.routeChange()},beforeRouteUpdate:function(t,e,r){this.scrollPos=document.querySelector("html").scrollTop,r()}}}}]);