import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{A as t,D as n,I as r,O as i,Ot as a,R as o,Z as s,b as c,et as l,j as u,pt as d}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-D1_ndkJp.js";import{t as f}from"./VideoPlayOverlay-CE9P33lA.js";var p=[`controls`],m=[`src`,`type`],h=o({__name:`MediaVideoTop`,props:{asset:{}},emits:[`videoPlayingStateChanged`,`videoControlsChanged`],setup(e,{emit:o}){let h=o,g=a(null),_=a(!1),v=a(!1),y=n(()=>v.value&&_.value);d(y,e=>{h(`videoControlsChanged`,e)}),s(()=>{h(`videoControlsChanged`,y.value)});let onVideoPlay=()=>{v.value=!0,h(`videoPlayingStateChanged`,!0)},onVideoPause=()=>{v.value=!1,h(`videoPlayingStateChanged`,!1)},onVideoClick=async()=>{if(y.value)return;let e=g.value;if(e){if(e.paused||e.ended){await e.play().catch(()=>{});return}e.pause()}};return(e,n)=>(l(),u(`div`,{class:`relative size-full overflow-hidden rounded bg-black`,onMouseenter:n[0]||=e=>_.value=!0,onMouseleave:n[1]||=e=>_.value=!1},[i(`video`,{ref_key:`videoElement`,ref:g,controls:y.value,preload:`metadata`,muted:``,loop:``,playsinline:``,class:`relative size-full object-contain transition-transform duration-300 group-hover:scale-105 group-data-[selected=true]:scale-105`,onClick:c(onVideoClick,[`stop`]),onPlay:onVideoPlay,onPause:onVideoPause},[e.asset.src?(l(),u(`source`,{key:0,src:e.asset.src,type:e.asset.mime_type??void 0},null,8,m)):t(``,!0)],40,p),r(f,{visible:!v.value,size:`md`},null,8,[`visible`])],32))}});export{h as default};
//# sourceMappingURL=MediaVideoTop-n-sgRyt7.js.map