text: !function(){var e="googima",t="TYPE_API",i="TYPE_SCHEDULE",r="viewable",a="-1",n="jw-flag-ads-googleima",o="jw-flag-ads-vpaid",s="jw-flag-ads-vpaid-controls",d="playing",l="adBreakStart",u="adBreakEnd",c="adCompanions",p="adError",g="adStarted",h="viewable",m=2e3,f=4096,v=1e3,y="external";function b(e,t,i){if(!e)return e;for(var r=t.getPlaylistItem(),a=t.getConfig(),n=e.replace("__random-number__",Math.random()*Math.pow(10,18)).replace("__timestamp__",(new Date).getTime()).replace("__page-url__",encodeURIComponent(window.location.href)).replace("__referrer__",encodeURIComponent(document.referrer)).replace("__player-height__",t.getHeight()||a.height).replace("__player-width__",t.getWidth()||a.width).replace("__item-duration__",function(e,t){var i=Math.pow(10,t);return Math.round(e*i)/i}(t.getDuration(),3)).replace("__domain__",encodeURIComponent(function(){var e=window.location.href.match(new RegExp(/^[^/]*:\/\/\/?([^/]*)/));return e&&e.length>1?e[1]:""}())),o=(n=i.companiondiv&&i.companiondiv.id?n.replace("__companion-div__",i.companiondiv.id):n.replace("__companion-div__","")).match(new RegExp(/__item-[a-z 0-9 A-Z]*__/g)),s=0;o&&s<o.length;s++){var d=o[s],l=d.substring(7,d.length-2);if(r.hasOwnProperty(l)&&t._.isString(r[l])){var u=r[l],c=i.truncateMacros?v:f;u.length>c&&(u=u.substring(0,c)),n=n.replace(d,encodeURIComponent(u))}else n=n.replace(d,"")}if(r.title&&-1===n.indexOf("vid_t=")){var p=r.title.substring(0,100).replace(/[^\x00-\x7F]/g,"");n+=(g=n,(-1!==g.indexOf("?")?"&":"?")+"vid_t="+encodeURIComponent(p))}var g;return n}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function A(e,t){if("start"===e||"0%"===e)return"pre";if("end"===e||"100%"===e)return"post";if("string"==typeof e&&("pre"===e||"post"===e||e.indexOf("%")>=0))return e;var i=t.seconds(e);return"number"==typeof i&&i}function P(e,t,i){var r=A(e,t);return r?i.isNumber(r)?function(e){var t=parseInt(e,10),i=Math.floor(t)%1e3,r=Math.floor(t/1e3)%60,a=Math.floor(t/6e4)%60,n=Math.floor(t/36e5)%24;return(n=n<10?"0"+n:n)+":"+(a=a<10?"0"+a:a)+":"+(r=r<10?"0"+r:r)+"."+(i=("000"+i).slice(-3))}(1e3*r):r:"pre"}function C(e,t,i){if(!i)return e;var r=e.indexOf("?")>=0?"&":"?",a=e.indexOf("cust_params="),n="cust_params=".length,o="",s="";if(t.foreach(i,function(e,t){o=""+o+s+e+"="+t,s="&"}),o=encodeURIComponent(o),a>=0){var d=e.substr(0,a+n),l=e.substr(a+n);return""+d+o+"%26"+l}return""+e+r+"cust_params="+o}function E(e,t,i){var r={};return t.foreach(e,function(e,a){var n={},o=a.ad||a;n.offset=P(o.offset||o.position||a.offset||"",t,i),n.adm=o.adm,n.tag=o.tag?C(o.tag,t,o.custParams):null,n.type=o.type||a.type||"linear,nonlinear",r[e]=n}),r}var _='<vmap:AdBreak breakType="_type_" breakId="_adbreakname_" timeOffset="_offset_"><vmap:AdSource allowMultipleAds="true" followRedirects="true" id="_adbreakname_-ad-1">_source_</vmap:AdSource></vmap:AdBreak>',M=function(){function e(t,i){w(this,e),this.player=t,this.options=i}return e.prototype.getAdsResponse=function(e){var t=this,i=this.player,r=i.utils,a=[],n=[],o=[];return r.foreach(E(e,r,i._),function(e,s){var d=s.offset.replace("pre","start").replace("post","end"),l=void 0;if(s.adm){var u=r.parseXML(s.adm);l="<vmap:VASTAdData>_vast_</vmap:VASTAdData>".replace(/_vast_/g,u?(c=u.documentElement,c.outerHTML||(new XMLSerializer).serializeToString(c)):"")}else l="<vmap:AdTagURI><![CDATA[_url_]]></vmap:AdTagURI>".replace(/_url_/g,b(s.tag,i,t.options,s.custParams));var c,p=_.replace(/_type_/g,s.type).replace(/_adbreakname_/g,e).replace(/_offset_/g,d).replace(/_source_/g,l);"start"===d?a.push(p):"end"===d?o.push(p):n.push(p)}),'<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">'+a.join("")+n.join("")+o.join("")+"</vmap:VMAP>"},e.prototype.getTagMap=function(e){return this.getTagList(e).reduce(function(e,t){return e[t.offset]=t,e},{})},e.prototype.getTagList=function(e){var t=this,i=this.player,r=i.utils,a=[];return r.foreach(E(e,r,i._),function(e,n){var o=A(n.offset,r);i._.isString(o)&&(o=parseFloat(o.replace("pre","0").replace("post","-1"))),a.push({offset:o,adm:n.adm,tag:n.tag?b(n.tag,i,t.options):null})}),a},e}(),j={autoplayadsmuted:!1,companiondiv:null,companionResourceType:"",debug:!1,enablePreloading:!1,loadVideoTimeout:15e3,locale:"",maxRedirects:-1,preloadAds:!1,premiumAds:!1,requestTimeout:1e4,truncateMacros:!0,vastLoadTimeout:1e4,vpaidcontrols:!1,vpaidmode:"insecure"};function I(e){if("true"===e)return!0;if("false"===e)return!1;var t=parseFloat(e);return isNaN(t)?e:t}var L=function(){function e(t,i){w(this,e),this.config=t,this.utils=i,this.bidsResponse={};for(var r in j)if(j.hasOwnProperty(r)){var a=t[r],n=j[r],o=typeof n;if(void 0!==a){if("boolean"!==o&&"number"!==o||(a=I(a)),typeof a!==o)throw new Error("invalid parameter: "+r+" should be a "+o);this[r]=a}else this[r]=n}}return e.prototype.getSingleTagPrerollBlock=function(){var e=this.getConfigSchedule(),t=this.singleTagBidsResponse;if("string"==typeof e){if(!t)return e;if(t.adm)return[{adm:t.adm}];var i=t.custParams;return C(t.tag,this.utils,i)}return null},e.prototype.addBidsResponse=function(e,t){var i=void 0;i=e&&!e.error&&(e.adm||e.tag)?e:null,t?this.bidsResponse[t]=i:this.singleTagBidsResponse=i},e.prototype.resetBidsResponse=function(){this.bidsResponse={},this.singleTagBidsResponse=null},e.prototype.getSchedule=function(){var e=this,t=this.getConfigSchedule();if(!t)return t;var i=this.utils.extend({},t),r=this.getSingleTagPrerollBlock();return r||Object.keys(this.bidsResponse).reduce(function(t,i){var r=t[i],a=e.bidsResponse[i];return r&&a&&(t[i]=Object.assign({},r,{adm:a.adm,tag:a.tag,custParams:Object.assign({},r.custParams,a.custParams)})),t},i)},e.prototype.getConfigSchedule=function(){var e=this.config;return e.tag||this.adschedule||e.schedule||e.ad},e.prototype.getAdRules=function(){var e=this.config.rules||{},t=parseInt(e.frequency,10);return{startOn:e.startOn||1,frequency:isNaN(t)?1:t}},e.prototype.setLocalizationOptions=function(e){var t=e.admessage,i=e.cuetext,r=e.podmessage,a=e.loadingAd;this.admessage=t,this.cuetext=i,this.podmessage=r,this.loadingAd=a},e}(),T=function(){function e(t,i,r){w(this,e),r.addClass(t,"jw-plugin-googima");var a=document.createElement("div");a.id=i+"_ad",a.className="jw-ads-view",this.visible=!1,this.utils=r,this.div=t,this.adDiv=a,t.appendChild(a)}return e.prototype.resizeNonLinear=function(e){this.resize(!1,e)},e.prototype.resizeLinear=function(){this.resize(!0)},e.prototype.resize=function(e,t){var i=this.utils;i.toggleClass(this.div,"jw-ad-non-linear",!e),i.toggleClass(this.div,"jw-ad-linear",e),i.style(this.div,{height:t?t+"px":""})},e.prototype.getAdDiv=function(){return this.adDiv},e.prototype.adSetup=function(){this.visible=!0,this.utils.addClass(this.div,"jw-ad-instream"),this.resize(!0)},e.prototype.adTakeDown=function(){this.visible=!1,this.utils.removeClass(this.div,"jw-ad-instream"),this.resize(!0)},e}(),S=null,k=-1;function R(){return k}function x(e){if(S)return S;if(window.google&&google.ima&&google.ima.AdDisplayContainer)return S=Promise.resolve();var t=["//","imasdk.googleapis.com/js/sdkloader/ima3.js"];"file:"===document.location.protocol&&t.unshift("https:");var i=new(0,e.scriptloader)(t.join(""));return S=i.load().then(function(){k=Date.now()})}var D={};var O,B=function(){function e(t,i,r){w(this,e),t.extend(this,i),this.vol=0,this.imaProxy=null,this.view=r}return e.prototype.setProxy=function(e){this.imaProxy=e,"boolean"==typeof this.muted&&this.mute(this.muted)},e.prototype.attachMedia=function(){},e.prototype.detachMedia=function(){},e.prototype.mute=function(e){this.muted=e,this.imaProxy&&(e?this.imaProxy.setVolume(0):this.vol&&this.imaProxy.setVolume(this.vol)),this.muteAllAdContainerVideo(e)},e.prototype.muteAllAdContainerVideo=function(e){for(var t=this.view.getAdDiv().getElementsByTagName("video"),i=0;i<t.length;i++)t[i].muted=e},e.prototype.volume=function(e){this.vol=e/100,this.imaProxy&&this.imaProxy.setVolume(this.vol)},e}(),q=2e3,U=3500,V="usd",N=1,z="//c.amazon-adsystem.com/aax2/apstag.js",W="video",H="3.0.0",J="//js-sec.indexww.com/htv/htv-jwplayer.min.js",G="//js.spotx.tv/directsdk/v1/",F="//search.spotxchange.com/ad/vast.html?key=",X="dfp",$="jwp",K="jwpspotx",Q="jwpdfp",Y=$,Z="APS",ee="Index",te="OpenRTB",ie="SpotX",re=(O={},O[[X]]=[Z,"FAN",ee,ie],O[[$]]=["FAN",te,ie],O[[Q]]=[ie],O[[K]]=[ie],O),ae="Error loading script",ne=1,oe=2,se=1,de=2,le=3,ue=4,ce=5,pe=6,ge=7,he=8,me=1,fe=2,ve=3,ye=4,be=5,we=6,Ae=0,Pe=100,Ce=102,Ee="bid",_e="error",Me="invalid",je="noBid",Ie=0,Le=1,Te=3,Se=5,ke=[{message:"SpotX :: Unable to find ad",result:je,code:Ie},{message:ae,result:_e,code:6},{message:"Invalid options: 'slot' is required",code:300},{message:"Invalid options: 'slot' must be part of DOM",code:301},{message:"Invalid options: 'channel_id' is required.",code:302},{message:"Invalid options: 'content_width' and 'content_height' are required when no 'video_slot' is provided.",code:303},{message:"Invalid options: 'content_width' provided but 'content_height' is not.",code:304},{message:"Invalid options: 'content_height' provided but 'content_width' is not.",code:305},{message:"Invalid options: 'custom' must be an object.",code:306},{message:"Invalid options: 'token' must be an object.",code:307},{message:"Invalid options: 'ados' must be an object.",code:308},{message:"Invalid options: 'contentPageUrl' must be a string.",code:309},{message:"Invalid options: 'demand_source_timeout' must be a number.",code:310},{message:"Invalid options: 'total_bid_timeout' must be a number.",code:311}],Re=320,xe=[{message:"Incorrect domain",code:321},{message:"unsupported_platform",code:322},{message:"Request_URL_noncompliant",code:323},{message:"Application not authorised for header bidding",code:324},{message:"pageurl is required",code:325},{message:"adformats",code:326}],De=Date.now||function(){return(new Date).getTime()};function Oe(e){return e?3:1}function Be(e){if("start"===e||"0%"===e||!e||"pre"===e||"00:00:00"===e)return 0;if("end"===e||"100%"===e||"post"===e)return-2;if("string"==typeof e&&e.indexOf("%")>=0)return-1;var t=parseInt(e);return t>=0?t:-1}function qe(e,t){return new Promise(function(i,r){setTimeout(r,t);var a=document.createElement("script");a.onload=a.onreadystatechange=function(e){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i(e),a.onload=a.onreadystatechange=null,n&&a.parentNode&&n.removeChild(a))},a.onerror=r,a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=t,a.src=e;var n=document.getElementsByTagName("head")[0]||document.documentElement;n.insertBefore(a,n.firstChild)}).catch(function(){return Promise.reject({message:ae})})}var Ue,Ve=(Ue={},Ue[["EMX"]]="https://hbint.emxdgt.com",Ue[["PubMatic"]]="https://openbid.pubmatic.com/translator",Ue[["Telaria"]]="https://jwplayer.eb.tremorhub.com/ad/rtb/jwp",Ue),Ne=window.__cmp||function(e,t,i){for(var r=window;r!==window.top&&!r.__cmpLocator;)r=window.parent;if(r.__cmpLocator){var a=De(),n=function(e){var t=e.data;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t={}}t.__cmpReturn&&t.__cmpReturn.callId===a&&(removeEventListener("message",n),i(t.__cmpReturn.returnValue))};window.addEventListener("message",n,!1);var o={__cmpCall:{command:e,parameter:t,callId:a}};r.postMessage(JSON.stringify(o),"*")}else i({gdprApplies:!1})},ze=function(e,t,i){var r=t.request,a=t.response,n=i?i.priceInCents:0,o=t.priceInCents?n/t.priceInCents:0;return e.replace(/\$\{AUCTION_ID\}/g,r.id).replace(/\$\{AUCTION_BID_ID\}/g,a.bidid||"").replace(/\$\{AUCTION_IMP_ID\}/g,a.seatbid[0].bid[0].impid||"").replace(/\$\{AUCTION_SEAT_ID\}/g,a.seatbid[0].seat||"").replace(/\$\{AUCTION_AD_ID\}/g,a.seatbid[0].bid[0].adid||"").replace(/\$\{AUCTION_PRICE\}/g,n/100).replace(/\$\{AUCTION_CURRENCY\}/g,t.priceCurrency).replace(/\$\{AUCTION_MBR\}/g,o).replace(/\$\{AUCTION_LOSS\}/g,t.code)},We={postAuctionHandler:function(e,t){var i=e.response;if(e.result===Ee&&"boolean"==typeof e.winner&&i.seatbid&&i.seatbid[0]&&i.seatbid[0].bid&&i.seatbid[0].bid[0]){e.winner?e.code=Ae:e.request.imp[0].bidfloor>e.priceInCents/100?e.code=Pe:e.code=Ce,e.adm&&(e.adm=ze(e.adm,e,t));var r=i.seatbid[0].bid[0],a=e.winner?r.nurl:r.lurl;if(a)if(e.winner&&!e.adm)e.tag=ze(a,e,t);else{var n=new XMLHttpRequest;n.open("POST",ze(a,e,t)),n.setRequestHeader("x-openrtb-version","2.5"),n.withCredentials=!0,n.send(null)}}return delete e.request,delete e.response,e},requestBids:function(e,t,i){var r=Ve[e.name];if(!r||!e.id||!e.pubid)return Promise.resolve({result:Me,code:Te});var a="Telaria"===e.name,n=t.floorPriceCurrency||V,o=void 0!==t.skipoffset,s={id:t.adPlayId,imp:[{id:"1",displaymanager:"jwplayer",tagid:e.id,video:{mimes:function(e){var t=document.createElement("video");return e.filter(function(e){return t.canPlayType(e)})}(["video/mp4","video/ogg","video/webm","video/aac","application/vnd.apple.mpegurl"]).concat("application/javascript"),minduration:3,maxduration:300,protocols:[se,de,le,ge,ue,ce,pe,he],w:t.playerWidth,h:t.playerHeight,startdelay:Be(t.offset),placement:Oe(t),linearity:1,skip:o?1:0,skipmin:o?t.skipoffset+2:void 0,skipafter:t.skipoffset,playbackmethod:[function(e){var t=e.autoplay,i=e.mute,r=e.autoplayAdsMuted;if(t){var a=i||r;return"viewable"===t?a?we:be:a?fe:me}return i?ye:ve}(t)],api:[ne,oe]},bidfloor:t.floorPriceCents/100,bidfloorcur:n.toUpperCase(),secure:"https:"===window.location.protocol?1:0}],site:{domain:window.location.hostname,page:window.location.href,publisher:{id:e.pubid}},device:{ua:window.navigator.userAgent,language:t.language.substring(0,2)},at:1};(!0===t.autoplay||"viewable"===t.autoplay&&t.viewable)&&(s.tmax=t.bidTimeout);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return Promise.race([new Promise(function(e){Ne("getConsentData",null,e)}),new Promise(function(t){setTimeout(t,e,{gdprApplies:!0,consentData:""})})])}().then(function(e){var t=e.gdprApplies,i=e.consentData;s.regs={ext:{gdpr:t?1:0}},t&&(s.user={ext:{consent:i}})}).then(function(){return new Promise(function(e){var t=new XMLHttpRequest;t.onreadystatechange=function(){4===this.readyState&&(e(this),t=null)},t.open("POST",r),a&&(t.setRequestHeader("content-type","application/json"),t.setRequestHeader("x-openrtb-version","2.5")),t.withCredentials=!0,t.send(JSON.stringify(s)),i.then(function(){t&&(t.abort(),t=null)})})}).then(function(i){if(200===i.status){var r=JSON.parse(i.responseText);if(r.id===s.id&&r.seatbid&&r.seatbid.length){var a=r.seatbid.reduce(function(e,t){if(null===e&&t&&t.bid&&t.bid.length){var i=t.bid.filter(function(e){return e.impid===s.imp[0].id});if(i.length)return i[0]}return e},null);if(a){var n;return t.mediationLayerAdServer===X||a.adm||a.nurl?{result:Ee,code:Le,priceInCents:100*a.price,priceCurrency:r.cur||t.floorPriceCurrency||V,adm:a.adm,custParams:(n={},n[[e.name+".key"]]=a.adid,n[[e.name+".price"]]=a.price,n),request:s,response:r}:{result:Me,code:Te,request:s,response:r}}}return{result:je,code:void 0!==r.nbr?r.nbr+400:Ie,request:s,response:r}}return 204===i.status?{result:je,code:Ie,request:s}:400===i.status?{result:Me,code:Te,request:s}:{result:_e,code:Se,request:s}})}},He=encodeURIComponent(window.location.href);var Je={requestBids:function(e,t,i){var r,a,n,o=e.id,s=(r=o,a=t.playerWidth,n=t.playerHeight,["https://an.facebook.com/v2/placementbid.json?&placementids[]="+r,"&playerwidth="+a,"&playerheight="+n,"&adformats[]="+W,"&SDK[]="+H,"&pageurl="+He,"$random="+Math.random()*Math.pow(10,18)].join(""));if(d=t.mediationLayerAdServer,l=t.floorPriceCents,u=t.floorPriceCurrency||V,!s||!(d===X||l&&u===V))return Promise.resolve({result:Me,code:Te});var d,l,u;return new Promise(function(e){var t=new XMLHttpRequest;t.onreadystatechange=function(){4===this.readyState&&(e(this),t=null)},t.open("GET",s),t.withCredentials=!0,t.send(null),i.then(function(){t&&(t.abort(),t=null)})}).then(function(e){if(200!==e.status)return{result:_e,code:Se,message:"Invalid response (status "+e.status+")"};var i=JSON.parse(e.responseText),r=i.errors,a=i.request_id;if(r&&r.length)return{result:Me,code:function(e){var t=xe.filter(function(t){return e.indexOf(t.message)>=0})[0];return t?t.code:Re}(r[0]),requestId:a};var n=i.bids;if(!n||!n[o]||!n[o][0])return{result:je,code:Ie,requestId:a};var s=n[o][0],d=s.bid_price_cents,l=s.bid_id;if(t.mediationLayerAdServer===X)return{result:Ee,code:Le,tag:t.tag,custParams:{jwFANBidPrice:Math.round(d/100),jwFANBidID:l},requestId:a};var u={result:Ee,code:Le,priceInCents:d,priceCurrency:s.bid_price_currency,requestId:a};d>=t.floorPriceCents&&(u.tag=(c=o,p=l,g=t.playerWidth,h=t.playerHeight,["https://an.facebook.com/v1/instream/vast.xml?placementid="+c,"&playerwidth="+g,"&playerheight="+h,"&SDK[]="+H,"&bidid="+p,"&pageurl="+He].join("")));var c,p,g,h;return u}).catch(function(e){return{result:_e,code:Se,message:"FAN header bidding failed: "+e}})}},Ge=null;function Fe(){return null===Ge&&(Ge=Promise.resolve(window.apstag).then(function(e){if(e&&e.init&&e.fetchBids)return e;return qe(["file"===document.location.protocol?"https:":"",z].join(""),U).then(function(){return window.apstag})}).catch(function(e){throw Ge=null,e})),Ge}var Xe={requestBids:function(e,t){return e.id&&e.slotID?Fe().then(function(i){return i.init({id:e.pubId,adServer:e.adServer}),new Promise(function(r){i.fetchBids({slots:[{slotID:e.slotID}],timeout:t.bidTimeout},r)})}).then(function(i){return i&&i[0]&&i[0].slotID===e.slotID?{result:Ee,code:Le,tag:t.tag,custParams:{amznbid:i[0].amznbid,amzniid:i[0].amzniid}}:{result:je,code:Ie}}).catch(function(e){return{result:_e,code:Se,message:"Amazon header bidding failed: "+e}}):Promise.resolve({result:Me,code:Te})}},$e=null,Ke=null;function Qe(e){if(null===Ke){var t=De(),i=$e||window.SpotX;if(i&&i.DirectAdOS)return Ke=Promise.resolve({SpotX:i,loadingTime:0});var r=["file"===document.location.protocol?"https:":"",G,e,".js"].join("");(Ke="function"==typeof require?(a=r,n=U,new Promise(function(e,t){setTimeout(t,n),require([a],e,t)}).catch(function(){return Promise.reject({message:ae})})).then(function(e){return{SpotX:$e=e,loadingTime:De()-t}}).catch(function(){return Ye(r,t)}):Ye(r,t)).catch(function(){Ke=null})}var a,n;return Ke}function Ye(e,t){return qe(e,U).then(function(){return{SpotX:window.SpotX,loadingTime:De()-t}})}var Ze=void 0;var et={postAuctionHandler:function(e){return e.scriptLoadingTime=Ze,e},requestBids:function(e,t){if(!e.id)return Promise.resolve({result:Me,code:302});var i={placement:Oe(t.outstream),hide_skin:!0,no_vpaid_ads:!1},r={channel_id:e.id,slot:t.playerContainer,content_width:t.playerWidth,content_height:t.playerHeight,player_vendor:"SpotXJW",player_vendor_id:t.playerId,ad_volume:t.adVolume,ad_mute:t.mute?1:0,autoplay:t.autoplay,blocked_autoplay_override_mode:t.autoplayAdsMuted,start_delay:Be(t.offset)},a=Object.assign(i,e.optionalParams,r);return e.passFloorPrice&&t.floorPriceCents&&(a.price_floor=t.floorPriceCents/100),Qe(e.id).then(function(e){var t=e.SpotX,i=e.loadingTime;Ze=i;var r=new t.DirectAdOS(a),n=De();return r.getAdServerKVPs().then(function(e){return{response:e,bidNetworkStartTime:n}})}).then(function(e){var i=e.response,r=e.bidNetworkStartTime,a=De()-r,n=i.spotx_ad_key,o={spotx_bid:i.spotx_bid,spotx_ad_key:n},s=100*parseFloat(i.spotx_bid),d={result:Ee,code:Le,priceInCents:s,custParams:o,scriptLoadingTime:Ze,bidNetworkResponseTime:a};if(t.mediationLayerAdServer===X)return d;var l=["file:"===document.location.protocol?"https:":"",F,n].join("");return Object.assign(d,{tag:l,tagKey:n})}).catch(function(e){var t=ke.filter(function(t){return t.message===e.message})[0];return t?{result:t.result||Me,code:t.code,scriptLoadingTime:Ze}:{result:_e,message:"SpotX header bidding failed: "+e,code:Se,scriptLoadingTime:Ze}})}},tt=null;function it(e){return null===tt&&(tt=Promise.resolve(window.indexapi).then(function(t){if(t)return t;return qe(["file"===document.location.protocol?"https:":"",e||J].join(""),U).then(function(){return window.indexapi})}).catch(function(e){throw tt=null,e})),tt}var rt,at={requestBids:function(e,t){if(!e.id&&!e.script)return Promise.resolve({result:Me,code:Te});var i=Object.assign({videoCommonArgs:{protocols:[2,3,5,6],mimes:["video/mp4","video/webm","application/javascript"],apiList:[1,2]},siteID:e.id},e);return it().then(function(e){return new Promise(function(r){e.deferQueue=e.deferQueue||[],e.deferQueue.push(function(){e.solicitIndexVideoAds(t.tag,function(e,t){r({updatedTag:e,indexTargeting:t})},i)})})}).then(function(e){var i=e.indexTargeting;return void 0!==i?{result:Ee,code:Le,tag:t.tag,custParams:i}:{result:je,code:Ie}}).catch(function(e){return{result:_e,code:Se,message:"Index Exchange header bidding failed: "+e}})}},nt=(rt={},rt[[Z]]=Xe,rt[["FAN"]]=Je,rt[[ee]]=at,rt[[te]]=We,rt[[ie]]=et,rt);var ot=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.settings,a=void 0===r?{}:r,n=i.bidders,o=void 0===n?[]:n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,e),this.settings=function(e,t){var i=Object.assign({bidTimeout:q,offset:"",playerContainer:t.container,playerHeight:t.height||0,playerWidth:t.width||0,tag:""},t,e);return re[i.mediationLayerAdServer]||(i.mediationLayerAdServer=Y),i.mediationLayerAdServer===K&&(i.floorPriceCents=N),i}(a,s);var d=0===Be(this.settings.offset),l=this.settings.mediationLayerAdServer===$||this.settings.mediationLayerAdServer===Q,u=re[this.settings.mediationLayerAdServer];this.bidders=o.filter(function(e){return(!isNaN(parseFloat(t.settings.floorPriceCents))||!l)&&(-1!==u.indexOf(e.type||e.name)&&(d||e.type===te||e.name===ie))}).map(function(e){return e.name===Z&&e.id&&e.slotID?Fe():e.name===ee&&(e.script||e.id)?it(e.script):e.name===ie&&e.id&&Qe(e.id),Object.assign(e,e.custom_params)}),this._bidRequest=null,this._currentTimeout=null,this._onCancelTrigger=null,this.onCancel=new Promise(function(e){t._onCancelTrigger=e})}return e.prototype.start=function(){return this._bidRequest||(this._bidRequest=function(e){var t=e.bidders,i=e.settings,r=e.onCancel,a=t.map(function(e){var t=De();return Promise.race([nt[e.type||e.name].requestBids(e,i,r),r]).then(function(i){return Object.assign({},e,i,{timeForBidResponse:De()-t|0})})}),n=i.mediationLayerAdServer===X||i.mediationLayerAdServer===Q,o=i.mediationLayerAdServer===$||i.mediationLayerAdServer===Q||i.mediationLayerAdServer===K,s={},d=[],l={priceInCents:i.floorPriceCents,timeForBidResponse:1/0,winner:!1};return Promise.all(a).then(function(e){var t=e.map(function(e){return n||(e.winner=!1),e.result===Ee&&(d.push(e),Object.assign(s,e.custParams),o&&(e.priceInCents>l.priceInCents||e.priceInCents===l.priceInCents&&e.timeForBidResponse<l.timeForBidResponse)&&(l.winner=!1,(l=e).winner=!0)),e}).map(function(e){var t=l.winner?l:null,i=nt[e.type||e.name];return"function"==typeof i.postAuctionHandler?i.postAuctionHandler(e,t):e});return Promise.all(t)}).then(function(e){var t={bidders:e};return l.winner?t.result=l:n&&d.length&&(t.result={tag:i.tag,custParams:s}),t})}({bidders:this.bidders,settings:this.settings,onCancel:this.onCancel})),this._bidRequest},e.prototype.stop=function(){var e=this;clearTimeout(this._currentTimeout),this._onCancelTrigger({result:"abort",code:4}),this._bidRequest=null,this._currentTimeout=null,this._onCancelTrigger=null,this.onCancel=new Promise(function(t){e._onCancelTrigger=t})},e.prototype.getEventObject=function(e,t,i){var r=i.offset,a=i.adBreakId,n=i.adPlayId,o=this.settings.mediationLayerAdServer,s=t||[];0===Be(r)||(s=s.filter(function(e){return e.type===te||e.name===ie}));var d={client:e,bidsVersion:"0.2.4",offset:r,mediationLayerAdServer:o,bidders:s,adBreakId:a,adPlayId:n,bidTimeout:this.settings.bidTimeout},l=this.settings.floorPriceCents;l&&o!==K&&o!==X&&(d.floorPriceCents=l);var u=this.settings.floorPriceCurrency;return u&&(d.floorPriceCurrency=u),d},e.prototype.then=function(e){return this._bidRequest?this._bidRequest.then(e,e):null},e.prototype.timeout=function(){clearTimeout(this._currentTimeout),this._currentTimeout=setTimeout(this._onCancelTrigger,this.settings.bidTimeout,{result:"timeout",code:2})},e}();function st(t,i,r,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return{type:t,client:e,adBreakId:r,adPlayId:a,adposition:null!==n?n:function(e){if(e.isBeforePlay()||0===e.getPosition())return"pre";if(e.isBeforeComplete()||e.getPosition()===e.getDuration())return"post";return"mid"}(i),viewable:i.getViewable()}}function dt(e){return new Array(e+1).join((Math.random().toString(36)+"00000000000000000").slice(2,18)).slice(0,e)}var lt=function(){return null},ut=function(){function t(e,i,r,a,n,o,s){w(this,t),r.utils.extend(this,r.Events),this.item=e,this.options=i,this.player=r,this.env=r.getEnvironment(),this.utils=r.utils,this.instreamProvider=a,this.view=n,this.initAdsManagerPromise=null,this.blockingInstreamPlayer=null,this.currentAd=null,this.bids=[],this.timeoutAdStart=-1,this.progressIntervalId=-1,this.viewablePlayedTime=0,this.lastPosition=null,this.adViewableImpressionHandler=lt,this.fullscreenIcon=r.getContainer().querySelector(".jw-icon-fullscreen"),this.adsLoaderManager=o,this.playbackProxy={currentTime:0,duration:0},this.video=s,this.paused=!1,this.pausedByViewable=!1,this.reason=null,this._qoe=new r.utils.Timer,this.debugConsoleLog=lt,i.debug&&(this.debugConsoleLog=function(){var e;(e=console).log.apply(e,arguments)})}return t.prototype.startBid=function(t,i,r){var a=this,n=this.player,o=this.utils.extend({},t.config.bids),s=i.offset,d=this.adsLoaderManager.getAdBreakId(s),l=this.adsLoaderManager.getAdPlayId(s),u=this.player.getConfig(),c=new ot(o,{adPlayId:l,tag:i.tag,offset:s,width:n.getWidth(),height:n.getHeight(),container:n.getContainer(),playerId:n.id,autoplay:u.autostart,autoplayAdsMuted:t.autoplayadsmuted,adVolume:n.getVolume(),mute:n.getMute(),outstream:u.outstream,language:t.locale||u.language,viewable:1===n.getViewable()},{genId:dt});return this.bids.push(c),c.start(),this.trigger("adBidRequest",c.getEventObject(e,o.bidders,{offset:s,adBreakId:d,adPlayId:l})),c.then(function(i){if(a.trigger("adBidResponse",c.getEventObject(e,i.bidders,{offset:s,adBreakId:d,adPlayId:l})),a.destroyed())return null;a.adsLoaderManager.setBid(s,c,i.bidders),t.addBidsResponse(i.result,r)})},t.prototype.init=function(e,t){var i=this,r=t.config.bids;if(r){var a=t.getSchedule();if("string"==typeof a)this.startBid(t,{tag:a,offset:"pre"});else{var n=parseInt(r.bidOnBreaks);n=n>0?n:1/0,Object.keys(a).slice(0,n).forEach(function(e){i.startBid(t,a[e],e)})}}var o=this.adsLoaderManager;return this.initAdsManagerPromise=x().then(function(){return i.destroyed()?null:(i.debugConsoleLog("[JW DEBUG] Open adsLoaderManager"),o.open(e,t,i.video))}).then(function(e){if(i.destroyed())return null;var r=o.getAdsManager(e,i.playbackProxy,i.options);i.instreamProvider.setProxy(r),o.bindEvents({LOADED:i.adLoaded.bind(i),AD_ERROR:i.adError.bind(i),CONTENT_PAUSE_REQUESTED:i.pauseRequested.bind(i),CONTENT_RESUME_REQUESTED:i.resumeRequested.bind(i),LOG:i.adLog.bind(i),STARTED:i.adStarted.bind(i),IMPRESSION:i.adImpression.bind(i),LINEAR_CHANGED:i.resize.bind(i),CLICK:i.adClick.bind(i),PAUSED:i.adPaused.bind(i),RESUMED:i.adResumed.bind(i),SKIPPED:i.adSkipped.bind(i),USER_CLOSE:i.adUserClose.bind(i),ALL_ADS_COMPLETED:i.allAdsCompleted.bind(i)});var a=r.getCuePoints();if(!t.preloadAds||-1===a.indexOf(0)){var n=i.player.getSafeRegion(!1),s=n.width,d=n.height,l=i.getViewMode();i.debugConsoleLog("[JW DEBUG] adsManager init with",s,d,l),o.init(s,d,l)}if(a.length){var u=a.filter(function(e){return e>0}).map(function(e){return{begin:e,text:i.options.cuetext}});i.player.addCues(u)}return r}).catch(function(e){throw i.asyncError&&i.asyncError(e),e}),this.initAdsManagerPromise},t.prototype.getViewMode=function(){var e=google.ima.ViewMode;return this.player.getFullscreen()?e.FULLSCREEN:e.NORMAL},t.prototype.prepareToPlayAd=function(e){if(!this.destroyed())if(this.blockingInstreamPlayer){var t=e?"":this.options.loadingAd;this.blockingInstreamPlayer.setText(t)}else clearTimeout(this.timeoutAdStart),this.startBlocking(e),this.muteInstreamProvider()},t.prototype.requestAds=function(e,t){var i=this,r=this.bids.concat(x());Promise.all(r).then(function(){i.destroyed()||null===i.adsLoaderManager.adsRequest&&(i.debugConsoleLog("[JW DEBUG] Request ads to IMA SDK"),i.adsLoaderManager.requestAds(e,t,i.options))})},t.prototype.muteInstreamProvider=function(){var e=this.video.muted||this.player.getMute();this.debugConsoleLog("[JW DEBUG] Setting mute on instreamProvider",e),this.instreamProvider.mute(e)},t.prototype.exitFullscreenOnInlineIOS=function(){if(this.env.OS.iOS&&!(this.env.Browser.version.major<10)){var e=this.player.getContainer();e.requestFullscreen||e.webkitRequestFullscreen||(this.debugConsoleLog("[JW DEBUG] Exiting fullscreen mode on iOS 10 or 11"),this.player.setFullscreen(!1),this.utils.style(this.fullscreenIcon,{display:"none"}))}},t.prototype.startBlocking=function(e){var t=this;if(!this.blockingInstreamPlayer&&!this.destroyed()){this.debugConsoleLog("[JW DEBUG] JW Player startBlocking"),this.exitFullscreenOnInlineIOS(),this.options.premiumAds&&this.player.on("viewable",function(e){e.viewable?t.pausedByViewable&&(t.debugConsoleLog("[JW DEBUG] PremiumAds mode enabled. Start playing the ad on viewable"),t.player.play()):t.paused||(t.debugConsoleLog("[JW DEBUG] PremiumAds mode enabled. Pause the ad on not viewable"),t.player.pause(),t.pausedByViewable=!0)},this),this._qoe.tick("adLoading"),this.utils.addClass(this.player.getContainer(),n),this.blockingInstreamPlayer=this.player.createInstream().init();var i=e?"":this.options.loadingAd;this.blockingInstreamPlayer.setText(i),this.blockingInstreamPlayer.applyProviderListeners(this.instreamProvider),this.view.adSetup(),clearTimeout(this.timeoutAdStart),this.timeoutAdStart=setTimeout(function(){if(t.bids.forEach(function(e){return e.stop()}),t.debugConsoleLog("[JW DEBUG] Ad request timeout"),!t.destroyed()){t.asyncError=null;var e={message:"Ad Request timeout after "+t.options.requestTimeout+" milliseconds",getErrorCode:function(){return 60004}};t.handleAdError(e,{}),t.asyncDiscardAdBreak()}},this.options.requestTimeout)}},t.prototype.stopBlocking=function(){this.destroyed()||(this.debugConsoleLog("[JW DEBUG] JW Player stopBlocking"),this.player.off("viewable",null,this),clearTimeout(this.timeoutAdStart),this.utils.style(this.fullscreenIcon,{display:""}),this.utils.removeClass(this.player.getContainer(),[o,s,n]),this.blockingInstreamPlayer&&(this.instreamProvider.off(),this.blockingInstreamPlayer.destroy(),this.blockingInstreamPlayer=null))},t.prototype.pauseRequested=function(e){var t=this;this.prepareToPlayAd();var i=this.adsLoaderManager.adEventObject(e.getAd());this.player.trigger(l,st(l,this.player,i.adBreakId,i.adPlayId,i.adposition)),this.blockingInstreamPlayer.on("destroyed",function(){var r=t.adsLoaderManager?t.adsLoaderManager.getLastAdPlayId(e.getAd()):i.adPlayId;t.player.trigger(u,st(u,t.player,i.adBreakId,r,i.adposition))})},t.prototype.resumeRequested=function(){this.debugConsoleLog("[JW DEBUG] ResumeRequest from IMA SDK"),this.currentAd&&this.currentAd.isLinear()&&this.finishAd(),this.blockingInstreamPlayer&&this.view.adTakeDown(),this.stopBlocking()},t.prototype.finishAd=function(){this.currentAd&&(clearInterval(this.progressIntervalId),this.viewablePlayedTime=0,this.currentAd=null)},t.prototype.discardAdBreak=function(e){!e&&this.adsLoaderManager&&(e=this.adsLoaderManager.adsManager),!this.destroyed()&&e&&(0===e.getCuePoints().length?this.destroy():(e.discardAdBreak(),e.stop()))},t.prototype.asyncDiscardAdBreak=function(){var e=this;this.initAdsManagerPromise&&this.initAdsManagerPromise.then(function(t){return e.discardAdBreak(t)}).catch(lt)},t.prototype.pause=function(e){var t=e.reason;if(!this.destroyed()){var i=this.adsLoaderManager.adsManager;i&&(this.pausedByViewable=!1,this.viewablePlayedTime=0,this.debugConsoleLog("[JW DEBUG] JW Player pause ad"),this.reason=t||y,i.pause())}},t.prototype.resume=function(e){var t=e.reason;if(!this.destroyed()){var i=this.adsLoaderManager.adsManager;i&&(this.pausedByViewable=!1,this.debugConsoleLog("[JW DEBUG] JW Player resume ad"),this.reason=t||y,i.resume())}},t.prototype.beforePlay=function(e){var t=this;if(this.initAdsManagerPromise){this.reason=e&&e.playReason?e.playReason:y,this.bids.forEach(function(e){return e.timeout()}),this.player.off("beforePlay",null,this);var i=!!e;this.prepareToPlayAd(i),this.adsLoaderManager.initializeDisplay({restrict:!0}),this._qoe.tick("adBeforePlay"),this.initAdsManagerPromise.then(function(e){if(!t.destroyed()){var i=t.adsLoaderManager;if(!i.initialized){var r=t.player.getSafeRegion(!1),a=r.width,n=r.height,o=t.getViewMode();t.debugConsoleLog("[JW DEBUG] adsManager init with",a,n,o),i.init(a,n,o)}t.debugConsoleLog("[JW DEBUG] Start adsManager"),i.start();var s=e.getCuePoints();"string"==typeof t.adsLoaderManager.schedule&&0===s.length||-1!==s.indexOf(0)||(t.debugConsoleLog("[JW DEBUG] Stop blocking since there is no preroll"),t.view.adTakeDown(),t.stopBlocking())}}).catch(lt)}},t.prototype.beforeComplete=function(){var e=this.adsLoaderManager.adsManager;e&&e.getCuePoints().indexOf(-1)>-1&&this.prepareToPlayAd(),this.adsLoaderManager.unbindEvents(["CONTENT_RESUME_REQUESTED"]),this.playbackProxy.currentTime=this.playbackProxy.duration,this.debugConsoleLog("[JW DEBUG] Call contentComplete on IMA SDK"),this.adsLoaderManager.contentComplete()},t.prototype.time=function(e){this.playbackProxy.currentTime=e.position,e.duration>=e.position?this.playbackProxy.duration=e.duration:this.playbackProxy.duration=1/0},t.prototype.resize=function(){var e=this.currentAd,t=this.adsLoaderManager.adsManager;if(t){var i=e&&!e.isLinear(),r=this.player.getSafeRegion(i);if(i){var a=e.getHeight();a=this.player.getFullscreen()?r.height/2:Math.max(100,a+10),this.debugConsoleLog("[JW DEBUG] Resize adsManager",r.width,a,this.getViewMode()),t.resize(r.width,a,this.getViewMode()),this.view.resizeNonLinear(a)}else this.debugConsoleLog("[JW DEBUG] Resize adsManager",r.width,r.height,this.getViewMode()),t.resize(r.width,r.height,this.getViewMode()),this.view.resizeLinear()}},t.prototype.setState=function(e,t){if(e.isLinear()){var i=this.adsLoaderManager.adEventObject(e);if(i.newstate=t,null!==this.reason){i[t===d?"playReason":"pauseReason"]=this.reason,this.reason=null}this.instreamProvider.trigger("state",i)}},t.prototype.progressInterval=function(e,t){var i=this;if(clearInterval(this.progressIntervalId),t){var r=e.getAdId(),a=-1,n=this.options.admessage||"",o=this.options.podmessage||"",s=new RegExp("__AD_POD_CURRENT__","g"),d=new RegExp("__AD_POD_LENGTH__","g");this.progressIntervalId=setInterval(function(){if(i.currentAd&&i.currentAd.getAdId()===r){var e=t.getRemainingTime();if(!(isNaN(e)||e<=0)&&a!==e){a=e;var l=i.currentAd.getDuration(),u=l-e,c=Math.round(l-u);if(i.blockingInstreamPlayer){var p=n.replace(/(\b)xx(s?\b)/g,"$1"+c+"$2"),g=i.currentAd.getAdPodInfo(),h=g.getTotalAds();if(h>1){var m=g.getAdPosition();p=o.replace(s,m).replace(d,h)+"  "+p}i.blockingInstreamPlayer.setText(p),i.instreamProvider.trigger("time",{duration:l,position:u})}if(l>0){var f=i.adsLoaderManager.adEventObject(i.currentAd);f.position=u,f.duration=l,i.adViewableImpressionHandler(f),i.trigger("adTime",f)}}}else clearInterval(i.progressIntervalId)},250)}},t.prototype.adLoaded=function(e){var t=this.adsLoaderManager.adEventObject(e.getAd());this.trigger("adRequest",t)},t.prototype.adStarted=function(e){this.paused=!1;var t=this.currentAd=e.getAd(),i=this.adsLoaderManager.adEventObject(t);this.trigger(g,i)},t.prototype.adImpression=function(e){var t=this;this.view.adSetup();var i=e.getAd(),r=i.isLinear(),a=r&&(i.getContentType().indexOf("image")>=0||-1===i.getDuration()),n=this.isVpaidAd(i),l=r&&n&&this.options.vpaidcontrols;this.currentAd=i,this.blockingInstreamPlayer&&this.blockingInstreamPlayer.setSkipOffset(i.getSkipTimeOffset()),this.adsLoaderManager.bindEvents({COMPLETE:this.adComplete.bind(this)}),n&&this.env.OS.mobile&&this.options.autoplayadsmuted&&this.adsLoaderManager.bindEvents({VOLUME_CHANGED:function(){t.adsLoaderManager.unbindEvents(["VOLUME_CHANGED"]),t.player.setMute(0===t.adsLoaderManager.adsManager.getVolume())}}),a?this.startBlocking():r||this.stopBlocking(),this.utils.toggleClass(this.player.getContainer(),o,r&&(a||n)),this.utils.toggleClass(this.player.getContainer(),s,l),this.resize(),this.muteInstreamProvider(),clearTimeout(this.timeoutAdStart);var u=this.adsLoaderManager.adsManager;this.progressInterval(i,u);var c=this.adsLoaderManager.adEventObject(i);"pre"!==c.adposition||void 0!==c.podcount&&1!==c.sequence||(this._qoe.tick("adImpression"),c.timeLoading=this._qoe.between("adBeforePlay","adImpression")),this.trigger("adImpression",c),this.setupViewableListener(),this.setState(i,d)},t.prototype.setupViewableListener=function(){this.player.off(h,this.viewableHandler,this),this.player.on(h,this.viewableHandler,this),this.viewableHandler({viewable:this.player.getViewable()})},t.prototype.adViewableHandler=function(e){var t=e.position;null===this.lastPosition&&(this.lastPosition=t);var i=t-this.lastPosition;if(this.lastPosition=t,i=Math.min(Math.max(0,i),4),this.viewablePlayedTime+=i,this.viewablePlayedTime>=2){this.player.off(h,this.viewableHandler,this),this.adViewableImpressionHandler=lt;var r=this.adsLoaderManager.adEventObject(this.currentAd);this.trigger("adViewableImpression",r)}},t.prototype.viewableHandler=function(e){e.viewable?(this.viewablePlayedTime=0,this.lastPosition=null,this.adViewableImpressionHandler=this.adViewableHandler):this.adViewableImpressionHandler=lt},t.prototype.adComplete=function(e){this.finishAd();var t=e.getAd(),i=this.adsLoaderManager.adEventObject(t);this.trigger("adComplete",i),this.adsLoaderManager.unbindEvents(["VOLUME_CHANGED"])},t.prototype.adClick=function(e){var t=this.adsLoaderManager.adsManager,i=e.getAd();this.reason="clickthrough",this.isVpaidAd(i)||(this.debugConsoleLog("[JW DEBUG] Ad paused due to ad click"),t.pause());var r=this.adsLoaderManager.adEventObject(i);this.trigger("adClick",r),this.pausedByViewable=!1},t.prototype.adPaused=function(e){if(!this.paused){this.paused=!0;var t=e.getAd();null===this.reason&&this.isVpaidAd(t)&&(this.reason="external"),this.setState(t,"paused")}},t.prototype.adResumed=function(e){if(this.paused){this.paused=!1;var t=e.getAd();null===this.reason&&this.isVpaidAd(t)&&(this.reason="external"),this.setState(t,d)}},t.prototype.adSkipped=function(e){this.debugConsoleLog("[JW DEBUG] AdSkipped"),this.adsLoaderManager.unbindEvents(["COMPLETE","VOLUME_CHANGED"]),this.finishAd();var t=this.adsLoaderManager.adEventObject(e.getAd());this.trigger("adSkipped",t)},t.prototype.adUserClose=function(e){this.debugConsoleLog("[JW DEBUG] AdUserClose"),this.currentAd&&this.currentAd.isLinear()&&-1===this.currentAd.getDuration()?this.adSkipped(e):(this.adsLoaderManager.unbindEvents(["COMPLETE","VOLUME_CHANGED"]),this.finishAd())},t.prototype.allAdsCompleted=function(){this.resumeRequested(),this.view.adTakeDown(),this.stopAdsManager()},t.prototype.stopAdsManager=function(){var e=this;this.initAdsManagerPromise.then(function(t){e.destroyed()||(e.debugConsoleLog("[JW DEBUG] Stop IMA SDK adsManager"),t.stop(),t.destroy(),e.initAdsManagerPromise=null,e.bids=[])}).catch(lt)},t.prototype.adLog=function(e){this.debugConsoleLog("[JW DEBUG]",e.type,e);var t=e.getAdData();if(t&&t.adError){var i=this.adsLoaderManager.adErrorEventObject(t.adError,e);402===i.code?this.handleAdError(t.adError,e):this.trigger(p,i)}},t.prototype.adError=function(e){var t=e.getError();this.handleAdError(t,e)},t.prototype.asyncError=function(e){var t=this;if(!this.destroyed())if(clearTimeout(this.timeoutAdStart),this.timeoutAdStart=setTimeout(function(){return t.destroy()},0),e&&e.getError){var i=e.getError();this.handleAdError(i,e,!0)}else e.target&&e.target.src?console.error("Failed to load "+e.target.src):console.error(e)},t.prototype.handleAdError=function(e,t,i){var r=this;this.options.debug&&console.error(e);var a=this.adsLoaderManager.adErrorEventObject(e,t);this.player&&0===this.player.getPosition()&&(this._qoe.tick("adError"),a.timeLoading=this._qoe.between("adBeforePlay","adError")),this.trigger(p,a),this.destroyed()||(900===e.getErrorCode()||i?(clearTimeout(this.timeoutAdStart),this.timeoutAdStart=setTimeout(function(){return r.destroy()},0)):(this.stopBlocking(),this.view.adTakeDown()))},t.prototype.isVpaidAd=function(e){var t=e.getContentType();return"application/javascript"===t||"application/x-shockwave-flash"===t},t.prototype.destroy=function(){if(this.debugConsoleLog("[JW DEBUG] JW Player destroy PlaylistItemManager"),this.off(),!this.destroyed()){this.player.off(null,null,this),this.bids.map(function(e){e.stop()}),this.bids=[],clearTimeout(this.timeoutAdStart),clearInterval(this.progressIntervalId),this.currentAd=null,this.options=null,this.video=null,this.initAdsManagerPromise=null;var e=this.adsLoaderManager;e&&(e.reset(),this.adsLoaderManager=null),this.blockingInstreamPlayer&&this.stopBlocking(),this.instreamProvider.off(),this.instreamProvider.setProxy(null),this.instreamProvider=null,this.view.adTakeDown(),this.view=null,this.player=null,this.item=null}},t.prototype.destroyed=function(){return!this.item},t}();function ct(e){try{return e.getAdPodInfo()}catch(e){return null}}function pt(e,t){var i=A(e,t);return"pre"===i?0:"post"===i?-1:i}var gt=function(){function t(e,i){w(this,t),this.adsLoader=null,this.adDisplayContainer=null,this.displayInitialized=!1,this.initialized=!1,this.started=!1,this.adsRequest=null,this.userRequestContext=null,this.adsManager=null,this.adsManagerEvents={},this.container=i,this.schedule=null,this.breakMap={},this.player=e}return t.prototype.getVpaidMode=function(e){var t=google.ima.ImaSdkSettings.VpaidMode;return"disabled"===e||"none"===e?t.DISABLED:"enabled"===e?t.ENABLED:t.INSECURE},t.prototype.initializeDisplay=function(e){this.adDisplayContainer&&!this.displayInitialized&&(this.adDisplayContainer.initialize(),e&&e.restrict&&(this.displayInitialized=!0))},t.prototype.contentComplete=function(){if(null!==this.adsRequest){var e=this.adsLoader;e&&e.contentComplete(),this.adsRequest=null}},t.prototype.reset=function(){this.userRequestContext=null;var e=this.adsManager;e&&(e.destroy(),this.adsManager=null),this.contentComplete(!0),this.schedule=null,this.breakMap={},this.adsManagerEvents={},this.initialized=this.started=!1},t.prototype.prepare=function(e){return null===this.adsLoader&&(this.adDisplayContainer=new google.ima.AdDisplayContainer(this.container,e),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer)),this.adsLoader},t.prototype.open=function(e,t,i){var r=google.ima.settings;r.setDisableCustomPlaybackForIOS10Plus(!0);var a=t.locale||this.player.getConfig().language;r.setLocale(a),t.maxRedirects>=0&&r.setNumRedirects(t.maxRedirects);var n=this.prepare(i);return new Promise(function(e,t){n.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,t,!1),n.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e,!1)})},t.prototype.requestAds=function(e,t,i){if(null===this.adsRequest){var r=t.getSchedule();if(r){var a=this.adsRequest=new google.ima.AdsRequest,n=this.userRequestContext={requestType:e,vpaidMode:t.vpaidmode,playerVersion:this.player.version.split("+")[0]};a.setAdWillAutoPlay(!1!==this.player.getConfig().autostart),a.setAdWillPlayMuted(this.player.getMute());var o=this.player.getSafeRegion(!1);a.linearAdSlotWidth=o.width,a.linearAdSlotHeight=o.height;var s=this.player.getSafeRegion(!0);a.nonLinearAdSlotWidth=s.width,a.nonLinearAdSlotHeight=s.height,a.forceNonLinearFullSlot=i.forceNonLinearFullSlot,a.vastLoadTimeout=i.vastLoadTimeout;var d=new M(this.player,i);if("object"==typeof r){var l=d.getTagList(r);1===l.length&&0===l[0].offset&&l[0].tag&&(r=l[0].tag)}"string"==typeof r?r=a.adTagUrl=n.adTagUrl=b(r,this.player,i):a.adsResponse=n.adsResponse=d.getAdsResponse(r),this.schedule=r,this.breakMap=Object.assign(d.getTagMap(r),this.breakMap);var u=this.adsLoader.getSettings(),c=this.getVpaidMode(n.vpaidMode);u.setPlayerType("jwplayer"),u.setPlayerVersion(n.playerVersion),u.setVpaidMode(c),this.adsLoader.requestAds(a,n)}}},t.prototype.getAdsManager=function(e,t,i){var r=new google.ima.AdsRenderingSettings;return r.enablePreloading=i.enablePreloading||i.preloadAds,r.loadVideoTimeout=i.loadVideoTimeout,r.uiElements=null,r.useStyledNonLinearAds=!0,this.adsManager=e.getAdsManager(t,r),this.userRequestContext=e.getUserRequestContext(),this.adsManager},t.prototype.init=function(e,t,i){null!==this.adsManager&&!1===this.initialized&&(this.adsManager.init(e,t,i),this.initialized=!0)},t.prototype.start=function(){null!==this.adsManager&&!1===this.started&&(this.initializeDisplay({restrict:!0}),this.adsManager.start(),this.started=!0)},t.prototype.bindEvents=function(e){var t=this,i=google.ima.AdEvent.Type,r=google.ima.AdErrorEvent.Type;Object.keys(e).forEach(function(a){var n=i[a]||r[a],o=t.adsManagerEvents[n];o&&t.adsManager.removeEventListener(n,o),t.adsManager.addEventListener(n,e[a],!1),t.adsManagerEvents[n]=e[a]})},t.prototype.unbindEvents=function(e){var t=this,i=google.ima.AdEvent.Type,r=google.ima.AdErrorEvent.Type;e.forEach(function(e){var a=i[e]||r[e],n=t.adsManagerEvents[a];n&&(t.adsManager.removeEventListener(a,n),delete t.adsManagerEvents[a])})},t.prototype.getTag=function(e,t){if("string"==typeof this.schedule)return this.schedule;var i=ct(e);if(i){var r=this.breakMap[i.getTimeOffset()]||{};if(r.tag)return r.tag}var a=this.userRequestContext;return t&&t.getUserRequestContext&&(a=t.getUserRequestContext()||a),a?a.adTagUrl||a.adsResponse||"":(console.error("invalid request context",a),"")},t.prototype.getAdBreakId=function(e){var t=pt(e,this.player.utils);return this.breakMap[t]=this.breakMap[t]||{},this.breakMap[t].adBreakId=this.breakMap[t].adBreakId||dt(12),this.breakMap[t].adBreakId},t.prototype.getAdPlayId=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=pt(e,this.player.utils);return this.breakMap[i].adPlayId=this.breakMap[i].adPlayId||{1:dt(12)},this.breakMap[i].adPlayId[t]=this.breakMap[i].adPlayId[t]||dt(12),this.breakMap[i].adPlayId[t]},t.prototype.getLastAdPlayId=function(e){var t=ct(e);if(!t)return a;var i=t.getTimeOffset(),r=this.breakMap[i].adPlayId;return r[Object.keys(r).reduce(function(e,t){return Math.max(e,t)})]},t.prototype.getTimeoffsetFromPosition_=function(){var e=this.player.getPosition(),t=1/0,i=void 0;return Object.keys(this.breakMap).forEach(function(r){var a=r-e;a>=0&&a<t&&(i=r,t=a)}),t===1/0?-1:i},t.prototype.adPodEventObject=function(t){var i=ct(t),r={},a=void 0,n=void 0;if(i){var o=i.getTotalAds();n=i.getAdPosition(),o>1&&(r.sequence=n,r.podcount=o);var s="mid";0===(a=i.getTimeOffset())?s="pre":-1===a&&(s="post"),r.adposition=s}else a=this.getTimeoffsetFromPosition_();return r.id=r.adBreakId=this.getAdBreakId(a),r.adPlayId=this.getAdPlayId(a,n),Object.assign(r,function(t,i,r){var a=r.bidders,n=r.bid,o={};if(!a)return o;if(n&&a.length){var s=n.getEventObject(e,a,{offset:i}),d=t&&t.getWrapperAdSystems?t.getWrapperAdSystems():[],l=t&&t.getAdSystem?t.getAdSystem():[];o.bidsVersion=s.bidsVersion,o.mediationLayerAdServer=s.mediationLayerAdServer,o.bidders=s.bidders,s.floorPriceCents&&(o.floorPriceCents=s.floorPriceCents),"dfp"===o.mediationLayerAdServer&&("SpotXJW"===l||d.indexOf("SpotXJW")>=0)&&o.bidders.forEach(function(e){e.winner="SpotX"===e.name})}return o}(t,a,this.breakMap[a]))},t.prototype.setBid=function(e,t,i){var r=pt(e,this.player.utils);this.breakMap[r]=this.breakMap[r]||{},this.breakMap[r].bid=t,this.breakMap[r].bidders=i},t.prototype.adEventObject=function(t){var i={client:e,tag:this.getTag(t),ima:{ad:t,userRequestContext:this.userRequestContext}};return t?(i.adtitle=t.getTitle(),i.adsystem=t.getAdSystem(),i.creativetype=t.getContentType(),i.linear=t.isLinear()?"linear":"nonlinear",i.viewable=this.player.getViewable(),Object.assign(i,this.adPodEventObject(t)),i):i},t.prototype.adErrorEventObject=function(t,i){var r=t.getMessage&&t.getMessage()||t.message,a=t.getVastErrorCode&&t.getVastErrorCode()||900,n=(t.getInnerError&&t.getInnerError()||{}).message,o=t.getErrorCode&&t.getErrorCode()||900;o<1e4&&(o+=2e4);var s=i.getAd&&i.getAd(),d=this.getTag(s,i);return Object.assign({client:e,message:"Ad Error: "+r,code:a,adErrorCode:o,tag:d},n?{innerErrorMessage:n}:null,this.adPodEventObject(s))},t}();!function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");t.setAttribute("media","screen"),t.innerHTML=e,document.head.appendChild(t)}}(".jw-plugin-googima,.jw-plugin-googima.jw-ad-instream .jw-ads-view>:not(div),.jw-plugin-googima.jw-ad-instream .jw-ads-view>div:not(:empty){height:100%;width:100%}.jw-plugin-googima{overflow:hidden;display:block;visibility:hidden;pointer-events:none;opacity:0}.jw-plugin-googima.jw-ad-instream{visibility:visible;display:block;pointer-events:all;opacity:1}.jw-plugin-googima.jw-ad-linear{top:0;left:0;bottom:0}.jw-plugin-googima.jw-ad-non-linear{top:auto}.jw-plugin-googima .jw-ads-view{position:absolute;width:100%;height:100%}.jwplayer.jw-flag-ads-googleima.jw-flag-touch .jw-controlbar{font-size:1em}.jwplayer.jw-flag-ads-googleima.jw-flag-touch .jw-display-icon-display,.jwplayer.jw-flag-ads-googleima.jw-flag-touch .jw-display-icon-display .jw-icon-display{pointer-events:none}.jwplayer.jw-flag-ads-googleima .jw-controlbar{background:0 0!important;pointer-events:none}.jwplayer.jw-flag-ads-googleima .jw-controlbar .jw-icon{pointer-events:all}.jwplayer.jw-flag-ads-googleima .jw-controls-backdrop{display:none}.jwplayer.jw-flag-ads-googleima.jw-ie .jw-slider-volume,.jwplayer.jw-flag-ads-googleima.jw-ie .jw-svg-icon{background:rgba(0,0,0,.25);border-radius:3px}.jwplayer.jw-flag-ads-googleima.jw-ie .jw-slider-volume{margin:0 10px}@supports (filter:drop-shadow(0 0 3px #000)){.jwplayer.jw-flag-ads-googleima.jw-ie .jw-slider-volume,.jwplayer.jw-flag-ads-googleima.jw-ie .jw-svg-icon{background:0 0;border-radius:0}.jwplayer.jw-flag-ads-googleima.jw-ie .jw-slider-volume{margin:0}}.jwplayer.jw-flag-ads-googleima .jw-controlbar .jw-svg-icon{fill:#fff;filter:drop-shadow(0 0 3px #000)}.jwplayer.jw-flag-ads-googleima .jw-spacer,.jwplayer.jw-flag-ads-googleima .jw-text{order:1}.jwplayer.jw-flag-ads-googleima .jw-controlbar .jw-text{text-shadow:0 0 3px #000}.jwplayer.jw-flag-ads-googleima.jw-flag-small-player.jw-flag-ads.jw-state-playing.jw-flag-touch:not(.jw-flag-ads-vpaid) .jw-controls .jw-controlbar{pointer-events:none}.jwplayer.jw-flag-ads-googleima.jw-flag-small-player .jw-controlbar{flex-flow:column-reverse nowrap;height:100%;max-height:none}.jwplayer.jw-flag-ads-googleima.jw-flag-small-player .jw-button-container{align-items:flex-end;flex-wrap:wrap;margin-bottom:7px}.jwplayer.jw-flag-ads-googleima.jw-flag-small-player .jw-controlbar .jw-icon{height:30px}.jwplayer.jw-flag-ads-googleima.jw-flag-small-player .jw-text{align-self:flex-start;margin:16px 0 0 16px;order:-1;width:100%}");(window.jwplayerPluginJsonp||window.jwplayer().registerPlugin)(e,"8.1",function(n,o,s){var d=this,l=this,u=n.utils,h=n.getConfig(),f=new L(o||{},u),v=null,y=void 0,b=0;if(f.premiumAds){if(n.getMute()||h.autostart)return console.log("Premium Ads: Cannot play ads in autostart or muted"),void I();if(function(){var e=(window.performance||{}).timing;if(e){var t=e.loadEventEnd||(new Date).getTime(),i=t-e.navigationStart;if(i>0)return i}return m}()>=m)return console.log("Premium Ads: Page load took too long to start an ad"),void I()}x(u).then(function(){if(y){var e=R();e>=0&&e-y>=m&&(console.log("Premium Ads: IMA SDK load took too long to start an ad"),I())}}).catch(u.noop);var w=n._,A=h.key,P=new T(s,n.id,u),C=new B(u,n.Events,P),E=new gt(n,P.getAdDiv()),_=null;this.version="8.5.16",this.bidsVersion="0.2.4",n.utils.extend(this,n.Events);function M(e,t,i,r){try{return e.getCompanionAds(t,i,r)}catch(e){return[]}}function j(e){var t=new google.ima.CompanionAdSelectionSettings;t.sizeCriteria=google.ima.CompanionAdSelectionSettings.SizeCriteria.IGNORE;var i=f.companiondiv||{width:300,height:250},r=function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];t.push({width:r.getWidth(),height:r.getHeight(),type:"html",resource:r.getContent(),click:null})}return t}(M(e,i.width,i.height,t)),a=r.length;if(a){var o=_.adsLoaderManager.adEventObject(e);o.companions=r,n.trigger(c,o)}if(f.companiondiv){t=new google.ima.CompanionAdSelectionSettings,f.companionResourceType&&(t.resourceType=google.ima.CompanionAdSelectionSettings.ResourceType[f.companionResourceType]);var s=M(e,f.companiondiv.width,f.companiondiv.height,t);a=Math.max(a,s.length),function(e){if(e&&e.length){var t=document.getElementById(f.companiondiv.id);if(t){var i=e[0];i&&(w.isFunction(i.getContent)?t.innerHTML=i.getContent():t.innerHTML=i.resource||i.content)}}}(s)}return a>0}function I(){S(),E&&E.adDisplayContainer&&E.adDisplayContainer.destroy(),n.off(null,null,this),n.playAd=u.noop}function S(){_&&(_.destroy(),_=null)}function k(e){_&&_.discardAdBreak(),E.contentComplete(),S(),e&&e.adschedule?f.adschedule=e.adschedule:f.adschedule=null,n.setCues([])}function O(e,t,a){var o=e.item||{};k(o);var s=a.getSchedule();if(t===i&&!function(){var e=f.getAdRules(),t=0===e.frequency&&1===b,i=b>=e.startOn&&(b-e.startOn)%e.frequency==0;return t||i}()||!s||"string"!=typeof s&&!Object.keys(s).length)return f.adschedule=null,void x(u).then(function(){E.prepare(v)}).catch(u.noop);if(E.reset(),(_=new ut(o,f,n,C,P,E,v)).on("all",function(e,t){return n.trigger(e,t)}),_.init(t,a).then(function(e){n.trigger("adsManager",{adsManager:e,videoElement:v})}).catch(u.noop),_.on(g,function(e){j(e.ima.ad)}),a.preloadAds){var d=n.getConfig().autostart;!1===d||d===r&&0===n.getViewable()?_.requestAds(t,a):n.once("autostartNotAllowed",function(){_.requestAds(t,a)},_)}n.once("beforePlay",function(e){if(f.premiumAds){var i=n.getHeight(),r=n.getWidth();if(i<270||r<480)return console.log("Premium Ads: Player size is smaller than 480x270 to play an ad"),void l.destroy();R()<0&&(y=Date.now())}_.beforePlay(e),_.requestAds(t,a)},_).on("beforeComplete",function(){return _.beforeComplete()},_).on("time",function(e){return _.time(e)},_).on("resize",function(){return _.resize()},_).on("fullscreen",function(){return _.resize()},_)}n.pauseAd=function(e,t){_&&(e?_.pause(t||{}):_.resume(t||{}))},n.playAd=function(e){var i=u.extend({},o);delete i.ad,delete i.tag,delete i.schedule,delete i.adschedule,n._.isArray(e)?i.tag=e[0]:i.tag=e;var r=new L(i,u);r.setLocalizationOptions(h.localization.advertising);var a=_?_.blockingInstreamPlayer:null;a&&(a.noResume=!0),O({},t,r),_&&(_.beforePlay(null),_.requestAds(t,r))},n.on("ready",function(){h.localization=n.getConfig().localization,f.setLocalizationOptions(h.localization.advertising),v||(v=n.createInstream().getMediaElement()),x().catch(function(e){e.message.match(/Failed to load/)&&U("Ad playback blocked by an ad blocker",2e4)}),q.catch(function(e){U("Ad Error: "+e.message,60002)});var e=document.body,t=function(){e.removeEventListener("mouseup",t),e.removeEventListener("touchend",t),E.initializeDisplay()};e.addEventListener("mouseup",t,!1),e.addEventListener("touchend",t,!1)},this).on("playlistItem",function(e){b++,f.resetBidsResponse(),O(e,i,f)},this).on("playlistComplete",function(){k()},this).on("cast",function(e){e.active&&k()},this).on("mute",function(e){var t=e.mute;C.mute(t)},this).on("destroyPlugin",function(){d.destroy()},this).on("remove",I,this);var q=function(e,t,i){var r=D[t];return r||(D[t]=new Promise(function(r,a){!function(i){var r=new e.key(t);if("unlimited"===r.edition())return i();var a=["//","entitlements.jwplayer.com","/",r.token(),".json"];"file:"===window.location.protocol&&a.unshift("https:"),e.ajax(a.join(""),function(e){i(e&&e.response)},function(){i()},{timeout:1e4,responseType:"json"})}(function(e){var t=e||{},n=void 0,o=void 0;!0===i.outstream?(n=!1!==t.canPlayOutstreamAds,o="Outstream Ad Limit Reached"):(n=!1!==t.canPlayAds,o="Ad Limit Reached"),!1!==n?r({message:"Can Play Ads"}):a({message:o})})}))}(u,A,o);q.catch(u.noop);var U=function(t,i){I(),n.trigger(p,{id:a,client:e,message:t,code:900,adErrorCode:i,tag:""})};this.destroy=S,this.adsDebugMode=function(){f.debug=!0,_&&(_.debugConsoleLog=function(){var e;(e=console).log.apply(e,arguments)})}})}();
  