"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3527],{4917:function(e,n,t){t.d(n,{Z:function(){return v}}),t(67294);var i=t(25675),r=t.n(i),o=t(11163),l=t(53418),a=t(34451),s=t(26587),d=t(87379),u=(0,d.iv)(["pointer-events:none;> *{background-color:",";color:",";animation:1.25s ease 0s infinite normal none running react-placeholder-pulse;}> a img{display:none !important;}> span{min-height:20px;color:",";width:90%;&::before{color:",";}}> h2{min-height:46px;width:80%;a{color:",";&:hover{color:",";}}}> *:last-child{width:80%;color:",";&::before{color:",";}}"],function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover}),c=d.ZP.article.withConfig({displayName:"StyledPostItem",componentId:"sc-1byom79-0"})(["background-color:white;width:100%;min-height:",";",""],function(e){return e.isImage&&"225px"},function(e){return e.loading&&u}),h=(0,d.ZP)(l.l7).withConfig({displayName:"StyledPostItemWrapperImage",componentId:"sc-1byom79-1"})(["display:block;> span{position:inherit !important;min-height:inherit !important;height:inherit !important;max-height:inherit !important;overflow:hidden !important;}> img{object-fit:cover;position:relative !important;height:auto !important;}"]),m=d.ZP.span.withConfig({displayName:"StyledPostItemCategory",componentId:"sc-1byom79-2"})(["display:block;margin:1.4rem 0 0.5rem;font-size:",";text-transform:capitalize;color:",";"],function(e){return e.theme.standardFont},function(e){return e.theme.greyBlue}),p=d.ZP.h2.withConfig({displayName:"StyledPostItemTitle",componentId:"sc-1byom79-3"})(["margin:0 0 0.5rem;font-size:",";font-weight:",";a{color:",";text-decoration:none;&:hover{color:",";text-decoration:underline;}}"],function(e){return e.theme.largeFont},function(e){return e.theme.bold},function(e){return e.theme.primary},function(e){return e.theme.blue}),g=d.ZP.span.withConfig({displayName:"StyledPostItemAuthor",componentId:"sc-1byom79-4"})(['margin:0.5rem 0;&::before{content:"','";color:',";display:inline-block;margin-right:0.5rem;}"],function(e){return e.preText},function(e){return e.theme.greyBlue}),f=t(85893),v=function(e){var n,t,i,d,u,v,x,y=e.onePost,b=e.loading,w=e.showImage,j=void 0===w||w,k=(0,o.useRouter)(),C=k.query,P=k.asPath,I=null!==(n=y.fields)&&void 0!==n?n:{},S=I.pageTitle,B=void 0===S?"":S,Z=I.slug,N=I.articleImage,L=I.author,z=I.category,T=I.subCategory,H=(0,s.zL)(P),E=H.isPreview,A=H.preSlug,M=(E?A:"")+"/blog",R=(0,a.eE)(z,T,C.slug),D=R.categoryTag,F=R.categorySlug,_="".concat(M,"/[...slug]"),X="".concat(M,"/").concat(void 0===F?" ":F,"/").concat(void 0===Z?"":Z);return(0,f.jsxs)(c,{isImage:!!j&&!!N,loading:void 0!==b&&b?1:0,children:[j&&N&&(0,f.jsx)(h,{ssrLink:!0,href:_,renderAs:X,children:(0,f.jsx)(r(),{alt:(null==N||null===(t=N.fields)||void 0===t?void 0:t.title)||B,blurDataURL:"/assetshttps://www.cbtnuggets.com/images/contentful/blog-post-placeholder.png",layout:"fill",loader:a.XI,loading:"eager",placeholder:"blur",quality:75,src:null==N||null===(i=N.fields)||void 0===i||null===(i=i.file)||void 0===i?void 0:i.url,title:B})}),(0,f.jsx)(m,{children:D}),(0,f.jsx)(p,{children:(0,f.jsx)(l.l7,{ssrLink:!0,href:_,renderAs:X,children:B})}),(null==L?void 0:L.fields)&&(0,f.jsx)(g,{as:(null==L||null===(d=L.fields)||void 0===d?void 0:d.slug)&&"a",href:null!=L&&null!==(u=L.fields)&&void 0!==u&&u.slug?null==L||null===(v=L.fields)||void 0===v?void 0:v.slug:void 0,preText:"By ",children:null==L||null===(x=L.fields)||void 0===x?void 0:x.name})]})}},46159:function(e,n,t){var i=t(67294),r=t(67042),o=t(53418),l=t(87735),a=t(85893);n.Z=function(){return(0,i.useEffect)(function(){var e=(0,r.jl)();e&&e.warn("Blog post not found!")},[]),(0,a.jsx)(l.X,{children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{children:"Blogs not found"}),(0,a.jsxs)("p",{children:["Head to our ",(0,a.jsx)(o.l7,{href:"/",children:"homepage"})," or"," ",(0,a.jsx)(o.l7,{ssrLink:!0,href:"/blog",renderAs:"/blog",children:"blog main page."})]})]})})}},87735:function(e,n,t){t.d(n,{X:function(){return l},Y:function(){return o}});var i=t(87379),r=function(e,n){var t=(0,i.iv)(["@media (max-width:","){height:24vw;max-height:unset;}@media (max-width:","){height:unset;min-height:40vw;}"],function(e){return e.theme.desktop990},function(e){return e.theme.phone}),r=(0,i.iv)(["grid-template-columns:1fr 1fr;article > a{height:",";max-height:",";","}"],n?"20vw":"26vw",n?"260px":"300px",t),o=(0,i.iv)(["grid-template-columns:1fr 1fr 1fr;article > a{height:",";max-height:",";","}"],function(){return n?"12vw":"16vw"},function(){return n?"175px":"197px"},t);return"Two"!==e?o:r},o=i.ZP.ul.withConfig({displayName:"StyledPostList",componentId:"sc-rdwdvf-0"})(["list-style-type:none;padding:0;display:grid;text-align:left;gap:3rem 2rem;"," @media (max-width:","){gap:2rem;grid-template-columns:repeat(2,1fr);}@media (max-width:","){grid-template-columns:1fr;}"],function(e){return r(e.columns,e.useNavigation)},function(e){return e.theme.desktop990},function(e){return e.theme.phone}),l=i.ZP.div.withConfig({displayName:"StyledPostEmpty",componentId:"sc-rdwdvf-1"})(["justify-content:center;align-items:center;text-align:center;display:flex;height:400px;h1{font-family:",";font-size:4.8rem;margin-bottom:4.8rem;}"],function(e){return e.theme.fontFamilyCursive})},595:function(e,n,t){t.d(n,{Z:function(){return k}});var i=t(67294),r=t(11163),o=t(26587),l=t(72033),a=t(87379),s=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=(0,a.iv)(["max-height:600px;visibility:initial;opacity:1;height:100%;transition:all 0.5s,max-height 0.2s;"]),t=(0,a.iv)(["max-height:0px;visibility:collapse;opacity:0;padding-top:0.5rem;height:0%;transition:all 0.5s,opacity 0.2s;"]);return e?n:t},d=a.ZP.nav.withConfig({displayName:"StyledBlogMenu",componentId:"sc-1x2l1y7-0"})(["padding:1rem 1rem 0;@media screen and (max-width:","){padding:0 20px;position:fixed;top:63px;width:100%;left:1px;background-color:#fff;z-index:1;}"],function(e){return e.theme.breakpoints.desktop990}),u=a.ZP.section.withConfig({displayName:"StyledBlogMenuWrapperTitle",componentId:"sc-1x2l1y7-1"})(["display:none;padding:1.5rem 1rem;margin-bottom:1rem;border-bottom:1px solid ",";@media screen and (max-width:","){display:block;}"],function(e){return e.theme.greyBorder},function(e){return e.theme.breakpoints.desktop990}),c=a.ZP.div.withConfig({displayName:"StyledBlogMenuTitle",componentId:"sc-1x2l1y7-2"})(["display:flex;justify-content:space-between;cursor:pointer;svg path{transform-origin:center;transition:all 0.5s;transform:rotate(","deg);fill:",";}> span{font-size:",";&:nth-child(1){font-weight:",";}&:nth-child(2){margin-left:auto;margin-right:1rem;}}"],function(e){return e.mainExpand?"180":"0"},function(e){return e.theme.colors.tertiary},function(e){return e.theme.largeFont},function(e){return e.theme.bold}),h=a.ZP.ul.withConfig({displayName:"StyledBlogMenuBody",componentId:"sc-1x2l1y7-3"})(["list-style-type:none;margin:0;padding:0.5rem 0 0;@media screen and (max-width:","){",";}li{&:nth-last-child(2) span{border-bottom:0;}& span span,& span svg{","}}"],function(e){return e.theme.breakpoints.desktop990},function(e){return s(e.mainExpand)},function(e){return e.loading?(0,a.iv)(["background-color:",";fill:",";color:",";animation:1.25s ease 0s infinite normal none running react-placeholder-pulse;"],function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover},function(e){return e.theme.transparentHover}):(0,a.iv)(["animation:none;fill:",";"],function(e){return e.theme.colors.tertiary})}),m=a.ZP.button.withConfig({displayName:"StyledBlogDropdownTitle",componentId:"sc-1x2l1y7-4"})(["display:flex;justify-content:space-between;color:",";border:none;border-bottom:1px solid ",";padding:1rem;cursor:pointer;background:none;font-size:inherit;width:100%;svg path{transform-origin:center;transition:all 0.5s;}",""],function(e){return e.theme.secondary},function(e){return e.theme.greyBorder},function(e){return e.expanded?(0,a.iv)(["font-weight:",";svg path{transform:rotate(-180deg);}"],function(e){return e.theme.bold}):""}),p=a.ZP.ul.withConfig({displayName:"StyledBlogDropdownSub",componentId:"sc-1x2l1y7-5"})(["transition:all 0.4s;list-style-type:none;margin:0;padding:2rem 0 0 1.5rem;li{padding-bottom:1.5rem;}",";"],function(e){return s(e.expanded)}),g=a.ZP.form.withConfig({displayName:"StyledBlogSearch",componentId:"sc-1x2l1y7-6"})(["position:relative;margin-bottom:2rem;input{display:block;width:100%;height:4.6rem;border-radius:23px;border:1px solid ",";font-size:",";margin-top:2.4rem;margin-bottom:0px;padding:0.6rem 3.5rem 0.6rem 1rem;text-indent:1rem;&::placeholder{color:",";}}@media (max-width:","){margin-right:2rem;}@media screen and (max-width:","){margin-right:0;}"],function(e){return e.theme.greyBorder},function(e){return e.theme.largeFont},function(e){return e.theme.greyBlue},function(e){return e.theme.desktop990},function(e){return e.theme.breakpoints.smphone}),f=a.ZP.button.withConfig({displayName:"StyledBlogSearchBtn",componentId:"sc-1x2l1y7-7"})(["position:absolute;bottom:0px;right:0px;z-index:0;display:flex;justify-content:center;align-items:center;width:4rem;height:100%;border:0;cursor:pointer;background-color:transparent;"]),v=t(85893),x=function(){return(0,v.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,v.jsx)("path",{d:"M17.09 8.59L12.5 13.17L7.91 8.59L6.5 10L12.5 16L18.5 10L17.09 8.59Z"})})},y=function(e){var n,t,i,r,o,l=e.category,a=e.expanded,s=e.preRenderAs,d=e.onClick;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(m,{"aria-expanded":a,className:"DropDownMenuToggle-sc-124hznw-4 bgpdEe",onClick:function(){return d(!a&&(null==l?void 0:l.sys.id))},expanded:a,children:[null==l||null===(n=l.fields)||void 0===n?void 0:n.name,(0,v.jsx)("span",{children:(0,v.jsx)(x,{})})]}),(0,v.jsxs)(p,{expanded:a,"aria-expanded":a,children:[(0,v.jsx)("li",{children:(0,v.jsxs)("a",{href:"".concat(s,"/").concat(null==l||null===(i=l.fields)||void 0===i?void 0:i.slug),children:["All ",null==l||null===(r=l.fields)||void 0===r?void 0:r.name]})},"sublink-".concat(null==l?void 0:l.sys.id,"-").concat(null==l||null===(t=l.fields)||void 0===t?void 0:t.slug)),null==l||null===(o=l.fields)||void 0===o||null===(o=o.subCategories)||void 0===o?void 0:o.map(function(e){var n,t,i,r,o="".concat(s,"/").concat(null==l||null===(n=l.fields)||void 0===n?void 0:n.slug,"/").concat(null==e||null===(t=e.fields)||void 0===t?void 0:t.slug);return(0,v.jsx)("li",{children:(0,v.jsx)("a",{href:o,children:null==e||null===(r=e.fields)||void 0===r?void 0:r.name})},"sublink-".concat(null==l?void 0:l.sys.id,"-").concat(null==e||null===(i=e.fields)||void 0===i?void 0:i.slug))})]})]})},b=t(16835),w=function(){return(0,v.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,v.jsx)("path",{d:"M5.9 1.8C3.6 1.8 1.8 3.6 1.8 5.9C1.8 8.2 3.6 10 5.9 10C8.2 10 10 8.2 10 5.9C10 3.6 8.2 1.8 5.9 1.8M5.9 0C9.2 0 11.8 2.6 11.8 5.9C11.8 7.4 11.3 8.7 10.4 9.8L10.7 10H11.4L16 14.6L14.6 16L10 11.4V10.7L9.8 10.4C8.7 11.3 7.4 11.8 5.9 11.8C2.6 11.8 0 9.2 0 5.9C0 2.6 2.6 0 5.9 0",fill:"#1B2733"})})},j=function(e){var n=e.preRenderAs,t=(0,r.useRouter)();return(0,v.jsxs)(g,{onSubmit:function(e){e.preventDefault();var i,r=null!==(i=e.target)&&void 0!==i?i:[],o=(0,b.Z)(r,1)[0],l=null==o?void 0:o.value.replace(/\?.*/g,"");if(l.length>1){var a="".concat(n,"/search/").concat(l);t.push(n+"/[...slug]",a)}},children:[(0,v.jsx)("input",{type:"search",placeholder:"Search articles",pattern:".{2,}"}),(0,v.jsx)(f,{"aria-label":"search icon button",type:"submit",children:(0,v.jsx)(w,{})})]})},k=function(){var e=(0,r.useRouter)().asPath,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=(0,r.useRouter)().asPath,t=(0,l.$B)(e),a=(0,i.useState)(!0),s=a[0],d=a[1],u=(0,i.useState)(null),c=u[0],h=u[1],m=(0,i.useState)(t),p=m[0],g=m[1];return(0,i.useEffect)(function(){var e=(0,o.zL)(n).isPreview;h(null),(0,l.KG)(e).then(function(e){g(e),d(!1)}).catch(function(e){d(!1),h(e)})},[n]),{loading:s,error:c,categories:p}}(),t=n.loading,a=n.categories,s=(0,i.useState)(!1),m=s[0],p=s[1],g=(0,i.useState)(""),f=g[0],b=g[1],w=(0,o.zL)(e),k=w.isPreview,C=w.preSlug,P=(k?C:"")+"/blog";return(0,v.jsxs)(d,{children:[(0,v.jsx)(u,{children:(0,v.jsxs)(c,{role:"button",onClick:function(){p(!m)},mainExpand:m,children:[(0,v.jsx)("span",{children:"Articles"}),(0,v.jsx)("span",{children:"Menu"}),(0,v.jsx)(x,{})]})}),(0,v.jsxs)(h,{mainExpand:m,"aria-expanded":m,loading:t?1:0,children:[null==a?void 0:a.map(function(e){return(0,v.jsx)("li",{children:(0,v.jsx)(y,{category:e,onClick:b,expanded:f===e.sys.id,preRenderAs:P})},e.sys.id)}),(0,v.jsx)(j,{preRenderAs:P})]})]})}},84418:function(e,n,t){t.d(n,{S:function(){return s}});var i=t(50029),r=t(64687),o=t.n(r),l=t(95229),a=t(77589);function s(e){return d.apply(this,arguments)}function d(){return(d=(0,i.Z)(o().mark(function e(n){var t,i,r,s,d,u,c,h,m,p,g,f,v,x,y,b,w,j,k,C,P,I,S,B;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=void 0===(t=n.categoryId)?"":t,s=void 0===(r=n.subCategoryId)?"":r,u=void 0===(d=n.ignoreId)?"":d,h=void 0===(c=n.authorId)?"":c,p=void 0===(m=n.pageNumber)?1:m,f=void 0===(g=n.perPage)?1:g,x=void 0!==(v=n.preview)&&v,b=void 0===(y=n.locale)?"en-US":y,w=x?a.z.preview.accessToken:a.z.live.accessToken,j=x?a.z.preview.host:a.z.live.host,k=(0,l.createClient)({space:a.P,accessToken:w,host:j}),C={content_type:"blogPost",order:"-fields.date",locale:b,limit:f,include:2,skip:f*(p-1),select:"fields.pageTitle,fields.slug,fields.category,fields.subCategory,fields.articleImage,fields.author"},(null==u?void 0:u.length)>0&&(C["sys.id[ne]"]=u),(null==h?void 0:h.length)>0&&(C["fields.author.sys.id"]=h),(null==i?void 0:i.length)>0&&(C["fields.category.sys.id"]=i),(null==s?void 0:s.length)>0&&(C["fields.subCategory.sys.id"]=s),x&&(C["metadata.tags.sys.id[nin]"]="wpscheduled"),e.next=12,k.getEntries(C);case 12:return S=void 0===(I=(P=e.sent).items)?[]:I,B=P.total,e.abrupt("return",{numberOfPosts:B,numberOfPages:Math.ceil(B/f),currentPage:p,posts:S});case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}}}]);