2025-03-22 00:49:46 +01:00

1 line
6.1 KiB
JavaScript

(()=>{"use strict";const c="https://s.cpx.to",u=c+"/sync",p=12771,l=87,w=false,g="_cids",f="xexp",m="xid",_="tid",x="texp",I=2592e6,h=2592e6,v=1e3;function n(t,e){return`&dsp=${t}&dsp_uid=`+e}function S(t){return t?n("id5",t):""}function b(){return window.localStorage&&window.localStorage.getItem("_pubcid")?n("pub_common",window.localStorage.getItem("_pubcid")):window.pbjs&&window.pbjs.getUserIds&&window.pbjs.getUserIds().pubcid?n("pub_common",window.pbjs.getUserIds().pubcid):""}function y(){var t;return window.__uid2&&window.__uid2.getAdvertisingTokenAsync?(window.__uid2.getAdvertisingTokenAsync().then(t=>{t&&((new Image).src=u+"?"+n("uid2",t))}),""):window.__uid2&&window.__uid2.getAdvertisingToken?(t=window.__uid2.getAdvertisingToken())?n("uid2",t):void 0:""}function k(t){let e=t?n("app_nexus",t):"";return e=!e&&T()?n("app_nexus","0"):e}function D(t){return t?n("TTD",t):""}function A(t){return t?n("firstId",t):""}function O(t){var e=c+"/getClassification?",t="pid="+p+"&hn_ver="+l+S(t.id5)+b()+y()+D(t.ttd)+A(t.firstId)+k(t.xandr);return fetch(e+t,{method:"GET",credentials:"include",browsingTopics:!0}).then(t=>E(t)).then(t=>{try{var e=JSON.parse(t).categories,n=Array.from(e,t=>t.id);window.localStorage&&(window.localStorage.setItem("_cptt",JSON.stringify({captify_categories:n})),window.localStorage.setItem("_cptte",Date.now()+864e5))}catch(t){}})}function U(n,i){var t=document.referrer?"&ref="+encodeURIComponent(document.referrer):"",e=window.captify_kw_query_12771?"&kw="+encodeURIComponent(captify_kw_query_12771).substring(0,v):"";let r=encodeURIComponent(document.URL),o=c+"/fire.js?",d=n?"&gcv="+n:"",a="pid="+p+t+"&url="+r+"&hn_ver="+l+"&fid="+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})+e+S(i.id5)+b()+y()+D(i.ttd)+A(i.firstId),s=a+k(i.xandr)+d;t=function(t,e){for(const i of t){var n=document.querySelector(i);if(n&&n.hasAttribute(e)){n=n.getAttribute(e);if(""!==n.trim())return n}}return null}(['meta[name="description"]'],"content"),e={pageMeta:{title:document.title.substring(0,v)}};t&&(e.pageMeta.description=t.substring(0,v)),fetch(o+s,{method:"POST",credentials:"include",body:JSON.stringify(e),browsingTopics:!0}).then(t=>{var e=E(t).then(t=>{var i,r;t=t,i=n,r=a,T()||t.split(",").forEach(function(t){let e="";var n=i?"&gdpr=1&gdpr_consent="+i:"";switch(t.toLowerCase()){case"app_nexus":e="https://secure.adnxs.com/getuid?"+encodeURIComponent(c+"/fire.js?dsp=app_nexus&dsp_uid=$UID&"+r)+n;break;case"dbm":e="https://cm.g.doubleclick.net/pixel?google_nid=captify_dmp&google_cm&dsp=dbm"+n;break;case"pubmatic":e="https://image2.pubmatic.com/AdServer/UCookieSetPug?rd="+encodeURIComponent(u+"?dsp=pubmatic&dsp_uid=#PM_USER_ID")+n;break;case"openx":e="https://u.openx.net/w/1.0/cm?id=f0f39a70-2c21-4d5d-af4b-7350637edcd5"+n+"&r="+encodeURIComponent(u+"?dsp=OPENX&dsp_uid={OPENX_ID}");break;case"rubicon":e="https://pixel.rubiconproject.com/token?pid=34010&customParamenters"}e&&((new Image).src=e)})});return w&&null==t.headers.get("X-Discarded")?Promise.allSettled([O(i),e]):e})}function T(){return window.navigator&&window.navigator.userAgent&&-1!==window.navigator.userAgent.indexOf("Safari")&&-1===window.navigator.userAgent.indexOf("Chrome")&&-1===window.navigator.userAgent.indexOf("Firefox")}function C(t){return fetch(t,{credentials:"include"}).then(t=>E(t))}function E(t){return t.ok?t.text():Promise.reject({status:t.status,statusText:t.statusText})}function t(t){let e={xandr:null,ttd:null,id5:null,firstId:null},n=!0,i=!0;window.localStorage&&window.localStorage.getItem(g)&&((c=JSON.parse(window.localStorage.getItem(g)))[f]&&c[m]&&c[f]>Date.now()&&(e.xandr=c[m],n=!1),c[x])&&c[_]&&c[x]>Date.now()&&(e.ttd=c[_],i=!1);var r,o,d,a,s,c=[],u=(n&&c.push((o=t,r=e,C("https://ib.adnxs.com/getuidj"+(o?"?gdpr=1&gdpr_consent="+o:"")).then(t=>{t=JSON.parse(t).uid;r.xandr="0"===t?null:t}).catch(()=>null))),i&&c.push((o=t,d=e,C("https://match.adsrvr.org/track/rid?ttd_pid=0fkciot&fmt=json"+(o?"&gdpr=1&gdpr_consent="+o:"")).then(t=>{t=JSON.parse(t).TDID;d.ttd=t||null}).catch(()=>null))),localStorage.getItem("captify-id5id-fast-track"));if(""!==u&&null!==u)e.id5=u;else try{u=JSON.parse(decodeURIComponent(window.localStorage.getItem("id5id"))).universal_uid,localStorage.setItem("captify-id5id-fast-track",u),e.id5=u}catch(t){}return window.ID5&&(a=e,new Promise((e,t)=>{ID5.init({partnerId:1539}).onAvailable(t=>{t=t.getUserId();t&&(a.id5=t,localStorage.setItem("captify-id5id-fast-track",t),e())})}).catch(t=>{})),window.firstId&&c.push((s=e,u=new RegExp("(?:^|.*; *)firstid *= *([^;]*).*$|^.*$","i"),(u=document.cookie.match(u)[1])?(s.firstId=decodeURIComponent(u),Promise.resolve()):new Promise((t,e)=>{setTimeout(()=>e(new Error("Timed out")),300),window.firstId.callbacks.push(()=>{s.firstId=(new FirstIdSdk).getId(),t()})}))),Promise.allSettled(c).then(()=>{var t;window.localStorage&&(n||i)&&(t=(t=window.localStorage.getItem(g))?JSON.parse(t):{},n&&e.xandr&&(t[m]=e.xandr,t[f]=Date.now()+I),i&&e.ttd&&(t[_]=e.ttd,t[x]=Date.now()+h),window.localStorage.setItem(g,JSON.stringify(t)))}).finally(()=>{U(t,e)})}function i(n){__gpp("addEventListener",(t,e)=>{e&&t.pingData&&"ready"===t.pingData.signalStatus&&(n(t.pingData.gppString),__gpp("removeEventListener",t=>{},t.listenerId))})}function e(t){var n;window.__tcfapi?(n=t,window.__tcfapi("addEventListener",2,(t,e)=>{e&&(t.gdprApplies?"useractioncomplete"!==t.eventStatus&&"tcloaded"!==t.eventStatus||(n(t.tcString),window.__tcfapi("removeEventListener",2,t=>{},t.listenerId)):(window.__gpp?i(n):n(""),window.__tcfapi("removeEventListener",2,t=>{},t.listenerId)))})):window.__gpp?i(t):t("")}function r(){let t=window,r;const o={};for(;t;){try{if(t.frames.__tcfapiLocator){r=t;break}}catch(t){}if(t===window.top)break;t=t.parent}window.__tcfapi=function(t,e,n,i){r?(i={__tcfapiCall:{command:t,parameter:i,version:e,callId:t=Math.random()+""}},o[t]=n,r.postMessage(i,"*")):n({msg:"CMP not found"},!1)},window.addEventListener("message",function(t){let e={};try{e="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}(t=e.__tcfapiReturn)&&"function"==typeof o[t.callId]&&(o[t.callId](t.returnValue,t.success),o[t.callId]=null)},!1)}window.self!==window.top&&r(),e(t)})();