!function(e,t){e._EPYT_=e._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:!0,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:!0,ajax_compat:!1,usingdefault:!0,ytapi_load:"light",pause_others:!1,facade_mode:!1,not_live_on_channel:!1,maxres_facade:"eager"},e._EPYT_.touchmoved=!1,e._EPYT_.apiVideos=e._EPYT_.apiVideos||{},0===e.location.toString().indexOf("https://")&&(e._EPYT_.ajaxurl=e._EPYT_.ajaxurl.replace("http://","https://")),e._EPYT_.pageLoaded=!1,t(e).on("load._EPYT_",(function(){e._EPYT_.pageLoaded=!0})),document.querySelectorAll||(document.querySelectorAll=function(t){var a=document,o=a.documentElement.firstChild,r=a.createElement("STYLE");return o.appendChild(r),a.__qsaels=[],r.styleSheet.cssText=t+"{x:expression(document.__qsaels.push(this))}",e.scrollBy(0,0),a.__qsaels}),void 0===e._EPADashboard_&&(e._EPADashboard_={initStarted:!1,checkCount:0,onPlayerReady:function(a){try{if(void 0!==_EPYT_.epdovol&&_EPYT_.epdovol){var o=parseInt(a.target.getIframe().getAttribute("data-vol"));isNaN(o)||(0===o?a.target.mute():(a.target.isMuted()&&a.target.unMute(),a.target.setVolume(o)))}var r=parseInt(a.target.getIframe().getAttribute("data-epautoplay"));isNaN(r)||1!==r||a.target.playVideo()}catch(e){}try{var i=a.target.getIframe(),n=i.getAttribute("id");e._EPYT_.apiVideos[n]=a.target,e._EPYT_.not_live_on_channel&&a.target.getVideoUrl().indexOf("live_stream")>0&&e._EPADashboard_.doLiveFallback(i)}catch(e){}finally{t(a.target.getIframe()).css("opacity",1)}},onPlayerStateChange:function(a){var o=a.target.getIframe();if(e._EPYT_.pause_others&&a.data===e.YT.PlayerState.PLAYING&&e._EPADashboard_.pauseOthers(a.target),a.data===e.YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===o.src.indexOf("autoplay=1")&&(a.target.ponce=!0),a.data===e.YT.PlayerState.ENDED&&"1"==t(o).data("relstop"))if("function"==typeof a.target.stopVideo)a.target.stopVideo();else{var r=t(o).clone(!0).off();r.attr("src",e._EPADashboard_.cleanSrc(r.attr("src").replace("autoplay=1","autoplay=0"))),t(o).replaceWith(r),e._EPADashboard_.setupevents(r.attr("id")),o=r.get(0)}var i=t(o).closest(".epyt-gallery");if((i.length||(i=t("#"+t(o).data("epytgalleryid"))),i.length)&&("1"==i.find(".epyt-pagebutton").first().data("autonext")&&a.data===e.YT.PlayerState.ENDED)){var n=i.find(".epyt-current-video");n.length||(n=i.find(".epyt-gallery-thumb").first());var d=n.find(" ~ .epyt-gallery-thumb").first();d.length?d.trigger("click"):i.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click")}},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},base64DecodeUnicode:function(e){return e=e.replace(/\s/g,""),decodeURIComponent(Array.prototype.map.call(atob(e),(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))},findSwapBlock:function(e){var a=t(e).closest(".wp-block-embed");return a.length||(a=t(e).closest(".epyt-live-chat-wrapper")),a.length||(a=t(e).closest(".epyt-video-wrapper")),a.length||(a=t(e)),a},doLiveFallback:function(a){var o=_EPADashboard_.findSwapBlock(a);if(o.length){var r=t("#epyt-live-fallback");if(r.length){var i="";try{i=e._EPADashboard_.base64DecodeUnicode(r.get(0).innerHTML)}catch(e){}if(i){var n=o.parent();e._EPADashboard_.loadYTAPI(),o.replaceWith(i),e._EPADashboard_.apiInit(),e._EPADashboard_.pageReady(),setTimeout((function(){void 0!==t.fn.fitVidsEP&&n.fitVidsEP()}),1)}}}},videoEqual:function(e,t){return!(!e.getIframe||!t.getIframe||e.getIframe().id!==t.getIframe().id)},pauseOthers:function(t){if(t)for(var a in e._EPYT_.apiVideos){var o=e._EPYT_.apiVideos[a];o&&"function"==typeof o.pauseVideo&&o!=t&&!_EPADashboard_.videoEqual(o,t)&&"function"==typeof o.getPlayerState&&[YT.PlayerState.BUFFERING,e.YT.PlayerState.PLAYING].indexOf(o.getPlayerState())>=0&&o.pauseVideo()}},justid:function(e){return new RegExp("[\\?&]v=([^&#]*)").exec(e)[1]},setupevents:function(t){if(void 0!==e.YT&&null!==e.YT&&e.YT.loaded){var a=document.getElementById(t);if(!a.epytsetupdone){e._EPADashboard_.log("Setting up YT API events: "+t),a.epytsetupdone=!0;var o={events:{onReady:e._EPADashboard_.onPlayerReady,onStateChange:e._EPADashboard_.onPlayerStateChange},host:(a.src||"").indexOf("nocookie")>0?"https://www.youtube-nocookie.com":"https://www.youtube.com"};return new e.YT.Player(t,o)}}},apiInit:function(){if(void 0!==e.YT){e._EPADashboard_.initStarted=!0;for(var t=document.querySelectorAll(_EPYT_.evselector),a=0;a=5||e._EPADashboard_.initStarted?clearInterval(e._EPADashboard_.checkInterval):(e._EPADashboard_.apiInit(),e._EPADashboard_.log("YT API init check"))}),1e3)},selectText:function(t){if(document.selection)(a=document.body.createTextRange()).moveToElementText(t),a.select();else if(e.getSelection){var a,o=e.getSelection();(a=document.createRange()).selectNode(t),o.removeAllRanges(),o.addRange(a)}},setVidSrc:function(t,a){if(t.is(".epyt-facade"))return t.attr("data-facadesrc",e._EPADashboard_.cleanSrc(a)),void t.trigger("click");var o=e._EPADashboard_.cleanSrc(a),r=e._EPADashboard_.parseYouTubeEmbedUrl(o),i=t.attr("id"),n=i?e._EPYT_.apiVideos[i]:null,d=void 0!==e.YT&&null!==e.YT&&e.YT.loaded;if(r.videoId&&"live_stream"!==r.videoId&&d&&n&&"function"==typeof n.loadVideoById){var s=e._EPADashboard_.mapUrlParamsToLoadOptions(r.params,r.videoId),l="1"===r.params.autoplay;try{l?n.loadVideoById(s):n.cueVideoById(s),t.data("ep-current-src",o)}catch(a){return void e._EPADashboard_.setVidSrcLegacy(t,o)}t.css("opacity","1")}else e._EPADashboard_.setVidSrcLegacy(t,o)},cleanSrc:function(e){return e.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1")},parseYouTubeEmbedUrl:function(e){var t={videoId:null,params:{}};if(!e||"string"!=typeof e)return t;var a=e.match(/\/embed\/([a-zA-Z0-9_-]{11})/);a&&a[1]?t.videoId=a[1]:e.indexOf("/embed/live_stream")>-1&&(t.videoId="live_stream");var o=e.indexOf("?");if(o>-1)for(var r=e.substring(o+1).split("#")[0].split("&"),i=0;i0&&(a.startSeconds=r)}if(e.end){var i=parseInt(e.end,10);!isNaN(i)&&i>0&&(a.endSeconds=i)}return a},setVidSrcLegacy:function(t,a){if(t.get(0).src&&t.get(0).contentWindow&&t.get(0).contentWindow.location)try{t.get(0).contentWindow.location.replace(a)}catch(e){t.attr("src",a)}else t.attr("src",a);t.get(0).epytsetupdone=!1,t.attr("id")||t.attr("id","_dytid_"+Math.round(8999*Math.random()+1e3)),e._EPADashboard_.setupevents(t.attr("id")),t.css("opacity","1")},loadYTAPI:function(){if(void 0===e.YT){if("never"!==e._EPYT_.ytapi_load&&("always"===e._EPYT_.ytapi_load||t('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length)){var a=document.createElement("script");a.src="https://www.youtube.com/iframe_api",a.type="text/javascript",document.getElementsByTagName("head")[0].appendChild(a)}}else e.YT.loaded&&(e._EPYT_.pageLoaded?(e._EPADashboard_.apiInit(),e._EPADashboard_.log("YT API available")):t(e).on("load._EPYT_",(function(){e._EPADashboard_.apiInit(),e._EPADashboard_.log("YT API available 2")})))},resolveFacadeQuality:function(e,a){if(e.epytFacadeCount=void 0===e.epytFacadeCount?0:e.epytFacadeCount+1,a||e.naturalHeight<200){var o=t(e).attr("src");o&&(t(e).attr("src",o.replace("maxresdefault","hqdefault")),t(e).off("load.epyt"))}e.epytFacadeCount>2&&t(e).off("load.epyt")},maximizeFacadeQuality:function(e){var a=t(e).attr("src");if(a&&a.indexOf("maxresdefault")<0){var o=a.replace("hqdefault","maxresdefault"),r=new Image;r.src=o,t(r).on("load.epyt",(function(){t(r).off("load.epyt"),r.naturalHeight>200&&(t(e).off("load.epyt"),t(e).attr("src",r.src))})).on("error",(function(){t(r).off("load.epyt")})).each((function(){r.complete&&t(r).trigger("load")}))}},pageReady:function(){e._EPYT_.not_live_on_channel&&"never"!==e._EPYT_.ytapi_load&&t(".epyt-live-channel").each((function(){var e=t(this);e.data("eypt-fallback")||(e.data("eypt-fallback",!0),e.css("opacity",0),setTimeout((function(){e.css("opacity",1)}),4e3))})),t(".epyt-gallery").each((function(){var a=t(this);if(!a.data("epytevents")||!t("body").hasClass("block-editor-page")){a.data("epytevents","1");var o=t(this).find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first(),r=o.data("src")||o.data("facadesrc")||o.attr("src");r||(r=o.data("ep-src"));var i=t(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");void 0!==r?(r=r.replace(i,"GALLERYVIDEOID"),a.data("ep-gallerysrc",r)):o.hasClass("__youtube_prefs_gdpr__")&&a.data("ep-gallerysrc",""),a.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",(function(r){if(o=a.find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first(),!e._EPYT_.touchmoved&&!t(this).hasClass("epyt-current-video")){a.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video"),t(this).addClass("epyt-current-video");var i=t(this).data("videoid");a.data("currvid",i);var n=a.data("ep-gallerysrc").replace("GALLERYVIDEOID",i),d=a.find(".epyt-pagebutton").first().data("thumbplay");"0"!==d&&0!==d&&(n.indexOf("autoplay")>0?n=n.replace("autoplay=0","autoplay=1"):n+="&autoplay=1",o.addClass("epyt-thumbplay"));var s=Math.max(t("body").scrollTop(),t("html").scrollTop()),l=o.offset().top-parseInt(_EPYT_.gallery_scrolloffset);s>l?t("html, body").animate({scrollTop:l},500,(function(){e._EPADashboard_.setVidSrc(o,n)})):e._EPADashboard_.setVidSrc(o,n)}})).on("touchmove",(function(t){e._EPYT_.touchmoved=!0})).on("touchstart",(function(){e._EPYT_.touchmoved=!1})).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",(function(e){var a=e.which;13!==a&&32!==a||(e.preventDefault(),t(this).trigger("click"))})),a.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",(function(){t(this).addClass("hover")})),a.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",(function(){t(this).removeClass("hover")})),a.on("click touchend",".epyt-pagebutton",(function(o){if(!e._EPYT_.touchmoved&&!a.find(".epyt-gallery-list").hasClass("epyt-loading")){a.find(".epyt-gallery-list").addClass("epyt-loading");var r=void 0!==o.originalEvent,i={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:t(this).data("playlistid"),pageToken:t(this).data("pagetoken"),pageSize:t(this).data("pagesize"),columns:t(this).data("epcolumns"),showTitle:t(this).data("showtitle"),showPaging:t(this).data("showpaging"),autonext:t(this).data("autonext"),thumbplay:t(this).data("thumbplay")}},n=t(this).hasClass("epyt-next"),d=parseInt(a.data("currpage")+"");d+=n?1:-1,a.data("currpage",d),t.post(_EPYT_.ajaxurl,i,(function(e){a.find(".epyt-gallery-list").html(e),a.find(".epyt-current").each((function(){t(this).text(a.data("currpage"))})),a.find('.epyt-gallery-thumb[data-videoid="'+a.data("currvid")+'"]').addClass("epyt-current-video"),"1"!=a.find(".epyt-pagebutton").first().data("autonext")||r||a.find(".epyt-gallery-thumb").first().trigger("click")})).fail((function(){alert("Sorry, there was an error loading the next page.")})).always((function(){if(a.find(".epyt-gallery-list").removeClass("epyt-loading"),"1"!=a.find(".epyt-pagebutton").first().data("autonext")){var e=Math.max(t("body").scrollTop(),t("html").scrollTop()),o=a.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);e>o&&t("html, body").animate({scrollTop:o},500)}}))}})).on("touchmove",(function(t){e._EPYT_.touchmoved=!0})).on("touchstart",(function(){e._EPYT_.touchmoved=!1}))}})),t(".__youtube_prefs_gdpr__.epyt-is-override").each((function(){t(this).parent(".wp-block-embed__wrapper").addClass("epyt-is-override__wrapper")})),t("button.__youtube_prefs_gdpr__").on("click",(function(a){a.preventDefault(),t.cookie&&(t.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"}),e.top.location.reload())})),"eager"===e._EPYT_.maxres_facade?t("img.epyt-facade-poster").on("load.epyt",(function(){e._EPADashboard_.resolveFacadeQuality(this,!1)})).on("error",(function(){e._EPADashboard_.resolveFacadeQuality(this,!0)})).each((function(){this.complete&&t(this).trigger("load")})):"soft"===e._EPYT_.maxres_facade&&t("img.epyt-facade-poster").on("load.epyt",(function(){e._EPADashboard_.maximizeFacadeQuality(this)})).each((function(){this.complete&&t(this).trigger("load")})),t(".epyt-facade-play").each((function(){t(this).find("svg").length||t(this).append('')})),t(".epyt-facade-poster[data-facadeoembed]").each((function(){var a=t(this);if(!a.data("facadeoembedcomplete")){a.data("facadeoembedcomplete","1");var o="https://www.youtube.com/"+a.data("facadeoembed");t.get("https://youtube.com/oembed",{url:o,format:"json"},(function(t){var o="eager"===e._EPYT_.maxres_facade?t.thumbnail_url.replace("hqdefault","maxresdefault"):t.thumbnail_url;a.attr("src",o)}),"json").fail((function(){})).always((function(){}))}})),t(document).on("click",".epyt-facade",(function(a){var o=t(this),r=o.attr("data-facadesrc");r=e._EPADashboard_.cleanSrc(r);for(var i=document.createElement("iframe"),n=0;n=0||0==d.name.toLowerCase().indexOf("data-"))&&t(i).attr(d.name,d.value)}t(i).removeClass("epyt-facade"),t(i).attr("allowfullscreen","").attr("title",o.find("img").attr("alt")).attr("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share").attr("referrerpolicy","strict-origin-when-cross-origin"),e._EPADashboard_.loadYTAPI(),o.replaceWith(i),e._EPADashboard_.setVidSrc(t(i),r),setTimeout((function(){void 0!==t.fn.fitVidsEP&&t(t(i).parent()).fitVidsEP()}),1)}))}}),e.onYouTubeIframeAPIReady=void 0!==e.onYouTubeIframeAPIReady?e.onYouTubeIframeAPIReady:function(){e._EPYT_.pageLoaded?(e._EPADashboard_.apiInit(),e._EPADashboard_.log("YT API ready")):t(e).on("load._EPYT_",(function(){e._EPADashboard_.apiInit(),e._EPADashboard_.log("YT API ready 2")}))},(!e._EPYT_.facade_mode||e._EPYT_.not_live_on_channel&&t('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&e._EPADashboard_.loadYTAPI(),e._EPYT_.pageLoaded?e._EPADashboard_.doubleCheck():t(e).on("load._EPYT_",(function(){e._EPADashboard_.doubleCheck()})),t(document).ready((function(){e._EPADashboard_.pageReady(),(!e._EPYT_.facade_mode||e._EPYT_.not_live_on_channel&&t('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&e._EPADashboard_.loadYTAPI(),e._EPYT_.ajax_compat&&t(e).on("load._EPYT_",(function(){t(document).ajaxSuccess((function(t,a,o){a&&a.responseText&&(-1!==a.responseText.indexOf("