window._ccScriptSettings = {"scriptKey":"26584f07-b2f2-4db8-8224-2ad066e7bc5b","browserCacheUserTracking":true,"localCacheUserTracking":true,"cookieSettingsType":0,"launcherScripts":["https://script-api.ccgateway.net/script/launcher/1/user.js","https://script-api.ccgateway.net/userId","https://script-api.ccgateway.net/script/launcher/1/realtime.js","https://script-api.ccgateway.net/script/launcher/3/api.js"],"customScripts":[],"site":{"scriptId":"www.history.com","parentId":"b4b3d228","sharedDomain":true,"whitelist":false},"analytics":{"heartbeat":false,"fingerprint":false,"clickout":true,"adiq":false,"contextual":true,"customTaxonomy":false},"syncs":{"active":true,"partnerSyncs":{"bidswitch":{"partnerTypeId":0,"id":"bidSwitch","partnerId":"153","active":false},"blueKai":{"partnerTypeId":0,"id":"blueKai","partnerId":"82487","active":true},"cmi":{"partnerTypeId":0,"id":"cmi","partnerId":"","active":true},"exelate":{"partnerTypeId":0,"id":"exelate","partnerId":"713","active":true,"siteId":"928"},"eyeota":{"partnerTypeId":0,"id":"eyeota","partnerId":"b2c38a0","active":false,"siteId":"928"},"lotame":{"partnerTypeId":0,"id":"lotame","partnerId":"10114","active":true},"magnite":{"partnerTypeId":0,"id":"magnite","partnerId":"52318","active":false},"nielsen":{"partnerTypeId":0,"id":"nielsen","partnerId":"1115","active":true,"siteId":"928"},"semasio":{"partnerTypeId":0,"id":"semasio","partnerId":"","active":false},"shareThis":{"partnerTypeId":0,"id":"shareThis","partnerId":"","active":false},"xandr":{"partnerTypeId":0,"id":"xandr","partnerId":"","active":true},"zeotap":{"partnerTypeId":0,"id":"zeotap","partnerId":"1380","active":false}}},"user":{"id":"c52e8585-2de5-46d8-82af-2e6c11f431d2","ip":"3.87.54.77","fingerprint":"3.87.54.77:2","audienceMemberships":null,"isNew":true,"requiresFingerprint":true,"ios":false,"cached":false,"optOut":false},"session":{"id":"cc248382-35ee-4771-91d8-ccc636b02e16","isNew":true},"conversions":{"baseScript":true,"alwaysFire":true,"urlTriggers":[""]},"customEvents":{"triggers":{"click":null,"keyPress":null,"clickout":null}},"realtime":{"loadIntent":true,"loadAudiences":true,"loadBrands":false,"loadDemographics":true,"setGptTargeting":false,"setPrebidConfig":false},"sampling":{"active":false,"size":0.05},"tap":{"active":false,"accountId":"b4b3d228-9f85-4d2e-b5b1-093e68faffb0"}};
window._ccLauncherSettings = {"activeParent":true,"timestamp":"2022-01-10 02:10:20","api":"https://script-api.ccgateway.net","cdn":"https://script-api.ccgateway.net","ingestion":"https://tag-api-2-1.ccgateway.net/v1","location":"https://privacy-location-edge.ccgateway.net","customEvents":"https://ce21.ccgateway.net","revenueMapEndpoint":"https://revenue-mapping-api.ccgateway.net/gam/v1","script":"www.history.com","parent":"b4b3d228"};
window.ContextualEngine=window.ContextualEngine||{};ContextualEngine.que=ContextualEngine.que||[];ContextualEngine.GetPageUrl=function(){this.PageUrl=this.PageUrl||window.location.href;return this.PageUrl;};ContextualEngine.LoadDefault=function(){this.pogoapi=this.pogoapi||"https://pogo.ccgateway.net";this.parentID=this.parentID||"unknown";if(window._ccScriptSettings&&window._ccScriptSettings.site&&this.parentID=="unknown"){this.parentID=window._ccScriptSettings.site.parentId||"unknown";}}
ContextualEngine.SetPogoAPI=function(pogoapiURL){this.pogoapi=pogoapiURL;}
ContextualEngine.SetPageUrl=function(pageUrl){this.PageUrl=pageUrl;};ContextualEngine.GeneratePogoUrl=function(){return this.pogoapi+"/v1/p/"+this.parentID+"/classification?url="+encodeURIComponent(this.GetPageUrl());}
ContextualEngine.GetClassifications=function(){this.executeEvent("On","ContextualEngineLoadClassifications");var xhttp=new XMLHttpRequest();xhttp.onreadystatechange=function(){if(this.readyState==4&&this.status==200){pogoClassification=JSON.parse(this.responseText);if(pogoClassification){ContextualEngine.BrandSafetyChecked=pogoClassification.brand_safety_checked;if(pogoClassification.contextualclassifications){ContextualEngine.ContextualClassifications=pogoClassification.contextualclassifications;ContextualEngine.executeEvent("Off","ContextualEngineLoadClassifications",ContextualEngine.ContextualClassifications);}};};};xhttp.open("GET",this.GeneratePogoUrl(),true);xhttp.send();};ContextualEngine.SetGptTargetting=function(){this.executeEvent("On","ContextualEngineSetTargetting");analysis=this.GetAnalysis();if(analysis){window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];window.googletag.cmd.push(function(){if(analysis["cc-intent-id"]){googletag.pubads().setTargeting("cc-intent-id",analysis["cc-intent-id"]);}
if(analysis["cc-iab-class-id"]){googletag.pubads().setTargeting("cc-iab-class-id",analysis["cc-iab-class-id"]);}
if(analysis["cc-iab-name"]){googletag.pubads().setTargeting("cc-iab-name",analysis["cc-iab-name"]);}
ContextualEngine.executeEvent("Off","ContextualEngineSetTargetting");});}}
ContextualEngine.SetLocalStorage=function(){this.executeEvent("On","ContextualEngineSetLocalStorage");analysis=this.GetAnalysis();if(window.localStorage&&analysis&&analysis["cc-iab-class-id"]){window.localStorage.setItem("ccContextualData",JSON.stringify(analysis["cc-iab-class-id"]))
this.executeEvent("Off","ContextualEngineSetLocalStorage");}}
ContextualEngine.Analyze=function(){this.executeEvent("On","ContextualEngineGetAnalysis");if(this.ContextualClassifications){intentIds=[];iabIds=[];iabNames=[];for(let index=0;index<this.ContextualClassifications.length;index++){classification=this.ContextualClassifications[index];if(classification.type&&classification.type=="carbon_segment_id"){if(classification.id){intentIds.push(classification.id);}}else if(classification.type&&classification.type=="iab_intent"){if(classification.id){iabIds.push(classification.id);}
if(classification.name){iabNames.push(classification.name);}}}
this.Analysis={"cc-intent-id":intentIds,"cc-iab-class-id":iabIds,"cc-iab-name":iabNames};this.analysisReady=true;this.executeEvent("Off","ContextualEngineGetAnalysis",this.Analysis);return this.Analysis}};ContextualEngine.GetAnalysis=function(){this.Analysis=this.Analysis||this.Analyze();return this.Analysis;}
ContextualEngine.setupEventListenerQueues=function(){this.eventListeners=this.eventListeners||{"OnContextualEngineInit":[],"OffContextualEngineInit":[],"OnContextualEngineReady":[],"OffContextualEngineReady":[],"OnContextualEngineLoadClassifications":[],"OffContextualEngineLoadClassifications":[],"OnContextualEngineGetAnalysis":[],"OffContextualEngineGetAnalysis":[],"OnContextualEngineSetTargetting":[],"OffContextualEngineSetTargetting":[],"OnContextualEngineSetLocalStorage":[],"OffContextualEngineSetLocalStorage":[],};}
ContextualEngine.executeEvent=function(type,eventname,data){this.setupEventListenerQueues();if(this.eventListeners[type+eventname]){for(let index=0;index<this.eventListeners[type+eventname].length;index++){try{this.eventListeners[type+eventname][index].call(this,data);}catch(e){console.log("[ERROR] issue in callback: "+e.name+": "+e.message)}}}}
ContextualEngine.isEventListenerValid=function(eventname,handler){if(eventname&&typeof(eventname)=="string"&&eventname!=""&&handler&&typeof(handler)=="function"){return true}
return false}
ContextualEngine.onEvent=function(eventname,handler){this.setupEventListenerQueues();eventOk=this.isEventListenerValid(eventname,handler);if(!eventOk){return false;}
if(this.eventListeners["On"+eventname]){this.eventListeners["On"+eventname].push(handler);return true;}
return false;}
ContextualEngine.offEvent=function(eventname,handler){this.setupEventListenerQueues();eventOk=this.isEventListenerValid(eventname,handler);if(!eventOk){return false;}
if(this.eventListeners["Off"+eventname]){this.eventListeners["Off"+eventname].push(handler);return true;}
return false;}
ContextualEngine.ProcessQue=function(){if(!this.isReady){console.log("[ERROR] ContextualEngine: "+"Status"+": "+"Not Ready Exiting Queue");return}
var tempQue=window.ContextualEngine.que||[]
for(callback of tempQue){try{callback();}catch(e){console.log("[ERROR] issue in callback: "+e.name+": "+e.message)}}
window.ContextualEngine.que={push:function(callback){try{callback();}catch(e){console.log("[ERROR] issue in callback: "+e.name+": "+e.message)}}}};ContextualEngine.Init=function(config){this.LoadDefault();this.setupEventListenerQueues();this.executeEvent("On","ContextualEngineInit");if(this.isReady){console.log("[INFO]","Already Initilized");this.executeEvent("Off","ContextualEngineInit");return;}
this.isReady=true;this.executeEvent("On","ContextualEngineReady");this.ProcessQue();this.executeEvent("Off","ContextualEngineReady");this.executeEvent("Off","ContextualEngineInit");this.offEvent("ContextualEngineLoadClassifications",this.Analyze);this.offEvent("ContextualEngineGetAnalysis",this.SetGptTargetting);this.offEvent("ContextualEngineGetAnalysis",this.SetLocalStorage);this.GetClassifications();}
ContextualEngine.isLoaded=true;ContextualEngine.Init();;(function(win,doc){function _saveCookie(){cookieData={};ccao.pageState.persistentParamNames.forEach((function(v){cookieData[v]=ccao.pageState.persistentParam[v];}));var numMinutes=20;var newDateObj=new Date(Date.now()+numMinutes*60000);_cookies().setItem(ccao.pageState.preserveInfoCookieName,JSON.stringify(cookieData),newDateObj,"/");}
function _uuidv4(){var uuid,cryptoObj=window.crypto||window.msCrypto;if(cryptoObj){uuid=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(c){return(c^cryptoObj.getRandomValues(new Uint8Array(1))[0]&15>>c/4).toString(16);});}else{uuid="xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c==='x'?r:(r&0x3|0x8);return v.toString(16);});}
return uuid;}
function _cookies(){return{getItem:function(sKey){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;},setItem:function(sKey,sValue,vEnd,sPath,sDomain,bSecure){if(!sKey||/^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)){return false;}
var sExpires="";if(vEnd){switch(vEnd.constructor){case Number:sExpires=vEnd===Infinity?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+vEnd;break;case String:sExpires="; expires="+vEnd;break;case Date:sExpires="; expires="+vEnd.toUTCString();break;}}
document.cookie=encodeURIComponent(sKey)+"="+encodeURIComponent(sValue)+sExpires+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"")+(bSecure?"; secure":"");return true;},removeItem:function(sKey,sPath,sDomain){if(!sKey||!this.hasItem(sKey)){return false;}
document.cookie=encodeURIComponent(sKey)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"");return true;},hasItem:function(sKey){return(new RegExp("(?:^|;\\s*)"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=")).test(document.cookie);},keys:function(){var aKeys=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/);for(var nLen=aKeys.length,nIdx=0;nIdx<nLen;nIdx++){aKeys[nIdx]=decodeURIComponent(aKeys[nIdx]);}
return aKeys;}};}
function extractRootDomain(url){var domain=extractHostname(url),splitArr=domain.split('.'),arrLen=splitArr.length;if(arrLen>2){domain=splitArr[arrLen-2]+'.'+splitArr[arrLen-1];if(splitArr[arrLen-2].length===2&&splitArr[arrLen-1].length===2){domain=splitArr[arrLen-3]+'.'+domain;}}
return domain;}
function extractHostname(url){var hostname;if(url.indexOf("//")>-1){hostname=url.split('/')[2];}
else{hostname=url.split('/')[0];}
hostname=hostname.split(':')[0];hostname=hostname.split('?')[0];return hostname;}
win["ccao"]=win["ccao"]||{};win["cca"]=win["cca"]||{};var ccao=win["cca"];ccao.privacy=ccao.privacy||{que:[]};if(win["ccao"].privacy&&win["ccao"].privacy.que){ccao.privacy.que.concat(win["ccao"].privacy.que);}
ccao.pageState=ccao.pageState||{};ccao.pageState.start=new Date().getTime();ccao.pageState.cn1="";ccao.pageState.cn2="";ccao.pageState.cs1="";ccao.pageState.cs2="";ccao.pageState.engagement=ccao.pageState.engagement||{ttl:60*1,count:0,id:_uuidv4(),timeLastEngage:(new Date().getTime())/1000/60,}
ccao.pageState.engagement.ttlMilli=ccao.pageState.engagement.ttl*1000;ccao.pageState.engagement.ttlMin=ccao.pageState.engagement.ttl/60;ccao.pageState.engagement.registerEngagement=function(){var present=(new Date().getTime())/1000/60;var timediff=present-ccao.pageState.engagement.timeLastEngage;var ttlMin=ccao.pageState.engagement.ttlMin;if(timediff<ttlMin){ccao.pageState.engagement.timeLastEngage=(new Date().getTime())/1000/60;return;}
ccao.pageState.engagement.count++;ccao.pageState.engagement.id=_uuidv4();ccao.pageState.engagement.timeLastEngage=(new Date().getTime())/1000/60;if(ccao.redoScriptLoad&&win._ccScriptSettings){ccao.redoScriptLoad(win._ccScriptSettings);}};ccao.pageState.genCookieGetParamsArray=function(){return[{name:ccao.pageState.cookieIDs.aid.name,value:ccao.pageState.cookieIDs.aid.value},{name:ccao.pageState.cookieIDs.sid.name,value:ccao.pageState.cookieIDs.sid.value},{name:ccao.pageState.cookieIDs.jid.name,value:ccao.pageState.cookieIDs.jid.value},{name:ccao.pageState.cookieIDs.anid.name,value:ccao.pageState.cookieIDs.anid.value}];};ccao.pageState.genMiscGetParamsArray=function(){return[{name:"extReferer",value:ccao.pageState.refer.externalRefer},{name:"curReferer",value:ccao.pageState.refer.currentRefer},{name:"url",value:ccao.pageState.url},{name:"prevPvid",value:ccao.pageState.refer.prevPvid},{name:"pageViews",value:ccao.pageState.persistentParam.pageViews}];};ccao.pageState.genUtmGetParamsArray=function(){return[{name:"utm_campaign",value:ccao.pageState.persistentParam.utm_campaign||""},{name:"utm_medium",value:ccao.pageState.persistentParam.utm_medium||""},{name:"utm_term",value:ccao.pageState.persistentParam.utm_term||""},{name:"utm_content",value:ccao.pageState.persistentParam.utm_content||""},{name:"utm_source",value:ccao.pageState.persistentParam.utm_source||""}];};ccao.pageState.genContextParamsArray=function(){var contextParamsArray=[];if(typeof ccao.pageState.jsonld==="object"&&ccao.pageState.jsonld){if(typeof(ccao.pageState.jsonld.author)==="object"&&ccao.pageState.jsonld.author){if(ccao.pageState.jsonld.author.name&&typeof(ccao.pageState.jsonld.author.name)==="string"){contextParamsArray.push({name:"author",value:ccao.pageState.jsonld.author.name});}else if(ccao.pageState.jsonld.author.length&&ccao.pageState.jsonld.author.length>0){if(ccao.pageState.jsonld.author[0]&&ccao.pageState.jsonld.author[0].name&&typeof(ccao.pageState.jsonld.author[0].name)==="string"){contextParamsArray.push({name:"author",value:ccao.pageState.jsonld.author[0].name});}}}else if(typeof(ccao.pageState.jsonld.author)==="string"){contextParamsArray.push({name:"author",value:ccao.pageState.jsonld.author});}
if(typeof(ccao.pageState.jsonld.publisher)==="object"&&ccao.pageState.jsonld.publisher&&ccao.pageState.jsonld.publisher.name&&typeof(ccao.pageState.jsonld.publisher.name)==="string"){contextParamsArray.push({name:"publisher",value:ccao.pageState.jsonld.publisher.name});}else if(typeof(ccao.pageState.jsonld.publisher)==="string"){contextParamsArray.push({name:"publisher",value:ccao.pageState.jsonld.publisher});}
if(typeof(ccao.pageState.jsonld.editor)==="object"&&ccao.pageState.jsonld.editor&&ccao.pageState.jsonld.editor.name&&typeof(ccao.pageState.jsonld.editor.name)==="string"){contextParamsArray.push({name:"editor",value:ccao.pageState.jsonld.editor.name});}else if(typeof(ccao.pageState.jsonld.editor)==="string"){contextParamsArray.push({name:"editor",value:ccao.pageState.jsonld.editor});}
if(typeof(ccao.pageState.jsonld.articleSection)==="string"&&ccao.pageState.jsonld.articleSection){contextParamsArray.push({name:"articleSection",value:ccao.pageState.jsonld.articleSection});}}
return contextParamsArray;};ccao.pageState.pageSocket={inWebWorker:false,open:false};ccao.pageState.verbose=false;ccao.pageState.costevents={};ccao.pageState.disablePlacement=false;ccao.pageState.cookieIDs={aid:{name:"GLAM-AID",backup:_uuidv4(),value:""},jid:{name:"GLAM-JID",backup:_uuidv4(),value:""},sid:{name:"GLAM-SID",backup:_uuidv4(),value:""},pvid:{name:"GLAM-PVID",value:_uuidv4()},anid:{name:"APPNEXUS",value:""}};ccao.pageState.cookieIDs.jid.value=_cookies().getItem(ccao.pageState.cookieIDs.jid.name)||function(){var newDateObj=new Date(Date.now()+20*60*1000);_cookies().setItem(ccao.pageState.cookieIDs.jid.name,ccao.pageState.cookieIDs.jid.backup,newDateObj,"/");return ccao.pageState.cookieIDs.jid.backup;}();ccao.pageState.cookieIDs.aid.value=_cookies().getItem(ccao.pageState.cookieIDs.aid.name)||function(){var newDateObj=new Date(Date.now()+30*24*60*60*1000);_cookies().setItem(ccao.pageState.cookieIDs.aid.name,ccao.pageState.cookieIDs.aid.backup,newDateObj,"/");return ccao.pageState.cookieIDs.aid.backup;}();ccao.pageState.cookieIDs.sid.value=_cookies().getItem(ccao.pageState.cookieIDs.sid.name)||function(){_cookies().setItem(ccao.pageState.cookieIDs.sid.name,ccao.pageState.cookieIDs.sid.backup,"","/");return ccao.pageState.cookieIDs.sid.backup;}();ccao.pageState.parentpvid="";ccao.pageState.preserveInfoCookieName="__j_state";var cookieData=JSON.parse(_cookies().getItem(ccao.pageState.preserveInfoCookieName))||{};ccao.pageState.refer={currentRefer:document.referrer||"",currentReferRoot:"",externalRefer:"",externalReferRoot:"",prevPvid:""};ccao.pageState.url=window.location.href||"";if(ccao.pageState.refer.currentRefer===""){ccao.pageState.refer.currentRefer=ccao.pageState.url;}
ccao.pageState.refer.currentReferRoot=extractRootDomain(ccao.pageState.refer.currentRefer)||"";ccao.pageState.refer.externalRefer=cookieData["extreferer"]||"";if(ccao.pageState.refer.externalRefer===""){ccao.pageState.refer.externalRefer=ccao.pageState.refer.currentRefer;ccao.pageState.refer.externalReferRoot=ccao.pageState.refer.currentReferRoot;}else{ccao.pageState.refer.externalReferRoot=extractRootDomain(ccao.pageState.refer.externalRefer)||"";}
ccao.pageState.persistentParam={};ccao.pageState.persistentParamNames=["utm_campaign","utm_source","utm_medium","utm_content","utm_term","landing_url","pageViews","prevPvid","glam_revenue","extreferer","user_worth"];ccao.pageState.persistentParam.extreferer=ccao.pageState.refer.externalRefer;ccao.pageState.persistentParam.user_worth=cookieData["user_worth"]||0;var match,search=/([^&=]+)=?([^&]*)/g,queryData=[];while((match=search.exec(window.location.search.substring(1).toLowerCase()))!==null){match.map(function(str){return decodeURIComponent(str.replace(/\+/g," "));});queryData[match[1].toLowerCase()]=match[2];}
var queryKeys=Object.keys(queryData);for(i=0;i<queryKeys.length;i++){if(queryKeys[i]==="utm_source"||queryKeys[i]==="utm_campaign"||queryKeys[i]==="utm_term"||queryKeys[i]==="utm_medium"||queryKeys[i]==="utm_content"){if(!cookieData[queryKeys[i]]||cookieData[queryKeys[i]]===""||cookieData[queryKeys[i]]!==queryData[queryKeys[i]]){ccao.pageState.costevents.cpc=true;ccao.pageState.cookieIDs.jid.value=function(){var newDateObj=new Date(Date.now()+20*60*1000);_cookies().setItem(ccao.pageState.cookieIDs.jid.name,ccao.pageState.cookieIDs.jid.backup,newDateObj,"/");return ccao.pageState.cookieIDs.jid.backup;}();ccao.pageState.persistentParam["utm_source"]="";ccao.pageState.persistentParam["utm_campaign"]="";ccao.pageState.persistentParam["utm_term"]="";ccao.pageState.persistentParam["utm_medium"]="";ccao.pageState.persistentParam["utm_content"]="";break;}}}
ccao.pageState.persistentParamNames.forEach((function(v){if((typeof(queryData[v])!=="undefined")){ccao.pageState.persistentParam[v]=queryData[v];}else if(typeof(cookieData[v])!=="undefined"){ccao.pageState.persistentParam[v]=cookieData[v];}}));if(!ccao.pageState.persistentParam.pageViews){ccao.pageState.persistentParam.pageViews=0;}
ccao.pageState.persistentParam.pageViews++;if(typeof(ccao.pageState.persistentParam.prevPvid)!=="undefined"&&ccao.pageState.persistentParam.prevPvid!==""){ccao.pageState.refer.prevPvid=ccao.pageState.persistentParam.prevPvid;}
ccao.pageState.persistentParam.prevPvid=ccao.pageState.cookieIDs.pvid.value;if(typeof(ccao.pageState.persistentParam.landing_url)==="undefined"||ccao.pageState.persistentParam.landing_url===""){ccao.pageState.persistentParam.landing_url=ccao.pageState.url;}
if((typeof(queryData["verbose"])!=="undefined")){ccao.pageState.verbose=true;}
if(typeof(WebSocket)!=="undefined"){ccao.pageState.supportsWebSockets=true;}else{ccao.pageState.supportsWebSockets=false;}
if(typeof(Worker)!=="undefined"&&typeof(URL)!=="undefined"){ccao.pageState.supportsWebWorkers=true;}else{ccao.pageState.supportsWebWorkers=false;}
if(ccao.pageState.supportsWebWorkers===true&&ccao.pageState.supportsWebSockets===true){ccao.pageState.pageSocket.inWebWorker=true;}else{ccao.pageState.pageSocket.inWebWorker=false;}
ccao.pageState.jsonldmatches=document.querySelectorAll("script[type=application\\/ld\\+json]");if(ccao.pageState.jsonldmatches.length>0){var jsonldState;for(i=0;i<ccao.pageState.jsonldmatches.length;i++){try{if(!jsonldState||typeof jsonldState!=="object"){jsonldState=JSON.parse(ccao.pageState.jsonldmatches[i].innerText);}else{var parsedJson=JSON.parse(ccao.pageState.jsonldmatches[i].innerText);if(!jsonldState.author||jsonldState.author==""){jsonldState.author=parsedJson.author||"";}
if(!jsonldState.publisher||jsonldState.publisher==""){jsonldState.publisher=parsedJson.publisher||"";}
if(!jsonldState.editor||jsonldState.editor==""){jsonldState.editor=parsedJson.editor||"";}
if(!jsonldState.articleSection||jsonldState.articleSection==""){jsonldState.articleSection=parsedJson.articleSection||"";}}}catch(e){console.debug("invalid schema json unable to parse");}}
ccao.pageState.jsonld=jsonldState;}else{ccao.pageState.jsonld={};}
ccao.pageState.lastClockIn=ccao.pageState.start;_saveCookie();var ccao=win["cca"]||{};ccao.privacy=ccao.privacy||{que:[]};ccao.custAud=ccao.custAud||{que:[]};ccao.fireAudienceEvent=function(id,cs,usp,pco){var eventObject={"id":id,"pco":pco};ccao.fireTrackingEvent(eventObject,false);};ccao.fireTrackingEvent=function(data,debug){if(debug){console.log("Tracking Pixel triggered");}
ccao.privacy.que.push(function(){switch(ccao.privacy.law.toLowerCase()){case "gdpr":if(ccao.privacy.gdpr.Consent){fireTrackingInternal(data,debug)}else{if(debug){console.log("GDPR consent not given, cannot fire Tracking Pixel");}}
break;case "ccpa":if(ccao.privacy.ccpa.Consent){fireTrackingInternal(data,debug)}else{if(debug){console.log("CCPA consent not given, cannot fire Tracking Pixel");}}
break;case "na":fireTrackingInternal(data,debug)
break;case "optout":case "unknown":default:break;}});};var fireTrackingMultiple=function(data,debug){if(debug){console.log("Multiple Pixels requested");}
var endpoint=win._ccLauncherSettings.customEvents;var ceUrl=new URL(endpoint+"/p/"+_ccScriptSettings.site.parentId+"/ces");if(ccao.privacy.gdpr&&ccao.privacy.gdpr.CS){ceUrl.searchParams.set("cs",ccao.privacy.gdpr.CS);}
if(ccao.privacy.ccpa&&ccao.privacy.ccpa.ConsentString){ceUrl.searchParams.set("usp",ccao.privacy.ccpa.CS);}
var bodyJson=[];for(i in data){var event=data[i];if(!event.id){if(debug){console.log("Event is missing ID, cannot be sent");console.log(event);}
continue;}
if(event.pco!==undefined&&!ceUrl.searchParams.get("pco")){ceUrl.searchParams.set("pco",event.pco);}
var eventObject={};eventObject["triggerid"]=event.id;eventObject["parent_id"]=_ccScriptSettings.site.parentId;eventObject["profileId"]=_ccScriptSettings.user.id;eventObject["pageview_id"]=_ccScriptSettings.pageData.pvid;if(event.NumberKey&&event.NumberKey!=""&&event.NumberValue&&!isNaN(event.NumberValue)){eventObject["numberkey"]=event.NumberKey;eventObject["numbervalue"]=event.NumberValue;}
if(event.StringKey&&event.StringKey!=""&&event.StringValue&&event.StringValue!=""){eventObject["stringkey"]=event.StringKey;eventObject["stringvalue"]=event.StringValue;}
var codes=["USD","EUR"];if(event.Money&&!isNaN(event.Money)&&event.CurrencyCode&&event.CurrencyCode.toUpperCase&&codes.includes(event.CurrencyCode.toUpperCase())){eventObject["money"]=event.Money;eventObject["currencycode"]=event.CurrencyCode.toUpperCase();}
if(event.Label&&event.Label!=""){eventObject["event_label"]=event.Label;}
ccao.pageState.engagement.registerEngagement();eventObject["engagement_id"]=ccao.pageState.engagement.id;eventObject["engagement_count"]=ccao.pageState.engagement.count;eventObject["engagement_ttl"]=ccao.pageState.engagement.ttl;bodyJson.push(eventObject);if(debug){console.log(eventObject);}}
var xmlHttp=new XMLHttpRequest();xmlHttp.open("POST",ceUrl,true);xmlHttp.setRequestHeader('Content-Type','application/json');xmlHttp.send(JSON.stringify(bodyJson));if(debug){console.log("Custom Event Pixel request sent. URL: "+ceUrl);console.log(bodyJson);}}
var fireTrackingInternal=function(data,debug){if(Array.isArray(data)){fireTrackingMultiple(data,debug);return}
if(!data.id){if(debug){console.log("Event is missing ID, cannot be sent");console.log(event);}
return}
var endpoint=win._ccLauncherSettings.customEvents;var pixel=new Image();var pagePixelUrl=new URL(endpoint+"/p/"+_ccScriptSettings.site.parentId+"/ce/"+data.id);pagePixelUrl.searchParams.set("ccuid",_ccScriptSettings.user.id);pagePixelUrl.searchParams.set("pvid",_ccScriptSettings.pageData.pvid);if(ccao.privacy.gdpr&&ccao.privacy.gdpr.CS){pagePixelUrl.searchParams.set("cs",ccao.privacy.gdpr.CS);}
if(ccao.privacy.ccpa&&ccao.privacy.ccpa.ConsentString){pagePixelUrl.searchParams.set("usp",ccao.privacy.ccpa.CS);}
if(data.pco){pagePixelUrl.searchParams.set("pco",data.pco);}
if(data.NumberKey&&data.NumberKey!=""&&data.NumberValue&&isNaN(data.NumberValue)==false){pagePixelUrl.searchParams.set("nk",data.NumberKey);pagePixelUrl.searchParams.set("nv",data.NumberValue);}
if(data.StringKey&&data.StringKey!=""&&data.StringValue&&data.StringValue!=""){pagePixelUrl.searchParams.set("sk",data.StringKey);pagePixelUrl.searchParams.set("sv",data.StringValue);}
var codes=["USD","EUR"];if(data.Money&&!isNaN(data.Money)&&data.CurrencyCode&&data.CurrencyCode.toUpperCase&&codes.includes(data.CurrencyCode.toUpperCase())){pagePixelUrl.searchParams.set("mn",data.Money);pagePixelUrl.searchParams.set("cc",data.CurrencyCode.toUpperCase());}
if(data.Label&&data.Label!=""){pagePixelUrl.searchParams.set("lb",data.Label);}
ccao.pageState.engagement.registerEngagement();pagePixelUrl.searchParams.set("engid",ccao.pageState.engagement.id);pagePixelUrl.searchParams.set("engcount",ccao.pageState.engagement.count);pagePixelUrl.searchParams.set("engttl",ccao.pageState.engagement.ttl);pixel.src=pagePixelUrl.href;setTimeout(function(){if(!pixel.complete||!pixel.naturalWidth){pixel.src="";}},2000);if(debug){console.log("Custom Event Pixel request sent. URL: "+pagePixelUrl.href);}};var tempQue=ccao.custAud.que
for(callback of tempQue){callback();}
ccao.custAud.que={push:function(callback){callback();}}})(window,document);;(function(win,doc){var launcherSettings=win._ccLauncherSettings;var ccaoName="cca";var settingsCallbackWaitingQueue=[];win._ccReady=win._ccReady||[];win[ccaoName]=win[ccaoName]||function(){(win[ccaoName].q=win[ccaoName].q||[]).push(arguments);};var ccao=win[ccaoName];ccao.q=[];ccao.init=true;ccao.messageProcessor=function(){(win[ccaoName].q=win[ccaoName].q||[]).push(arguments);};ccao.push=function(){win[ccaoName].messageProcessor.apply(this,arguments);};ccao.loadedScripts={count:0};ccao.settings=win._ccScriptSettings;ccao.baseScript=ccao.baseScript||[];ccao.privacy=ccao.privacy||{que:[]};ccao.site=ccao.site||{};ccao.site.gdpr=ccao.site.gdpr||{key:"__cmp",check:true,wait:false};var cookieConsent=ccao.site.gdpr.check===false;var pvid=ccao.pageState.cookieIDs.pvid.value;function _saveCookie(){cookieData={};ccao.pageState.persistentParamNames.forEach((function(v){cookieData[v]=ccao.pageState.persistentParam[v];}));var numMinutes=20;var newDateObj=new Date(Date.now()+numMinutes*60000);_cookies().setItem(ccao.pageState.preserveInfoCookieName,JSON.stringify(cookieData),newDateObj,"/");}
ccao.debugMode=function(){return false;};ccao.clearFlagCookie=function(){if(!ccao.settings.site.sharedDomain){var img=new Image(1,1);img.src=launcherSettings.api+"/sync/clear";}};ccao.notifyCCReady=function notifyCCReady(settingObj){settingObj.pageData={"pvid":pvid};ccao.settings=settingObj;win._ccSettings=settingObj;if(win._ccReady!==null){var readyLen=win._ccReady.length;for(var i=0;i<readyLen;i++){win._ccReady[i](settingObj);}}
win._ccReady={"push":function(pushFunc){if(typeof(pushFunc)==='function')pushFunc(settingObj);}};};ccao.getSettings=function getSettings(callback){win._ccReady.push(callback);};ccao.afterPageLoad=function(func){if(document.readyState==="complete"){func();}else{ccao.attachCCEvent("load",function(){func();});}};ccao.attachCCEvent=function(eventName,callback){try{win.addEventListener?win.addEventListener(eventName,callback,true):win.attachEvent&&win.attachEvent("on"+eventName,callback);}catch(e){console&&console.log(e);}};function newCustomEvent(event,params){params=params||{bubbles:false,cancelable:false,detail:undefined};var evt=document.createEvent('CustomEvent');evt.initCustomEvent(event,params.bubbles,params.cancelable,params.detail);return evt;}
function setStorage(store,key,value){switch(ccao.privacy.law.toLowerCase()){case "gdpr":if(ccao.privacy.gdpr.Consent){store.setItem(key,value);}
break;case "ccpa":if(ccao.privacy.ccpa.Consent){store.setItem(key,value);}
break;case "na":store.setItem(key,value);break;case "optout":case "unknown":default:break;}}
var createCustomEvent=function(evtType,evtDetail){if(typeof win.CustomEvent==="function")return new CustomEvent(evtType,{detail:evtDetail});return newCustomEvent(evtType,{detail:evtDetail});};function api(){var userId=null;this.ready=false;this.addEventListener=function(evt,callback){if(this.eventTarget){this.eventTarget.addEventListener(evt,callback);}};this.readyEvent=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('apiReady',function(evt){callback({'userId':userId});});}};this.realtimeReady=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('realtimeReady',function(evt){callback(evt.detail);});}};if(this.eventTarget){this.eventTarget.addEventListener('userIdReady',function(evt){userId=evt.detail.id;});}
this.userIdEvent=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('userIdReady',function(evt){callback(evt.detail.id,evt.detail.isNew);});}
if(userId!==null&&this.ready===false){callback(userId,window._ccScriptSettings.user.isNew);}};if(this.eventTarget){this.eventTarget.addEventListener('audiencesReady',function(evt){ccao.settings.user.audienceMemberships=evt.detail;var user={audienceMemberships:evt.detail};ccao.privacy=ccao.privacy||{};ccao.privacy.que=ccao.privacy.que||[];ccao.privacy.que.push(function(){setStorage(win.sessionStorage,"carbonUser",JSON.stringify(user));});});}
this.audiencesReady=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('audiencesReady',function(evt){callback(evt.detail);});}};if(this.eventTarget){this.eventTarget.addEventListener('interestsReady',function(evt){ccao.settings.user.interests=evt.detail;});}
this.interestsReady=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('interestsReady',function(evt){callback(evt.detail);});}};if(this.eventTarget){this.eventTarget.addEventListener('demographicsReady',function(evt){ccao.settings.user.demographics=evt.detail;});}
this.demographicsReady=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('demographicsReady',function(evt){callback(evt.detail);});}};this.brandsReady=function(callback){if(this.eventTarget){this.eventTarget.addEventListener('brandsReady',function(evt){callback(evt.detail);});}};if(this.eventTarget){this.eventTarget.addEventListener('brandsReady',function(evt){ccao.settings.user.brands=evt.detail;});}};api.prototype.eventTarget=document.createElement(null);api.prototype.dispatchEvent=function(evtType,detail){this.eventTarget.dispatchEvent(createCustomEvent(evtType,detail));};ccao.api=new api();win.carbonApi=ccao.api;win.carbon=win.carbonApi;ccao.api.addEventListener("revenue",(e)=>{ccao.pageState.persistentParam.user_worth+=e.detail;if(cookieConsent===true)
_saveCookie();const worthUpdatedEvent={type:"worthUpdated",data:{aid:ccao.pageState.cookieIDs.aid.value,worth:ccao.pageState.persistentParam.user_worth,increase:e.detail}};ccao.api.dispatchEvent(worthUpdatedEvent.type,worthUpdatedEvent.data);});function userIdComplete(){try{if(win._ccScriptSettings.localCacheUserTracking&&ccao.setUserStorage){ccao.setUserStorage();}
ccao.api.dispatchEvent('userIdReady',{id:window._ccScriptSettings.user.id,isNew:window._ccScriptSettings.user.isNew});}catch(err){console.debug('error:'+err.message);}}
ccao.loadScript=function(scriptUri,callback,onError){setTimeout(function(){var scriptTag=document.createElement("script");scriptTag.src=scriptUri;scriptTag.type="text/javascript";scriptTag.async=true;if(callback!==undefined){scriptTag.addEventListener('load',callback);}
if(onError!==undefined){scriptTag.onerror=onError;}
document.body.appendChild(scriptTag);},1);};function fireIMMessage(event){switch(ccao.privacy.law.toLowerCase()){case "gdpr":if(ccao.privacy.gdpr.Consent){event.source.postMessage({carbon:true,method:'imload',object:win._ccScriptSettings,href:window.location.href},event.origin);}
break;case "ccpa":if(ccao.privacy.ccpa.Consent){event.source.postMessage({carbon:true,method:'imload',object:win._ccScriptSettings,href:window.location.href},event.origin);}
break;case "na":event.source.postMessage({carbon:true,method:'imload',object:win._ccScriptSettings,href:window.location.href},event.origin);break;case "optout":case "unknown":default:break;}}
function notifyIMReady(event){if(!event.data.carbon||event.data.method.toLowerCase()!=="imready")
return;ccao.privacy=ccao.privacy||{};ccao.privacy.que=ccao.privacy.que||[];ccao.privacy.que.push(function(){fireIMMessage(event);});}
var loadBundle=function(){ccao.loadScript(launcherSettings.api+"/script/bundle?id="+launcherSettings.script+"&parentId="+launcherSettings.parent);window.addEventListener('message',notifyIMReady,false);};var decideUserId=function(continueCallback){ccao.mergeUserIds=function(){ccao.mergeUserIds=null;var baseUser={ccuid:null,ccsid:null};var localUser=win._ccScriptSettings.user.localCachedUser||{localCache:false,cached:false};var bcUser=win._ccScriptSettings.user.browserCachedUser||{browserCache:false,cached:false};var fpFrameUser=win._ccScriptSettings.user.fpframeuser||{fp:false};var cachedUser=Object.assign({},baseUser,localUser,bcUser,fpFrameUser);if(cachedUser.fp===true||cachedUser.cached===true){win._ccScriptSettings.user.isNew=false;if(win._ccScriptSettings.user.id!==cachedUser.ccuid){win._ccScriptSettings.user.id=cachedUser.ccuid;win._ccScriptSettings.user.idChange=true;}}else if(cachedUser.ccuid!==null&&win._ccScriptSettings.user.isNew===true){win._ccScriptSettings.user.id=cachedUser.ccuid;}
if(cachedUser.ccsid!==null){win._ccScriptSettings.session.isNew=false;if(win._ccScriptSettings.session.id!==cachedUser.ccsid){win._ccScriptSettings.session.id=cachedUser.ccsid;win._ccScriptSettings.user.idChange=true;}}
userIdComplete();continueCallback();};if(win._ccScriptSettings.cookieSettingsType===4&&typeof(win._ccScriptSettings.user.fpframeuser)==='undefined'){ccao.mergeUserIdTimeout=window.setTimeout(ccao.mergeUserIds,1500);}else{ccao.mergeUserIds();}};var setUser=function(endpoint){switch(ccao.privacy.law.toLowerCase()){case "gdpr":if(ccao.privacy.gdpr.Consent){ccao.loadScript(endpoint);}
break;case "ccpa":if(ccao.privacy.ccpa.Consent){ccao.loadScript(endpoint);}
break;case "na":var img=new Image(1,1);ccao.loadScript(endpoint);break;case "optout":case "unknown":default:break;}}
var loaded=false;var scriptsLoadedCallback=function(){if(loaded===true)
return;loaded=true;var finishLaunch=function(){if(win._ccScriptSettings.cookieSettingsType===0||win._ccScriptSettings.cookieSettingsType===3){if(win._ccScriptSettings.user.idChange!==undefined||win._ccScriptSettings.user.isNew||win._ccScriptSettings.session.isNew){var endpoint=win._ccLauncherSettings.api+'/setUser?parent='+win._ccScriptSettings.site.parentId+'&site='+win._ccScriptSettings.site.scriptId+'&ccuid='+win._ccScriptSettings.user.id+'&ccsid='+win._ccScriptSettings.session.id;ccao.privacy=ccao.privacy||{};ccao.privacy.que=ccao.privacy.que||[];ccao.privacy.que.push(function(){setUser(endpoint);if(!win._ccLauncherSettings.api.includes(".ccgateway.net")){endpoint=endpoint.replace(win._ccLauncherSettings.api,win._ccLauncherSettings.cdn);setUser(endpoint);}});}}
if(win._ccScriptSettings.cookieSettingsType===4){if(win._ccScriptSettings.user.idChange!==undefined||win._ccScriptSettings.user.isNew||win._ccScriptSettings.session.isNew){ccao.setFpFrameUser(win._ccScriptSettings.user.id,win._ccScriptSettings.session.id);}}
var samplingSettings=win._ccScriptSettings.sampling||{active:false,sample:true};if(samplingSettings.active===false||samplingSettings.sample===true)
loadBundle();else
ccao.samplingCallback=loadBundle;userIdComplete();};var fpRedirectCallback=function(){ccao.fpRedirect(finishLaunch);};var callbackFunc=win._ccScriptSettings.cookieSettingsType===1&&ccao.fpRedirect?fpRedirectCallback:finishLaunch;decideUserId(callbackFunc);};var loadedScripts=0;var launchScriptCallback=function(){if(++loadedScripts===win._ccScriptSettings.launcherScripts.length){window.setTimeout(function(){scriptsLoadedCallback();},1);}};ccao.launchScripts=function(){if(win._ccScriptSettings.launcherScripts){for(var scriptIndex=0;scriptIndex<win._ccScriptSettings.launcherScripts.length;scriptIndex++){ccao.loadScript(win._ccScriptSettings.launcherScripts[scriptIndex],launchScriptCallback);}}};var launch=function(){var doLaunch=function(ccuid,iscached){var browserCachedUser={cached:false,browserCache:false};if(iscached){browserCachedUser.browserCache=browserCachedUser.cached=true;}
browserCachedUser.ccuid=ccuid;win._ccScriptSettings.user.browserCachedUser=browserCachedUser;if(loadedScripts===win._ccScriptSettings.launcherScripts.length){scriptsLoadedCallback();}};if(win._ccScriptSettings.browserCacheUserTracking){var requestTime=new Date();ccao.idCallback=function(){var cached=false;if(win.carbonUIDCache===undefined)
cached=true;else
cached=win.carbonUIDCache<requestTime;ccao.pageState=cca.pageState||{};ccao.pageState.ccuid=win._carbonUID||"";doLaunch(win._carbonUID,cached);ccao.idCallback=undefined;};}
ccao.launchScripts();};launch();})(window,document);