window.addEventListener("runPermutiveContextualApi",(function(e){var t="https://api.permutive.com/ctx/v1/segment?k="+e.detail.apiKey,n=new window.XMLHttpRequest,o=e.detail.payload.page,a=e.detail.workspaceId;n.open("POST",t,!0),n.onreadystatechange=function(){if(4===n.readyState&&200===n.status){var e;try{e=JSON.parse(n.responseText)}catch(e){return}window[a].addon("contextual",e),window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],window.googletag.cmd.push((function(){var t=window.googletag.pubads(),n=(e.gam||[]).concat("rts");t.setTargeting("prmtvctx",n)}))}},n.send(JSON.stringify({pageProperties:function(e){try{var t={client:{url:document.URL,referrer:document.referrer,type:"web",user_agent:navigator.userAgent,domain:window.location.hostname,title:document.title}};return"object"!=typeof e||Array.isArray(e)?t:Object.assign({},e,t)}catch(e){return{}}}(o),url:document.URL}))}));