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

3 lines
18 KiB
JavaScript

/* Lucead script for The Moneytizer 2024-12-18 02:47:39 */
window.lucead_site={"id":2048491583,"name":"The Moneytizer","schain_domain":"","schain_id":"","js":"","placements":{"3223693641":{"id":3223693641,"name":"Test","sizes":[[300,250]],"floor":0,"ssps":[]}}};(()=>{var ae=Object.defineProperty,le=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var Z=(e,n,t)=>n in e?ae(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,N=(e,n)=>{for(var t in n||(n={}))pe.call(n,t)&&Z(e,t,n[t]);if(Y)for(var t of Y(n))ue.call(n,t)&&Z(e,t,n[t]);return e},H=(e,n)=>le(e,de(n));var T="storage";function K(e){T=e}function fe(){let e=JSON.parse(localStorage.getItem(T))||{};for(let n in e)if(e.hasOwnProperty(n)){let t=e[n][1]||0;t&&t<W()&&(delete e[n],I(n,null))}return e}function S(e){let n=fe();return n[e]&&n[e][0]||null}function I(e,n,t){let r=JSON.parse(localStorage.getItem(T))||{};n?r[e]=[n,t?W()+t:0]:delete r[e],localStorage.setItem(T,JSON.stringify(r)),ge()}function R(e){I(e,null)}function W(){return Math.floor(Date.now()/1e3)}function ge(){let e=JSON.parse(localStorage.getItem(T));for(let n in e)if(e.hasOwnProperty(n)){let t=e[n][1]||0;t&&t<W()&&delete e[n]}localStorage.setItem(T,JSON.stringify(e))}function A(){console.log("%cLucead","background:#EEE;color:#2A4B9A;border-radius:4px;padding:2px",...arguments)}function P(){console.error("%cLucead","background:#EEE;color:#4EA05D;border-radius:4px;padding:2px",...arguments)}function q(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"m":"d"}function ee(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function te(){let n=location.hash.replace("#","").split("&"),t={},r="lucead-";for(let o of n){let[i,s]=o.split("=");t[i.replace(r,"")]=s}return t}function ne(e){return new Promise((n,t)=>{let r=document.createElement("script");r.src=e,r.onload=n,r.onerror=t,document.head.appendChild(r)})}function oe(e,n){return n==="USD"?e:n==="EUR"?e*1.18:0}var B="241217.1",he=1600,re=!1,F=!1,se=!0,_e=!0,ye=!0,we=!1,Be=window.rtbpbjs||window.pbjs||window._abPbJs,m=window.lucead_site,Q=window.location.hash.includes("prebid-dev"),ie=0,U="https://lucead.com",be="https://lucead.com",ve="https://s.lucead.com",j=te(),M;function ce(){let e={ver:"1.0",complete:1,nodes:[]};return m!=null&&m.schain_domain&&(m!=null&&m.schain_id)&&e.nodes.push({asi:m.schain_domain,sid:m.schain_id,hp:1}),e}function xe(){return`${Math.trunc(Math.random()*1e9)}`}window.lucead_render=function(e,n){let t=e.frameElement;if(t){t.style.borderWidth="0";let r=document.createElement("iframe");r.style.cssText=`width:${t.clientWidth}px;height:${t.clientHeight}px;border:none;overflow:hidden`,r.scrolling="no",t.parentNode.insertBefore(r,t),r.contentDocument.open(),r.contentDocument.write(`<html lang="en"><head><title>Lucead</title></head><body style="margin:0;background-color:#FFF">${n}</body></html>`),r.contentDocument.close(),t.remove()}};async function Se(e){if(S("country"))return S("country");try{e=e.replace("/go","");let n=await fetch(`${e}/go/country`).then(t=>t.text());return n.length!==2?null:(I("country",n,86400*30),n)}catch(n){return null}}function Ie(){let e="mesured";if(S(e))return;I(e,"1",86400*7);let n=!!navigator.runAdAuction,t=!!document.browsingTopics,r=`${U}/go/report/features?is_chrome=${ee()?1:0}&pa_on=${n?1:0}&topics_on=${t?1:0}`;fetch(r)}async function $(e,n={}){let t=new AbortController,r=setTimeout(()=>t.abort(),he);try{let o=await fetch(e,H(N({},n),{signal:t.signal,credentials:"include"}));return clearTimeout(r),o}catch(o){return clearTimeout(r),null}}function X(e,n=null,t=null){if(!e)return null;if(n&&t){let r=JSON.stringify({ssp:n,placement_id:t,domain:location.hostname,metric:"renders"});e+=`<script>navigator.sendBeacon('${U}/go/report/event','${r}');<\/script>`;let o={grid:39534936,magnite:39534938,criteo:39534939};o[n]&&(new Image().src=`https://www8.smartadserver.com/imp?imgid=${o[n]}&tmstp=${Date.now()}&tgt=`)}return ye?`<html lang="en"><body><script>top?.lucead_render(window,${JSON.stringify(e)});<\/script></body></html>`:e.includes("<html")?e:`<html lang="en"><body style="margin:0;background-color:#FFF">${e}</body></html>`}function C(e,n){var o,i,s,c,h,d,u,a,l,y;let t=e.ortbConverter({}).toORTB({bidRequests:[n],bidderRequest:e.bidderRequest});if((o=t==null?void 0:t.device)!=null&&o.geo&&(delete t.device.devicetype,delete t.device.flashver,delete t.device.js,delete t.device.lmt,delete t.device.pxratio,delete t.device.ppi,delete t.device.language,delete t.site.mobile,delete t.device.carrier,delete t.device.ip,delete t.device.geo,delete t.device.geofetch,delete t.content,delete t.cur,delete t.publisher,delete t.site.cat,delete t.site.name,delete t.site.pagecat,delete t.site.privacypolicy,delete t.site.sectioncat),e.consent?(e.deepSetValue(t,"user.ext.consent",(i=e==null?void 0:e.consent)==null?void 0:i.tcString),e.deepSetValue(t,"regs.ext.gdpr",(s=e==null?void 0:e.consent)!=null&&s.gdprApplies?1:0)):e.deepSetValue(t,"regs.ext.gdpr",0),(c=t.imp)!=null&&c.length&&((h=n==null?void 0:n.sizes)!=null&&h.length)){for(let w of t.imp)if(w.banner.w=n.sizes[0][0],w.banner.h=n.sizes[0][1],m.id&&((d=n==null?void 0:n.params)!=null&&d.placementId)){let O=location.hostname+"_"+((u=n==null?void 0:n.params)==null?void 0:u.placementId);w.tagid=O,e.deepSetValue(w,"ext.gpid",O)}}(l=(a=t==null?void 0:t.source)==null?void 0:a.ext)!=null&&l.wrapper||(e.deepSetValue(t,"source.ext.wrapper","Prebid_js"),e.deepSetValue(t,"source.ext.wrapper_version",(e==null?void 0:e.prebid_version)||((y=window==null?void 0:window.pbjs)==null?void 0:y.version))),n!=null&&n.userIdAsEids&&e.deepSetValue(t,"user.ext.eids",n.userIdAsEids);let r=ce();return r&&e.deepSetValue(t,"source.ext.schain",r),t}function z(e,n=null,t=null){var i;if(!((i=e==null?void 0:e.seatbid)!=null&&i.length))return null;let r=e.seatbid[0].bid.filter(s=>s&&s.price>0&&s.adm);r.sort((s,c)=>c.price-s.price);let o=r[0];return{cpm:(o==null?void 0:o.price)||0,currency:e.cur||"USD",ad:X((o==null?void 0:o.adm)||null,n,t),size:{width:o==null?void 0:o.w,height:o==null?void 0:o.h},ssp:n,advertiser_domains:(o==null?void 0:o.adomain)||null}}async function Oe(){return new Promise(e=>{window.__tcfapi?window.__tcfapi("getTCData",2,(n,t)=>{e(t?n:null)}):e(null)})}function $e(e){if(S("sync"))return;I("sync",1,86400);let n=`gdpr=${Number(e==null?void 0:e.gdprApplies)}&gdpr_consent=${e==null?void 0:e.tcString}`,t=[`https://hb.360yield.com/prebid-universal-creative/load-cookie.html?pbs=1&${n}`,`https://eus.rubiconproject.com/usync.html?${n}`];for(let r of t){let o=document.createElement("iframe");o.id="lucead-cookie-sync",o.src=r,o.style.display="none",document.body.appendChild(o)}}async function ke(e){try{return await fetch(`${e.static_url}/prebid/site?p=`+e.bidRequests[0].params.placementId).then(n=>n.json())}catch(n){return null}}async function Te({base_url:e,placement_id:n,bidRequest:t,bidderRequest:r,is_sra:o,endpoint_url:i}){var y,w,O,D;let s=t.sizes.map(b=>({width:b[0],height:b[1]}));s!=null&&s.length||s||(s=[{width:300,height:250}]);let c=e,h=q(),d=Ee(t),u={prebid_bid_id:t==null?void 0:t.bidId,prebid_request_id:window.lucead_request_id||(r==null?void 0:r.bidderRequestId),prerender:re,placement_id:n,floor:d,floor_currency:"USD",is_sra:o,endpoint_url:i,device:h,is_dev:Q,country:M,page_url:location.href,page_path:location.pathname,page_height:(y=document==null?void 0:document.body)==null?void 0:y.scrollHeight,data_saver_enabled:!!((w=navigator==null?void 0:navigator.connection)!=null&&w.saveData),ua:navigator.userAgent,sizes:s,version:B},a={seller:c,topWindowHostname:location.hostname,decisionLogicUrl:`${c}/js/ssp.js`,interestGroupBuyers:[c,"https://ps.avads.net","https://explorefledge.com"],auctionSignals:N({lucead:u},u),requestedSize:s[0],sellerSignals:{},sellerCurrency:"USD",perBuyerSignals:{[c]:u,"https://explorefledge.com":u,"https://ps.avads.net":{currency:"USD"}},resolveToConfig:!1,dataVersion:2,deprecatedReplaceInURN:{"${PLACEMENT_ID}":n,"${DOMAIN}":location==null?void 0:location.hostname,"${WIDTH}":(O=s[0])==null?void 0:O.width,"${HEIGHT}":(D=s[1])==null?void 0:D.height}},l;if(!navigator.runAdAuction||location.hash.includes("skip-pa")?l=null:l=await navigator.runAdAuction(a),l){if(await navigator.deprecatedReplaceInURN(l,{"${PLACEMENT_ID}":n,"${DOMAIN}":location.hostname}),re){let b=document.createElement("iframe");b.src=l,b.style.display="none",document.body.appendChild(b),b.remove()}return{bid_id:t==null?void 0:t.bidId,ad:X(`<iframe src="${l}" style="width:100%;height:100%;border:none;overflow:hidden" seamless="seamless" scrolling="no" ></iframe>`),is_pa:!0,placement_id:n,cpm:d,currency:"USD",size:s[0]}}else return null}var G=null;async function Ae(e){let n=e.site;return M=await Se(U),await Promise.all(e.bidRequests.map(async(t,r)=>{var s,c,h,d,u,a,l,y,w,O,D,b;let o={bid_id:t==null?void 0:t.bidId,bid:0,ad:null,size:null,placement_id:((s=t==null?void 0:t.params)==null?void 0:s.placementId)||e.placement_id},i=t.sizes.map(v=>({width:v[0],height:v[1]}));try{let v=(c=t==null?void 0:t.params)==null?void 0:c.placementId,E=F?`cache-${v}-${r}-`+i.map(f=>`${f.width}x${f.height}`).join("-"):null;if(!v)return o;if(_e){if(!G)G=Date.now();else if(G<Date.now()-3e4)return o}if(F&&E){let f=S(E);if(f)return f.bid_id=t.bidId,f}let p=n.placements[v]||null,x=H(N({},e),{data:e,placement:p,placement_id:v,bidRequest:t,bid_request:t,deepSetValue:e.deepSetValue}),_=[];if(_.push(Te(x)),(h=p==null?void 0:p.ssps)!=null&&h.improve&&M&&!["in","th","jp","id"].includes(M)&&_.push(Ne(x)),(d=p==null?void 0:p.ssps)!=null&&d.grid&&_.push(Pe(x)),(u=p==null?void 0:p.ssps)!=null&&u.criteo&&_.push(Ue(x)),(a=p==null?void 0:p.ssps)!=null&&a.smart&&_.push(Je(x)),(l=p==null?void 0:p.ssps)!=null&&l.pubmatic&&_.push(Ve(x)),(y=p==null?void 0:p.ssps)!=null&&y.magnite&&_.push(Me(x)),(w=p==null?void 0:p.ssps)!=null&&w.unruly&&_.push(Ce(x)),(O=p==null?void 0:p.ssps)!=null&&O.amazon&&_.push(ze(x)),!_.length)return o;let g=await Promise.all(_);if(g===null||!(g!=null&&g.length))return o;if(g!=null&&g.length&&((D=g[0])!=null&&D.is_pa))return g[0];if(g=g.filter(f=>f&&f.cpm),g!=null&&g.length){(b=g[0])!=null&&b.is_pa||g.sort((k,L)=>((L==null?void 0:L.cpm)||0)-((k==null?void 0:k.cpm)||0));let f=g[0];if(f.ssp&&(f.cpm*=.68),f.bid_id=t.bidId,f.placement_id=v,F&&E){let k=`<script class="lucead-rendered">top.lucead_rendered("${E}");<\/script>`;f.ad.includes("</body>")?f.ad=f.ad.replace("</body>",k+"</body>"):f.ad+=k,I(E,f,60)}return f}else return o}catch(v){return P(v),o}}))}function je(){if(window.pbjs)return window.pbjs;for(let e in window){let n=window[e];if(e.length>=4&&n&&n.que&&typeof n.que.push=="function"&&n.requestBids&&n.onEvent)return n}return null}function De(){if(window.lucead_stws)return;window.lucead_stws=!0;let e=je();e.onEvent&&e.onEvent("bidWon",n=>{n.adUnitCode&&I("pa-floor:"+n.adUnitCode,{bidderCode:n.bidderCode,cpm:oe(n.cpm,n.currency)},86400)})}function Ee(e){let n=S(`pa-floor:${e.adUnitCode}`);return j.floor?parseFloat(j.floor):n?n.cpm:.4}async function V(e){let n=window.lucead_request_id||e.request_id;m||(m=await ke(e)),m!=null&&m.js&&(0,eval)(m.js),e.endpoint_url&&(U=e.endpoint_url.replace("/go","")),e.base_url&&(be=e.base_url),Le(e),De(),e.site=m,e.consent=await Oe(),(Q||j.log)&&A("Lucead for Prebid ",B,e);let t=null;se&&setTimeout(()=>$e(e.consent),5e3),we&&setTimeout(Ie,5e3);let r=Date.now();try{t=await Ae(e)}catch(o){P(o)}fetch(`${U}/go/prebid/pub`,{method:"POST",contentType:"text/plain",body:JSON.stringify({request_id:n,pa_enabled:"runAdAuction"in navigator?"on":"off",domain:location.hostname,responses:t,is_sra:e.is_sra,request_key:ie,duration:Date.now()-r})}).catch(P),++ie}window.lucead_rendered=function(e){A("rendered",S(e)),R(e)};function J(e,n){return j.mock===e?`https://adapting-opossum-stunning.ngrok-free.app/test-prebid?mock=${e}`:n}async function Ne({placement:e,data:n,bidRequest:t,prebid_version:r}){var c,h,d,u,a;let o=e.ssps.improve.ssp_placement_id.toString().split(":"),i=J("improve","https://ad.360yield.com"+(o.length===2?"/"+o[0]:"")+"/pb");j.debug&&(i+="?debug=1&ivt_bypass=1");let s=C(n,t);s.imp=[{ext:{tid:s.source.tid,bidder:o.length===2?{placementId:parseInt(o[1])||22511670,publisherId:parseInt(o[0])||1159}:{placementId:parseInt(o[0])||22511670}},banner:{topframe:1},id:t.bidId,secure:1}],s.imp[0].banner.format=t.sizes.map(l=>({w:l[0],h:l[1]})),s.id=t.bidderRequestId,s.ext={improvedigital:{sdk:{name:"pbjs",version:r||"9.15.0"}}};try{let l=await $(i,{method:"POST",contentType:"text/plain",body:JSON.stringify(s)});if((l==null?void 0:l.status)!==200)return null;if(l=await l.json(),se&&((h=(c=l.ext)==null?void 0:c.improvedigital)!=null&&h.sync))for(let y of(d=l.ext.improvedigital)==null?void 0:d.sync)new Image().src=y;return!(l!=null&&l.seatbid)||!((a=(u=l==null?void 0:l.seatbid[0])==null?void 0:u.bid[0])!=null&&a.price)?null:(l=z(l,"improve",e.id),l)}catch(l){return P(l),null}}async function Pe({placement:e,data:n,bidRequest:t}){let r=J("grid","https://grid.bidswitch.net/hbjson"),o=C(n,t);o.imp[0].tagid=e.ssps.grid.ssp_placement_id.toString(),delete o.source.ext.schain;try{let i=await $(r,{method:"POST",contentType:"text/plain",body:JSON.stringify(o)});return(i==null?void 0:i.status)!==200?null:(i=await i.json(),z(i,"grid",e.id))}catch(i){return console.error(i),null}}async function Ue({placement:e,data:n,bidRequest:t,prebid_version:r,deepSetValue:o}){let i=e.ssps.criteo.ssp_placement_id.toString().split(":"),h=J("criteo",`https://grid-bidder.criteo.com/openrtb_2_5/pbjs/auction/request?profileId=207&av=${String(37)}&wv=${encodeURIComponent(r||"9.15.0")}&cb=${String(Math.floor(Math.random()*99999999999))}&lsavail=1&networkId=${i[0]}`);j.debug&&(h+="&debug=1");let d=C(n,t);delete d.imp[0].banner.w,delete d.imp[0].banner.h,d.imp[0].ext.bidder={publishersubid:e.id,uid:i[2]||""},e.ssps.criteo.floor&&(d.imp[0].bidfloor=e.ssps.criteo.floor,d.imp[0].bidfloorcur="USD"),i[1]&&o(d,"site.publisher.id",i[1]),o(d,"publisher.url",location.href);try{let u=await $(h,{method:"POST",contentType:"text/plain",body:JSON.stringify(d)});return(u==null?void 0:u.status)!==200?null:(u=await u.json(),z(u,"criteo",e.id))}catch(u){return console.error(u),null}}async function Ce({placement:e,data:n,bidRequest:t}){let r="https://targeting.unrulymedia.com/unruly_prebid",o=N({},n.bidderRequest);o.bids=[t],o.bids[0].params.endpoint={siteId:parseint(e.ssps.unruly.ssp_placement_id)};try{let i=await $(r,{method:"POST",contentType:"text/plain",body:JSON.stringify({bidderRequest:o})});return(i==null?void 0:i.status)!==200?(A("Criteo response not ok",i),null):(i=await i.json(),i.bids[0])}catch(i){return console.error(i),null}}async function ze({placement:e}){let n={src:600,u:"https://adapting-opossum-stunning.ngrok-free.app/test-amazon.php",pid:"O4mON3Hn3L4Js",cb:0,ws:"1792x481",v:"24.910.1025",t:"2000",slots:'[{"sd":"test-slot-id","s":["300x250","300x600"],"sn":"test-slot-name"}]',pubid:"6bbeeb6f-714d-47ea-8434-a3c90bec82f4",gdprl:'{"status":"no-cmp"}'};console.log(e);let t="https://aax.amazon-adsystem.com/e/dtb/bid?".Object.keys(n).map(o=>`${o}=${encodeURIComponent(n[o])}`).join("&"),r=await fetch(t).then(o=>o.text()).then(o=>console.log(o));console.log(r)}async function Je({placement:e,sizes:n,size:t,prebid_version:r,transaction_id:o,bid_id:i,ad_unit_code:s,consent:c}){let h="https://prg.smartadserver.com/prebid/v1",d=e.ssps.smart.ssp_placement_id.toString().split(":").map(a=>parseInt(a));if(d.length<3)return null;let u={siteid:d[0]||351627,pageid:d[1]||1232283,formatid:d[2]||88269,ckid:d[3]||0,tagId:s,pageDomain:location.href,transactionId:o,timeout:3e3,bidId:i,prebidVersion:r||"8.37.0",schain:ce(),gpid:s,sizes:n.map(a=>({w:a[0],h:a[1]})),bidfloor:0,gdpr_consent:(c==null?void 0:c.tcString)||null};try{let a=await $(h,{method:"POST",contentType:"text/plain",body:JSON.stringify(u)});return!(a!=null&&a.ok)||(a==null?void 0:a.status)!==200||a.headers.get("content-length")==="0"?(A("Response not ok",a),null):(a=await a.json(),a?{cpm:(a==null?void 0:a.cpm)||0,currency:(a==null?void 0:a.currency)||"USD",ad:a!=null&&a.ad?X(a.ad):null,size:{width:a.width||t.width,height:a.height||t.height},ssp:"smart"}:null)}catch(a){return console.error(a),null}}async function Ve({placement:e,data:n,bidRequest:t}){let r=J("pubmatic","https://hbopenbid.pubmatic.com/translator?source=prebid-client"),[o,i]=e.ssps.pubmatic.ssp_placement_id.toString().split(":"),s=C(n,t);s.at=1,s.cur=["USD"],s.imp[0].tagid=i,s.imp[0].secure=1,s.imp[0].banner.pos="0",s.site.publisher.id=o;try{let c=await $(r,{method:"POST",contentType:"text/plain",body:JSON.stringify(s)});return c!=null&&c.ok?(c=await c.json(),z(c,"pubmatic",e.id)):(A("Response not ok",c),null)}catch(c){return console.error(c),null}}async function Me({placement:e,ad_unit_code:n,data:t,bidRequest:r}){let o=J("magnite","https://prebid-server.rubiconproject.com/openrtb2/auction"),i=e.ssps.magnite.ssp_placement_id.toString().split(":").map(c=>parseInt(c));if(i.length<3)return null;let s=C(t,r);s.imp[0].ext.prebid={bidder:{rubicon:{video:{},accountId:i[0],siteId:i[1],zoneId:i[2]}},adunitcode:n};try{let c=await $(o,{method:"POST",contentType:"text/plain",body:JSON.stringify(s)});return c!=null&&c.ok?(c=await c.json(),z(c,"magnite",e.id)):null}catch(c){return console.error(c),null}}function Le(e){let n="ig-joined-global2",t="1805860168";!navigator.runAdAuction||S(n)||setTimeout(()=>{I(n,Date.now().toString(),86400*7),ne(`${e.static_url||ve}/tag/${t}.js`)},6e3)}async function He(){if(K("lucead"),window.lucead_prebid_data)if(Array.isArray(window.lucead_prebid_data))for(let e of window.lucead_prebid_data)V(e);else V(window.lucead_prebid_data);window.ayads_prebid=V,window.lucead_prebid=V,window.lucead_version=B,Q&&(window.lucead_request_id=xe())}He();})();