(()=>{"use strict";var e={744:(e,t,r)=>{var a=r(795);t.H=a.createRoot,a.hydrateRoot},795:e=>{e.exports=window.ReactDOM}},t={};const r=window.React;var a=function r(a){var o=t[a];if(void 0!==o)return o.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}(744);const o="vpbVideoPlayer",n=({attributes:e,id:t})=>{const{width:a,radius:n}=e;return(0,r.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t#${t} .${o}{\n\t\t\twidth: ${["0px","0%","0em"].includes(a)?"100%":a};\n\t\t\tborder-radius: ${n};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},s=e=>{const t=[];return Object.keys(e).map((r=>{e[r]&&t.push(r)})),t};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-vpb-video").forEach((e=>{const t=JSON.parse(e.dataset.attributes);(0,a.H)(e).render((0,r.createElement)(r.Fragment,null,(0,r.createElement)(n,{attributes:t,id:e.id}),(0,r.createElement)(l,{attributes:t}))),e?.removeAttribute("data-attributes")}))}));const l=({attributes:e})=>{const{source:t,poster:a,muted:n,autoplay:l}=e,d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const t=new Plyr(d.current,(e=>{const{controls:t,repeat:r,autoplay:a,muted:o,resetOnEnd:n,autoHideControl:l}=e,d=o?{storage:{enabled:!1,key:"plyr"},volume:0}:{};return{controls:s(t),clickToPlay:!1,loop:{active:r},muted:o,autoplay:a,...d,resetOnEnd:n,hideControls:l,playsinline:!0}})(e));t.on("ready",(()=>{n&&l&&t.play()}))}),[]);const c=l?{autoplay:l}:{},u=n?{muted:n}:{};return(0,r.createElement)("div",{className:o},(0,r.createElement)("div",{className:"videoWrapper"},(0,r.createElement)("video",{controls:!0,playsinline:!0,"data-poster":a,preload:"metadata",...c,...u,ref:d},"Your browser does not support the video tag.",(0,r.createElement)("source",{src:t,type:`video/${i=t,i.substring(i.lastIndexOf(".")+1)||"mp4"}`}))));var i}})();