hypnagaga/docs/assets/ResponsiveAd-034dbb7c.js
2024-04-08 17:43:04 +00:00

2 lines
7.8 KiB
JavaScript

import{S as A,i as S,s as k,D as N,l as p,y as L,g as B,b as i,e as m,d as E,m as C,n as T,t as _,h as b,f as c,j as M,O as F,r as Q,M as D,v as U,w as z}from"./index-99a30af8.js";import{t as Y}from"./throttle-dfed7c30.js";const v=(n,t=window.location.href)=>{n=n.replace(/[\[\]]/g,"\\$&");const e=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)").exec(t);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null},x=600,G=()=>new Promise(n=>{const t=setTimeout(()=>{n("Resolved with timeout")},x),o=()=>{clearTimeout(t),window.__iasPET=window.__iasPET||{},window.__iasPET.queue=window.__iasPET.queue||[],window.__iasPET.pubId="931336",n("loaded")},e=document.createElement("script");e.src="//static.adsafeprotected.com/iasPET.1.js",e.setAttribute("async","async"),document.head.appendChild(e),e.onload=o,e.onerror=()=>{n("error")}}),W="ot_logs",K="ot_geolocation_mock",V="38cb75bd-fbe1-4ac8-b4af-e531ab368caf-test",H=()=>{window.freestar=window.freestar||{};const n=window.freestar;n.debug=!0,n.queue=n.queue||[],n.config=n.config||{},n.config.enabled_slots=[],n.initCallback=function(){n.config.enabled_slots.length===0?n.initCallbackCalled=!1:n.newAdSlots(n.config.enabled_slots)},n.config.channel="/4735792/reuters.com/graphics",window.initBootstrap({onetrust_logs:v(W)||"false",geolocation_mock:v(K)||"default",onetrust_script_id:V},t=>{const o=G();return Promise.all([o]).then(e=>{const[r]=e;return{...t,ias:r}})}),window.bootstrap.getResults(t=>{window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{window.googletag.pubads().enableSingleRequest(),window.googletag.pubads().enableAsyncRendering(),window.googletag.pubads().collapseEmptyDivs(!0)}),n.queue.push(function(){const o=new URL(document.location.href).searchParams.get("adstest");o&&window.googletag.pubads().setTargeting("adstest",o);const e=window.location.pathname.split("/").filter(r=>r.match(/[a-z0-9]+/)&&r!=="graphics")[0]||"unknown-graphic";window.googletag.pubads().setTargeting("template","graphics"),window.googletag.pubads().setTargeting("graphicId",e)}),Array.isArray(window.graphicsAdQueue)||console.error("Ad queue not initialized!"),n.queue.push(function(){n.newAdSlots(window.graphicsAdQueue||[],n.config.channel)})})},R=(n,t)=>{const{onload:o,async:e=!0}=t||{},r=document.createElement("script");r.addEventListener("load",o),r.async=e,r.src=n,document.head.append(r)};function J(n){let t=0,o=!0;const e=(s=!0)=>{const a=document.getElementById("ot-sdk-btn-floating");a&&(s?(o=!0,a.style.bottom=""):(o=!1,a.style.bottom="-5rem"))},r=()=>{t>window.scrollY?o||e(!0):o&&window.scrollY>250&&e(!1),t=window.scrollY};return N(()=>{window.addEventListener("scroll",Y(r,250),{passive:!0})}),[]}class j extends A{constructor(t){super(),S(this,t,J,null,k,{})}}j.__docgen={version:3,name:"OneTrust.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function X(n){let t,o,e,r,s,a,l,d,g,w,u,h,y;return h=new j({}),{c(){t=p("link"),o=p("link"),e=p("link"),r=p("link"),s=p("link"),a=p("link"),l=p("link"),d=p("link"),g=p("link"),w=p("link"),u=L(),B(h.$$.fragment),i(t,"rel","preconnect"),i(t,"href","https://a.pub.network/"),i(t,"crossorigin",""),i(o,"rel","preconnect"),i(o,"href","https://b.pub.network/"),i(o,"crossorigin",""),i(e,"rel","preconnect"),i(e,"href","https://c.pub.network/"),i(e,"crossorigin",""),i(r,"rel","preconnect"),i(r,"href","https://d.pub.network/"),i(r,"crossorigin",""),i(s,"rel","preconnect"),i(s,"href","https://c.amazon-adsystem.com"),i(s,"crossorigin",""),i(a,"rel","preconnect"),i(a,"href","https://s.amazon-adsystem.com"),i(a,"crossorigin",""),i(l,"rel","preconnect"),i(l,"href","https://btloader.com/"),i(l,"crossorigin",""),i(d,"rel","preconnect"),i(d,"href","https://api.btloader.com/"),i(d,"crossorigin",""),i(g,"rel","preconnect"),i(g,"href","https://confiant-integrations.global.ssl.fastly.net"),i(g,"crossorigin",""),i(w,"rel","stylesheet"),i(w,"href","https://a.pub.network/reuters-com/cls.css")},m(f,P){m(document.head,t),m(document.head,o),m(document.head,e),m(document.head,r),m(document.head,s),m(document.head,a),m(document.head,l),m(document.head,d),m(document.head,g),m(document.head,w),E(f,u,P),C(h,f,P),y=!0},p:T,i(f){y||(_(h.$$.fragment,f),y=!0)},o(f){b(h.$$.fragment,f),y=!1},d(f){f&&c(u),c(t),c(o),c(e),c(r),c(s),c(a),c(l),c(d),c(g),c(w),M(h,f)}}}function Z(n){return N(()=>{window.graphicsAdQueue=window.graphicsAdQueue||[],R("https://graphics.thomsonreuters.com/cdn/js/bootstrap.static.js",{onload:H,async:!1}),R("https://a.pub.network/reuters-com/pubfig.min.js")}),[]}class $ extends A{constructor(t){super(),S(this,t,Z,X,k,{})}}$.__docgen={version:3,name:"AdScripts.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const I=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1),ee=()=>"ad-"+I()+I();function te(n){let t,o;return{c(){t=p("div"),i(t,"data-freestar-ad",o=n[0]||null),i(t,"id",n[1])},m(e,r){E(e,t,r)},p(e,[r]){r&1&&o!==(o=e[0]||null)&&i(t,"data-freestar-ad",o)},i:T,o:T,d(e){e&&c(t)}}}function ne(n,t,o){let{placementName:e}=t,{adType:r}=t,{dataFreestarAd:s="__970x250"}=t;const a=ee();return N(()=>{const l={placementName:e,slotId:a,targeting:{div_id:a,type:r}},d=window==null?void 0:window.freestar;d?d.queue.push(function(){d.newAdSlots([l],d.config.channel)}):(window.graphicsAdQueue=window.graphicsAdQueue||[],window.graphicsAdQueue.push(l))}),n.$$set=l=>{"placementName"in l&&o(2,e=l.placementName),"adType"in l&&o(3,r=l.adType),"dataFreestarAd"in l&&o(0,s=l.dataFreestarAd)},[s,a,e,r]}class oe extends A{constructor(t){super(),S(this,t,ne,te,k,{placementName:2,adType:3,dataFreestarAd:0})}}function O(n){let t=n[1],o,e,r=q(n);return{c(){r.c(),o=Q()},m(s,a){r.m(s,a),E(s,o,a),e=!0},p(s,a){a&2&&k(t,t=s[1])?(U(),b(r,1,1,T),z(),r=q(s),r.c(),_(r,1),r.m(o.parentNode,o)):r.p(s,a)},i(s){e||(_(r),e=!0)},o(s){b(r),e=!1},d(s){s&&c(o),r.d(s)}}}function q(n){let t,o;return t=new oe({props:{placementName:n[1],adType:n[2]}}),{c(){B(t.$$.fragment)},m(e,r){C(t,e,r),o=!0},p(e,r){const s={};r&2&&(s.placementName=e[1]),r&4&&(s.adType=e[2]),t.$set(s)},i(e){o||(_(t.$$.fragment,e),o=!0)},o(e){b(t.$$.fragment,e),o=!1},d(e){M(t,e)}}}function se(n){let t,o,e,r;F(n[5]);let s=n[0]&&O(n);return{c(){s&&s.c(),t=Q()},m(a,l){s&&s.m(a,l),E(a,t,l),o=!0,e||(r=D(window,"resize",n[5]),e=!0)},p(a,[l]){a[0]?s?(s.p(a,l),l&1&&_(s,1)):(s=O(a),s.c(),_(s,1),s.m(t.parentNode,t)):s&&(U(),b(s,1,1,()=>{s=null}),z())},i(a){o||(_(s),o=!0)},o(a){b(s),o=!1},d(a){a&&c(t),s&&s.d(a),e=!1,r()}}}function re(n,t,o){let e,r,{desktopPlacementName:s}=t,{mobileBreakpoint:a=1024}=t,l;const d=u=>{switch(u){case"reuters_desktop_leaderboard_atf":return"reuters_mobile_leaderboard";case"reuters_sponsorlogo":return"reuters_sponsorlogo";default:return"reuters_mobile_mpu_1"}},g=u=>{switch(u){case"reuters_desktop_leaderboard_atf":case"reuters_mobile_leaderboard":return"leaderboard";case"reuters_sponsorlogo":return"sponsorlogo";case"reuters_mobile_mpu_1":return"mpu";case"reuters_billboard_desktop":return"billboard";default:return"native"}};function w(){o(0,l=window.innerWidth)}return n.$$set=u=>{"desktopPlacementName"in u&&o(3,s=u.desktopPlacementName),"mobileBreakpoint"in u&&o(4,a=u.mobileBreakpoint)},n.$$.update=()=>{n.$$.dirty&25&&o(1,e=l&&l<a?d(s):s),n.$$.dirty&2&&o(2,r=g(e))},[l,e,r,s,a,w]}class ae extends A{constructor(t){super(),S(this,t,re,se,k,{desktopPlacementName:3,mobileBreakpoint:4})}}ae.__docgen={version:3,name:"ResponsiveAd.svelte",data:[{visibility:"public",description:null,keywords:[],name:"desktopPlacementName",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"mobileBreakpoint",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:1024}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};export{$ as A,ae as R};
//# sourceMappingURL=ResponsiveAd-034dbb7c.js.map