/*! * ------------------------ * -- Built : Fri Apr 04 2025 13:08:18 GMT+0000 (Coordinated Universal Time) * -- Commit hash : 4eab42d50bac9e3449b9bc6567721d1f84b04253 * -- Branch : main * ------------------------ */(()=>{"use strict";var e,t;!function(e){e.PAGE_VIEW="page-view",e.VIDEO_PLAY="video-start-playing",e.FIRST_VIDEO_PLAY="first-video-start-playing",e.VIDEO_COMPLETED="video-completed",e.ADDED_BY_PIXELS="added-by-pixels",e.SWAPPED_BY_PIXELS="swapped-by-pixels",e.INJECTED_BY_PIXELS="injected-by-pixels"}(e||(e={})),function(e){e.PAGE_VIEW="page-view",e.AD="ad",e.VIDEO="video",e.EMBED="embed"}(t||(t={}));var n,i,r,a,o,l,d=function(e,t){return void 0===t&&(t=!0),function(n){if(t){var i=new XMLHttpRequest;i.open("POST",e,!0),i.setRequestHeader("Content-Type","application/json"),i.send(JSON.stringify(n))}else{var r=new Blob([JSON.stringify(n)]);navigator.sendBeacon(e,r)}}},s=(d("https://analytics.pixels.ai"),d("https://analytics.pixels.ai/v3",!1)),c=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},u=function(e,t,n){if(n||2===arguments.length)for(var i,r=0,a=t.length;r0&&r[r.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{d(i.next(e))}catch(e){a(e)}}function l(e){try{d(i.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}d((i=i.apply(e,t||[])).next())}))},w=function(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(d){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&l[0]?i.return:l[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;switch(i=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,i=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},A=function(e,t,n){if(n||2===arguments.length)for(var i,r=0,a=t.length;r0&&r[r.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]=.75*e.duration&&(H=!0,u())})),u=function(){return N(void 0,void 0,void 0,(function(){var t,n;return V(this,(function(i){switch(i.label){case 0:return t=r(e).getConfig().recItems[0].mediaid,p("pixels","prerunPrebid","nextMediaId",t),[4,y(t,B)];case 1:return L=i.sent(),[4,k(t)];case 2:return n=i.sent(),p("pixels","prerunPrebid","prebidCallback adTag returned",n),f(n,t),U=t,[2]}}))}))},r(e).setPlaylistItemCallback((function(t,n){return N(void 0,void 0,void 0,(function(){var i;return V(this,(function(r){switch(r.label){case 0:return z(e).getAdTag()?(p("pixels","===================================================="),p("pixels","setPlaylistItemCallback","item (JW)",t),p("pixels","setPlaylistItemCallback","index (JW)",n),n<0?[2]:(p("pixels","setPlaylistItemCallback","nextIndex",G),U===t.mediaid?[3,3]:[4,y(t.mediaid,B)])):[2];case 1:return L=r.sent(),G>0?[4,k(t.mediaid)]:[3,3];case 2:i=r.sent(),p("pixels","setPlaylistItemCallback","prebidCallback adTag returned",i),f(i,t.mediaid),r.label=3;case 3:return K++,G++,H=!1,p("pixels","setPlaylistItemCallback","currentIndex",K),[2]}}))}))})),f=function(t,n){var i,a,o,l,d,s,c,u;t?u=t:(null===(o=null===(a=null===(i=r(e).getConfig().advertising)||void 0===i?void 0:i.schedule)||void 0===a?void 0:a[0])||void 0===o?void 0:o.tag)?u=r(e).getConfig().advertising.schedule[0].tag:(null===(c=null===(s=null===(d=null===(l=r.defaults)||void 0===l?void 0:l.advertising)||void 0===d?void 0:d.schedule)||void 0===s?void 0:s[0])||void 0===c?void 0:c.tag)&&(u=r.defaults.advertising.schedule[0].tag),X(e,u,n)},T.label=1;case 1:return T.trys.push([1,3,,4]),v=function(e){var t,n,i=e+"=",r=document.cookie.split(";");try{for(var a=E(r),o=a.next();!o.done;o=a.next()){for(var l=o.value;" "===l.charAt(0);)l=l.substring(1,l.length);if(0===l.indexOf(i))return l.substring(i.length,l.length)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return null}(j),v||(v=O(),function(e,t,n){var i="";if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),i="; expires="+r.toUTCString()}document.cookie=e+"="+(t||"")+i+"; path=/"}(j,v,365)),g=location.pathname.match(/(\d+).html/),h=function(e,t,n,i){return{organisation:"nationalworld"===e?"derbyshiretimes":e,video_id:n,page_id:i,uuid:t,referrer:window.top.document.referrer||null,url:window.top.location.href,device:/Mobi/i.test(window.navigator.userAgent)?"mobile":"desktop"}}("independent",v,null===(x=null===(b=window.JSGlobals)||void 0===b?void 0:b.article)||void 0===x?void 0:x.videoId,Array.isArray(g)&&g.length>1?g[1]:null),window.pixelsLayer={push:function(e){return s(F(F({},h),e))}},function(e){void 0===e&&(e=null);var n=window.top.__pixelsLayerKey||"pixelsLayer",i=window.top[n]||[];i.swappedVideoId=e,i.push({type:t.EMBED}),window.top[n]=i}(i.isSwapped?n:null),[4,D(e,o.JWPLAYER,l)];case 2:return T.sent(),[3,4];case 3:return _=T.sent(),console.error(_),[3,4];case 4:return[2]}}))}))},J=function(e,t,n){void 0===n&&(n=!1);var i=new URL(t),r=new URLSearchParams(i.search);return n?r.has("cust_params")?h(r.get("cust_params")).getValuesForKey(e):"":r.get(e)},X=function(e,t,n,i){var r,a,o,l,d,s,c;void 0===n&&(n=null),void 0===i&&(i=!1);var u=window.jwplayer;n||(n=u(e).getConfig().playlistItem.mediaid),p("pixels","enrichAndSetAdTag","media id",n);var f=new URL(t),v=f.origin+f.pathname,y=new URLSearchParams(f.search);if(y.has("cust_params")){var g=h(y.get("cust_params"));(null==L?void 0:L.pixels_data)&&g.updateOrAdd("pixels_data",L.pixels_data),(null==L?void 0:L.pixels_segments)&&g.updateOrAdd("pixels_segments",L.pixels_segments),i&&(g.updateOrAdd("adpos",G),g.updateOrAdd("videoID",n),g.updateOrAdd("playerid",C),g.updateOrAdd("permutive",J("permutive",M,!0)),y.set("description_url","__page-url__"),y.set("gdpr",J("gdpr",M)),y.set("gdpr_consent",J("gdpr_consent",M)),y.set("addtl_consent",J("addtl_consent",M)),p("pixels","enrichAndSetAdTag","prev ad tag is: ",M)),y.set("cust_params",g.get())}var E="".concat(v,"?").concat(y.toString());i?(p("pixels","enrichAndSetAdTag","setAdTag called BY PIXELS",E),p("pixels","enrichAndSetAdTag","adpos set to",G)):(M=E,p("pixels","enrichAndSetAdTag","setAdTag called",E)),(null===(o=null===(a=null===(r=u(e).getConfig().advertising)||void 0===r?void 0:r.schedule)||void 0===a?void 0:a[0])||void 0===o?void 0:o.tag)?u(e).getConfig().advertising.schedule[0].tag=E:(null===(c=null===(s=null===(d=null===(l=u.defaults)||void 0===l?void 0:l.advertising)||void 0===d?void 0:d.schedule)||void 0===s?void 0:s[0])||void 0===c?void 0:c.tag)&&(u.defaults.advertising.schedule[0].tag=E)},W=function(e,t){var n=document.createElement("img");n.src=t,n.style.position="absolute",n.style.left="50%",n.style.top="50%",n.style.width="10%",n.style.marginLeft="-5%",n.style.marginTop="-5%",e.appendChild(n)};function z(e){return{initPlayer:function(t,n,i,r){p("pixels","wrapper-independent-prebid","initPlayer","called with playerId",t,i,r),Q(t,n);var a=document.getElementById(e);a.style.position="relative",a.style.width="100%",a.style.paddingTop="56.25%",i&&(a.style.background=i),r&&W(a,r)},setup:function(t){var n=t.playerId,i=t.mediaId;Y?(p("pixels","setup","called with mediaId",i),q(e,i,t)):(p("pixels","setup","called with mediaId and playerId",i,n),Q(n,(function(){q(e,i,t)})))},test:function(e){p("pixels","test","called",e)},initPlaylistPrebidCallback:function(e){p("pixels","initPlaylistPrebidCallback","called"),k=e},getVideoPlayerInstance:function(){return window.jwplayer},on:function(t,n){p("pixels","on","inited for event",t),(0,window.jwplayer)(e).on(t,n)},resize:function(t,n){p("pixels","resize","called"),(0,window.jwplayer)(e).resize(t,n)},getHeight:function(){return p("pixels","getHeight","called"),(0,window.jwplayer)(e).getHeight()},getAdTag:function(){var t,n,i,r,a,o,l;p("pixels","getAdTag","called");var d=window.jwplayer;return(null===(i=null===(n=null===(t=d(e).getConfig().advertising)||void 0===t?void 0:t.schedule)||void 0===n?void 0:n[0])||void 0===i?void 0:i.tag)?d(e).getConfig().advertising.schedule[0].tag:(null===(l=null===(o=null===(a=null===(r=d.defaults)||void 0===r?void 0:r.advertising)||void 0===a?void 0:a.schedule)||void 0===o?void 0:o[0])||void 0===l?void 0:l.tag)?d.defaults.advertising.schedule[0].tag:void 0},setAdTag:function(t){p("pixels","setAdTag","currentIndex",K),!t||K>0||X(e,t)},getMediaId:function(){return p("pixels","getMediaId","called"),(0,window.jwplayer)(e).getConfig().playlistItem.mediaid},getPlaylistIndex:function(){return p("pixels","getPlaylistIndex","called"),(0,window.jwplayer)(e).getPlaylistIndex()},getPlaylistItem:function(t){return p("pixels","getPlaylistItem","called"),(0,window.jwplayer)(e).getPlaylistItem(t)},trigger:function(t,n){return p("pixels","trigger","called"),(0,window.jwplayer)(e).trigger(t,n)},getConfig:function(){return p("pixels","getConfig","called"),(0,window.jwplayer)(e).getConfig()},pause:function(){return p("pixels","pause","called"),(0,window.jwplayer)(e).pause()},play:function(){return p("pixels","play","called"),(0,window.jwplayer)(e).play()}}}window.pixels=z})(); //# sourceMappingURL=wrap-independent-no-prebid-without-consent-lib.js.map