1import{x as c,aq as n,ak as u,p,m as t,t as f,a9 as y,o as m,ab as g}from"./CXIEtJGx.js";import{u as V}from"./BEitN51j.js";const P=c({name:"UiVideo",props:{src:{type:String,required:!0},controls:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},aspectRatio:{type:String,default:"16/9"},placeholderSrc:{type:String,default:""},placeholderAlt:{type:String,default:"Video Placeholder"},autoplay:{type:Boolean,default:!1}},setup(e){const o=n(!1),a=n(null),s=n(!0),i=()=>{!e.autoplay&&a.value&&(a.value.muted=!1),o.value=!0},r=()=>{o.value=!1},l=()=>{!e.loop||!a.value||(a.value.currentTime=0,a.value.play())},d=v=>{v?(a.value?.play(),s.value=!1):a.value?.pause()};return{isPlaying:o,videoRef:a,onVideoPlay:i,onVideoPause:r,onVideoEnd:l,togglePlay:d,handleVideoClick:()=>{d(!o.value)},showPlaceholder:s}}}),k=["controls","autoplay"],h=["src"],C=["src","alt"];function b(e,o,a,s,i,r){return u(),p("div",{class:"relative h-max w-full",style:g({aspectRatio:e.aspectRatio})},[t("video",{ref:"videoRef",controls:e.controls,class:"controls-hide-download size-full",preload:"auto",autoplay:e.autoplay,muted:"",onPlay:o[0]||(o[0]=(...l)=>e.onVideoPlay&&e.onVideoPlay(...l)),onPause:o[1]||(o[1]=(...l)=>e.onVideoPause&&e.onVideoPause(...l)),onEnded:o[2]||(o[2]=(...l)=>e.onVideoEnd&&e.onVideoEnd(...l)),onClick:o[3]||(o[3]=(...l)=>e.handleVideoClick&&e.handleVideoClick(...l))},[t("source",{src:e.src,type:"video/mp4"},null,8,h)],40,k),o[6]||(o[6]=f()),e.showPlaceholder&&e.placeholderSrc?(u(),p("img",{key:0,src:e.placeholderSrc,alt:e.placeholderAlt,class:y(["pointer-events-none absolute inset-0 size-full object-cover transition-opacity",{"opacity-0":e.isPlaying}])},null,10,C)):m("",!0),o[7]||(o[7]=f()),t("button",{class:y(["absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-gold px-4 py-2 font-bold text-white shadow-lg transition-all duration-75 hover:brightness-95 active:scale-95",{"scale-0":e.isPlaying}]),onClick:o[4]||(o[4]=l=>e.togglePlay(!e.isPlaying))},[...o[5]||(o[5]=[t("svg",{class:"size-6 xl:h-8 xl:w-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5v14l11-7z"})],-1)])],2)],4)}const z=Object.assign(V(P,[["render",b]]),{__name:"UiVideo"});export{z as _};
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.