(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2492],{58263:function(e,t,r){"use strict";var n,i=r(11720);function a(){return a=Object.assign||function(e){for(var t=1;t0&&(t=0),-1*t>r.current.getBoundingClientRect().height&&(t=-1*r.current.getBoundingClientRect().height),-1*t>0&&(n=100/(e/(-1*t))),o(Math.ceil(n))},c=function(){var e=document.documentElement,t=Math.ceil(e.scrollTop/(e.scrollHeight-e.clientHeight)*100);t!==i&&o(t)};return(0,v.useEffect)((function(){return"reference"===t&&r?(l(),window.addEventListener("scroll",l),function(){return window.removeEventListener("scroll",l)}):(c(),window.addEventListener("scroll",c),function(){return window.removeEventListener("scroll",c)})})),(0,a.tZ)("div",{className:_e().root,children:(0,a.tZ)("div",{className:_e().bar,children:(0,a.tZ)("div",{className:_e().back,children:(0,a.tZ)("div",{className:_e().progress,style:{width:"".concat(i,"%")}})})})})},ge=r(74885),pe=r(13277),fe=function(e){var t=e.posts;t.map((function(e){return e}));var r=null===t||void 0===t?void 0:t.map((function(e){var t=e.title,r=e.slug,n=e.heroImage;return{title:t,url:r,image:null===n||void 0===n?void 0:n.url}})),n=(0,V.q)().t;return(0,a.tZ)(ge.ZP,{items:r,card:{width:"295",height:"295"},buttonText:n(W.t.ReadPost),title:n(W.t.RelatedBlogPosts),itemComponent:pe.Z})},Ze=r(61307),Pe=r(5756),Be=r(70495),we=r.n(Be),Ce=function(e){var t=e.author;return(0,a.BX)("div",{className:we().root,children:[(0,a.tZ)("h3",{className:u()(["blogHeader",we().title]),children:"Blog author"}),(0,a.tZ)(_(),{src:t.image.url,width:85,height:85,className:we().image}),(0,a.tZ)("p",{className:we().name,children:t.name}),(0,a.tZ)("p",{className:we().description,children:t.description})]})},ke=r(17072),be=r(42298),Ne=function(e){var t,r,n=e.post,i=e.posts,c=e.postSchema,d=e.products,m=e.table,Z=(0,V.q)().t,C=(0,v.useState)([]),k=C[0],y=C[1],x=(0,v.useState)([]),E=x[0],L=x[1],I=(0,v.useState)(""),X=I[0],S=I[1],H=n.content,M=n.author,q=n.slug,D=d.items,F=m.newsletterImage,z=(0,v.useRef)(null),O=(0,v.useRef)(null),j=(0,v.useRef)(X),U=(0,v.useRef)(E),Q=(0,v.useMemo)((function(){return(0,a.tZ)(g.rZ,{data:H,customNodeRules:[(0,p.SZ)(f.Xy,(function(e){var t=e.node,r=e.children,n=e.key,i="h".concat(t.level);if(2===t.level){var l=t.children[0].value,c=null===l||void 0===l?void 0:l.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"");return k.find((function(e){return e.key===c}))||y((function(e){return(0,o.Z)(e).concat([{title:l,key:c}])})),(0,a.tZ)(i,{headingId:c,children:r})}return(0,a.tZ)(i,{children:r},n)}))],renderBlock:function(e){var t=e.record;switch(t.__typename){case"ImageBlockRecord":var r,n,i,o,l,c;return(0,a.tZ)("div",{className:u()(s().boundary,s().limitedWidth),children:(0,a.tZ)(_(),{src:null===t||void 0===t||null===(r=t.image)||void 0===r?void 0:r.url,width:null!==(l=null===t||void 0===t||null===(n=t.image)||void 0===n?void 0:n.width)&&void 0!==l?l:760,height:null!==(c=null===t||void 0===t||null===(i=t.image)||void 0===i?void 0:i.height)&&void 0!==c?c:526,layout:"responsive",objectPosition:"0 0",alt:null===t||void 0===t||null===(o=t.image)||void 0===o?void 0:o.alt})});case"JsonBlockRecord":return(0,a.tZ)(P(),{id:t.id,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(null===t||void 0===t?void 0:t.json)}});case"VideoBlockRecord":return(null===t||void 0===t?void 0:t.video)?(0,a.tZ)("div",{className:u()(s().videoContainer,s().limitedWidth),children:(0,a.tZ)(B.Q,{src:t.video,title:t.title,className:s().video,frameBorder:t.frameBorder,allowFullScreen:t.allowFullScreen,width:610,type:"video"})}):null;case"WebstoryBlockRecord":return t.link?(0,a.tZ)("div",{className:u()(s().iframeOuter,s().limitedWidth,s().webstory),children:(0,a.tZ)(B.Q,{className:s().iframe,src:t.link,width:360,type:"webstory"})}):null;case"TableBlockRecord":var d,h,m,v=null===t||void 0===t||null===(d=t.table)||void 0===d?void 0:d.columns,g=null===t||void 0===t||null===(h=t.table)||void 0===h?void 0:h.hasColumnHeaders,p=null===t||void 0===t||null===(m=t.table)||void 0===m?void 0:m.data;return(0,a.tZ)("div",{className:s().boundary,children:(0,a.tZ)("table",{children:(0,a.BX)("tbody",{children:[g&&(0,a.tZ)("tr",{children:null===v||void 0===v?void 0:v.map((function(e){return(0,a.tZ)("td",{children:(0,a.tZ)("p",{children:(0,a.tZ)("strong",{children:e})})},e)}))}),null===p||void 0===p?void 0:p.map((function(e){return(0,a.tZ)("tr",{children:null===v||void 0===v?void 0:v.map((function(t){var r=e[t];return(0,a.tZ)("td",{dangerouslySetInnerHTML:{__html:r}},t)}))},e.id)}))]})})});case"CustomerExperienceBlockRecord":return(null===t||void 0===t?void 0:t.video)?(0,a.tZ)("div",{className:s().customerExperienceContainer,children:null===t||void 0===t?void 0:t.video.map((function(e){var t=e.video,r=e.title,n=e.frameBorder,i=e.allowFullScreen;return(0,a.BX)("div",{className:u()(s().customerExperienceCard,s().customerExperienceCardVideo),children:[r&&(0,a.tZ)("h3",{children:r}),(0,a.tZ)(B.Q,{src:t,title:r,className:s().video,frameBorder:n,allowFullScreen:i})]})}))}):null;case"TiktokBlockRecord":return(null===t||void 0===t?void 0:t.tiktok)?(0,a.tZ)("div",{className:u()(s().customerExperienceContainer,s()["scroll-scroll"]),children:null===t||void 0===t?void 0:t.tiktok.map((function(e){var t=e.dataVideoId,r=e.title;return t?(0,a.tZ)("div",{className:u()(s().customerExperienceCard,s().customerExperienceCardTiktok,"no-quote"),children:(0,a.tZ)(B.Q,{src:t,title:r,className:s().tiktokIframe,frameBorder:0,allowFullScreen:!0})}):null}))}):null;case"IframeBlockRecord":return t.link?(0,a.tZ)("div",{children:(0,a.tZ)(B.Q,{src:t.link,title:t.title||"iframe",width:t.width||"500",height:t.height||"760",frameBorder:t.frameBorder||"0",allowFullScreen:t.allowFullScreen||!0})}):null;case"InstagramBlockRecord":return t.link?(0,a.BX)(w.k,{children:[(0,a.tZ)("blockquote",{className:u()("instagram-media",s()["instagram-blockquote"]),"data-instgrm-captioned":!0,"data-instgrm-permalink":t.link,"data-instgrm-version":"14"}),(0,a.tZ)(P(),{strategy:"afterInteractive",src:"https://www.instagram.com/embed.js",async:!0})]}):null;case"QuizBlockRecord":var f=t.title,Z=t.description,C=t.quizType,k=t.question;return(0,a.BX)(a.HY,{children:[f&&(0,a.tZ)("h3",{children:f}),Z&&(0,a.tZ)("p",{children:Z}),(0,a.tZ)("div",{children:function(){switch(C){case"Point":return(0,a.tZ)(b,{questions:k});case"Group":return(0,a.tZ)(N,{questions:k});default:return null}}()})]});default:return null}}})}),[H]),G=function(){if(z.current){var e,t=U.current.find((function(e){return e.element.getBoundingClientRect().top-10<=0}));t&&j.current!==t.headingId&&(e=t.headingId,j.current=e,S(e))}};(0,v.useEffect)((function(){return window.addEventListener("scroll",G,{passive:!0}),function(){window.removeEventListener("scroll",G)}}),[]),(0,v.useEffect)((function(){if(z.current){var e=new ResizeObserver((function(e){if(e[0]){var t=e[0].target.querySelectorAll("[headingid]"),r=Array.from(t).map((function(e){return{element:e,headingId:e.getAttribute("headingId")}}));r.reverse(),n=r,U.current=n,L(n)}var n}));return e.observe(z.current),function(){e.disconnect()}}}),[z]);var Y,J,K=d.items.slice(0,3),$=n.updatedAt?(0,be.Z)(new Date(n.updatedAt),"MMMM dd, yyyy"):void 0;return(0,a.BX)(a.HY,{children:[(0,a.tZ)(ve,{calculateBy:"reference",reference:O}),(0,a.tZ)(l.PB,{title:n.metaTitle||void 0,titleTemplate:"%s",description:n.metaDescription||void 0,openGraph:{images:[{url:(null===(t=n.heroImage)||void 0===t?void 0:t.url)||" ",alt:n.metaTitle||" "}]},canonical:"".concat("https://www.ukmeds.co.uk","/").concat(n.slug)}),c&&(0,a.tZ)(R,{postSchema:c}),(0,a.tZ)("div",{className:s().blogPageWrapper,children:(0,a.BX)("div",{className:u()(s().layout,s().layoutGrid),children:[(0,a.tZ)("div",{className:s().sectionsColumn,children:(0,a.tZ)(A,{items:k,active:X,navigateToSection:function(e){var t=E.find((function(t){return t.headingId===e}));t&&window.scrollBy({behavior:"smooth",left:0,top:t.element.getBoundingClientRect().top})},sticky:!0})}),(0,a.tZ)("div",{className:s().contentColumn,ref:O,children:(0,a.BX)("div",{className:s().mainContent,children:[(0,a.tZ)("div",{className:s().backLinkContainer,children:(0,a.BX)(T.Z,{href:"/blog",className:s().backLink,prefetch:!1,children:[(0,a.tZ)(le.Z,{width:9,height:9})," ",(0,a.tZ)("span",{children:Z(W.t.AllBlogs)})]})}),(0,a.tZ)("div",{className:s().contentHeader,children:M&&(0,a.tZ)("div",{className:s().postHeaderContainer,children:(0,a.tZ)(oe,{author:M,relatedProducts:D,readTimeWords:null!==(Y=null===(r=n.contentWordCounter)||void 0===r?void 0:r.words)&&void 0!==Y?Y:4e3,updatedAt:$,category:n.category,slug:null!==q&&void 0!==q?q:""})})}),(0,a.BX)("div",{className:s().content,children:[(0,a.tZ)("h1",{children:n.title}),(0,a.tZ)("div",{ref:z,className:"rich-text",children:Q})]})]})}),(0,a.BX)("div",{className:s().sidebarColumn,children:[i&&0!==i.length&&(0,a.tZ)(de,{posts:null===i||void 0===i?void 0:i.slice(0,5)}),0!==K.length&&(0,a.tZ)(ae,{items:K,sticky:!0,variant:"sidebar"})]})]})}),(0,a.BX)(h.im,{variant:"page-inner",children:[(0,a.tZ)("div",{className:s().layout,children:(0,a.BX)("div",{className:s().contentColumnBottom,children:[K&&0!==K.length&&(0,a.tZ)(ae,{items:K,variant:"main"}),M&&(0,a.tZ)("div",{className:s().blogAuthorContainer,children:(0,a.tZ)(Ce,{author:M})})]})}),(0,a.BX)(h.W2,{children:[(0,a.tZ)(Ze.Z,{image:null!==(J=null===F||void 0===F?void 0:F.url)&&void 0!==J?J:""}),i&&0!==i.length&&(0,a.tZ)(fe,{posts:i})]})]}),(0,a.tZ)(Pe.Z,{}),(0,a.tZ)(ke.Z,{})]})},ye=!0,Re=function(e){var t=e.post,r=e.posts,n=e.postSchema,i=e.items,o=e.table;return(0,a.tZ)(Ne,{post:t,posts:r,postSchema:n,products:{title:t.products_title||"",items:i},table:o})}},29398:function(e,t,r){"use strict";r.d(t,{JG:function(){return a},es:function(){return n},j1:function(){return i}});var n=function(e){var t=document.createElement("a");t.href=e;var r=t.pathname.split("/").filter(Boolean);return["index.php","magento"].indexOf(r[0])>-1?"/".concat(r.slice(1).join("/")):r.includes("uk-meds-plus")?"/customer/meds-plus":"/".concat(r.join("/"))};function i(e){return e&&"string"===typeof e?e.replace(/(https?:\/\/|\/\/)(.+?)\/media/g,"/media"):""}var a=function(e){return e.replace(/([^:]\/)\/+/g,"$1")}},9568:function(e){e.exports={root:"Badge_root__Y4GEP"}},25472:function(e){e.exports={root:"ReadProgressBar_root__Uauzz",bar:"ReadProgressBar_bar__MAzor",back:"ReadProgressBar_back__aks_L",progress:"ReadProgressBar_progress__8ddSP"}},70082:function(e){e.exports={root:"Sections_root__ZR2WV",item:"Sections_item___UIU3",active:"Sections_active__Lhyjh",sticky:"Sections_sticky___gZIO"}},86804:function(e){e.exports={header:"BlogPostPage_header__TEJD8",iframeOuter:"BlogPostPage_iframeOuter__kI_y8",boundary:"BlogPostPage_boundary__9RMAt",limitedWidth:"BlogPostPage_limitedWidth__22Qmc","instagram-blockquote":"BlogPostPage_instagram-blockquote__bSJAi",videoContainer:"BlogPostPage_videoContainer__zMxc3",video:"BlogPostPage_video__yPA21",customerExperienceTitle:"BlogPostPage_customerExperienceTitle__dQcxA",customerExperienceContainer:"BlogPostPage_customerExperienceContainer__xD_Vs",customerExperienceCard:"BlogPostPage_customerExperienceCard__rOCtj",customerExperienceCardVideo:"BlogPostPage_customerExperienceCardVideo__RN2Y8",customerExperienceCardTiktok:"BlogPostPage_customerExperienceCardTiktok__yl0OC",tiktokIframe:"BlogPostPage_tiktokIframe__Flk18",blogPageWrapper:"BlogPostPage_blogPageWrapper__3tF9o",layout:"BlogPostPage_layout__is5l8",layoutGrid:"BlogPostPage_layoutGrid__xmUq_",sectionsColumn:"BlogPostPage_sectionsColumn__iLAZh",contentColumn:"BlogPostPage_contentColumn__GzmQN",contentColumnBottom:"BlogPostPage_contentColumnBottom__o0ss0",sidebarColumn:"BlogPostPage_sidebarColumn__o7R0_",contentHeader:"BlogPostPage_contentHeader__xuqRU",postTitle:"BlogPostPage_postTitle__4EKlb",postImage:"BlogPostPage_postImage__a53e7",sticky:"BlogPostPage_sticky__nOyzk",backLinkContainer:"BlogPostPage_backLinkContainer___pnIo",backLink:"BlogPostPage_backLink__2hdp8",postHeaderContainer:"BlogPostPage_postHeaderContainer__DTaIt",selectableHeadings:"BlogPostPage_selectableHeadings__DQA38",webstory:"BlogPostPage_webstory__13Voo",mainContent:"BlogPostPage_mainContent___Jkyd",blogAuthorContainer:"BlogPostPage_blogAuthorContainer__aIFv_"}},37290:function(e){e.exports={root:"PostAuthor_root__LPznv",link:"PostAuthor_link__ay662",name:"PostAuthor_name__axXlM",dateData:"PostAuthor_dateData__BE1QU",nameAndDateContainer:"PostAuthor_nameAndDateContainer__RV_2u",picture:"PostAuthor_picture__ttuKD",data:"PostAuthor_data___WrFZ",shareTo:"PostAuthor_shareTo__fcmzF",socialItem:"PostAuthor_socialItem__gBEo7"}},75362:function(e){e.exports={authorContainer:"PostHeader_authorContainer___pJWJ",badges:"PostHeader_badges__bEMzj",readTimeAndDate:"PostHeader_readTimeAndDate__ZO_oC",relatedProductContainer:"PostHeader_relatedProductContainer__q35qI"}},70495:function(e){e.exports={title:"BlogAuthor_title__QDq47",image:"BlogAuthor_image__t_3wb",description:"BlogAuthor_description__wzghz"}},80879:function(e){e.exports={blogPostItem:"RelatedBlogPosts_blogPostItem__nHFAw",title:"RelatedBlogPosts_title__bo_Hd",header:"RelatedBlogPosts_header__yDd_y",postTitle:"RelatedBlogPosts_postTitle__hksDZ",content:"RelatedBlogPosts_content__AB5qM",postImage:"RelatedBlogPosts_postImage__WClb8",postDate:"RelatedBlogPosts_postDate__iZr7u",actionsBtn:"RelatedBlogPosts_actionsBtn__fFfIv",authorLink:"RelatedBlogPosts_authorLink__HQ18F",authorName:"RelatedBlogPosts_authorName__0LI_Y",authorPicture:"RelatedBlogPosts_authorPicture__KOGPo",authorData:"RelatedBlogPosts_authorData__hcWYd",lineClamp:"RelatedBlogPosts_lineClamp__QUEoS"}},34756:function(e){e.exports={price:"RelatedProducts_price__t0BVP",name:"RelatedProducts_name__jt3XX",sidebar:"RelatedProducts_sidebar__0FUDD",sticky:"RelatedProducts_sticky__pmg41",headerMobile:"RelatedProducts_headerMobile__VrTQU",items:"RelatedProducts_items__g9_Ut",item:"RelatedProducts_item__yUc83",image:"RelatedProducts_image__SNLCY",title:"RelatedProducts_title__4r3ah",content:"RelatedProducts_content__F0mpS",bulletPoints:"RelatedProducts_bulletPoints__gUr_y",viewButton:"RelatedProducts_viewButton__Ngv_n",main:"RelatedProducts_main__qMOUE",action:"RelatedProducts_action__xFn8z",subItem:"RelatedProducts_subItem__FDL0V"}},20934:function(e){e.exports={answer:"quiz_answer__VhoHB",text:"quiz_text__jqdHw"}}},function(e){e.O(0,[8489,2298,5860,5756,661,5987,9774,2888,179],(function(){return t=55947,e(e.s=t);var t}));var t=e.O();_N_E=t}]);