2 lines
5.9 KiB
JavaScript
2 lines
5.9 KiB
JavaScript
!function(){var e,n,o,t,s,i,a;"undefined"!=typeof choice_cmp_config&&choice_cmp_config.utid&&(e=window.location.hostname,n=document.createElement("script"),o=document.getElementsByTagName("script")[0],t="https://cmp.quantcast.com".concat("/choice/",choice_cmp_config.utid,"/",e,"/choice.js"),s=0,n.async=!0,n.type="text/javascript",n.src=t,o.parentNode.insertBefore(n,o),function(){for(var e,s="__tcfapiLocator",t=[],i=window;i;){try{if(i.frames[s]){e=i;break}}catch(e){}if(i===window.top)break;i=i.parent}e||(!function e(){var n,o=i.document,t=!!i.frames[s];return t||(o.body?((n=o.createElement("iframe")).style.cssText="display:none",n.name=s,o.body.appendChild(n)):setTimeout(e,5)),!t}(),i.__tcfapi=function(){var e,n,o=arguments;if(!o.length)return t;"setGdprApplies"===o[0]?3<o.length&&2===o[2]&&"boolean"==typeof o[3]&&(e=o[3],"function"==typeof o[2]&&o[2]("set",!0)):"ping"===o[0]?(n={gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"},"function"==typeof o[2]&&o[2](n)):("init"===o[0]&&"object"==typeof o[3]&&(o[3]=Object.assign(o[3],{tag_version:"V2"})),t.push(o))},i.addEventListener("message",function(t){var s="string"==typeof t.data,e={};try{e=s?JSON.parse(t.data):t.data}catch(e){}var i=e.__tcfapiCall;i&&window.__tcfapi(i.command,i.version,function(e,n){var o={__tcfapiReturn:{returnValue:e,success:n,callId:i.callId}};s&&(o=JSON.stringify(o)),t&&t.source&&t.source.postMessage&&t.source.postMessage(o,"*")},i.parameter)},!1))}(),i=function(){var e=arguments;typeof window.__uspapi!==i&&setTimeout(function(){void 0!==window.__uspapi&&window.__uspapi.apply(window.__uspapi,e)},500)},void 0===window.__uspapi&&(window.__uspapi=i,a=setInterval(function(){s++,window.__uspapi===i&&s<3?console.warn("USP is not accessible"):clearInterval(a)},6e3)))}(),function(){var t,r,c,s,p,d,u,f,l,h,g,_,w,m,y,v,I,C,L,P,O,e,n;function j(e){for(var n in b=",",e)e[n]&&(b+=e[n]+",");return b}function o(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"__cmpLoaded",__cmpLoaded:!0,gdpr:e.gdprApplies})}function i(a){window.dataLayer=window.dataLayer||[],_=[],g=[],I=[],v=[],d=[],p=[],window.__tcfapi("getConfig",2,function(i,e){var n,o;e&&(a.gdprApplies?(a.hasOwnProperty("publisher")&&(C=j(a.publisher.consents),L=j(a.publisher.legitimateInterests)),a.hasOwnProperty("purpose")&&(P=j(a.purpose.consents),O=j(a.purpose.legitimateInterests))):(i.coreConfig.hasOwnProperty("vendorPurposeLegitimateInterestIds")&&(O=j(i.coreConfig.vendorPurposeLegitimateInterestIds)),i.coreConfig.hasOwnProperty("vendorPurposeIds")&&(P=j(i.coreConfig.vendorPurposeIds)),i.coreConfig.hasOwnProperty("publisherPurposeLegitimateInterestIds")&&(L=j(i.coreConfig.publisherPurposeLegitimateInterestIds)),i.coreConfig.hasOwnProperty("publisherPurposeIds")&&(C=j(i.coreConfig.publisherPurposeIds))),n=0,o=setInterval(function(){100===(n+=1)&&clearInterval(o),u&&t&&(clearInterval(o),a.gdprApplies?a.hasOwnProperty("vendor")&&Object.keys(a.vendor.consents).forEach(function(e){!a.vendor.consents[e]&&a.gdprApplies||(_[e]=h[e],g[e]=e)}):(_=h).forEach(function(e,n){g[n]=n}),a.addtlConsent&&s?(p=a.addtlConsent.split("1~")[1].split("."))&&p.forEach(function(e){d.push(s[e])}):!a.gdprApplies&&s&&s.forEach(function(e,n){d.push(e),p.push(n)}),window.__tcfapi("getNonIABVendorConsents",2,function(n,e){var o,t,s;e&&(o=i.nonIabVendorsInfo,n.gdprApplies&&n.hasOwnProperty("nonIabVendorConsents")&&null!==n.nonIabVendorConsents?(o.hasOwnProperty("nonIabVendorList")&&(s=o.nonIabVendorList,Object.keys(s).forEach(function(e){y[s[e].vendorId]=s[e].name})),Object.keys(n.nonIabVendorConsents).forEach(function(e){!n.nonIabVendorConsents[e]&&n.gdprApplies||(I[e]=y[e],v[e]=e)})):o.hasOwnProperty("nonIabVendorList")&&(s=o.nonIabVendorList,Object.keys(s).forEach(function(e){(t=s[e]).hasOwnProperty("vendorId")&&t.hasOwnProperty("name")&&(I[t.vendorId]=t.name,v[t.vendorId]=t.vendorId)}))),l=_.filter(Boolean).join("|"),f=g.filter(Boolean).join(","),c=d.filter(Boolean).join("|"),r=p.filter(Boolean).join("|"),m=I.filter(Boolean).join("|"),w=v.filter(Boolean).join(","),window.dataLayer.push({event:"__cmpConsents",__cmpConsents:{iabVendorConsentIds:f,iabVendorsWithConsent:l,nonIABVendorConsentIds:w,nonIABVendorsWithConsent:m,googleVendorConsentIds:r,googleVendorsWithConsent:c,gdpr:a.gdprApplies,publisherConsents:C,publisherLegitimateInterests:L,purposeConsents:P,purposeLegitimateInterests:O}})}))},100))})}"undefined"!=typeof choice_cmp_config&&choice_cmp_config.utid&&((new Date).getTime(),window.location.hostname,s=[],p=[],d=[],h=[],g=[],_=[],y=[],v=[],I=[],choice_cmp_config.datalayer&&((n=new XMLHttpRequest).onreadystatechange=function(){var e;4!=this.readyState||200!=this.status||(e=JSON.parse(this.responseText)).hasOwnProperty("vendors")&&(u=e.vendors,Object.keys(u).forEach(function(e){h[u[e].id]=u[e].name}))},n.open("GET","https://cmp.quantcast.com/GVL-v2/vendor-list.json",!0),n.send(),(e=new XMLHttpRequest).onreadystatechange=function(){4==this.readyState&&200==this.status&&(t=JSON.parse(this.responseText)).forEach(function(e){s[e.provider_id]=e.provider_name})},e.open("GET","https://cmp.quantcast.com/tcfv2/google-atp-list.json",!0),e.send()),window.__tcfapi("addEventListener",2,function(e,n){if(n)switch(e.eventStatus){case"cmpuishown":choice_cmp_config.datalayer&&o(e);break;case"tcloaded":choice_cmp_config.datalayer&&(o(e),i(e)),choice_cmp_config.ccpa&&choice_cmp_config.ccpa&&window.__uspapi("uspPing",1,function(e,n){var o=document.getElementById("choice-footer-msg");n&&e.mode.includes("USP")&&e.jurisdiction.includes(e.location.toUpperCase())&&null!==o&&(o.innerHTML=o.innerHTML+'We use cookies and other data collection technologies to provide the best experience for our customers. You may request that your data not be shared with third parties here: <a href="javascript:void(0)" onclick="window.__uspapi(\'displayUspUi\');">Do Not Sell My Data</a>.',o.classList.add("ccpa-msg-added"),window.__uspapi("setUspDftData",1,function(e,n){n||console.log("Error: USP string not updated!")}))});break;case"useractioncomplete":choice_cmp_config.datalayer&&i(e)}}))}();
|