"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9103,1002],{34451:function(e,n,t){t.d(n,{Ai:function(){return f},BP:function(){return v},C:function(){return y},FQ:function(){return l},Mp:function(){return a},XI:function(){return h},eE:function(){return p},eK:function(){return d},xS:function(){return g}});var r,i=t(50029),u=t(64687),o=t.n(u);t(13922);var c=t(72033),s=t(26587),l=function(e){return/\/search\/.*/g.test(e)},a=function(e,n){var t=1;return n>=5&&(n-23&&(t=e-2)),t},f=function(e){return Array(e).fill({}).map(function(e,n){return{sys:{id:"skelleton-".concat(n)}}})},d=function(e){return{numberOfPosts:e,numberOfPages:1,currentPage:1,posts:f(e)}},p=function(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={categoryTag:null,categorySlug:null};if(!((null==n?void 0:n.length)>0&&Array.isArray(r)))return i;var u=null!==(t=n.find(function(e){var n=e.fields;return(null==n?void 0:n.slug)===(null==r?void 0:r[r.length-1])}))&&void 0!==t?t:null==n?void 0:n[0],o=null==e?void 0:e.find(function(e){return e.fields.subCategories.find(function(e){var n;return(null==e||null===(n=e.sys)||void 0===n?void 0:n.id)===u.sys.id})});return null!=o&&o.fields?(i.categoryTag="".concat(o.fields.name," / ").concat(u.fields.name),i.categorySlug="".concat(o.fields.slug,"/").concat(u.fields.slug)):(i.categoryTag=u.fields.name,i.categorySlug=u.fields.slug),i},g=(r=(0,i.Z)(o().mark(function e(n){var t,r,i,u,l,a,f,d,p=arguments;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p.length>1&&void 0!==p[1]?p[1]:"",i=p.length>2&&void 0!==p[2]&&p[2],u=[],(l=n.indexOf("/blog/"))>=0&&(u=(0,s.a7)(n,l)),r.length>0&&(u=r.replace(" / ","/").replace("All ","").replace(/\s/g,"-").toLowerCase().split("/")),a={categoryId:"",subCategoryId:""},!((null===(t=u)||void 0===t?void 0:t.length)>0)){e.next=17;break}return e.next=10,(0,c.KG)(i);case 10:if(null==(f=e.sent)||f.forEach(function(e){var n,t;u.find(function(n){var t;return n===(null==e||null===(t=e.fields)||void 0===t?void 0:t.slug)})&&(a.categoryId=(null==e||null===(n=e.sys)||void 0===n?void 0:n.id)||"",a.subCategoryId=(0,c.an)(null==e||null===(t=e.fields)||void 0===t?void 0:t.subCategories,u))}),!(a.categoryId.length<=0)){e.next=17;break}return e.next=15,(0,c.aH)(i);case 15:d=e.sent,a.subCategoryId=(0,c.an)(d,u);case 17:return e.abrupt("return",a);case 18:case"end":return e.stop()}},e)})),function(e){return r.apply(this,arguments)}),v=function(e){var n={pageNumber:1,searchTerm:""};if(!(Array.isArray(e)&&(null==e?void 0:e.length)>0))return n;if(null!=e&&e.includes("page")){var t=Number(e[e.indexOf("page")+1]);n.pageNumber=isNaN(t)?1:t}return null!=e&&e.includes("search")&&(n.searchTerm=decodeURI(e[e.indexOf("search")+1])),n},y=function(){return{pageNumber:null,searchTerm:null,asPath:null}},h=function(e){var n=e.src,t=e.width,r=e.quality;return"".concat(void 0===n?"":n,"?w=").concat(void 0===t?800:t,"&q=").concat(void 0===r?75:r)}},13922:function(e,n,t){t.d(n,{s:function(){return s}});var r=t(95229),i=t(83454),u=i.env.CONTENTFUL_SPACE_ID||"aoyx73g9h2pg",o=i.env.CONTENTFUL_ENVIRONMENT||"master",c={preview:{host:"preview.contentful.com",accessToken:i.env.CONTENTFUL_PREVIEW_ACCESS_TOKEN||"_m2Ya2h7qmrZiY2Ln9iSbLm4HQWEhAWg-tCRNc-wesg"},live:{host:"cdn.contentful.com",accessToken:i.env.CONTENTFUL_LIVE_ACCESS_TOKEN||"r38OWV8WrekczjzQP7Qje7KySFMW58C5sUCk455m7B0"}};function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preview,t=n?c.preview.accessToken:c.live.accessToken,i=n?c.preview.host:c.live.host;return(0,r.createClient)({space:u,environment:o,accessToken:t,host:i})}},81002:function(e,n,t){t.d(n,{o:function(){return c}});var r=t(50029),i=t(64687),u=t.n(i),o=t(13922);function c(e,n){return s.apply(this,arguments)}function s(){return(s=(0,r.Z)(u().mark(function e(n,t){var r,i,c,s,l,a=arguments;return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>2&&void 0!==a[2]&&a[2],i=a.length>3&&void 0!==a[3]?a[3]:"en-US",!(n&&t)){e.next=11;break}return c=(0,o.s)({preview:r}),e.next=6,c.getEntries({content_type:t,"fields.slug":n,include:10,locale:i});case 6:if(!((l=void 0===(s=e.sent.items)?[]:s).length>0)){e.next=11;break}return e.abrupt("return",l[0]);case 11:return e.abrupt("return",null);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}},72033:function(e,n,t){t.d(n,{$B:function(){return f},E1:function(){return p},KG:function(){return v},aH:function(){return h},an:function(){return d}});var r=t(27812),i=t(59499),u=t(50029),o=t(64687),c=t.n(o),s=t(13922);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function a(e){for(var n=1;n1)||void 0===f[1]||f[1],i=f.length>2&&void 0!==f[2]?f[2]:"en-US",u=(0,s.s)({preview:t}),o={select:"sys.id,sys.contentType,fields.slug,fields.name","fields.slug[in]":n.join(","),locale:i},e.next=6,Promise.all([u.getEntries(a(a({},o),{},{content_type:"blogCategory"})),u.getEntries(a(a({},o),{},{content_type:"blogSubCategory"}))]);case 6:return l=e.sent.reduce(function(e,n){return[].concat((0,r.Z)(e),(0,r.Z)(n.items))},[]),e.abrupt("return",n.map(function(e){var n,t={entryId:"",contentType:"",name:"",slug:e},r=l.find(function(n){var t;return e===(null==n||null===(t=n.fields)||void 0===t?void 0:t.slug)});return r&&(t.entryId=r.sys.id,t.name=null==r||null===(n=r.fields)||void 0===n?void 0:n.name,t.contentType=r.sys.contentType.sys.id),t}));case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function v(){return y.apply(this,arguments)}function y(){return(y=(0,u.Z)(c().mark(function e(){var n,t,r,i,u,o=arguments;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>0&&void 0!==o[0]&&o[0],t=o.length>1&&void 0!==o[1]?o[1]:"en-US",r=(0,s.s)({preview:n}),e.next=5,r.getEntries({content_type:"blogCategory","fields.position[gt]":0,order:"fields.position",locale:t});case 5:return u=void 0===(i=e.sent.items)?[]:i,e.abrupt("return",u);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function h(){return b.apply(this,arguments)}function b(){return(b=(0,u.Z)(c().mark(function e(){var n,t,r,i,u,o=arguments;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>0&&void 0!==o[0]&&o[0],t=o.length>1&&void 0!==o[1]?o[1]:"en-US",r=(0,s.s)({preview:n}),e.next=5,r.getEntries({content_type:"blogSubCategory",locale:t});case 5:return u=void 0===(i=e.sent.items)?[]:i,e.abrupt("return",u);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}},26587:function(e,n,t){function r(e,n){return e.slice(n+1).replace(/\?.*/g,"").replace(/\/page\/\d+$/g,"").replace(/\/search\/.*/g,"").split(/(\/).*?/g)}function i(e){var n={includeBlog:!1,position:0},t=e.replace(/\?.*/g,""),r=t.indexOf("/blog/"),i=t.indexOf("/blog");return r>=0?n={includeBlog:!0,position:r}:i>=0&&i+5===t.length&&(n={includeBlog:!0,position:i}),n}function u(e){var n=e.indexOf("/contentful-preview/")>=0;return n?{isPreview:n,preSlug:"/contentful-preview/pages/sectionBasedPage"}:{isPreview:!1,preSlug:""}}t.d(n,{HE:function(){return i},a7:function(){return r},zL:function(){return u}}),t(64687),t(81002),t(72033),t(34451)}}]);