import{u as x,b as _,U as D,k as t,B as S,v as R,G as N,V as G,_ as E,S as s,X as T,i as O,j as Q,Y as U,Z as W,t as a,F as Y,s as l,p as P,f as j,A as X,e as Z,c as q,h as V,o as J,n as K,$ as ee,g as $,a0 as te,N as re,H as ne,l as ae,L as ie,z as oe,P as H}from"./index-7832e1e4.js";import{b as se,c as le,d as ce}from"./related-posts-list.style-e9f56063.js";const ue=Y("<div>"),de=c=>{const{localize:u}=x(_),[i,f]=D(1),d=3,o=()=>c.relatedVideos.length/d,g=()=>i()>=o(),y=n=>t(s,{when:!0,get children(){return t(ce,{get orientation(){return n.orientation},type:"button",onClick:()=>f(i()+1),get children(){return[(()=>{const b=O(ue);return Q(b,()=>u("show-more","show more")),b})(),t(U,W({get fill(){return a.palette.red}},{height:2.14,width:2.86}))]}})}});return t(T,{componentName:"Related videos",get children(){return t(S,{widthType:"bgFull",templateShorthand:[12],customCss:"margin-top: 5rem;",get children(){return t(se,{get children(){return[t(R,{tag:"h3",variant:"medium",get children(){return c.heading}}),t(le,{get children(){return[t(N,{templateShorthand:[4,4,4],responsive:{tablet:[6,6],mobile:[12]},get children(){return t(G,{get each(){return c.relatedVideos.slice(0,i()*d)},children:n=>t(E,{get title(){return n.video_title.trim()},get videoUrl(){return n.video_link},inGrouping:!0,get isHealthcareProfessional(){return n.isHealthcareProfessional},get permalink(){return n.permalink},get image(){return n==null?void 0:n.image},ableToPlay:!1,get isVisibleForPublic(){return n.isVisibleForPublic}})})}}),t(s,{get when(){return!g()},get children(){return t(y,{orientation:"horizontal"})}})]}})]}})}})}})},{spacing:m}=a,ge=l.div` container-type: inline-size; margin: ${m.xl} 0; `,he=l.div` color: ${P.gray}; font-family: ${j}; font-size: 1.64rem; padding-top: 1rem; display: flex; gap: 0.5rem; `,pe=l(X)` color: ${P.gray}; &:hover { color: ${a.palette.pink}; } `,me=l.div` color: ${P.red}; `,fe=l.div` display: flex; gap: 0.5rem; ${a.mediaQueries.tabletMin} { width: 70%; margin: 0 auto; } ${a.mediaQueries.mobileMax} { padding: ${m.s} ${m.xxs}; } `;l.div` ${a.mediaQueries.mobileMax} { padding: ${m.s} ${m.xxs}; } `;const Se=()=>{const c=Z(),u=q(),{appStore:i,setCacheType:f,createCachedResource:d,setStatusCode:o,localize:g,viewport:y,videosEntityName:n,siteInfo:b}=x(_),F=()=>y.width<=a.breakpoints.MOBILE;V(J(()=>u.hash,()=>K({id:u.hash.replace("#",""),smallScreen:F(),isCareSite:b.siteType==="atos-care"})));const[C]=d(ee,()=>({key:`/video-item/${c.videoSlug}`}),!0),r=$(()=>{var e,h;return(h=(e=C())==null?void 0:e.video)==null?void 0:h.content}),L=()=>{var e;return(e=r())==null?void 0:e.tags},M=()=>{var e;return(e=r())==null?void 0:e.id},[z]=d(te,()=>({tags:L()}),!0),k=$(()=>{var e,h;return(h=(e=z())==null?void 0:e.relatedvideos)==null?void 0:h.filter(p=>p.content.id!==M()).map(p=>p==null?void 0:p.content)}),A=()=>w()?(f(H.none),!0):(f(H.defaultCache),!1),w=()=>{var e;return u.pathname==="/"?!1:i.isHcp()?!0:!!((e=r())!=null&&e.isHealthcareProfessional)},v=()=>{i.setHcp(w())};v(),V(()=>{v()});const B=()=>r()?(typeof o=="function"&&o(200),!1):(typeof o=="function"&&o(404),!0),I=()=>[t(pe,{href:`/${n}`,get children(){return g("instructional-videos","Instructional videos")}}),"/",t(me,{get children(){var e;return(e=r())==null?void 0:e.post_title}})];return t(T,{componentName:"Single video",get children(){return[t(s,{get when(){return B()&&!C.loading},get children(){return t(re,{})}}),t(ge,{get children(){return t(s,{get when(){return r()},get children(){return[t(ne,{get isHcp(){return A()}}),t(ae,{get seo(){return r().seo},get title(){return r().post_title}}),t(S,{widthType:"bgFull",templateShorthand:[12],backgroundType:"color",backgroundValue:"white",customCss:"z-index: 1;",get children(){return t(he,{get children(){return t(s,{get when(){return y.width<=a.breakpoints.MOBILE},get fallback(){return I()},get children(){return t(ie,{url:`/${n}`,get label(){return g("instructional-videos","Instructional videos")},plainStyle:!0,arrowDirection:"left",size:"small"})}})}})}}),t(S,{widthType:"bgFull",templateShorthand:[12],get children(){return t(fe,{get children(){return t(E,{get title(){var e;return(e=r())==null?void 0:e.video_title},get videoUrl(){var e;return(e=r())==null?void 0:e.video_link},inGrouping:!1,get isHealthcareProfessional(){var e;return(e=r())==null?void 0:e.isHealthcareProfessional},ableToPlay:!0,get isVisibleForPublic(){var e;return(e=r())==null?void 0:e.isVisibleForPublic},get permalink(){var e;return(e=r())==null?void 0:e.permalink},hideMyContentStar:!0})}})}}),t(s,{get when(){var e;return((e=k())==null?void 0:e.length)>0},get children(){return t(de,{get relatedVideos(){return k()},get heading(){return g("related-content","Related content")}})}}),t(oe,{type:"video-item",get permalink(){var e;return(e=r())==null?void 0:e.permalink},get title(){var e;return(e=r())==null?void 0:e.video_title},get data(){return r()}})]}})}})]}})};export{Se as Video}; //# sourceMappingURL=video-5c1b21bc.js.map