l||"Header"===t&&l>100&&i.result)},k="250px",x=function(){function t(t,e){this._clsOptions=t,this.targetDensityExperiment=e,this._totalContentInserted=0,this._recipeCount=0,this._mainContentHeight=0,this._mainContentDiv=null,this._firstContentDiv=null,this._totalAvailableElements=0,this._minDivHeight=250,this._densityDevice=a.Desktop,this._pubLog={onePerViewport:!1,targetDensity:0,targetDensityUnits:0,combinedMax:0},this._densityMax=.99,this._infPageEndOffset=0,this.locationMaxLazySequence=new Map([["Recipe",5],["Below_Post",1]]),this.locationToMinHeight={Below_Post:k,Content:k,Recipe:k,Sidebar:k};var n=this._clsOptions.siteAds.breakpoints,i=n.tablet,o=n.desktop;this._device=function(t,e){var n=window.innerWidth;return n>=e?"desktop":n>=t?"tablet":"phone"}(i,o),this._config=new b(t),this._clsOptions.enabledLocations=this._config.enabledLocations}return t.prototype.start=function(){var t,e,n,i=this;try{!function(t){var e=document.body,n="adthrive-device-".concat(t);if(!e.classList.contains(n))try{e.classList.add(n)}catch(t){document.createElement("_")}}(this._device);var a=(t=this._device,e=this._clsOptions.siteAds.adUnits,n=new E,e.filter((function(t){return void 0!==t.dynamic&&t.dynamic.enabled})).map((function(e){var i=e.location.replace(/\s+/g,"_");return{auctionPriority:w.get(i)||8,location:i,sequence:s(e.sequence,1),sizes:D(e.adSizes).filter((function(i){return C(e.location,i,t,n)})),devices:e.devices,pageSelector:s(e.dynamic.pageSelector,"").trim(),elementSelector:s(e.dynamic.elementSelector,"").trim(),position:s(e.dynamic.position,"beforebegin"),max:Math.floor(s(e.dynamic.max,0)),spacing:s(e.dynamic.spacing,0),skip:Math.floor(s(e.dynamic.skip,0)),every:Math.max(Math.floor(s(e.dynamic.every,1)),1),classNames:e.dynamic.classNames||[],sticky:"Footer"===e.location||e.sticky,stickyOverlapSelector:s(e.stickyOverlapSelector,"").trim(),autosize:e.autosize,special:s(e.targeting,[]).filter((function(t){return"special"===t.key})).reduce((function(t,e){return t.concat.apply(t,r([],o(e.value),!1))}),[]),lazy:s(e.dynamic.lazy,!1),lazyMax:s(e.dynamic.lazyMax,2),lazyMaxDefaulted:0!==e.dynamic.lazyMax&&!e.dynamic.lazyMax}}))).filter((function(t){return i._locationEnabled(t)})).filter((function(t){return function(t,e){return-1!==t.devices.indexOf(e)}(t,i._device)})).filter((function(t){return 0===(e=t).pageSelector.length||null!==document.querySelector(e.pageSelector);var e}));this.inject(a).forEach((function(t){return i._clsOptions.setInjectedSlots(t)}))}catch(t){}},t.prototype.inject=function(t,e){void 0===e&&(e=document);var n=this.targetDensityExperiment.result,i=t.filter((function(t){return n?"Content"!==t.location:t})),a=t.filter((function(t){return n?"Content"===t.location:null}));return r(r([],o(i.length?this._injectNonDensitySlots(i,e):[]),!1),o(a.length?this._injectDensitySlots(a,e):[]),!1)},t.prototype._injectNonDensitySlots=function(t,e){var n,a,l=this;void 0===e&&(e=document);var s=[],u=[];try{for(var d=i(t),p=d.next();!p.done;p=d.next()){var h=p.value,y=0,f=0,m=0;h.spacing>0&&(y=window.innerHeight*h.spacing,f=y);var _=this._repeatDynamicAds(h),g=this.getElements(h.elementSelector,e);h.skip;for(var v=function(t){if(m+1>_.length)return"break";var n=g[t];if(y>0){var i=c(n).bottom;if(i<=f)return"continue";f=i+y}var a=_[m],l="".concat(a.location,"_").concat(a.sequence);s.some((function(t){return t.name===l}))&&(m+=1);var d=b.getDynamicElementId(a),p="adthrive-".concat(h.location.replace("_","-").toLowerCase()),v=r([p,"".concat(p,"-").concat(h.sequence)],o(h.classNames),!1),P=b.addAd(n,d,h.position,v);if(P){var S=O(a,P);if(S.length){var E={clsDynamicAd:h,dynamicAd:a,element:P,sizes:S,name:l,infinite:e!==document};s.push(E),u.push({location:a.location,element:P}),"Recipe"===h.location&&++b._recipeCount,m+=1}n=P}},b=this,P=h.skip;P0?[f]:[]),!1)),!1));if(this._pubLog={onePerViewport:p,targetDensity:d,targetDensityUnits:y,combinedMax:f},!m)return[];var _=0,g=0,v=function(t){var n=b.getElements(t.elementSelector,e),i=b._getInsertEvery(m,p);b._logDensityInfo(n,t.elementSelector,i);var o=function(n){var o,r,a=null;o=s._attemptInsertion({dynamicAd:t,element:n,insertNext:g,onePerViewport:p,contentInsertedThisPage:_,target:e,insertEvery:i,targetAll:h}),g=o.insertNext,r=o.slot,a=o.adElement,r&&a&&(c.push(r),++_,a.style.minHeight=s.locationToMinHeight[t.location])};t.skip;for(var r=t.skip;r=b._mainContentHeight&&b._totalAvailableElements>1)){if(!(_n?window.innerHeight:n},t.prototype._getDensitySettings=function(){var t=this._clsOptions.siteAds.adDensityLayout,e=this._determineOverrides(t.pageOverrides);return e.length?e[0]:t[this._densityDevice]},t.prototype._determineOverrides=function(t){var e=this;return t.filter((function(t){var e=d(t.pageSelector);return""===t.pageSelector||e.elements&&e.elements.length})).map((function(t){return t[e._densityDevice]}))},t.prototype._getTargetDensityUnits=function(t){return Math.floor(t*this._mainContentHeight/(1-t)/this._minDivHeight)-this._recipeCount},t.prototype._getCombinedMax=function(t){return s(t.filter((function(t){var e;try{e=document.querySelector(t.elementSelector)}catch(t){}return e})).map((function(t){return t.max+(t.lazyMaxDefaulted?0:t.lazyMax)})).sort((function(t,e){return e-t}))[0],0)},t.prototype._logDensityInfo=function(t,e,n){var i=this._pubLog,o=i.onePerViewport,r=i.targetDensity,a=i.targetDensityUnits,l=i.combinedMax;this._totalAvailableElements,this._clsOptions.targetDensityLog={onePerViewport:o,combinedMax:l,targetDensityUnits:a,targetDensityPercentage:r,mainContentHeight:this._mainContentHeight,recipeCount:this._recipeCount,numberOfEls:t.length}},t.prototype._attemptInsertion=function(t){var e,i=t.dynamicAd,o=t.element,r=t.insertNext,a=t.onePerViewport,l=t.contentInsertedThisPage,s=t.target,c=t.insertEvery,u=t.targetAll,d=null,p=null;if(this._isElementSpacedCorrectly(o,r,a,i,u,c)){var h=n(n({},i),{sequence:this._totalContentInserted+1,lazy:i.lazy&&l>=i.max});d=(e=this._addContentAd(o,i,h,s,c)).insertedSlot,r=e.insertNext,p=e.adElement}return{insertNext:r,slot:d,adElement:p}},t.prototype._isElementSpacedCorrectly=function(t,e,n,i,o,r){var a="beforebegin"===i.position||"afterbegin"===i.position,l="beforeend"===i.position||"afterbegin"===i.position,s=o||this._isElementFarEnough(n,t,e,a,r),c=l||this._isElementNotInRow(t,a),u=s&&c;return u&&(this._lastElement=t,this._lastAdPosition="beforebegin"===i.position||"afterbegin"===i.position?"top":"bottom"),u},t.prototype._getMinimumSpacingByLastInjection=function(t){return this._lastAdPosition&&"bottom"===this._lastAdPosition&&tn&&(0===l||s-l>=o+a)},t.prototype._isElementNotInRow=function(t,e){var n=t.previousElementSibling,i=t.nextElementSibling,o=e?!n&&i||n&&t.tagName!==n.tagName?i:n:i;return!(!o||0!==t.getBoundingClientRect().height)||(!o||t.getBoundingClientRect().top!==o.getBoundingClientRect().top)},t.prototype._calculateMainContentHeightAndAllElements=function(t){var e=this._setMainContentAndElements(t),n=e.mainContentDiv,i=e.firstContentDiv;this._mainContentDiv=n,this._firstContentDiv=i;var o=this._mainContentDiv.querySelector("div #comments, section .comments");this._mainContentHeight=o?this._mainContentDiv.offsetHeight-o.offsetHeight:this._mainContentDiv.offsetHeight},t.prototype._setMainContentAndElements=function(t){var e=this._getPotentialElements(t);if(0===e.length)throw Error("No Main Content Elements Found");return{mainContentDiv:Array.from(e).reduce((function(t,e){return e.offsetHeight>t.offsetHeight?e:t}))||document.body,firstContentDiv:Array.from(e).reduce((function(t,e){return c(e).topt.offsetHeight?e:t}));return e&&e.offsetHeight>1.5*window.innerHeight?e:null},t.prototype._getSelectors=function(t){return t.indexOf(",")>-1?t.split(","):[t]},t.prototype._addContentAd=function(t,e,n,i,a){void 0===i&&(i=document);var l=null,s="adthrive-".concat(e.location.replace("_","-").toLowerCase()),c="".concat(s,"-").concat(e.sequence),u=this.addAd(t,this.getDynamicElementId(n),n.position,r([s,c],o(e.classNames),!1)),d=this._getNextInsertPosition(n.position,u,a);if(u){var p=O(n,u);if(p.length)l={clsDynamicAd:e,dynamicAd:n,element:u,sizes:p,name:"".concat(n.location,"_").concat(n.sequence),infinite:i!==document},++this._totalContentInserted}return{insertedSlot:l,insertNext:d,adElement:u}},t.prototype._getNextInsertPosition=function(t,e,n){var i=e.getBoundingClientRect(),o=window.pageYOffset;return("beforebegin"===t||"afterbegin"===t?i.top:i.bottom)+o+n+this._minDivHeight},t.prototype.getDynamicElementId=function(t){return"".concat("AdThrive","_").concat(t.location,"_").concat(t.sequence,"_").concat(this._device)},t.prototype.getElements=function(t,e){return void 0===e&&(e=document),e.querySelectorAll(t)},t.prototype.addAd=function(t,e,n,i){if(void 0===i&&(i=[]),!document.getElementById(e)){var o='
');t.insertAdjacentHTML(n,o)}return document.getElementById(e)},t.prototype._repeatDynamicAds=function(t){for(var e=[],i=t.lazy?s(this.locationMaxLazySequence.get(t.location),0):0,o=t.max,r=0===i&&t.lazy?o+t.lazyMax:Math.min(Math.max(i-t.sequence+1,0),o+t.lazyMax),a=Math.max(o,r),l=0;l=o;e.push(n(n({},t),{sequence:c,lazy:u}))}return e},t.prototype._locationEnabled=function(t){var e=-1!==this._clsOptions.enabledLocations.indexOf(t.location),n=this._clsOptions.disableAds&&this._clsOptions.disableAds.all||document.body.classList.contains("adthrive-disable-all"),i=!document.body.classList.contains("adthrive-disable-content")&&!this._clsOptions.disableAds.reasons.has("content_plugin");return e&&!n&&i},t}();!function(t){t.Video_Collapse_Autoplay_SoundOff="Video_Collapse_Autoplay_SoundOff",t.Video_Individual_Autoplay_SOff="Video_Individual_Autoplay_SOff",t.Video_Coll_SOff_Smartphone="Video_Coll_SOff_Smartphone",t.Video_In_Post_ClicktoPlay_SoundOn="Video_In-Post_ClicktoPlay_SoundOn"}(P||(P={})),function(t){t.StickySekindo="stickySekindo",t.StaticSekindo="staticSekindo",t.None="none"}(S||(S={}));var M,I=function(t){function n(){var e=t.call(this)||this;return e.key="sekho",e._result=!1,e._choices=[{choice:!0},{choice:!1}],e._result=e.run(),e.setExperimentKey(),e}return e(n,t),Object.defineProperty(n.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0}),n.prototype.run=function(){return new l(.05).get()},n}(h),j=function(t){function i(e,n){var i=t.call(this,e,(new I).result,"ClsVideoInsertion")||this;return i._videoConfig=e,i._clsOptions=n,i._IN_POST_SELECTOR=".adthrive-video-player",i._WRAPPER_BAR_HEIGHT=36,i._playersAddedFromPlugin=[],i}return e(i,t),i.prototype.init=function(){this._initializePlayers()},i.prototype._wrapJWPlayerWithCLS=function(t,e,n){if(void 0===n&&(n=0),t.parentNode){var i=t.offsetWidth*(9/16),o=this._createGenericCLSWrapper(i,e,n);t.parentNode.insertBefore(o,t),o.appendChild(t)}},i.prototype._createSekindoCLSWrapper=function(t,e){var n=this._getTitleHeight(document.createElement("h4"));return this._createGenericCLSWrapper(t,e,n)},i.prototype._createGenericCLSWrapper=function(t,e,n){var i=document.createElement("div");return i.id="cls-video-container-".concat(e),i.className="adthrive",i.style.minHeight="".concat(t+n,"px"),i},i.prototype._getTitleHeight=function(t){t.innerText="Title",t.style.visibility="hidden",document.body.appendChild(t);var e=window.getComputedStyle(t),n=parseInt(e.height,10),i=parseInt(e.marginTop,10),o=parseInt(e.marginBottom,10);return document.body.removeChild(t),Math.min(n+o+i,50)},i.prototype._initializePlayers=function(){var t=document.querySelectorAll(this._IN_POST_SELECTOR);t.length&&this._initializeRelatedPlayers(t),this._shouldRunAutoplayPlayers()&&this._determineAutoplayPlayers()},i.prototype._createStationaryRelatedPlayer=function(t,e){this._device,P.Video_In_Post_ClicktoPlay_SoundOn,e&&t.mediaId&&(this._wrapJWPlayerWithCLS(e,t.mediaId),this._playersAddedFromPlugin.push(t.mediaId))},i.prototype._createStickyRelatedPlayer=function(t,e){if(this._device,P.Video_Individual_Autoplay_SOff,this._stickyRelatedOnPage=!0,this._videoConfig.mobileStickyPlayerOnPage="mobile"===this._device,e&&t.position&&t.mediaId){var n=document.createElement("div");e.insertAdjacentElement(t.position,n);var i=document.createElement("h3");i.style.margin="10px 0";var o=this._getTitleHeight(i);this._wrapJWPlayerWithCLS(n,t.mediaId,this._WRAPPER_BAR_HEIGHT+o),this._playersAddedFromPlugin.push(t.mediaId)}},i.prototype._createSekindoPlayer=function(t,e){var i=t.playlistId;n(n({},t),{classNames:[]});var o="mobile"===this._device?{width:340,height:260}:{width:320,height:250},r=this._createSekindoCLSWrapper(o.height,i);e.insertAdjacentElement(t.position,r),this._playersAddedFromPlugin.push(i)},i.prototype._createPlaylistPlayer=function(t,e){var n=t.playlistId;this._videoConfig.mobileStickyPlayerOnPage=!0;var i=document.createElement("div");e.insertAdjacentElement(t.position,i),this._wrapJWPlayerWithCLS(i,n,this._WRAPPER_BAR_HEIGHT),this._playersAddedFromPlugin.push("playlist-".concat(n))},i.prototype._isVideoAllowedOnPage=function(){var t=this._clsOptions.disableAds;return t&&t.video?(t.reasons.has("video_tag")||t.reasons.has("video_plugin")||t.reasons.has("video_page"),!1):!this._clsOptions.videoDisabledFromPlugin},i}(function(t){function i(e,n,i){var o=t.call(this)||this;o._videoConfig=e,o._component=i,o._stickyRelatedOnPage=!1,o._contextualMediaIds=[];var r=o._videoConfig.players||[];o._device=/Windows NT|Macintosh/i.test(navigator.userAgent)?"desktop":"mobile",o._potentialPlayerMap=o._setPotentialPlayerMap(n);var a=r.filter((function(t){return"stationaryRelated"===t.type&&t.enabled}));return o._potentialPlayerMap.stationaryRelated=a,o}return e(i,t),i.prototype._setPotentialPlayerMap=function(t){var e=this,n=this._videoConfig.players,i={stickyRelated:[],stickyPlaylist:[],sekindo:[],stationaryRelated:[]};return n&&n.length?n.filter((function(t){var n;return(null===(n=t.devices)||void 0===n?void 0:n.indexOf(e._device))>-1})).reduce((function(n,i){return n[i.type]||(f.event(e._component,"constructor","Unknown Video Player Type detected",i.type),n[i.type]=[]),i.enabled&&(t&&"sekindo"===i.type||n[i.type].push(i)),n}),i):i},i.prototype._checkPlayerSelectorOnPage=function(t){var e=this,n=this._potentialPlayerMap[t].map((function(t){return{player:t,playerElement:e._getPlacementElement(t)}}));return n.length?n[0]:{player:null,playerElement:null}},i.prototype._getOverrideElement=function(t,e,n){if(t&&e){var i=document.createElement("div");e.insertAdjacentElement(t.position,i),n=i}else{var o=this._checkPlayerSelectorOnPage("stickyPlaylist"),r=o.player,a=o.playerElement;if(r&&a){i=document.createElement("div");a.insertAdjacentElement(r.position,i),n=i}}return n},i.prototype._shouldOverrideElement=function(t){var e=t.getAttribute("override-embed");return"true"===e||"false"===e?"true"===e:!!this._videoConfig.contextualSettings&&this._videoConfig.contextualSettings.overrideEmbedLocation},i.prototype._getPlacementElement=function(t){var e=d(t.pageSelector),n=u(t.elementSelector);return e.valid?t.pageSelector&&!e.elements.length?(f.event("VideoUtils","getPlacementElement",new Error("PSNF: ".concat(t.pageSelector," does not exist on the page"))),null):n.valid?n.elements.length>t.skip?n.elements[t.skip]:(f.event("VideoUtils","getPlacementElement",new Error("ESNF: ".concat(t.elementSelector," does not exist on the page"))),null):null:null},i.prototype._getEmbeddedPlayerType=function(t){var e=t.getAttribute("data-player-type");return e&&"default"!==e||(e=this._videoConfig.contextualSettings?this._videoConfig.contextualSettings.defaultPlayerType:"static"),this._stickyRelatedOnPage&&(e="static"),e},i.prototype._getUnusedMediaId=function(t){var e=t.getAttribute("data-video-id");return!(!e||-1!==this._contextualMediaIds.indexOf(e))&&(this._contextualMediaIds.push(e),e)},i.prototype._createRelatedPlayer=function(t,e,n){"collapse"===e?this._createCollapsePlayer(t,n):"static"===e&&this._createStaticPlayer(t,n)},i.prototype._createCollapsePlayer=function(t,e){var i=this._checkPlayerSelectorOnPage("stickyRelated"),o=i.player,r=i.playerElement,a=o||this._potentialPlayerMap.stationaryRelated[0];a&&a.playerId&&(this._shouldOverrideElement(e)&&(e=this._getOverrideElement(o,r,e)),e=document.querySelector("#cls-video-container-".concat(t," > div"))||e,this._createStickyRelatedPlayer(n(n({},a),{mediaId:t}),e))},i.prototype._createStaticPlayer=function(t,e){if(this._potentialPlayerMap.stationaryRelated.length&&this._potentialPlayerMap.stationaryRelated[0].playerId){var i=this._potentialPlayerMap.stationaryRelated[0];this._createStationaryRelatedPlayer(n(n({},i),{mediaId:t}),e)}},i.prototype._shouldRunAutoplayPlayers=function(){return!(!this._isVideoAllowedOnPage()||!(this._potentialPlayerMap.stickyRelated.length||this._potentialPlayerMap.stickyPlaylist.length||this._potentialPlayerMap.sekindo.length))},i.prototype._determineAutoplayPlayers=function(){var t=this._component,e="VideoManagerComponent"===t,n=this._config;if(this._stickyRelatedOnPage)f.event(t,"stickyRelatedOnPage",e&&{device:n&&n.context.device,isDesktop:this._device}||{});else{var i=this._checkPlayerSelectorOnPage("stickyPlaylist"),o=i.player,r=i.playerElement,a=this._checkPlayerSelectorOnPage("sekindo"),l=a.player,s=a.playerElement;o&&o.playerId&&o.playlistId&&r?this._createPlaylistPlayer(o,r):l&&l.playlistId&&s?this._createSekindoPlayer(l,s):f.event(t,"noStickyPlaylistOrSekindo",e&&{vendor:"none",device:n&&n.context.device,isDesktop:this._device}||{})}},i.prototype._initializeRelatedPlayers=function(t){for(var e=0;e