(()=>{"use strict";var d,o;d=window,o=d.document,(new(function(){function t(){this.scriptLoaded=!1,this.hasFullySponsored=!1,this.hasDirectSold=!1,this.alreadyHandledAnchorSlotRendered=!1,this.scriptLoaded=!1,this.hasFullySponsored=!1,this.alreadyHandledAnchorSlotRendered=!1,d.blogherads=d.blogherads||{},d.blogherads.adq=d.blogherads.adq||[]}return t.prototype.init=function(){var o,t,e,i,s,n=this;(null===(t=null===(o=d.pmc)||void 0===o?void 0:o.hooks)||void 0===t?void 0:t.add_action)&&(d.pmc.hooks.add_action("pmc_adm_dfp_fully_sponsored",this.handleFullySponsored.bind(this)),d.pmc.hooks.add_action("pmc_adm_dfp_direct_sold",this.handleDirectSold.bind(this))),this.detectFullySponsored(),this.detectDirectSold(),"boomerang"!==(null===(e=window.pmcOutbrain)||void 0===e?void 0:e.pmcadm_provider)?this.loadScript():null===(s=null===(i=d.blogherads)||void 0===i?void 0:i.adq)||void 0===s||s.push((function(){d.blogherads.addEventListener("anchorSlotRendered",n.handleAnchorSlotRendered.bind(n))}))},t.prototype.handleAnchorSlotRendered=function(){this.alreadyHandledAnchorSlotRendered||(setTimeout(this.loadScript.bind(this),200),this.alreadyHandledAnchorSlotRendered=!0)},t.prototype.detectFullySponsored=function(){var t,e;return this.hasFullySponsored||!(null===(e=null===(t=d.pmc)||void 0===t?void 0:t.displayAds)||void 0===e?void 0:e.is_fully_sponsored)&&!o.documentElement.classList.contains("pmcadm-fully-sponsored")||(this.hasFullySponsored=!0),this.hasFullySponsored},t.prototype.detectDirectSold=function(){var t,e;return this.hasDirectSold||!(null===(e=null===(t=d.pmc)||void 0===t?void 0:t.displayAds)||void 0===e?void 0:e.is_direct_sold)&&!o.documentElement.classList.contains("pmcadm-direct-sold")||(this.hasDirectSold=!0),this.hasDirectSold},t.prototype.handleDirectSold=function(){this.hasDirectSold=!0},t.prototype.handleFullySponsored=function(){this.hasFullySponsored=!0},t.prototype.loadScript=function(){if(this.detectFullySponsored(),this.detectDirectSold(),!this.hasFullySponsored&&!this.scriptLoaded&&void 0===d.OBR){this.hasDirectSold&&(window.OB_ContextKeyValue="takeovers");var t=o.createElement("script");t.src="https://widgets.outbrain.com/outbrain.js",t.async=!0,o.body.appendChild(t),this.scriptLoaded=!0}},t}())).init()})();