1import{V as L,f as C,i as f,a as F,b as R,c as B,P}from"./CS2F5_Co.js";import{s as o,O as c,o as D,L as Q,aa as O,l as $,d as j,w as v,j as E,a7 as T}from"./Ur6qcH-W.js";const A={__name:"LazyVimeo",props:{src:{type:String,required:!0},aspectRatio:{type:String,default:"16:9",validator:function(s){return/^\d+:\d+$/u.test(s)},required:!1},showTitle:{type:Boolean,default:!0,required:!1},maxWidth:{type:String,default:"560px",required:!1},autoplay:{type:Boolean,default:!1,required:!1},thumbnailQuality:{type:String,default:"standard",required:!1},iframeClass:{type:String,default:"ly-iframe",required:!1},customTitle:{type:String,default:"",required:!1},customThumbnail:{type:String,default:"",required:!1},oembedFetch:{type:Boolean,default:!0,required:!1},iframePolicy:{type:String,default:"",required:!1}},setup(s,{expose:w}){const a=s,d=o(!1),i=o(!1),e=o(null),l=o(null),n=o(!0),r=o(!1),m=o(),p=c(()=>R(a.src)),q=c(()=>a.customThumbnail?a.customThumbnail:l.value!==null?l.value.thumbnail_url:""),S=c(()=>B(a.aspectRatio)),h=c(()=>a.customTitle?a.customTitle:l.value!==null?l.value.title:a.customTitle),I=({el:t,ctx:u})=>{m.value=u.vnode.el},y=()=>{e.value!==null&&(e.value.remove(),e.value=null,d.value=!1,i.value=!1)},g=(t=!1,u="youtube")=>{e.value=F(p.value,h.value,a.iframeClass,a.iframePolicy,u),e.value.addEventListener("load",()=>{n.value===!1&&(i.value||(i.value=!0)),t&&(u==="youtube"?e.value.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"):e.value.contentWindow.postMessage('{"method":"play"}',"*"))}),m.value.appendChild(e.value),e.value.focus()},W=()=>{d.value=!0,n.value===!1&&!i.value&&r.value&&d.value&&e.value===null&&g(!1,"vimeo")},M=()=>{f&&e.value!==null&&e.value.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")},b=()=>{f&&(e.value===null?g(a.autoplay,"vimeo"):e.value.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"))},k=()=>{f&&e.value!==null&&e.value.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}',"*")},V=()=>{a.oembedFetch?C(a.src,"vimeo").then(function(t){return t.json()}).then(t=>{l.value=t,r.value=!0}).catch(()=>{l.value=null,r.value=!1}).finally(()=>{n.value=!1,a.autoplay&&b()}):(r.value=!0,n.value=!1)},x=()=>{y(),d.value=!1,i.value=!1,e.value=null,l.value=null,n.value=!0,r.value=!1};return D(()=>{V()}),Q(O(()=>a.src),async(t,u)=>{t!==u&&(x(),V())}),w({pauseVideo:M,playVideo:b,stopVideo:k,resetView:y}),(t,u)=>(j(),$(L,{aspectRatioValue:S.value,maxWidth:s.maxWidth,onVnodeMounted:I},{default:v(()=>[E(P,{type:"vimeo",isVideoFound:r.value,fetchingInfo:n.value,defaultThumbnailQuality:s.thumbnailQuality,customThumbnail:q.value,videoTitle:h.value,videoID:p.value,showTitle:s.showTitle,clicked:d.value,onceLoaded:i.value,onClick:W},{button:v(()=>[T(t.$slots,"button")]),loader:v(()=>[T(t.$slots,"loader")]),_:3},8,["isVideoFound","fetchingInfo","defaultThumbnailQuality","customThumbnail","videoTitle","videoID","showTitle","clicked","onceLoaded"])]),_:3},8,["aspectRatioValue","maxWidth"]))}};export{A as default};
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.