!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){},function(e,t,r){"use strict";r.r(t);r(0);const{createElement:o,render:n,useState:u,useEffect:p,Fragment:i,useRef:a}=wp.element;var c=e=>{const[t,r]=u(!1),[n,c]=u(!1);a(null);p(()=>{c(!0)},[e]);const l=(e,t)=>{new Plyr(e,{})};let d=[],s=[];return"youtube"==e.type&&(d=e.url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&|?]+)/)),"vimeo"==e.type&&(s=e.url.match(/(http|https)?:\/\/(www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|)(\d+)(?:|\/\?)/)),o(i,null,n?o("div",{className:"course_video_popup_wrapper",onClick:e=>{document.querySelector(".course_video_popup_wrapper")&&e.target===document.querySelector(".course_video_popup_wrapper")&&c(!1)}},o("div",{className:"course_video_popup_content"},o("span",{className:"vicon vicon-close",onClick:()=>{c(!1)}}),o("div",{className:"video_wrapper"},"youtube"==e.type?o("div",{ref:t=>{t&&l(t,e.url)},"data-plyr-provider":"youtube","data-plyr-embed-id":d[1]}):"vimeo"==e.type?o("div",{ref:t=>{t&&l(t,e.url)},"data-plyr-provider":"vimeo","data-plyr-embed-id":s[4]}):o("div",{className:"video_wrapper"},o("video",{className:"activity_meta video",ref:t=>l(t,e.url)},o("source",{src:e.url,type:"video/mp4"})))))):"")};const{createElement:l,useState:d,useEffect:s,Fragment:m,render:v}=wp.element;function f(e,t){return!(!e||void 0===e.className||"string"!=typeof e.className)&&(e.className&&e.className.split(" ").indexOf(t)>-1)}document.addEventListener("click",(function(e){if(f(e.target,"course_video_popup")||f(e.target.parentElement,"course_video_popup")){let t=e.target;if(void 0!==e.target.parentElement&&e.target.parentElement&&f(e.target.parentElement,"course_video_popup")&&(t=e.target.parentElement),e.preventDefault(),e.stopPropagation(),null==document.getElementById("course_vid_popup")){let e=document.createElement("div");e.setAttribute("id","course_vid_popup"),document.body.appendChild(e)}v(l(c,{url:t.getAttribute("href"),image:t.querySelector("img")?t.querySelector("img").getAttribute("src"):"",def:t.innerHTML,type:t.getAttribute("type")}),document.getElementById("course_vid_popup"))}}),!1)}]);