var pmc_contextual_player={player_main_div:".pmc-contextual-player",message_pattern:"pmcadm:dfp:isdirect=true",init:function(){this.bind_events()},bind_events:function(){var self=this;self.pause_triggered=false;jQuery(window).on("message",function(wrappedEvent){var event=wrappedEvent.originalEvent;if("string"===typeof event.data){if(event.data.substring(0,self.message_pattern.length)===self.message_pattern){if("object"!==typeof pmc_adm_config||"string"!==typeof pmc_adm_config.contextual_on_direct_sold||"show"!==pmc_adm_config.contextual_on_direct_sold){self.remove_contextual_player()}}else if(event.data==="pmc_show_interrupt_ads"){if(window.contextual_player){try{if(window.contextual_player.getState()!=="playing"){var jwconfig=window.contextual_player.getConfig();if(jwconfig.autostart==="viewable"&&jwconfig.viewable){self.pause_triggered=true}}else{self.pause_triggered=true}if(self.pause_triggered){window.contextual_player.pause()}}catch(e){}}}else if(event.data==="pmc_hide_interrupt_ads"){if(self.pause_triggered){window.contextual_player.play();self.pause_triggered=false}}}});if("object"===typeof contextual_player){contextual_player.on("play",self.current_playing);contextual_player.on("adPlay",self.current_playing);contextual_player.on("relatedReady",function(){var relatedPlugin=contextual_player.getPlugin("related");if("object"===typeof relatedPlugin){relatedPlugin.on("feedShown",function(){self.create_playlist_nav();jQuery(".pmc-contextual-player .jw-related-control").on("click",self.current_playing)})}});contextual_player.on("ready",function(){var relatedPlugin=contextual_player.getPlugin("related");if("object"===typeof relatedPlugin){relatedPlugin.on("feedShown",function(){self.create_playlist_nav();jQuery(".pmc-contextual-player .jw-related-control").on("click",self.current_playing)})}})}},remove_contextual_player:function(){var player=jQuery(this.player_main_div);if(0VIEWING');if("object"===typeof current_item&&1===current_item.length){current_item.addClass("is-active")}if(0===jQuery(".jw-related-shelf-item[data-jw-index="+playlist_index+"] .contextual-self-now-playing").length){current_item.find(".jw-related-shelf-item-image").append(now_playing)}},create_playlist_nav:function(){if(0===jQuery(".pmc-contextual-player .l-adm-contextual-video__shadow").length){var shadow_left=jQuery('
'),shadow_right=jQuery('
');jQuery(".pmc-contextual-player .jw-related-control-left").prepend(shadow_left);jQuery(".pmc-contextual-player .jw-related-control-right").prepend(shadow_right)}}};pmc_contextual_player.init();; (()=>{"use strict";const t=window;t.blogherads=t.blogherads||{},t.blogherads.adq=t.blogherads.adq||[];const e=()=>t.blogherads,d=window,n=()=>"function"==typeof d.blogherads?.reloadAds,s=t=>Boolean(t?.domId?.length),a=window;a.pmc=a.pmc||{};const i=()=>a.pmc,o=window,r=i();r.displayAds=new function(){const t=e();this.init=function(){this.bind_events()}.bind(this),this.bind_events=function(){const e=i();e.hooks?.add_action?.("pmc_gallery_rotate_ads",this.rotate_ads_for_gallery),e.hooks?.add_action?.("pmc_rotate_ads",this.rotate_ads),"loading"!==document.readyState?this.display():document.addEventListener("DOMContentLoaded",this.display),o.addEventListener("message",this.direct_sold_ad_event_listener,!1),t.addEventListener("blankAdServed",this.blank_ad_event_listener),t.addEventListener("slotRefresh",this.slot_refresh_event_listener)}.bind(this),this.rotate_ads=function(e){if(!e||this.is_direct_sold||!n())return;const d=[];jQuery("div.slot-rotate-"+e).each((function(){let e="";e=1===parseInt(jQuery(this).data("is-adhesion-ad"))?"skm-ad-bottom":jQuery(this).attr("id");const n=t.getSlotById(e);n&&d.push(n)})),d&&d.length&&t.reloadAds(d)}.bind(this),this.rotate_ads_for_gallery=function(){if(!n())return;const e=o.pmc_meta;"mobile"===e?.env?t.reloadAds(t.getSlots()):t.reloadAds()}.bind(this),this.display=function(){""!==function(){const t=document.querySelector("#pmc-adm-ad-interrupts div.pmc-adm-boomerang-pub-div div");let e="";return t&&(e=t.id),e}()?o.pmc_admanager.show_interrupt_ads():t.getSlots().forEach((function(t){t.removeBlock("gallery"),t.display()}))}.bind(this),this.has_ads=function(e){return!!t.getSlots().find((t=>function(t,e){return Boolean(t&&"object"==typeof t&&"string"==typeof t.subAdUnitPath&&t.subAdUnitPath.includes(e))}(t,e)))}.bind(this),this.direct_sold_ad_event_listener=function(e){const d=i();if(!d.hooks||"string"!=typeof e.data)return;"pmcadm:dfp:isdirect=true"===e.data.substring(0,24)&&(this.is_direct_sold=!0,o.document.documentElement.classList.add("pmcadm-direct-sold"),t.getSlots().forEach((t=>t.setAutoRefreshTime(0))),d.hooks.do_action?.("pmc_adm_dfp_direct_sold",e))}.bind(this),this.blank_ad_event_listener=function(t){if(!s(t))return;let e=o.document.getElementById(t.domId);for(;e&&!e.matches(".adma");)e=e.parentElement;if(e&&e.matches(".adma")){for(e.classList.add("ad-empty");e&&!e.matches('[data-component="ad-unit"]');)e=e.parentElement;e&&e.setAttribute("data-ad-empty",!0)}}.bind(this),this.slot_refresh_event_listener=function(t){if(!s(t))return;let e=o.document.getElementById(t.domId);for(;e&&!e.matches(".adma");)e=e.parentElement;if(e&&e.matches(".ad-empty")){for(e.classList.remove("ad-empty");e&&!e.matches('[data-component="ad-unit"]');)e=e.parentElement;e&&e.matches("[data-ad-empty]")&&e.removeAttribute("data-ad-empty")}}.bind(this)},e().adq.push((function(){r.displayAds.init()}))})();;