(()=>{"use strict";let t;function e(){document.querySelectorAll(".jetpack-video-wrapper").forEach((function(t){t.querySelectorAll("embed, iframe, object").forEach((function(e){let i=0;const a=t.previousElementSibling;a&&"P"===a.nodeName&&"center"===getComputedStyle(a)["text-align"]&&(i="0 auto"),e.hasAttribute("data-ratio")||(e.setAttribute("data-ratio",(e.height||0)/(e.width||0)),e.setAttribute("data-width",e.width),e.setAttribute("data-height",e.height),e.style.display="block",e.style.margin=i);const d=e.getAttribute("data-width"),n=e.getAttribute("data-height"),o=e.getAttribute("data-ratio"),r=e.parentElement.clientWidth;if(e.removeAttribute("height"),e.removeAttribute("width"),"Infinity"===o)return e.style.width="100%",void(e.style.height=n+"px");parseInt(d,10)>r?(e.style.width=r+"px",e.style.height=r*parseFloat(o)+"px"):(e.style.width=d+"px",e.style.height=n+"px")}))}))}function i(){window.addEventListener("load",e),window.addEventListener("resize",(function(){clearTimeout(t),t=setTimeout(e,500)})),window.addEventListener("is.post-load",e),setTimeout(e)}"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)})();