console.log("THETA VIDEO"); let infowomaninread = {} infowomaninread.pel = document.createElement('script') infowomaninread.pel.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js' infowomaninread.pel.async = true window.parent.document.head.appendChild(infowomaninread.pel) infowomaninread.pel = document.createElement('script') infowomaninread.pel.src = `https://static.thetamedia.gr/prebid.js?t=1721893585` infowomaninread.pel.async = true window.parent.document.head.appendChild(infowomaninread.pel) infowomaninread._theta_head = window.parent.document.head || window.parent.document.getElementsByTagName('head')[0] infowomaninread.scrolling = false infowomaninread.carousel = JSON.parse('{"desktop":{},"mobile":{}}'.replaceAll('"', '"')) infowomaninread.conf = JSON.parse('{"mediaTypes":{"video":{"context":"outstream","plcmt":1,"mimes":["video/mp4"]}},"bidders":[{"bidder":"adform","params":{"mid":1256519}},{"bidder":"rubicon","params":{"accountId":26556,"siteId":544434,"zoneId":3385194,"video":{"size_id":203}}}]}'.replaceAll('"', '"')) infowomaninread.sellerId = "47" infowomaninread.selector = "p" infowomaninread.selectorIndex = "1" infowomaninread.selectorIndexMobile = "1" infowomaninread.margin = "0" infowomaninread.passbackuri = "https://thetamarketplace.com/passback/infowomaninread" infowomaninread.hituri = "https://thetamarketplace.com/hit/infowomaninread/host/false" infowomaninread.brandsafetyuri = "https://thetamarketplace.com/brandsafety/dealID" infowomaninread.dmp = true infowomaninread.containerHeight = 0 infowomaninread.method = "StickyOne" infowomaninread.thisscript = document.currentScript infowomaninread.unset_carousel_width = "false" infowomaninread.unset_carousel_width = infowomaninread.unset_carousel_width == "true" infowomaninread.PREBID_TIMEOUT = 1500; infowomaninread.FAILSAFE_TIMEOUT = 3000; infowomaninread.mobileCheck = function() { let check = false; ((a) => { if ( /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( a ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( a.substr(0, 4) ) ) check = true })(navigator.userAgent || navigator.vendor || window.opera) return check } infowomaninread.sindex = infowomaninread.selectorIndex if(infowomaninread.mobileCheck()) { infowomaninread.sindex = infowomaninread.selectorIndexMobile } infowomaninread.ins = window.parent.document.querySelectorAll(infowomaninread.selector) infowomaninread.ins = infowomaninread.ins.length === 1 || infowomaninread.selector.includes('#') ? infowomaninread.ins[0] : infowomaninread.ins[infowomaninread.sindex] if(infowomaninread.ins.tagName == 'P') { infowomaninread.n = window.parent.document.createElement('div') infowomaninread.n.setAttribute('id', 'infowomaninread_inread') infowomaninread.ins.parentNode.insertBefore(infowomaninread.n, infowomaninread.ins.nextSibling); infowomaninread.ins = infowomaninread.n infowomaninread.ins.setAttribute('data-margin', true) } else { let t = document.createElement('div') t.setAttribute('id', `infowomaninread_inread`) infowomaninread.ins.append(t) infowomaninread.ins = t; // infowomaninread.ins.setAttribute('id', 'infowomaninread_inread') } infowomaninread.ins.setAttribute('style', 'text-align:center;') let bidders = infowomaninread.conf.bidders if(infowomaninread.mobileCheck()) { bidders.push(infowomaninread.carousel.mobile) } else { bidders.push(infowomaninread.carousel.desktop) } infowomaninread.adUnits = [ { code: 'infowomaninread_inread', mediaTypes: { banner: { sizes: [ [ 300, 250 ], [ 300, 600 ], [ 570, 427 ] ] }, video: { api: [1,2,3,4,5,6], context: 'outstream', linearity: 2, mimes: ['video/mp4'], playerSize: [[640, 480]], protocols: [1, 2, 3, 4, 5, 6, 7, 8], skip: 1, renderer: { url: 'https://s2.adform.net/banners/scripts/video/outstream/render.js', render: function (bid) { let ad = bid.ad || bid.vastXml; if (ad) { bid.renderer.push(() => { window.parent.Adform.renderOutstream(bid, ad) infowomaninread.prepare(); if(infowomaninread.method == 'StickyOne') { infowomaninread.onesticky(); } else { infowomaninread.finalizeInterval = setInterval(() => { infowomaninread.finalize() }, 300) } }); } else { if (bid.vastUrl) { (async () => { ad = await fetch(resp).then(resp => resp.text()); if (typeof ad === 'string') { bid.renderer.push(() => { window.parent.Adform.renderOutstream(bid, ad) infowomaninread.prepare(); if(infowomaninread.method == 'StickyOne') { infowomaninread.onesticky(); } else { infowomaninread.finalizeInterval = setInterval(() => { infowomaninread.finalize() }, 300) } }); } else { console.log('Invalid VAST'); } })(); } else { console.log('Invalid ad'); } } } } } }, bids: infowomaninread.conf.bidders, }]; window.parent.pbjs = window.parent.pbjs || {}; window.parent.pbjs.que = window.parent.pbjs.que || []; infowomaninread.onesticky = () => { if (infowomaninread.ins !== null) { window.parent.addEventListener('scroll', () => { infowomaninread.scrolling = true }) infowomaninread.scrollInterval = setInterval(() => { infowomaninread.finalize() if (infowomaninread.scrolling) { infowomaninread.scrolling = false infowomaninread.oneScroll() } }, 300) } } infowomaninread.oneScroll = function() { infowomaninread.iframe = infowomaninread.iframe || infowomaninread.ins.getElementsByTagName('iframe')[0] if(typeof infowomaninread.iframe !== "undefined") { let { rect, b, c, m, w, iw, ih, mw, mh } = infowomaninread.preparePositioning() if (c != 0) { if(infowomaninread.containerHeight === 0) { infowomaninread.containerHeight = infowomaninread.ins.clientHeight } let style = `position: fixed; left: 50%; top: 50%; width: 1px !important; height: 1px !important;` infowomaninread.ins.setAttribute('style', style) infowomaninread.iframe.setAttribute('style', style) if (infowomaninread.stickyElement) infowomaninread.stickyElement.el.setAttribute('style', style) if (infowomaninread.keepclose === true) { infowomaninread.close.style.display = 'block' } infowomaninread.buffer.setAttribute('style', `height:${ infowomaninread.containerHeight }px; margin:${ infowomaninread.margin } `) } else { infowomaninread.originalPosition(m) } } } infowomaninread.isElementInViewport = function(rect) { if (rect.top + rect.height / 2 < 0) { return -1 } if (rect.top + rect.height / 2 > (window.parent.innerHeight || window.parent.document.documentElement.clientHeight)) { return 1 } return 0 } infowomaninread.preparePositioning = function() { let rect = { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 } rect = infowomaninread.sibling.getBoundingClientRect() let w = infowomaninread.containerWidth * infowomaninread.factor let b = { height: rect.height, width: rect.width, top: rect.top + infowomaninread.ins.clientHeight / 2 + infowomaninread.sibling.clientHeight, left: rect.left } let c = infowomaninread.isElementInViewport(b) let m = infowomaninread.mobileCheck() let iw = 270 //infowomaninread.factor * infowomaninread.containerWidth let ih = 202 //infowomaninread.factor * infowomaninread.containerHeight let mw = infowomaninread.mobilefactor * infowomaninread.containerWidth let mh = infowomaninread.mobilefactor * infowomaninread.containerHeight return { rect, b, c, m, w, iw, ih, mw, mh } } infowomaninread.mobilePositioning = function(w, h) { if (infowomaninread.keepclose === true) { infowomaninread.close.style.display = 'block' } let style = `position: fixed; bottom:` + infowomaninread.bottomOffset + `px; left: 50%; transform: translate(-50%, 0); width: ${w}px !important; height: ${h}px !important; z-index: 20;` if (infowomaninread.mobilePosition !== undefined && infowomaninread.mobilePosition === 'top') { style = `position: fixed; top: 50px; left: 50%; transform: translate(-50%, 0); width: ${w}px !important; height: ${h}px !important; z-index: 20;` } infowomaninread.ins.setAttribute('style', style) infowomaninread.iframe.setAttribute('style', style) infowomaninread.ins.setAttribute( 'style', `position: fixed; top: 10%; left: 50%; transform: translate(-50%, -10%); width: ${w}px !important; height: ${h}px !important; z-index: 20;` ) infowomaninread.iframe.setAttribute( 'style', `position: fixed; top: 10%; left: 50%; transform: translate(-50%, -10%); width: ${w}px !important; height: ${h}px !important; z-index: 20;` ) infowomaninread.adsby.style.top = '55px' infowomaninread.close.style.top = '55px' infowomaninread.controlbar.style.bottom = '45px' } infowomaninread.originalPosition = function(m) { if (infowomaninread.keepclose === false) { infowomaninread.close.style.display = 'none' } if (infowomaninread.stickyElement) infowomaninread.stickyElement.el.setAttribute( 'style', `clear: both; position:relative;` ) if (m) { infowomaninread.ins.setAttribute('style', `position: relative; margin:${ infowomaninread.margin }`) infowomaninread.iframe.setAttribute('style', `position: relative;`) } else { infowomaninread.ins.setAttribute( 'style', `clear: both; position: relative; margin: ${ infowomaninread.margin };` ) infowomaninread.iframe.setAttribute( 'style', `clear: both; position: relative;` ) } infowomaninread.buffer.setAttribute('style', `height: 0;`) } infowomaninread.prepare = function() { infowomaninread.sibling = document.createElement('div') infowomaninread.sibling.setAttribute('id', 'thetasib') infowomaninread.ins.parentNode.insertBefore(infowomaninread.sibling, infowomaninread.ins) infowomaninread.buffer = document.createElement('div') infowomaninread.buffer.setAttribute('id', 'thetabuffer') infowomaninread.ins.parentNode.insertBefore(infowomaninread.buffer, infowomaninread.ins) } infowomaninread.finalize = () => { infowomaninread.iframe = infowomaninread.ins.querySelectorAll('iframe')[0] if(typeof infowomaninread.iframe !== "undefined" && infowomaninread.iframe.contentWindow !== null && infowomaninread.iframe.contentWindow.document.getElementById('thetaadsby') === null && infowomaninread.iframe.contentWindow.document.getElementById('banner') !== null) { infowomaninread.adsby = document.createElement('div') infowomaninread.adsby.setAttribute('id', 'thetaadsby') infowomaninread.adsby.setAttribute( 'style', 'display: block; \ position: absolute; \ z-index: 20; \ cursor: pointer; \ top: 7px; \ left: 5px; \ color: #fff; \ font-size: 11px; \ text-decoration: none; \ border-radius: 5px' ) let img = document.createElement('img') img.src = 'https://assets.thetamedia.gr/inread/ads-by-theta@2x.png' if (infowomaninread.mobileCheck()) { img.setAttribute('width', '60') } else { img.setAttribute('width', '125') } infowomaninread.adsby.appendChild(img) infowomaninread.iframe.contentWindow.document.getElementById('banner').appendChild(infowomaninread.adsby) infowomaninread.player = infowomaninread.iframe.contentWindow.document.getElementById('vast-wrapper') infowomaninread.player.style.backgroundColor = 'transparent' img = document.createElement('img') img.src = 'https://assets.thetamedia.gr/inread/close-theta@2x.png' img.setAttribute('width', '16') infowomaninread.close = infowomaninread.iframe.contentWindow.document.getElementById('vast-skip') if (infowomaninread.keepclose === false) { infowomaninread.close.style.display = 'none' } // select control bar and play button. let e = infowomaninread.iframe.contentWindow.document.querySelector('.vjs-progress-control') e = infowomaninread.iframe.contentWindow.document.querySelector('.vjs-play-control') infowomaninread.clearIntervals = window.parent.setInterval(function() { if(infowomaninread.ins.childElementCount < 3) { infowomaninread.ins.remove() window.parent.clearInterval(infowomaninread.clearIntervals); window.parent.clearInterval(infowomaninread.scrollInterval); window.parent.clearInterval(infowomaninread.finalizeInterval); } }, 500); } } infowomaninread.passback = function() { thetapbins = infowomaninread.thisscript.parentElement if(thetapbins.parentElement.tagName === 'HTML') { thetapbins = thetapbins.parentElement.querySelector('body') } var script_tag = document.createElement('script') script_tag.src = infowomaninread.passbackuri script_tag.async = true script_tag.defer = true infowomaninread.ins.appendChild(script_tag) } infowomaninread.pbjsconfig = { enableTIDs: true, currency: { adServerCurrency: 'EUR' }, ortb2: { site: { ext: { data: { hostname: location.hostname } }, publisher: { domain: location.hostname } } }, schain: { validation: "strict", config: { ver: "1.0", complete: 1, nodes: [ { asi: "thetamarketplace.com", sid: infowomaninread.sellerId, hp:1 } ] } }, userSync: { iframeEnabled: true, filterSettings: { iframe: { bidders: '*', filter: 'include', }, }, userIds: [], auctionDelay: 1000, syncDelay: 3000, syncEnabled: true } } infowomaninread.initAdserver = function() { if (infowomaninread.initAdserverSet) return; infowomaninread.initAdserverSet = true; let adServerTargeting = window.parent.pbjs.getAdserverTargetingForAdUnitCode('infowomaninread_inread'); if (adServerTargeting && adServerTargeting['hb_adid']) { const text = window.parent.document.body.innerText var formdata = new FormData(); formdata.append('t', text) var requestOptions = { method: 'POST', body: formdata, redirect: 'follow' }; fetch(infowomaninread.brandsafetyuri.replace("dealID", adServerTargeting["hb_deal"]), requestOptions) .then((response) => { return response.json() }) .then((data) => { if(data.res === false) { if(infowomaninread.ins.hasAttribute('data-margin') === true) { infowomaninread.ins.style.margin = infowomaninread.margin } if(adServerTargeting["hb_format"] === 'banner') { var iframe = document.createElement('iframe'); iframe.setAttribute('id', 'thetacarousel') iframe.setAttribute('frameBorder', '0') if(infowomaninread.unset_carousel_width == true){ iframe.setAttribute('style', 'width:unset !important;') } infowomaninread.ins.appendChild(iframe) var iframeDoc = iframe.contentWindow.document; window.parent.pbjs.renderAd(iframeDoc, adServerTargeting['hb_adid']); } else { window.parent.pbjs.renderAd(infowomaninread.ins, adServerTargeting['hb_adid']); } } else { infowomaninread.passback() } }) .catch((error) => console.error(error)); } else { infowomaninread.passback() } } if(location.hostname === 'localhost' || location.hostname === '127.0.0.1') { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('passback') === 'true') { infowomaninread.passback() } else { window.parent.pbjs.que.push(function() { window.parent.pbjs.addAdUnits(infowomaninread.adUnits); window.parent.pbjs.setConfig(infowomaninread.pbjsconfig) window.parent.pbjs.requestBids({ timeout: infowomaninread.PREBID_TIMEOUT, bidsBackHandler: infowomaninread.initAdserver }); }); } } else { fetch(infowomaninread.hituri.replace('/host', '/' + window.location.host), { method: 'GET', }) infowomaninread.pbjsconfig.consentManagement = { gdpr: { cmpApi: 'iab', timeout: 1000, actionTimeout: 10000, defaultGdprScope: true } } window.parent.__tcfapi('addEventListener', 2, function (tcData, success) { if (success) { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); if(urlParams.get('passback') === 'true') { infowomaninread.passback() return } if (tcData.eventStatus == 'useractioncomplete' || tcData.eventStatus == 'tcloaded') { if(tcData.purpose.consents[1] && tcData.purpose.consents[3] && tcData.purpose.consents[5] && tcData.purpose.consents[7] && tcData.purpose.consents[8] && tcData.purpose.consents[9] && tcData.purpose.consents[10]) { if (tcData.vendor.consents[131]) { infowomaninread.pbjsconfig.userSync.userIds.push({ name: "id5Id", params: { partner: 1653, externalModuleUrl: 'https://cdn.id5-sync.com/api/1.0/id5PrebidModule.js', }, storage: { type: "html5", name: "id5id", expires: 90, refreshInSeconds: 8 * 3600 } }) } if (tcData.vendor.consents[95]) { infowomaninread.pbjsconfig.userSync.userIds.push({ name: "lotamePanoramaId", params: { clientId: 17773 } }) } infowomaninread.pbjsconfig.userSync.userIds.push({ name: "sharedId", storage: { name: "_sharedID", type: "html5", expires: 30 } }) infowomaninread.pbjsconfig.userSync.userIds.push({ name: "criteo" }) } window.parent.pbjs.que.push(function() { window.parent.pbjs.addAdUnits(infowomaninread.adUnits); window.parent.pbjs.setConfig(infowomaninread.pbjsconfig) window.parent.pbjs.requestBids({ timeout: infowomaninread.PREBID_TIMEOUT, bidsBackHandler: infowomaninread.initAdserver }); }); setTimeout(function() { infowomaninread.initAdserver(); }, infowomaninread.FAILSAFE_TIMEOUT); if(infowomaninread.dmp === true) { const stringToUuid = (str) => { str = str.replace('-', ''); return 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c, p) { return str[p % str.length]; }); } navigator.mediaDevices .enumerateDevices() .then((devices) => { const uuid = JSON.parse(decodeURIComponent(localStorage.id5id)).universal_uid const source = window.location.host const atype = 1 const text = window.parent.document.body.innerText var formdata = new FormData(); formdata.append('t', text) var requestOptions = { method: 'POST', body: formdata, redirect: 'follow' }; fetch('https://contextual.thetamarketplace.com/', requestOptions) .then(response => response.json()) .then(data => { const key = data.key let ns = document.createElement('noscript') let img = document.createElement('img') img.src = `//dmp.adform.net/dmp/profile/?pid=12269&sg=${key}&eid_${source}_${atype}=${uuid}` img.setAttribute('style', 'display:none !important') ns.appendChild(img) infowomaninread._theta_head.appendChild(ns) }) }) .catch((err) => { console.log(`${err.name}: ${err.message}`); }); } } } }); }