1import{a as te}from"/build/_shared/chunk-BA2K3D5C.js";import{a as Q}from"/build/_shared/chunk-5OBEDPFR.js";import{a as ee}from"/build/_shared/chunk-H6S7FWVP.js";import{d as $}from"/build/_shared/chunk-T36URGAI.js";var s=$(ee()),V=$(te()),e=$(Q()),g={"ratio2:3":"_2_3","ratio1:1":"_1_1","ratio4:5":"_4_5","ratio9:16":"_9_16","ratio16:9":"_16_9","ratio21:9":"_21_9"},re=({desktopAspectRatio:w,mobileAspectRatio:_,desktopVideoSource:h,mobileVideoSource:d,loopVideo:R,video_autoplay:C,video_controls:L,video_sound:H,optionalDisplayImage:t,variant:b,className:M,mobile_styles:x,desktop_styles:k,scroll_to_play:E,fetchPriority:S,desktopVideoQuality:m,mobileVideoQuality:v,lazyload:I})=>{var O,U,F,T,z,p,A,W,j,q,B,G,J,K,X,Y,Z,y;let l=(0,s.useRef)(null),a=(0,s.useRef)(null),[P,D]=(0,s.useState)(void 0),o=(0,s.useMemo)(()=>{var n,r,c,i;return`${((r=(n=h==null?void 0:h.data)==null?void 0:n.attributes)==null?void 0:r.url)||((i=(c=d==null?void 0:d.data)==null?void 0:c.attributes)==null?void 0:i.url)}_${m!=null?m:"1080"}${g[w]}`},[h,d,w]),u=(0,s.useMemo)(()=>{var n,r;return`${(r=(n=d==null?void 0:d.data)==null?void 0:n.attributes)==null?void 0:r.url}_${v!=null?v:"720"}${g[_]}`},[d,_]);(0,s.useEffect)(()=>{let f=window.innerWidth;D(f>768?"desktop":"mobile")},[]),(0,s.useEffect)(()=>{let f=(n,r)=>{n.forEach(c=>{c.isIntersecting?r.current.play().catch(i=>{console.error("Auto-play failed:",i)}):r.current.pause()})};if(E){let n=new IntersectionObserver(c=>{f(c,l)},{threshold:.5}),r=new IntersectionObserver(c=>{f(c,a)},{threshold:.5});return n.observe(l.current),r.observe(a.current),()=>{n.disconnect(),r.disconnect()}}},[E]);let N=(0,e.jsxs)("div",{className:`${M}`,children:[S==="high"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("link",{rel:"preload",as:"image",fetchpriority:"high",href:((F=(U=(O=t==null?void 0:t.desktop)==null?void 0:O.data)==null?void 0:U.attributes)==null?void 0:F.url)||`${o}_poster`}),(0,e.jsx)("link",{rel:"preload",as:"image",fetchpriority:"high",href:((p=(z=(T=t==null?void 0:t.mobile)==null?void 0:T.data)==null?void 0:z.attributes)==null?void 0:p.url)||`${u}_poster`})]}),(0,e.jsx)("video",{ref:l,"data-test-id":"media-hub-video-element",className:`md:hidden w-full ${x}`,autoPlay:!!C,muted:!H,playsInline:!0,controls:b!=="ctaHighlights"&&b!=="categoryCarousel"?!!L:!1,poster:((j=(W=(A=t==null?void 0:t.mobile)==null?void 0:A.data)==null?void 0:W.attributes)==null?void 0:j.url)||`${u}_poster`,loop:!!R,children:P==="mobile"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("source",{src:`${u}.webm`,type:"video/webm"}),(0,e.jsx)("source",{src:`${u}.mp4`,type:"video/mp4"})]})},`m-${u}`),(0,e.jsx)("video",{ref:a,"data-test-id":"video-element",className:`hidden md:block w-full ${k}`,autoPlay:!!C,muted:!H,controls:b!=="ctaHighlights"&&b!=="categoryCarousel"?!!L:!1,poster:((G=(B=(q=t==null?void 0:t.desktop)==null?void 0:q.data)==null?void 0:B.attributes)==null?void 0:G.url)||`${o}_poster`,loop:!!R,children:P==="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("source",{src:`${o}.webm`,type:"video/webm"}),(0,e.jsx)("source",{src:`${o}.mp4`,type:"video/mp4"})]})},`d-${u}`)]});return I?(0,e.jsx)(V.default,{once:!0,offset:300,placeholder:(0,e.jsxs)("div",{className:M,children:[(0,e.jsx)("img",{className:`hidden md:block w-full ${k}`,alt:"Video placeholder",src:((X=(K=(J=t==null?void 0:t.desktop)==null?void 0:J.data)==null?void 0:K.attributes)==null?void 0:X.url)||`${o}_poster`}),(0,e.jsx)("img",{className:`md:hidden w-full ${x}
1`,alt:"Video placeholder",src:((y=(Z=(Y=t==null?void 0:t.mobile)==null?void 0:Y.data)==null?void 0:Z.attributes)==null?void 0:y.url)||`${u}_poster`})]}),children:N}):N};export{re as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.