@newrelic/video-videojs 4.0.3 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -3
- package/README.md +450 -66
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.LICENSE.txt +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.LICENSE.txt +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/newrelic-video-videojs.min.js +1 -1
- package/dist/umd/newrelic-video-videojs.min.js.LICENSE.txt +1 -1
- package/dist/umd/newrelic-video-videojs.min.js.map +1 -1
- package/package.json +1 -1
- package/src/techs/contrib-hls.js +64 -52
- package/src/techs/hls-js.js +29 -12
- package/src/techs/shaka.js +37 -10
- package/src/tracker.js +77 -36
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see newrelic-video-videojs.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VideojsTracker=t():e.VideojsTracker=t()}(self,()=>(()=>{"use strict";var e={555(e,t,i){i.r(t),i.d(t,{__esModule:()=>o,default:()=>d});var r={28:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OptimizedHttpClient=void 0;var r,n=i(347),a=(r=i(144))&&r.__esModule?r:{default:r};class s{async send(e,t){const{url:i,payload:r,options:n={}}=e;try{if(!i||!r)throw new Error("URL and payload are required");const e={url:i,payload:r,options:n,callback:t};await this.executeRequest(e)}catch(e){a.default.error("Failed to send request:",e.message),t({retry:!1,status:0,error:e.message})}}async executeRequest(e){const{url:t,payload:i,options:r,callback:n}=e,a=Date.now();try{const n=JSON.stringify(i.body);if(r.isFinalHarvest&&navigator.sendBeacon){const i=await this.sendWithBeacon(t,n),r={success:i,status:i?204:0};return void this.handleRequestComplete(e,r,a)}const s=await this.fetchWithTimeout(t,{method:"POST",body:n,headers:{"Content-Type":"application/json"},keepalive:r.isFinalHarvest},1e4),o={success:s.ok,status:s.status,statusText:s.statusText};this.handleRequestComplete(e,o,a)}catch(t){const i={success:!1,status:0,error:t.message};this.handleRequestComplete(e,i,a)}}handleRequestComplete(e,t){const{callback:i}=e;i({retry:!t.success&&(0===t.status||(0,n.shouldRetry)(t.status)),status:t.status,error:t.error})}async sendWithBeacon(e,t){try{return navigator.sendBeacon(e,t)}catch(e){return a.default.warn("sendBeacon failed, falling back to fetch:",e.message),!1}}async fetchWithTimeout(e,t,i){const r=new AbortController,n=setTimeout(()=>r.abort(),i);try{const i=await fetch(e,{...t,signal:r.signal});return clearTimeout(n),i}catch(e){if(clearTimeout(n),"AbortError"===e.name)throw new Error(`Request timeout after ${i}ms`);throw e}}}t.OptimizedHttpClient=s,t.default=s},51:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class i{}i.AdPositions={PRE:"pre",MID:"mid",POST:"post"},i.COLLECTOR={US:["bam.nr-data.net","bam-cell.nr-data.net"],EU:"bam.eu01.nr-data.net",Staging:"staging-bam-cell.nr-data.net",GOV:"gov-bam.nr-data.net"},i.VALID_EVENT_TYPES=["VideoAction","VideoAdAction","VideoErrorAction","VideoCustomAction"],i.MAX_PAYLOAD_SIZE=1048576,i.MAX_BEACON_SIZE=61440,i.MAX_EVENTS_PER_BATCH=1e3,i.INTERVAL=1e4,t.default=i},144:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class i{static error(...e){r(e,i.Levels.ERROR,"darkred")}static warn(...e){r(e,i.Levels.WARNING,"darkorange")}static notice(...e){r([].slice.call(arguments),i.Levels.NOTICE,"darkcyan")}static debug(...e){r(e,i.Levels.DEBUG,"indigo")}static debugCommonVideoEvents(e,t,r){try{if(i.level<=i.Levels.DEBUG){r=r||function(e){i.debug("Event: "+e.type)};var n=["canplay","buffering","waiting","ended","play","playing","pause","resume","error","abort","seek","seeking","seeked","stalled","dispose","loadeddata","loadstart","loadedmetadata"];t&&(null===t[0]?(t.shift(),n=t):n=n.concat(t));for(var a=0;a<n.length;a++)"function"==typeof e?e.call(window,n[a],r):e.on?e.on(n[a],r):e.addEventListener?e.addEventListener(n[a],r):e.addEventHandler?e.addEventHandler(n[a],r):i.warn("debugCommonVideoEvents: No common listener function found for ",e)}}catch(e){i.warn(e)}}}function r(e,t,r){t=t||i.Levels.NOTICE,r=r||"darkcyan";var s,o,d=i.prefix;i.includeTime&&(d+="["+("0"+(s=new Date).getDate()).slice(-2)+":"+("0"+s.getMinutes()).slice(-2)+":"+("0"+s.getSeconds()).slice(-2)+"."+("00"+s.getMilliseconds()).slice(-3)+"] "),d+=function(e){return a[e]}(t)+":",i.level<=t&&t!==i.Levels.SILENT&&(!i.colorful||"undefined"!=typeof document&&document.documentMode?n(e,d):(o=t===i.Levels.ERROR&&console.error?console.error:t===i.Levels.WARNING&&console.warn?console.warn:t===i.Levels.DEBUG&&console.debug&&null==window.cast?console.debug:console.log,d="%c"+d,e.splice(0,0,d,"color: "+r),o.apply(console,e)))}function n(e,t){if(e instanceof Array)for(var i in e)n(e[i],t);else"string"==typeof e?console.log(t+" "+e):(console.log(t+"↵"),console.log(e))}i.Levels={SILENT:5,ERROR:4,WARNING:3,NOTICE:2,DEBUG:1,ALL:0},i.level=i.Levels.ERROR,i.colorful=!0,i.includeTime=!0,i.prefix="[nrvideo]";const a={4:"e",3:"w",2:"n",1:"d"};!function(){if("undefined"!=typeof window&&window.location&&window.location.search){var e=/\?.*&*nrvideo-debug=(.+)/i.exec(window.location.search);null!==e&&("true"===e[1]?i.level=i.Levels.ALL:i.level=e[1]),null!==/\?.*&*nrvideo-colors=false/i.exec(window.location.search)&&(i.colorful=!1)}}(),t.default=i},302:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(i(330)),n=u(i(568)),a=u(i(455)),s=u(i(51)),o=i(487),d=u(i(144));function u(e){return e&&e.__esModule?e:{default:e}}class l extends n.default{constructor(e){super(),this.customData={},this.heartbeat=null,this.parentTracker=null,this._trackerReadyChrono=new a.default,this._trackerReadyChrono.start(),this._actionTable=s.default.ACTION_TABLE,this._actionAdTable=s.default.ACTION_AD_TABLE,e=e||{},this.setOptions(e)}setOptions(e){e&&(e.parentTracker&&(this.parentTracker=e.parentTracker),e.customData&&(this.customData=e.customData),e.heartbeat&&(this.heartbeat=e.heartbeat))}dispose(){this.unregisterListeners()}registerListeners(){}unregisterListeners(){}getHeartbeat(){return this.state._isAd?2e3:this.heartbeat?this.heartbeat:this.parentTracker&&this.parentTracker.heartbeat?this.parentTracker.heartbeat:3e4}startHeartbeat(){this._heartbeatInterval=setInterval(this.sendHeartbeat.bind(this),Math.max(this.getHeartbeat(),2e3))}stopHeartbeat(){this._heartbeatInterval&&clearInterval(this._heartbeatInterval)}sendHeartbeat(e){this.sendVideoAction(l.Events.HEARTBEAT,e)}getAttributes(e,t){(e=e||{}).trackerName=this.getTrackerName(),e.trackerVersion=this.getTrackerVersion(),e.coreVersion=r.default.version,e.timeSinceTrackerReady=this._trackerReadyChrono.getDeltaTime();for(let t in this.customData)e[t]=this.customData[t];return null!=document.hidden&&(e.isBackgroundEvent=document.hidden),e}getTrackerVersion(){return r.default.version}getTrackerName(){return"base-tracker"}sendVideoAction(e,t){this.emit("VideoAction",e,this.getAttributes(t))}sendVideoAdAction(e,t){this.emit("VideoAdAction",e,this.getAttributes(t))}sendVideoErrorAction(e,t){let i=this.isAd()?"adError":"videoError";this.emit("VideoErrorAction",e,this.getAttributes(t,i))}sendVideoCustomAction(e,t){this.emit("VideoCustomAction",e,this.getAttributes(t,"customAction"))}setHarvestInterval(e){if(o.videoAnalyticsHarvester)try{o.videoAnalyticsHarvester.setHarvestInterval(e)}catch(e){return void d.default.error("Failed to set harvest interval:",e.message)}else d.default.error("VideoAnalyticsHarvester is not available")}}l.Events={HEARTBEAT:"HEARTBEAT"},t.default=l},328:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(i(455)),n=a(i(144));function a(e){return e&&e.__esModule?e:{default:e}}t.default=class{constructor(){this.reset(),this._createdAt=Date.now(),this._hb=!0,this._acc=0,this._bufferAcc=0}reset(){this._viewSession=null,this._viewCount=0,this._isAd=!1,this.numberOfErrors=0,this.numberOfAds=0,this.numberOfVideos=0,this.totalPlaytime=0,this.totalAdPlaytime=0,this.isAdBreak=!1,this.initialBufferingHappened=!1,this.resetFlags(),this.resetChronos()}resetFlags(){this.isPlayerReady=!1,this.isRequested=!1,this.isStarted=!1,this.isPaused=!1,this.isSeeking=!1,this.isBuffering=!1,this.isPlaying=!1}resetChronos(){this.timeSinceRequested=new r.default,this.timeSinceStarted=new r.default,this.timeSincePaused=new r.default,this.timeSinceSeekBegin=new r.default,this.timeSinceBufferBegin=new r.default,this.timeSinceAdBreakStart=new r.default,this.timeSinceLastDownload=new r.default,this.timeSinceLastHeartbeat=new r.default,this.timeSinceLastRenditionChange=new r.default,this.timeSinceLastAdQuartile=new r.default,this.timeSinceLastAd=new r.default,this.timeSinceResumed=new r.default,this.timeSinceSeekEnd=new r.default,this.playtimeSinceLastEvent=new r.default,this.customTimeSinceAttributes={},this.elapsedTime=new r.default,this.bufferElapsedTime=new r.default}isAd(){return this._isAd}setIsAd(e){this._isAd=e}setTimeSinceAttribute(e){this.customTimeSinceAttributes[e]=new r.default,this.customTimeSinceAttributes[e].start()}removeTimeSinceAttribute(e){delete this.customTimeSinceAttributes[e]}getViewSession(){if(!this._viewSession){let e=(new Date).getTime(),t=Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2);this._viewSession=e+"-"+t}return this._viewSession}getViewId(){return this.getViewSession()+"-"+this._viewCount}getStateAttributes(e){e=e||{},this.isAd()?(this.isRequested&&(e.timeSinceAdRequested=this.timeSinceRequested.getDeltaTime(),e.timeSinceLastAdHeartbeat=this.timeSinceLastHeartbeat.getDeltaTime()),this.isStarted&&(e.timeSinceAdStarted=this.timeSinceStarted.getDeltaTime()),this.isPaused&&(e.timeSinceAdPaused=this.timeSincePaused.getDeltaTime()),this.isBuffering&&(e.timeSinceAdBufferBegin=this.timeSinceBufferBegin.getDeltaTime()),this.isSeeking&&(e.timeSinceAdSeekBegin=this.timeSinceSeekBegin.getDeltaTime()),this.isAdBreak&&(e.timeSinceAdBreakBegin=this.timeSinceAdBreakStart.getDeltaTime()),e.numberOfAds=this.numberOfAds):(this.isRequested&&(e.timeSinceRequested=this.timeSinceRequested.getDeltaTime(),e.timeSinceLastHeartbeat=this.timeSinceLastHeartbeat.getDeltaTime()),this.isStarted&&(e.timeSinceStarted=this.timeSinceStarted.getDeltaTime()),this.isPaused&&(e.timeSincePaused=this.timeSincePaused.getDeltaTime()),this.isBuffering&&(e.timeSinceBufferBegin=this.timeSinceBufferBegin.getDeltaTime()),this.isSeeking&&(e.timeSinceSeekBegin=this.timeSinceSeekBegin.getDeltaTime()),e.timeSinceLastAd=this.timeSinceLastAd.getDeltaTime(),e.numberOfVideos=this.numberOfVideos),e.numberOfErrors=this.numberOfErrors,this.isAd()||(this.playtimeSinceLastEvent.startTime>0?e.playtimeSinceLastEvent=this.playtimeSinceLastEvent.getDeltaTime():e.playtimeSinceLastEvent=0,this.isPlaying?this.playtimeSinceLastEvent.start():this.playtimeSinceLastEvent.reset(),this.totalPlaytime+=e.playtimeSinceLastEvent,e.totalPlaytime=this.totalPlaytime);for(const[t,i]of Object.entries(this.customTimeSinceAttributes))e[t]=i.getDeltaTime();return e}calculateBufferType(e){let t="";return t=e?"initial":this.isSeeking?"seek":this.isPaused?"pause":"connection",n.default.debug("Buffer Type = "+t),t}goViewCountUp(){this._viewCount++}goPlayerReady(){return!this.isPlayerReady&&(this.isPlayerReady=!0,!0)}goRequest(){return!this.isRequested&&(this.isRequested=!0,this.timeSinceLastAd.reset(),this.timeSinceRequested.start(),!0)}goStart(){return!(!this.isRequested||this.isStarted||(this.isAd()?this.numberOfAds++:this.numberOfVideos++,this.isStarted=!0,this.isPlaying=!0,this.timeSinceStarted.start(),this.playtimeSinceLastEvent.start(),0))}goEnd(){return!!this.isRequested&&(this.numberOfErrors=0,this.resetFlags(),this.timeSinceRequested.stop(),this.timeSinceStarted.stop(),this.playtimeSinceLastEvent.stop(),!0)}goPause(){return!(!this.isStarted||this.isPaused||(this.isPaused=!0,this.isPlaying=!1,this.timeSincePaused.start(),this.playtimeSinceLastEvent.stop(),this.timeSinceResumed.reset(),this.isBuffering&&(this._bufferAcc+=this.bufferElapsedTime.getDeltaTime()),this.elapsedTime.start(),0))}goResume(){return!(!this.isStarted||!this.isPaused||(this.isPaused=!1,this.isPlaying=!0,this.timeSincePaused.stop(),this.timeSinceResumed.start(),this._hb?(this._acc=this.elapsedTime.getDeltaTime(),this._hb=!1):(this.isBuffering&&this.bufferElapsedTime.start(),this._acc+=this.elapsedTime.getDeltaTime()),0))}goBufferStart(){return!(!this.isRequested||this.isBuffering||(this.isBuffering=!0,this.isPlaying=!1,this.timeSinceBufferBegin.start(),this.bufferElapsedTime.start(),0))}goBufferEnd(){return!(!this.isRequested||!this.isBuffering||(this.isBuffering=!1,this.isPlaying=!0,this.timeSinceBufferBegin.stop(),this._hb?(this._bufferAcc=this.bufferElapsedTime.getDeltaTime(),this._hb=!1):this._bufferAcc+=this.bufferElapsedTime.getDeltaTime(),0))}goSeekStart(){return!(!this.isStarted||this.isSeeking||(this.isSeeking=!0,this.isPlaying=!1,this.timeSinceSeekBegin.start(),this.timeSinceSeekEnd.reset(),0))}goSeekEnd(){return!(!this.isStarted||!this.isSeeking||(this.isSeeking=!1,this.isPlaying=!0,this.timeSinceSeekBegin.stop(),this.timeSinceSeekEnd.start(),0))}goAdBreakStart(){return!this.isAdBreak&&(this.isAdBreak=!0,this.timeSinceAdBreakStart.start(),!0)}goAdBreakEnd(){return!!this.isAdBreak&&(this.isRequested=!1,this.isAdBreak=!1,this.totalAdPlaytime=this.timeSinceAdBreakStart.getDeltaTime(),this.timeSinceAdBreakStart.stop(),!0)}goDownload(){this.timeSinceLastDownload.start()}goHeartbeat(){this.timeSinceLastHeartbeat.start()}goRenditionChange(){this.timeSinceLastRenditionChange.start()}goAdQuartile(){this.timeSinceLastAdQuartile.start()}goError(){this.isError=!0,this.numberOfErrors++}goLastAd(){this.timeSinceLastAd.start()}}},330:e=>{e.exports=JSON.parse('{"name":"@newrelic/video-core","version":"4.0.0","description":"New Relic video tracking core library","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","scripts":{"build":"webpack --mode production","build:dev":"webpack --mode development","watch":"webpack --mode production --progress --color --watch","watch:dev":"webpack --progress --color --watch","clean":"rm -rf dist coverage doc","test":"nyc --reporter=html --reporter=text mocha --require @babel/register","doc":"jsdoc -c jsdoc.json -d documentation","deploy":"node scripts/deploy.js","third-party-updates":"oss third-party manifest --includeOptDeps && oss third-party notices --includeOptDeps && git add THIRD_PARTY_NOTICES.md third_party_manifest.json"},"repository":{"type":"git","url":"https://github.com/newrelic/video-core-js"},"author":"Jordi Aguilar","contributors":["Andreu Santarén Llop","Malay Chandan","Bharat Sarsawat"],"license":"Apache-2.0","devDependencies":{"@babel/core":"^7.24.5","@babel/plugin-transform-modules-commonjs":"^7.24.1","@newrelic/newrelic-oss-cli":"^0.1.2","@babel/preset-env":"^7.24.5","@babel/register":"^7.24.6","aws-sdk":"^2.920.0","babel-loader":"^9.1.3","chai":"^4.3.4","diff":"^5.0.0","jsdom":"^25.0.1","mocha":"^10.4.0","nyc":"^15.1.0","sinon":"^2.4.1","webpack":"^5.91.0","webpack-cli":"^4.9.2"},"files":["THIRD_PARTY_NOTICES.md","dist","src","CHANGELOG.md","LICENSE","README.md","src","!test"],"publishConfig":{"access":"public"}}')},347:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=function(e){try{if(!window.NRVIDEO||!window.NRVIDEO.info)throw new Error("NRVIDEO info is not available.");let{beacon:t,licenseKey:i,applicationID:n}=window.NRVIDEO.info;if(!t||!i)throw new Error("Options object provided by New Relic is not correctly initialized");return n?`https://${e||t}/ins/1/${i}?a=${n}&v=${r.default.version}&ref=${window.location.href}&ca=VA`:`https://${e||t}/ins/1/${i}?&v=${r.default.version}&ref=${window.location.href}&ca=VA`}catch(e){return console.error(e.message),null}},t.compressPayload=function(e){const t=JSON.stringify(e),i=new Blob([t]).stream(),r=new CompressionStream("gzip"),n=i.pipeThrough(r);return new Response(n).blob()},t.dataSize=function(e){if("string"==typeof e&&e.length)return e.length;if("object"==typeof e){if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&e.byteLength)return e.byteLength;if("undefined"!=typeof Blob&&e instanceof Blob&&e.size)return e.size;if(!("undefined"!=typeof FormData&&e instanceof FormData))try{return function(e){try{return JSON.stringify(e,s())??""}catch(e){return n.default.error("Error stringifying value:",e.message),""}}(e).length}catch(e){return}}},t.decompressPayload=async function(e){try{let t;if(e instanceof Blob)t=e.stream();else if(e instanceof ArrayBuffer)t=new Blob([e]).stream();else{if(!(e instanceof Uint8Array))throw new Error("Unsupported compressed data type");t=new Blob([e]).stream()}const i=new DecompressionStream("gzip"),r=t.pipeThrough(i),n=new Response(r),a=await n.text();return JSON.parse(a)}catch(e){throw new Error(`Failed to decompress payload: ${e.message}`)}},t.shouldRetry=function(e){switch(e){case 408:case 429:case 500:return!0;case 401:case 403:case 404:return!1}return e>=502&&e<=504||e>=512&&e<=530};var r=a(i(330)),n=a(i(144));function a(e){return e&&e.__esModule?e:{default:e}}const s=()=>{const e=new WeakSet;return(t,i)=>{if("object"==typeof i&&null!==i){if(e.has(i))return;e.add(i)}return i}}},374:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HarvestScheduler=void 0;var r=i(431),n=i(413),a=i(28),s=i(347),o=u(i(51)),d=u(i(144));function u(e){return e&&e.__esModule?e:{default:e}}t.HarvestScheduler=class{constructor(e){this.eventBuffer=e,this.retryQueueHandler=new n.RetryQueueHandler,this.httpClient=new a.OptimizedHttpClient,this.fallBackUrl="",this.retryCount=0,this.eventBuffer instanceof r.NrVideoEventAggregator&&this.eventBuffer.setSmartHarvestCallback((e,t)=>this.triggerSmartHarvest(e,t)),this.isStarted=!1,this.currentTimerId=null,this.harvestCycle=o.default.INTERVAL,this.isHarvesting=!1,this.setupPageLifecycleHandlers()}startScheduler(){this.isStarted?d.default.warn("Harvest scheduler is already started"):(this.isStarted=!0,d.default.notice("Starting harvest scheduler",{harvestCycle:this.harvestCycle,eventBufferSize:this.eventBuffer?this.eventBuffer.size():0}),this.scheduleNextHarvest())}stopScheduler(){this.isStarted&&(this.isStarted=!1,this.currentTimerId&&(clearTimeout(this.currentTimerId),this.currentTimerId=null),d.default.notice("Harvest scheduler stopped"))}async triggerSmartHarvest(e,t){if(d.default.notice(`${e} harvest triggered at ${t}% threshold`,{type:e,threshold:t}),this.eventBuffer&&!this.eventBuffer.isEmpty()){this.currentTimerId&&(clearTimeout(this.currentTimerId),this.currentTimerId=null);try{await this.triggerHarvest({})}catch(t){d.default.error(`${e} harvest failed:`,t.message)}finally{this.isStarted&&this.scheduleNextHarvest()}}}scheduleNextHarvest(){if(!this.isStarted)return;const e=this.harvestCycle;this.currentTimerId=setTimeout(()=>this.onHarvestInterval(),e)}async onHarvestInterval(){try{const e=this.eventBuffer&&!this.eventBuffer.isEmpty(),t=this.retryQueueHandler&&this.retryQueueHandler.getQueueSize()>0;if(!e&&!t)return;await this.triggerHarvest({})}catch(e){d.default.error("Error during scheduled harvest:",e.message)}finally{this.scheduleNextHarvest()}}async triggerHarvest(e={}){if(this.isHarvesting)return{success:!1,reason:"harvest_in_progress"};this.isHarvesting=!0;try{let t=this.drainEvents(e);if(e.isFinalHarvest){const e=o.default.MAX_BEACON_SIZE;(0,s.dataSize)(t)>e&&(t=this.trimEventsToFit(t,e))}const i=await this.sendChunk(t,e,!0);return{success:i.success,totalChunks:1,results:[i]}}catch(e){return d.default.error("Harvest cycle failed:",e.message),this.handleHarvestFailure(e),{success:!1,error:e.message,consecutiveFailures:this.consecutiveFailures}}finally{this.isHarvesting=!1}}trimEventsToFit(e,t){if(0===e.length)return e;const i=[];let r=0;for(let n=e.length-1;n>=0;n--){const a=e[n],o=(0,s.dataSize)({ins:[a,...i]});o>t||(i.unshift(a),r=o)}const n=e.length-i.length;if(n>0){const a=e.slice(0,n);d.default.warn(`Discarded ${n} events to fit beacon size limit`,{originalCount:e.length,trimmedCount:i.length,finalSize:r,maxSize:t}),this.retryQueueHandler&&this.retryQueueHandler.addFailedEvents(a)}return i}drainEvents(){const e=this.eventBuffer.drain();let t=[...e],i=(0,s.dataSize)(e);if(this.retryQueueHandler&&this.retryQueueHandler.getQueueSize()>0){const e=o.default.MAX_PAYLOAD_SIZE-i,r=o.default.MAX_EVENTS_PER_BATCH-t.length;if(e>0&&r>0){const i=this.retryQueueHandler.getRetryEventsToFit(e,r);i.length>0&&(t=[...i,...t])}}return t}async sendChunk(e,t,i){const r={url:(0,s.buildUrl)(this.fallBackUrl),payload:{body:{ins:e}},options:{...t,isLastChunk:i}};return new Promise(t=>{this.httpClient.send(r,i=>{i.retry?this.handleRequestFailure(e):(this.retryCount=0,this.fallBackUrl=""),t({success:!i.retry,status:i.status,error:i.error,chunk:e,eventCount:e.length})})})}handleRequestFailure(e){this.retryQueueHandler.addFailedEvents(e),"US"===window.NRVIDEO?.info?.region&&(this.retryCount++,this.retryCount>5?(this.retryCount=0,this.fallBackUrl=""):this.retryCount>=2&&(this.fallBackUrl=o.default.COLLECTOR.US[1]))}handleHarvestFailure(e){this.consecutiveFailures++,d.default.warn("Harvest failure handled",{error:e.message,consecutiveFailures:this.consecutiveFailures})}updateHarvestInterval(e){"number"!=typeof e&&isNaN(e)?d.default.warn("Invalid newInterval provided to updateHarvestInterval"):e<1e3||e>3e5?d.default.warn("newInterval out of bounds (1000-300000), ignoring"):this.harvestCycle!==e&&(this.harvestCycle=e,d.default.notice("Updated harvestCycle:",this.harvestCycle),this.currentTimerId&&(clearTimeout(this.currentTimerId),this.currentTimerId=null),this.isStarted&&this.scheduleNextHarvest())}setupPageLifecycleHandlers(){let e=!1;const t=()=>{e||(e=!0,this.triggerHarvest({isFinalHarvest:!0,force:!0}))};document.addEventListener("visibilitychange",()=>{document.hidden&&t()}),window.addEventListener("pagehide",()=>{t()}),window.addEventListener("beforeunload",()=>{t()})}}},399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,n=(r=i(144))&&r.__esModule?r:{default:r},a=i(449),s=i(659);class o{static addTracker(e,t){t?.info&&(0,s.setVideoConfig)(t.info),e.on&&e.emit?(d.push(e),e.on("*",u),"function"==typeof e.trackerInit&&e.trackerInit()):n.default.error("Tried to load a non-tracker.",e)}static removeTracker(e){e.off("*",u),e.dispose();let t=d.indexOf(e);-1!==t&&d.splice(t,1)}static getTrackers(){return d}static send(e,t,i){const r={actionName:t,...i};return(0,a.recordEvent)(e,r)}static sendError(e){return(0,a.recordEvent)("VideoErrorAction",{actionName:"ERROR",...e})}static async forceHarvest(){try{const{videoAnalyticsHarvester:e}=i(487);return await e.forceHarvest()}catch(e){return n.default.error("Failed to force harvest:",e.message),{success:!1,error:e.message}}}}let d=[];function u(e){try{let t=function(e){let t={};for(let i in e)null!==e[i]&&void 0!==e[i]&&(t[i]=e[i]);return t}(e.data);n.default.level<=n.default.Levels.DEBUG?n.default.notice("Sent",e.type,t):n.default.notice("Sent",e.type),o.send(e.eventType,e.type,t)}catch(e){n.default.error("Error in event handler:",e.message)}}t.default=o},413:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RetryQueueHandler=void 0;var r=s(i(144)),n=i(347),a=s(i(51));function s(e){return e&&e.__esModule?e:{default:e}}const{MAX_PAYLOAD_SIZE:o,MAX_EVENTS_PER_BATCH:d}=a.default;class u{constructor(){this.retryQueue=[],this.maxQueueSize=d,this.maxQueueSizeBytes=o}addFailedEvents(e){try{const t=Array.isArray(e)?e:[e];r.default.notice(`Adding ${t.length} failed events to retry queue`,{queueSizeBefore:this.retryQueue.length});for(const e of t){this.retryQueue.length>=this.maxQueueSize&&this.evictOldestEvent();const t=(0,n.dataSize)(e);for(;(0,n.dataSize)(this.retryQueue)+t>this.maxQueueSizeBytes;)this.evictOldestEvent();this.retryQueue.push({...e})}}catch(e){r.default.error("Failed to add events to retry queue:",e.message)}}discardEvent(e,t){r.default.warn("Discarded event",{reason:t,eventType:e.eventType})}evictOldestEvent(){if(this.retryQueue.length>0){const e=this.retryQueue.shift();this.discardEvent(e,"Queue full - evicted oldest")}}getRetryEventsToFit(e,t){const i=[];let r=0,a=0;for(let s=this.retryQueue.length-1;s>=0;s--){const o=this.retryQueue[s];if(a>=t)break;const d=(0,n.dataSize)(o);if(r+d>e)break;i.unshift(o),r+=d,a++,this.retryQueue.splice(s,1)}return i}getQueueSize(){return this.retryQueue.length}clear(){this.retryQueue=[]}}t.RetryQueueHandler=u,t.default=u},431:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.NrVideoEventAggregator=void 0;var r=s(i(144)),n=s(i(51)),a=i(347);function s(e){return e&&e.__esModule?e:{default:e}}const{MAX_PAYLOAD_SIZE:o,MAX_EVENTS_PER_BATCH:d}=n.default;class u{constructor(){this.buffer=[],this.maxPayloadSize=o,this.maxEventsPerBatch=d,this.currentPayloadSize=0,this.totalEvents=0,this.smartHarvestPayloadThreshold=Math.floor(.6*this.maxPayloadSize),this.overflowPayloadThreshold=Math.floor(.9*this.maxPayloadSize),this.smartHarvestEventThreshold=Math.floor(.6*this.maxEventsPerBatch),this.overflowEventThreshold=Math.floor(.9*this.maxEventsPerBatch),this.onSmartHarvestTrigger=null}add(e){try{const t=(0,a.dataSize)(e),i=this.currentPayloadSize+t>=this.maxPayloadSize,r=this.totalEvents+1>=this.maxEventsPerBatch;return(i||r)&&this.makeRoom(t),this.buffer.push(e),this.totalEvents++,this.currentPayloadSize+=t,this.checkSmartHarvestTrigger(),!0}catch(e){return r.default.error("Failed to add event to buffer:",e.message),!1}}checkSmartHarvestTrigger(){const e=this.currentPayloadSize/this.maxPayloadSize,t=this.totalEvents/this.maxEventsPerBatch,i=this.currentPayloadSize>=this.overflowPayloadThreshold,n=this.totalEvents>=this.overflowEventThreshold;if(i||n){const n=i?`payload ${this.currentPayloadSize}/${this.maxPayloadSize} bytes (${Math.round(100*e)}%)`:`events ${this.totalEvents}/${this.maxEventsPerBatch} (${Math.round(100*t)}%)`;r.default.warn(`OVERFLOW PREVENTION: ${n} - Emergency harvest triggered`),this.onSmartHarvestTrigger&&"function"==typeof this.onSmartHarvestTrigger&&this.onSmartHarvestTrigger("overflow",90)}else{const e=this.currentPayloadSize>=this.smartHarvestPayloadThreshold,t=this.totalEvents>=this.smartHarvestEventThreshold;(e||t)&&this.onSmartHarvestTrigger&&"function"==typeof this.onSmartHarvestTrigger&&this.onSmartHarvestTrigger("smart",60)}}setSmartHarvestCallback(e){this.onSmartHarvestTrigger=e}drain(){try{const e=this.buffer.splice(0);return this.totalEvents=0,this.currentPayloadSize=0,e}catch(e){return r.default.error("Failed to drain events from buffer:",e.message),[]}}isEmpty(){return 0===this.totalEvents}size(){return this.totalEvents}clear(){this.buffer=[],this.totalEvents=0}makeRoom(e){if(e>this.maxPayloadSize)r.default.error("Event dropped: Event size exceeds maximum payload size.");else for(;(this.totalEvents>=this.maxEventsPerBatch||this.currentPayloadSize+e>=this.maxPayloadSize)&&this.buffer.length>0;){const e=this.buffer.shift(),t=(0,a.dataSize)(e);this.totalEvents--,this.currentPayloadSize-=t,r.default.warn("Event buffer full, oldest event removed.")}}}t.NrVideoEventAggregator=u,t.default=u},449:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.recordEvent=function(e,t={}){try{if(!n.default.VALID_EVENT_TYPES.includes(e))return a.default.warn("Invalid event type provided to recordEvent",{eventType:e}),!1;if(!window?.NRVIDEO?.info)return;const{appName:i,applicationID:s}=window.NRVIDEO.info,o={...t,eventType:e,...s?{}:{appName:i},timestamp:Date.now(),timeSinceLoad:window.performance?window.performance.now()/1e3:null};return r.videoAnalyticsHarvester.addEvent(o)}catch(e){return a.default.error("Failed to record event:",e.message),!1}};var r=i(487),n=s(i(51)),a=s(i(144));function s(e){return e&&e.__esModule?e:{default:e}}},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class i{constructor(){this.reset()}reset(){this.startTime=0,this.stopTime=0,this.offset=0}getDeltaTime(){return this.startTime?this.offset+((new Date).getTime()-this.startTime):null}start(){this.startTime=(new Date).getTime(),this.stopTime=0}stop(){return this.stopTime=(new Date).getTime(),this.getDeltaTime()}clone(){var e=new i;return e.startTime=this.startTime,e.stopTime=this.stopTime,e.offset=this.offset,e}}t.default=i},487:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.videoAnalyticsHarvester=void 0;var r,n=i(374),a=i(431),s=(r=i(144))&&r.__esModule?r:{default:r};const o=new class{constructor(){this.isInitialized=!1,this.harvestScheduler=null,this.eventBuffer=null}initialize(){if(this.isInitialized)s.default.warn("Video analytics agent already initialized");else try{this.eventBuffer=new a.NrVideoEventAggregator,this.harvestScheduler=new n.HarvestScheduler(this.eventBuffer),this.harvestScheduler.startScheduler(),this.isInitialized=!0,s.default.notice("Video analytics agent initialized successfully")}catch(e){s.default.error("Failed to initialize video analytics agent:",e.message)}}addEvent(e){this.isInitialized||(s.default.warn("Video analytics agent not initialized, initializing now"),this.initialize());try{return this.eventBuffer.add(e)}catch(e){return s.default.error("Failed to add event to harvesting system:",e.message),!1}}setHarvestInterval(e){this.isInitialized||this.initialize(),this.harvestScheduler.updateHarvestInterval(e)}};t.videoAnalyticsHarvester=o},568:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{on(e,t){if(this._listeners=this._listeners||{},"function"==typeof t)return this._listeners[e]=this._listeners[e]||[],this._listeners[e].push(t),this}off(e,t){if(this._listeners=this._listeners||{},this._listeners[e]){var i=this._listeners[e].indexOf(t);-1!==i&&this._listeners[e].splice(i,1)}return this}emit(e,t,i){return this._listeners=this._listeners||{},i=i||{},Array.isArray(this._listeners[t])&&this._listeners[t].forEach(r=>{r.call(this,{eventType:e,type:t,data:i,target:this})}),Array.isArray(this._listeners["*"])&&this._listeners["*"].forEach(r=>{r.call(this,{eventType:e,type:t,data:i,target:this})}),this}}},659:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.setVideoConfig=function(e){return d.setConfiguration(e)},t.videoConfiguration=void 0;var r=a(i(144)),n=a(i(51));function a(e){return e&&e.__esModule?e:{default:e}}const{COLLECTOR:s}=n.default;class o{setConfiguration(e){return this.initializeGlobalConfig(e),r.default.notice("Video analytics configuration initialized successfully"),!0}validateRequiredFields(e){if(!e||"object"!=typeof e)return r.default.error("Configuration must be an object"),!1;const{licenseKey:t,appName:i,region:n,applicationID:a,beacon:o}=e;if(!t)return r.default.error("licenseKey is required"),!1;if(a){if(!o)return r.default.error("beacon is required when applicationID is provided"),!1;if(!Object.values(s).flatMap(e=>e).includes(o))return r.default.error(`Invalid beacon: ${o}`),!1}else{if(!i||!n)return r.default.error("appName and region are required when applicationID is not provided"),!1;if(!s[n])return r.default.error(`Invalid region: ${n}. Valid regions are: ${Object.keys(s).join(", ")}`),!1}return!0}initializeGlobalConfig(e){if(!this.validateRequiredFields(e))return;let{licenseKey:t,appName:i,region:r,beacon:a,applicationID:o}=e;a="US"===r?n.default.COLLECTOR.US[0]:a||s[r],window.NRVIDEO={info:{...r?{region:r}:{},beacon:a,licenseKey:t,applicationID:o,...o?{}:{appName:i}}}}}const d=t.videoConfiguration=new o;t.default=o},793:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(i(144)),n=o(i(302)),a=o(i(328)),s=o(i(330));function o(e){return e&&e.__esModule?e:{default:e}}class d extends n.default{constructor(e,t){super(),this.state=new a.default,this.adsTracker=null,this._lastBufferType=null,this._userId=null,t=t||{},this.setOptions(t),e&&this.setPlayer(e,t.tag),r.default.notice("Tracker "+this.getTrackerName()+" v"+this.getTrackerVersion()+" is ready.")}setUserId(e){this._userId=e}setOptions(e){e&&(e.adsTracker&&this.setAdsTracker(e.adsTracker),"boolean"==typeof e.isAd&&this.setIsAd(e.isAd),n.default.prototype.setOptions.apply(this,arguments))}setPlayer(e,t){(this.player||this.tag)&&this.dispose(),"undefined"!=typeof document&&document.getElementById&&("string"==typeof e&&(e=document.getElementById(e)),"string"==typeof t&&(t=document.getElementById(t))),t=t||e,this.player=e,this.tag=t,this.registerListeners()}isAd(){return this.state.isAd()}setIsAd(e){this.state.setIsAd(e)}setAdsTracker(e){this.disposeAdsTracker(),e&&(this.adsTracker=e,this.adsTracker.setIsAd(!0),this.adsTracker.parentTracker=this,this.adsTracker.on("*",u.bind(this)))}disposeAdsTracker(){this.adsTracker&&(this.adsTracker.off("*",u),this.adsTracker.dispose())}dispose(){this.stopHeartbeat(),this.disposeAdsTracker(),this.unregisterListeners(),this.player=null,this.tag=null}registerListeners(){}unregisterListeners(){}getViewId(){return this.parentTracker?this.parentTracker.getViewId():this.state.getViewId()}getViewSession(){return this.parentTracker?this.parentTracker.getViewSession():this.state.getViewSession()}getVideoId(){return null}getTitle(){return null}isLive(){return null}getBitrate(){return null}getWebkitBitrate(){if(this.tag&&this.tag.webkitVideoDecodedByteCount){let e;if(this._lastWebkitBitrate){e=this.tag.webkitVideoDecodedByteCount;let t=e-this._lastWebkitBitrate,i=this.getHeartbeat()/1e3;e=Math.round(t/i*8)}return this._lastWebkitBitrate=this.tag.webkitVideoDecodedByteCount,e||null}}getRenditionName(){return null}getRenditionBitrate(){return null}getRenditionShift(e){let t,i=this.getRenditionBitrate();return this.isAd()?(t=this._lastAdRendition,e&&(this._lastAdRendition=i)):(t=this._lastRendition,e&&(this._lastRendition=i)),i&&t?i>t?"up":i<t?"down":null:null}getRenditionHeight(){return this.tag?this.tag.videoHeight:null}getRenditionWidth(){return this.tag?this.tag.videoWidth:null}getDuration(){return this.tag?this.tag.duration:null}getPlayhead(){return this.tag?this.tag.currentTime:null}getLanguage(){return null}getSrc(){return this.tag?this.tag.currentSrc:null}getPlayrate(){return this.tag?this.tag.playbackRate:null}isMuted(){return this.tag?this.tag.muted:null}isFullscreen(){return null}getCdn(){return null}getPlayerName(){return this.getTrackerName()}getPlayerVersion(){return s.default.version}getFps(){return null}isAutoplayed(){return this.tag?this.tag.autoplay:null}getPreload(){return this.tag?this.tag.preload:null}getAdQuartile(){return null}getAdPosition(){return this.parentTracker?this.parentTracker.state.isStarted?"mid":"pre":null}getAdPartner(){return null}getAdCreativeId(){return null}getInstrumentationProvider(){return null}getInstrumentationName(){return null}getInstrumentationVersion(){return null}getAttributes(e,t){if(void 0===(e=n.default.prototype.getAttributes.apply(this,arguments)).isAd&&(e.isAd=this.isAd()),e.viewSession=this.getViewSession(),e.viewId=this.getViewId(),e.playerName=this.getPlayerName(),e.playerVersion=this.getPlayerVersion(),e["instrumentation.provider"]=this.getInstrumentationProvider(),e["instrumentation.name"]=this.getInstrumentationName(),e["instrumentation.version"]=this.getInstrumentationVersion(),e["enduser.id"]=this._userId,e.src="Browser","customAction"===t)return e;try{e.pageUrl=window.location.href}catch(e){}this.isAd()?(e.adId=this.getVideoId(),e.adTitle=this.getTitle(),e.adSrc=this.getSrc(),e.adCdn=this.getCdn(),e.adBitrate=this.getBitrate()||this.getWebkitBitrate()||this.getRenditionBitrate(),e.adRenditionName=this.getRenditionName(),e.adRenditionBitrate=this.getRenditionBitrate(),e.adRenditionHeight=this.getRenditionHeight(),e.adRenditionWidth=this.getRenditionWidth(),e.adDuration=this.getDuration(),e.adPlayhead=this.getPlayhead(),e.adLanguage=this.getLanguage(),e.adIsMuted=this.isMuted(),e.adFps=this.getFps(),e.adPosition=this.getAdPosition(),e.adCreativeId=this.getAdCreativeId(),e.adPartner=this.getAdPartner()):(e.contentId=this.getVideoId(),e.contentTitle=this.getTitle(),e.contentSrc=this.getSrc(),e.contentCdn=this.getCdn(),e.contentPlayhead=this.getPlayhead(),e.contentIsLive=this.isLive(),e.contentBitrate=this.getBitrate()||this.getWebkitBitrate()||this.getRenditionBitrate(),e.contentRenditionName=this.getRenditionName(),e.contentRenditionBitrate=this.getRenditionBitrate(),e.contentRenditionHeight=this.getRenditionHeight(),e.contentRenditionWidth=this.getRenditionWidth(),e.contentDuration=this.getDuration(),e.contentLanguage=this.getLanguage(),e.contentPlayrate=this.getPlayrate(),e.contentIsFullscreen=this.isFullscreen(),e.contentIsMuted=this.isMuted(),e.contentIsAutoplayed=this.isAutoplayed(),e.contentPreload=this.getPreload(),e.contentFps=this.getFps(),null!=this.adsTracker&&this.adsTracker.state.totalAdPlaytime>0&&(e.totalAdPlaytime=this.adsTracker.state.totalAdPlaytime)),this.state.getStateAttributes(e);for(let t in this.customData)e[t]=this.customData[t];return e}sendCustom(e,t,i){i=i||{},this.sendVideoCustomAction(e,i),this.state.setTimeSinceAttribute(t)}sendPlayerReady(e){this.state.goPlayerReady()&&(e=e||{},this.sendVideoAction(d.Events.PLAYER_READY,e))}sendRequest(e){if(this.state.goRequest()){let t;this.isAd()?(t=d.Events.AD_REQUEST,this.sendVideoAdAction(t,e)):(t=d.Events.CONTENT_REQUEST,this.sendVideoAction(t,e))}}sendStart(e){if(this.state.goStart()){let t;this.isAd()?(t=d.Events.AD_START,this.parentTracker&&(this.parentTracker.state.isPlaying=!1),this.sendVideoAdAction(t,e)):(t=d.Events.CONTENT_START,this.sendVideoAction(t,e)),this.startHeartbeat(),this.state.goHeartbeat()}}sendEnd(e){if(this.state.goEnd()){let t;e=e||{},this.isAd()?(t=d.Events.AD_END,e.timeSinceAdRequested=this.state.timeSinceRequested.getDeltaTime(),e.timeSinceAdStarted=this.state.timeSinceStarted.getDeltaTime(),this.parentTracker&&(this.parentTracker.state.isPlaying=!0)):(t=d.Events.CONTENT_END,e.timeSinceRequested=this.state.timeSinceRequested.getDeltaTime(),e.timeSinceStarted=this.state.timeSinceStarted.getDeltaTime()),this.stopHeartbeat(),this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e),this.parentTracker&&this.isAd()&&this.parentTracker.state.goLastAd(),this.state.goViewCountUp(),this.state.totalPlaytime=0}}sendPause(e){if(this.state.goPause()){let t=this.isAd()?d.Events.AD_PAUSE:d.Events.CONTENT_PAUSE;this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e)}}sendResume(e){if(this.state.goResume()){let t;e=e||{},this.isAd()?(t=d.Events.AD_RESUME,e.timeSinceAdPaused=this.state.timeSincePaused.getDeltaTime()):(t=d.Events.CONTENT_RESUME,e.timeSincePaused=this.state.timeSincePaused.getDeltaTime()),this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e)}}sendBufferStart(e){if(this.state.goBufferStart()){let t;e=e||{},t=this.isAd()?d.Events.AD_BUFFER_START:d.Events.CONTENT_BUFFER_START,e=this.buildBufferAttributes(e),this._lastBufferType=e.bufferType,this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e)}}sendBufferEnd(e){if(this.state.goBufferEnd()){let t;e=e||{},this.isAd()?(t=d.Events.AD_BUFFER_END,e.timeSinceAdBufferBegin=this.state.timeSinceBufferBegin.getDeltaTime()):(t=d.Events.CONTENT_BUFFER_END,e.timeSinceBufferBegin=this.state.timeSinceBufferBegin.getDeltaTime()),e=this.buildBufferAttributes(e),null!=this._lastBufferType&&(e.bufferType=this._lastBufferType),this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e),this.state.initialBufferingHappened=!0}}buildBufferAttributes(e){return null==e.timeSinceStarted||e.timeSinceStarted<100?e.isInitialBuffering=!this.state.initialBufferingHappened:e.isInitialBuffering=!1,e.bufferType=this.state.calculateBufferType(e.isInitialBuffering),e.timeSinceResumed=this.state.timeSinceResumed.getDeltaTime(),e.timeSinceSeekEnd=this.state.timeSinceSeekEnd.getDeltaTime(),e}sendSeekStart(e){if(this.state.goSeekStart()){let t;t=this.isAd()?d.Events.AD_SEEK_START:d.Events.CONTENT_SEEK_START,this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e)}}sendSeekEnd(e){if(this.state.goSeekEnd()){let t;e=e||{},this.isAd()?(t=d.Events.AD_SEEK_END,e.timeSinceAdSeekBegin=this.state.timeSinceSeekBegin.getDeltaTime()):(t=d.Events.CONTENT_SEEK_END,e.timeSinceSeekBegin=this.state.timeSinceSeekBegin.getDeltaTime()),this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e)}}sendDownload(e){(e=e||{}).state||r.default.warn("Called sendDownload without { state: xxxxx }."),this.sendVideoAction(d.Events.DOWNLOAD,e),this.state.goDownload()}sendError(e){(e=e||{}).isAd=this.isAd(),this.state.goError();let t=this.isAd()?d.Events.AD_ERROR:d.Events.CONTENT_ERROR;this.sendVideoErrorAction(t,e)}sendRenditionChanged(e){let t;(e=e||{}).timeSinceLastRenditionChange=this.state.timeSinceLastRenditionChange.getDeltaTime(),e.shift=this.getRenditionShift(!0),t=this.isAd()?d.Events.AD_RENDITION_CHANGE:d.Events.CONTENT_RENDITION_CHANGE,this.isAd()?this.sendVideoAdAction(t,e):this.sendVideoAction(t,e),this.state.goRenditionChange()}sendHeartbeat(e){if(this.state.isRequested){let t,i=this.getHeartbeat();this.state._hb=!0,i=this.adjustElapsedTimeForPause(i),this.isAd()?(t=d.Events.AD_HEARTBEAT,"bitmovin-ads"===this.getPlayerName()?this.sendVideoAdAction(t,e):this.sendVideoAdAction(t,{elapsedTime:i,...e})):(t=d.Events.CONTENT_HEARTBEAT,this.sendVideoAction(t,{elapsedTime:i,...e})),this.state.goHeartbeat()}}adjustElapsedTimeForPause(e){return this.state._acc&&(e-=this.state._acc,this.state._acc=0),this.state.isPaused&&((e-=this.state.elapsedTime.getDeltaTime())<10&&(e=0),this.state.elapsedTime.start()),this.state._bufferAcc?(e-=this.state._bufferAcc,this.state._bufferAcc=0):this.state.isBuffering&&((e-=this.state.bufferElapsedTime.getDeltaTime())<5&&(e=0),this.state.bufferElapsedTime.start()),Math.max(0,e)}sendAdBreakStart(e){this.isAd()&&this.state.goAdBreakStart()&&(this.state.totalAdPlaytime=0,this.parentTracker&&(this.parentTracker.state.isPlaying=!1),this.sendVideoAdAction(d.Events.AD_BREAK_START,e))}sendAdBreakEnd(e){this.isAd()&&this.state.goAdBreakEnd()&&((e=e||{}).timeSinceAdBreakBegin=this.state.timeSinceAdBreakStart.getDeltaTime(),this.sendVideoAdAction(d.Events.AD_BREAK_END,e),this.parentTracker&&(this.parentTracker.state.isPlaying=!0),this.stopHeartbeat(),this.parentTracker&&this.isAd()&&this.parentTracker.state.goLastAd())}sendAdQuartile(e){this.isAd()&&((e=e||{}).quartile||r.default.warn("Called sendAdQuartile without { quartile: xxxxx }."),e.timeSinceLastAdQuartile=this.state.timeSinceLastAdQuartile.getDeltaTime(),this.sendVideoAdAction(d.Events.AD_QUARTILE,e),this.state.goAdQuartile())}sendAdClick(e){this.isAd()&&((e=e||{}).url||r.default.warn("Called sendAdClick without { url: xxxxx }."),this.sendVideoAdAction(d.Events.AD_CLICK,e))}}function u(e){e.type!==d.Events.AD_ERROR?this.sendVideoAdAction(e.type,e.data):this.sendVideoErrorAction(e.type,e.data)}d.Events={PLAYER_READY:"PLAYER_READY",DOWNLOAD:"DOWNLOAD",ERROR:"ERROR",CONTENT_REQUEST:"CONTENT_REQUEST",CONTENT_START:"CONTENT_START",CONTENT_END:"CONTENT_END",CONTENT_PAUSE:"CONTENT_PAUSE",CONTENT_RESUME:"CONTENT_RESUME",CONTENT_SEEK_START:"CONTENT_SEEK_START",CONTENT_SEEK_END:"CONTENT_SEEK_END",CONTENT_BUFFER_START:"CONTENT_BUFFER_START",CONTENT_BUFFER_END:"CONTENT_BUFFER_END",CONTENT_HEARTBEAT:"CONTENT_HEARTBEAT",CONTENT_RENDITION_CHANGE:"CONTENT_RENDITION_CHANGE",CONTENT_ERROR:"CONTENT_ERROR",AD_REQUEST:"AD_REQUEST",AD_START:"AD_START",AD_END:"AD_END",AD_PAUSE:"AD_PAUSE",AD_RESUME:"AD_RESUME",AD_SEEK_START:"AD_SEEK_START",AD_SEEK_END:"AD_SEEK_END",AD_BUFFER_START:"AD_BUFFER_START",AD_BUFFER_END:"AD_BUFFER_END",AD_HEARTBEAT:"AD_HEARTBEAT",AD_RENDITION_CHANGE:"AD_RENDITION_CHANGE",AD_ERROR:"AD_ERROR",AD_BREAK_START:"AD_BREAK_START",AD_BREAK_END:"AD_BREAK_END",AD_QUARTILE:"AD_QUARTILE",AD_CLICK:"AD_CLICK"},t.default=d}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,a),i.exports}var s={};(()=>{var e=s;Object.defineProperty(e,"B",{value:!0}),e.A=void 0;var t=m(a(399)),i=m(a(51)),r=m(a(455)),n=m(a(144)),o=m(a(568)),d=m(a(302)),u=m(a(793)),l=m(a(328)),c=a(431),h=a(413),f=a(28),y=a(374),p=a(449),v=a(330);function m(e){return e&&e.__esModule?e:{default:e}}const g={Constants:i.default,Chrono:r.default,Log:n.default,Emitter:o.default,Tracker:d.default,VideoTracker:u.default,VideoTrackerState:l.default,Core:t.default,version:v.version,NrVideoEventAggregator:c.NrVideoEventAggregator,RetryQueueHandler:h.RetryQueueHandler,OptimizedHttpClient:f.OptimizedHttpClient,HarvestScheduler:y.HarvestScheduler,recordEvent:p.recordEvent};e.A=g})();const o=s.B,d=s.A},64(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(i(555)),a=s(i(472));function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function u(e,t,i){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,i||[],c(e).constructor):t.apply(e,i))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}t.default=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),i=t,a=[{key:"isUsing",value:function(e){return!!e.ima3}}],(r=[{key:"getTrackerName",value:function(){return"brightcove-ima-ads"}},{key:"getPlayerName",value:function(){return"brightcove-ima-ads"}},{key:"getPlayhead",value:function(){var e;return null===(e=this.player)||void 0===e||null===(e=e.ima3)||void 0===e||null===(e=e.adPlayer)||void 0===e?void 0:e.currentTime()}},{key:"registerListeners",value:function(){n.default.Log.debugCommonVideoEvents(this.player,[null,"ima3-ready","ima3error","ima3-ad-error","ima3-started","ima3-complete","ima3-paused","ima3-resumed","ads-request","ads-load","ads-ad-started","ads-ad-ended","ads-pause","ads-play","ads-click","ads-pod-started","ads-pod-ended","ads-allpods-completed"]),this.player.on("ima3-started",this.onStarted.bind(this)),this.player.on("ima3-paused",this.onPaused.bind(this)),this.player.on("ima3-resumed",this.onResume.bind(this)),this.player.on("ima3-complete",this.onComplete.bind(this)),this.player.on("ima3-skipped",this.onSkipped.bind(this)),this.player.on("adserror",this.onError.bind(this)),this.player.on("ads-click",this.onClick.bind(this))}},{key:"unregisterListeners",value:function(){this.player.off("ima3-started",this.onStarted),this.player.off("ima3-paused",this.onPaused),this.player.off("ima3-resumed",this.onResume),this.player.off("ima3-complete",this.onComplete),this.player.off("ima3-skipped",this.onSkipped),this.player.off("adserror",this.onError),this.player.off("ads-click",this.onClick)}},{key:"onStarted",value:function(e){this.sendRequest(),this.sendStart()}},{key:"onPaused",value:function(e){this.sendPause()}},{key:"onResume",value:function(e){this.sendResume()}},{key:"onComplete",value:function(e){this.sendEnd()}},{key:"onSkipped",value:function(e){this.sendEnd({skipped:!0})}},{key:"onError",value:function(e){this.sendError()}},{key:"onClick",value:function(e){this.sendClick()}}])&&o(i.prototype,r),a&&o(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(a.default)},717(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(i(555)),a=s(i(472));function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,a,s,o=[],d=!0,u=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;d=!1}else for(;!(d=(r=a.call(i)).done)&&(o.push(r.value),o.length!==t);d=!0);}catch(e){u=!0,n=e}finally{try{if(!d&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function u(e,t,i){return(t=c(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function h(e,t,i){return t=v(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,i||[],v(e).constructor):t.apply(e,i))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function y(e,t,i,r){var n=p(v(1&r?e.prototype:e),t,i);return 2&r&&"function"==typeof n?function(e){return n.apply(i,e)}:n}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(arguments.length<3?e:i):n.value}},p.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g={DAI_STREAM_INITIALIZED:"dai-stream-initialized",DAI_STREAM_LOADED:"dai-stream-loaded",DAI_STREAM_ERROR:"dai-stream-error",DAI_AD_BREAK_STARTED:"dai-ad-break-started",DAI_AD_BREAK_ENDED:"dai-ad-break-ended",DAI_AD_PERIOD_STARTED:"dai-ad-period-started",DAI_AD_PERIOD_ENDED:"dai-ad-period-ended",DAI_AD_STARTED:"dai-ad-started",DAI_AD_FIRST_QUARTILE:"dai-ad-first-quartile",DAI_AD_MIDPOINT:"dai-ad-midpoint",DAI_AD_THIRD_QUARTILE:"dai-ad-third-quartile",DAI_AD_COMPLETE:"dai-ad-complete",DAI_AD_SKIPPED:"dai-ad-skipped",DAI_AD_PAUSED:"dai-ad-paused",DAI_AD_RESUMED:"dai-ad-resumed",DAI_AD_CLICKED:"dai-ad-clicked",DAI_AD_ERROR:"dai-ad-error",DAI_CUEPOINTS_CHANGED:"dai-cuepoints-changed",DAI_TIMED_METADATA:"dai-timed-metadata"};t.default=function(e){function t(e){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=h(this,t,[e])).streamManager=null,i.currentAdData=null,i.adBreakData=null,i.streamData=null,i.cuePoints=[],i.initialized=!1,i.eventHandlers=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),i=t,a=[{key:"isUsing",value:function(e){return e.imaDai&&"function"==typeof e.imaDai||e.dai&&void 0!==e.dai.VERSION||e.ima&&e.ima.dai||e.streamManager}}],(r=[{key:"setStreamManager",value:function(e){this.streamManager=e,this.setupStreamManagerListeners(),this.initialized=!0,n.default.Log.debug("DaiAdsTracker: StreamManager set and listeners registered")}},{key:"setupStreamManagerListeners",value:function(){var e,t,i=this;if(this.streamManager&&null!==(e=google)&&void 0!==e&&null!==(e=e.ima)&&void 0!==e&&null!==(e=e.dai)&&void 0!==e&&null!==(e=e.api)&&void 0!==e&&e.StreamEvent){var r=google.ima.dai.api.StreamEvent.Type;this.eventHandlers=(u(u(u(u(u(u(u(u(u(u(t={},r.LOADED,this.onStreamLoaded.bind(this)),r.STREAM_INITIALIZED,this.onStreamInitialized.bind(this)),r.ERROR,this.onStreamError.bind(this)),r.AD_BREAK_STARTED,this.onAdBreakStarted.bind(this)),r.AD_BREAK_ENDED,this.onAdBreakEnded.bind(this)),r.AD_PERIOD_STARTED,this.onAdPeriodStarted.bind(this)),r.AD_PERIOD_ENDED,this.onAdPeriodEnded.bind(this)),r.STARTED,this.onAdStarted.bind(this)),r.FIRST_QUARTILE,this.onAdFirstQuartile.bind(this)),r.MIDPOINT,this.onAdMidpoint.bind(this)),u(u(u(u(u(u(u(u(u(t,r.THIRD_QUARTILE,this.onAdThirdQuartile.bind(this)),r.COMPLETE,this.onAdComplete.bind(this)),r.SKIPPED,this.onAdSkipped.bind(this)),r.PAUSED,this.onAdPaused.bind(this)),r.RESUMED,this.onAdResumed.bind(this)),r.CLICK,this.onAdClicked.bind(this)),r.VIDEO_CLICKED,this.onAdClicked.bind(this)),r.CUEPOINTS_CHANGED,this.onCuePointsChanged.bind(this)),r.TIMED_METADATA,this.onTimedMetadata.bind(this))),Object.entries(this.eventHandlers).forEach(function(e){var t=o(e,2),r=t[0],n=t[1];i.streamManager.addEventListener(r,n)}),n.default.Log.debug("DaiAdsTracker: StreamManager listeners registered")}else n.default.Log.warn("DaiAdsTracker: StreamManager or DAI API not available")}},{key:"registerListeners",value:function(){y(t,"registerListeners",this,3)([]),n.default.Log.debugCommonVideoEvents(this.player,[null,Object.values(g)])}},{key:"unregisterListeners",value:function(){var e=this;y(t,"unregisterListeners",this,3)([]),this.streamManager&&this.eventHandlers&&Object.entries(this.eventHandlers).forEach(function(t){var i=o(t,2),r=i[0],n=i[1];e.streamManager.removeEventListener(r,n)}),this.streamManager=null,this.currentAdData=null,this.adBreakData=null,this.streamData=null,this.cuePoints=[],this.initialized=!1,this.eventHandlers=null}},{key:"onStreamLoaded",value:function(e){this.streamData=this.extractStreamData(e),n.default.Log.debug("DaiAdsTracker: Stream loaded",this.streamData),this.sendRequest()}},{key:"onStreamInitialized",value:function(e){n.default.Log.debug("DaiAdsTracker: Stream initialized"),this.sendDownload({state:"stream-initialized"})}},{key:"onStreamError",value:function(e){var t=this.extractErrorData(e);n.default.Log.error("DaiAdsTracker: Stream error",t),this.sendError(t)}},{key:"onAdBreakStarted",value:function(e){this.adBreakData=this.extractAdBreakData(e),n.default.Log.debug("DaiAdsTracker: Ad break started",this.adBreakData),this.sendAdBreakStart(this.adBreakData)}},{key:"onAdBreakEnded",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad break ended"),this.sendAdBreakEnd(),this.adBreakData=null}},{key:"onAdPeriodStarted",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad period started"),this.adBreakData||this.onAdBreakStarted(e)}},{key:"onAdPeriodEnded",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad period ended")}},{key:"onAdStarted",value:function(e){this.currentAdData=this.extractAdData(e),n.default.Log.debug("DaiAdsTracker: Ad started",this.currentAdData),this.sendStart()}},{key:"onAdFirstQuartile",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad first quartile"),this.sendAdQuartile({quartile:1})}},{key:"onAdMidpoint",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad midpoint"),this.sendAdQuartile({quartile:2})}},{key:"onAdThirdQuartile",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad third quartile"),this.sendAdQuartile({quartile:3})}},{key:"onAdComplete",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad complete"),this.sendEnd(),this.currentAdData=null}},{key:"onAdSkipped",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad skipped"),this.sendEnd({skipped:!0}),this.currentAdData=null}},{key:"onAdPaused",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad paused"),this.sendPause()}},{key:"onAdResumed",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad resumed"),this.sendResume()}},{key:"onAdClicked",value:function(e){n.default.Log.debug("DaiAdsTracker: Ad clicked"),this.sendAdClick({url:this.getClickThroughUrl()})}},{key:"onCuePointsChanged",value:function(e){this.cuePoints=this.extractCuePoints(e),n.default.Log.debug("DaiAdsTracker: Cue points changed",this.cuePoints)}},{key:"onTimedMetadata",value:function(e){var t=this.extractTimedMetadata(e);n.default.Log.debug("DaiAdsTracker: Timed metadata",t)}},{key:"extractStreamData",value:function(e){try{var t=e.getStreamData();return{streamId:null==t?void 0:t.streamId,url:null==t?void 0:t.url,adTagParameters:null==t?void 0:t.adTagParameters,streamType:this.getStreamType()}}catch(e){return n.default.Log.warn("DaiAdsTracker: Failed to extract stream data",e),{}}}},{key:"extractAdBreakData",value:function(e){try{var t,i=e.getAdBreak();return{adBreakId:null==i?void 0:i.id,adBreakTitle:null==i?void 0:i.title,adCount:(null==i||null===(t=i.ads)||void 0===t?void 0:t.length)||0,position:this.getAdPosition()}}catch(e){return n.default.Log.warn("DaiAdsTracker: Failed to extract ad break data",e),{}}}},{key:"extractAdData",value:function(e){try{var t=e.getAd();return{adId:null==t?void 0:t.getAdId(),creativeId:null==t?void 0:t.getCreativeId(),duration:null==t?void 0:t.getDuration(),title:null==t?void 0:t.getTitle(),description:null==t?void 0:t.getDescription(),advertiserName:null==t?void 0:t.getAdvertiserName(),clickThroughUrl:null==t?void 0:t.getClickThroughUrl(),dealId:null==t?void 0:t.getDealId(),wrapperAdIds:null==t?void 0:t.getWrapperAdIds(),position:this.getAdPosition()}}catch(e){return n.default.Log.warn("DaiAdsTracker: Failed to extract ad data",e),{}}}},{key:"extractErrorData",value:function(e){try{var t=e.getError();return{errorCode:null==t?void 0:t.getErrorCode(),errorMessage:null==t?void 0:t.getMessage(),innerError:null==t?void 0:t.getInnerError()}}catch(t){return n.default.Log.warn("DaiAdsTracker: Failed to extract error data",t),{errorMessage:"Unknown DAI error"}}}},{key:"extractCuePoints",value:function(e){try{return e.getCuepoints()||[]}catch(e){return n.default.Log.warn("DaiAdsTracker: Failed to extract cue points",e),[]}}},{key:"extractTimedMetadata",value:function(e){try{return{type:e.getType(),data:e.getData()}}catch(e){return n.default.Log.warn("DaiAdsTracker: Failed to extract timed metadata",e),{}}}},{key:"getTrackerName",value:function(){return"dai-ads"}},{key:"getPlayerName",value:function(){return"videojs-dai"}},{key:"getPlayerVersion",value:function(){var e,t;return null!==(e=this.player.dai)&&void 0!==e&&e.VERSION?this.player.dai.VERSION:null!==(t=this.player.ima)&&void 0!==t&&t.VERSION?"ima-dai: ".concat(this.player.ima.VERSION):"unknown"}},{key:"getAdCuePoints",value:function(){return this.cuePoints}},{key:"getAdPosition",value:function(){if(!this.currentAdData&&!this.adBreakData)return null;var e=this.player.currentTime(),t=this.player.duration();return e<5?"pre":t&&e>t-10?"post":"mid"}},{key:"getDuration",value:function(){var e;return void 0!==(null===(e=this.currentAdData)||void 0===e?void 0:e.duration)?1e3*this.currentAdData.duration:null}},{key:"getVideoId",value:function(){var e;return(null===(e=this.currentAdData)||void 0===e?void 0:e.adId)||null}},{key:"getAdCreativeId",value:function(){var e;return(null===(e=this.currentAdData)||void 0===e?void 0:e.creativeId)||null}},{key:"getTitle",value:function(){var e;return(null===(e=this.currentAdData)||void 0===e?void 0:e.title)||null}},{key:"getSrc",value:function(){var e;return(null===(e=this.streamData)||void 0===e?void 0:e.url)||null}},{key:"getPlayhead",value:function(){if(this.streamManager)try{return 1e3*this.streamManager.getStreamTime()}catch(e){return 1e3*this.player.currentTime()}return 1e3*this.player.currentTime()}},{key:"getAdPartner",value:function(){return"google-dai"}},{key:"getClickThroughUrl",value:function(){var e;return(null===(e=this.currentAdData)||void 0===e?void 0:e.clickThroughUrl)||null}},{key:"getStreamType",value:function(){var e;return null!==(e=this.streamData)&&void 0!==e&&e.streamType?this.streamData.streamType:this.player.duration()===1/0?"live":"vod"}},{key:"isLiveStream",value:function(){return"live"===this.getStreamType()}},{key:"getCurrentAdBreak",value:function(){return this.adBreakData}},{key:"getCurrentAd",value:function(){return this.currentAdData}},{key:"getStreamData",value:function(){return this.streamData}},{key:"getBitrate",value:function(){var e=this.getTech();if(e&&e.tech&&e.tech.stats)return e.tech.stats.bandwidth}},{key:"getRenditionBitrate",value:function(){var e=this.getTech();if(e&&e.getRenditionBitrate)return e.getRenditionBitrate()}}])&&l(i.prototype,r),a&&l(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(a.default)},38(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,a=(n=i(472))&&n.__esModule?n:{default:n};function s(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function d(e,t,i){return t=l(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,i||[],l(e).constructor):t.apply(e,i))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}t.default=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),function(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"getTrackerName",value:function(){return"freewheel-ads"}},{key:"getPlayerName",value:function(){return"freewheel-ads"}},{key:"getPlayerVersion",value:function(){return this.player.FreeWheelPlugin.VERSION}},{key:"getPlayhead",value:function(){if(this.player.ads.ad.currentTime)return 1e3*this.player.ads.ad.currentTime()}},{key:"getDuration",value:function(){if(this.player.ads.ad.duration)return 1e3*this.player.ads.ad.duration}},{key:"getVideoId",value:function(){return this.player.ads.ad.id}},{key:"getAdPartner",value:function(){return"freewheel"}},{key:"getAdCreativeId",value:function(){try{return this.player.ads.provider.event.adInstance.getActiveCreativeRendition().getId()}catch(e){}}},{key:"getSrc",value:function(){try{return this.player.ads.provider.event.adInstance.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl()}catch(e){}}},{key:"getTitle",value:function(){try{return this.player.ads.provider.event.adInstance.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getName()}catch(e){}}},{key:"getAdPosition",value:function(){switch(this.player.ads.ad.type){case"PREROLL":return nrvideo.Constants.AdPositions.PRE;case"MIDROLL":return nrvideo.Constants.AdPositions.MID;case"POSTROLL":return nrvideo.Constants.AdPositions.POST}}}],[{key:"isUsing",value:function(e){return!!e.FreeWheelPlugin&&"undefined"!=typeof tv&&tv.freewheel}}])}(a.default)},298(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(i(555)),a=s(i(472));function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function u(e,t,i){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,i||[],c(e).constructor):t.apply(e,i))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}t.default=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),i=t,r=[{key:"getTrackerName",value:function(){return"ima-ads"}},{key:"getPlayerName",value:function(){return"ima"}},{key:"getPlayerVersion",value:function(){return"ima: "+google.ima.VERSION+"; contrib-ads: "+this.player.ads.VERSION}},{key:"getCuePoints",value:function(){return this.player.ima.getAdsManager().getCuePoints()}},{key:"getAdPosition",value:function(){if(this.lastAdData&&this.lastAdData.podInfo&&void 0!==this.lastAdData.podInfo.podIndex){var e=this.lastAdData.podInfo.podIndex;return 0===e?"pre":-1===e?"post":"mid"}return null}},{key:"getDuration",value:function(){return this.lastAdData&&void 0!==this.lastAdData.duration?1e3*this.lastAdData.duration:null}},{key:"getVideoId",value:function(){return this.lastAdData&&this.lastAdData.adId?this.lastAdData.adId:null}},{key:"getAdCreativeId",value:function(){return this.lastAdData&&this.lastAdData.creativeId?this.lastAdData.creativeId:null}},{key:"getSrc",value:function(){return this.lastAdData&&this.lastAdData.mediaUrl?this.lastAdData.mediaUrl:null}},{key:"getTitle",value:function(){return this.lastAdData&&this.lastAdData.title?this.lastAdData.title:null}},{key:"getPlayhead",value:function(){var e=this.player.ima.getAdsManager();if(e)return 1e3*(this.getDuration()-e.getRemainingTime())}},{key:"getPlayrate",value:function(){return this.player.playbackRate()}},{key:"getAdPartner",value:function(){return"ima"}},{key:"getWebkitBitrate",value:function(){var e=this.getAdVideoElement();if(e&&e.webkitVideoDecodedByteCount){var t;if(this._lastAdWebkitBitrate>0){var i=e.webkitVideoDecodedByteCount-this._lastAdWebkitBitrate,r=this.getHeartbeat()/1e3;t=Math.round(i/r*8)}return this._lastAdWebkitBitrate=e.webkitVideoDecodedByteCount,null!=t?t:null}return null}},{key:"getRenditionBitrate",value:function(){if(this.lastAdData)return this.lastAdData.renditionBitrate}},{key:"registerListeners",value:function(){var e=google.ima.AdEvent.Type,t=google.ima.AdErrorEvent.Type.AD_ERROR;this.lastAdData=null,n.default.Log.debugCommonVideoEvents(this.player.ima.addEventListener,[null,e.ALL_ADS_COMPLETED,e.LINEAR_CHANGED,e.COMPLETE,e.USER_CLOSE,e.IMPRESSION,e.CONTENT_PAUSE_REQUESTED,e.CONTENT_RESUME_REQUESTED,e.SKIPPED,e.SKIPPABLE_STATE_CHANGED,e.LOADED,e.PAUSED,e.RESUMED,e.STARTED,e.AD_CAN_PLAY,e.AD_METADATA,e.EXPANDED_CHANGED,e.AD_BREAK_READY,e.LOG,e.CLICK,e.FIRST_QUARTILE,e.MIDPOINT,e.THIRD_QUARTILE,t]),this.player.ima.addEventListener(e.LOADED,this.onLoaded.bind(this)),this.player.ima.addEventListener(e.STARTED,this.onStart.bind(this)),this.player.ima.addEventListener(e.PAUSED,this.onPaused.bind(this)),this.player.ima.addEventListener(e.RESUMED,this.onResumed.bind(this)),this.player.ima.addEventListener(e.COMPLETE,this.onComplete.bind(this)),this.player.ima.addEventListener(e.SKIPPED,this.onSkipped.bind(this)),this.player.ima.addEventListener(e.CLICK,this.onClick.bind(this)),this.player.ima.addEventListener(e.FIRST_QUARTILE,this.onFirstQuartile.bind(this)),this.player.ima.addEventListener(e.MIDPOINT,this.onMidpoint.bind(this)),this.player.ima.addEventListener(e.THIRD_QUARTILE,this.onThirdQuartile.bind(this)),this.player.ima.addEventListener(t,this.onError.bind(this))}},{key:"unregisterListeners",value:function(){var e=google.ima.AdEvent.Type,t=google.ima.AdErrorEvent.Type.AD_ERROR;this.player.ima.removeEventListener(e.LOADED,this.onLoaded),this.player.ima.removeEventListener(e.STARTED,this.onLoaded.bind(this)),this.player.ima.removeEventListener(e.IMPRESSION,this.onImpression),this.player.ima.removeEventListener(e.PAUSED,this.onPaused),this.player.ima.removeEventListener(e.RESUMED,this.onResumed),this.player.ima.removeEventListener(e.COMPLETE,this.onComplete),this.player.ima.removeEventListener(e.SKIPPED,this.onSkipped),this.player.ima.removeEventListener(e.CLICK,this.onClick),this.player.ima.removeEventListener(e.FIRST_QUARTILE,this.onFirstQuartile),this.player.ima.removeEventListener(e.MIDPOINT,this.onMidpoint),this.player.ima.removeEventListener(e.THIRD_QUARTILE,this.onThirdQuartile),this.player.ima.removeEventListener(t,this.onError),this.lastAdData=null}},{key:"onLoaded",value:function(e){this.lastAdData=this.getAdData(),this.sendRequest()}},{key:"onStart",value:function(e){this.lastAdData=this.getAdData(),this._lastAdWebkitBitrate=0,this.sendStart()}},{key:"onComplete",value:function(e){this.sendEnd(),this.lastAdData=null}},{key:"onSkipped",value:function(e){this.sendEnd({skipped:!0}),this.lastAdData=null}},{key:"onError",value:function(e){var t=e.getError(),i=t.getErrorCode(),r=t.getMessage();this.sendError({adError:t,errorCode:i,errorMessage:r})}},{key:"onClick",value:function(e){this.sendAdClick()}},{key:"onFirstQuartile",value:function(){this.sendAdQuartile({adQuartile:1})}},{key:"onMidpoint",value:function(){this.sendAdQuartile({adQuartile:2})}},{key:"onThirdQuartile",value:function(){this.sendAdQuartile({adQuartile:3})}},{key:"onPaused",value:function(){this.sendPause()}},{key:"onResumed",value:function(){this.sendResume()}},{key:"getAdData",value:function(){try{var e=this.player.ima.getAdsManager();if(e){var t,i=e.getCurrentAd();if(i)return{adId:i.getAdId(),creativeId:i.getCreativeId(),duration:i.getDuration(),mediaUrl:i.getMediaUrl(),title:i.getTitle(),podInfo:null===(t=i.getAdPodInfo())||void 0===t?void 0:t.data,renditionBitrate:i.getVastMediaBitrate()}}return null}catch(e){return null}}},{key:"getAdVideoElement",value:function(){if(this.player.ima&&this.player.ima.controller&&this.player.ima.controller.adUi){var e=this.player.ima.controller.adUi.adContainerDiv;if(e){var t=e.querySelector("video");if(t)return t}}}}],a=[{key:"isUsing",value:function(e){return e.ima&&"undefined"!=typeof google}}],r&&o(i.prototype,r),a&&o(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(a.default)},472(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=u(i(555)),a=u(i(330)),s=u(i(409)),o=u(i(257)),d=u(i(338));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function h(e,t,i){return t=y(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,i||[],y(e).constructor):t.apply(e,i))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}t.default=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),i=t,(r=[{key:"getTech",value:function(){var e=this.player.tech({IWillNotUseThisInPlugins:!0});if(e){if(s.default.isUsing(e))return new s.default(e);if(o.default.isUsing(e))return new o.default(e);if(d.default.isUsing(e))return new d.default(e)}}},{key:"getTrackerName",value:function(){return"videojs-ads"}},{key:"getTrackerVersion",value:function(){return a.default.version}},{key:"isMuted",value:function(){return this.player.muted()}},{key:"getRenditionHeight",value:function(){return null}},{key:"getRenditionWidth",value:function(){return null}},{key:"getPlayerName",value:function(){return"videojs-ads"}},{key:"getPlayerVersion",value:function(){return this.player.ads.VERSION}},{key:"registerListeners",value:function(){n.default.Log.debugCommonVideoEvents(this.player,[null,"ads-request","ads-load","adstart","adend","adskip","adserror","ads-click","ads-pod-started","ads-pod-ended","ads-first-quartile","ads-midpoint","ads-third-quartile","ads-pause","ads-play","adtimeout"]),this.player.on("ads-request",this.onAdrequest.bind(this)),this.player.on("ads-load",this.onAdload.bind(this)),this.player.on("adstart",this.onAdstart.bind(this)),this.player.on("adend",this.onAdend.bind(this)),this.player.on("adskip",this.onAdskip.bind(this)),this.player.on("adserror",this.onAdserror.bind(this)),this.player.on("ads-click",this.onAdsClick.bind(this)),this.player.on("ads-pod-started",this.onPodStart.bind(this)),this.player.on("ads-pod-ended",this.onPodEnd.bind(this)),this.player.on("ads-first-quartile",this.onFirstQuartile.bind(this)),this.player.on("ads-midpoint",this.onMidpoint.bind(this)),this.player.on("ads-third-quartile",this.onThirdQuartile.bind(this)),this.player.on("ads-pause",this.onAdspause.bind(this)),this.player.on("ads-play",this.onAdsplay.bind(this))}},{key:"unregisterListeners",value:function(){this.player.off("ads-request",this.onAdrequest),this.player.off("ads-load",this.onAdload),this.player.off("adstart",this.onAdstart),this.player.off("adend",this.onAdend),this.player.off("adskip",this.onAdskip),this.player.off("adserror",this.onAdserror),this.player.off("ads-click",this.onAdsClick),this.player.off("ads-pod-started",this.onPodStart),this.player.off("ads-pod-ended",this.onPodEnd),this.player.off("ads-first-quartile",this.onFirstQuartile),this.player.off("ads-midpoint",this.onMidpoint),this.player.off("ads-third-quartile",this.onThirdQuartile),this.player.off("ads-pause",this.onAdspause),this.player.off("ads-play",this.onAdsplay)}},{key:"onAdrequest",value:function(e){this.sendRequest(),this.sendDownload({state:"ads-request"})}},{key:"onAdload",value:function(e){this.sendDownload({state:"ads-load"})}},{key:"onAdstart",value:function(e){this.sendRequest(),this.sendStart()}},{key:"onAdend",value:function(e){this.sendEnd()}},{key:"onAdskip",value:function(e){this.sendEnd({skipped:!0})}},{key:"onAdserror",value:function(e){this.sendError()}},{key:"onAdsClick",value:function(e){this.sendAdClick({url:"unknown"})}},{key:"onPodStart",value:function(e){this.sendAdBreakStart()}},{key:"onPodEnd",value:function(e){this.sendAdBreakEnd()}},{key:"onFirstQuartile",value:function(){this.sendAdQuartile({quartile:1})}},{key:"onMidpoint",value:function(){this.sendAdQuartile({quartile:2})}},{key:"onThirdQuartile",value:function(){this.sendAdQuartile({quartile:3})}},{key:"onAdspause",value:function(){this.sendPause()}},{key:"onAdsplay",value:function(){this.sendResume()}}])&&l(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r}(n.default.VideoTracker)},409(e,t){function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function n(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,(t.default=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tech=t.vhs,this.player=t.el().player},(t=[{key:"getRenditionName",value:function(){try{var e=this.tech.playlists.media();if(e&&e.attributes)return e.attributes.NAME}catch(e){}return null}},{key:"getRenditionBitrate",value:function(){try{var e=this.tech.playlists.media();if(e&&e.attributes)return e.attributes.BANDWIDTH}catch(e){}return null}},{key:"getRenditionWidth",value:function(){try{var e=this.tech.playlists.media();if(e&&e.attributes&&e.attributes.RESOLUTION)return e.attributes.RESOLUTION.width}catch(e){}return null}},{key:"getRenditionHeight",value:function(){try{var e=this.tech.playlists.media();if(e&&e.attributes&&e.attributes.RESOLUTION)return e.attributes.RESOLUTION.height}catch(e){}return null}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){try{if(this.tech.stats&&this.player){var e=this.tech.stats;if(e.mediaBytesTransferred>0&&e.mediaRequests>0){var t=this.player.currentTime()/(this.player.playbackRate()||1);if(t>0)return 8*e.mediaBytesTransferred/t}}if(void 0!==this.tech.bandwidth&&this.tech.bandwidth>0)return this.tech.bandwidth;if(void 0!==this.tech.systemBandwidth&&this.tech.systemBandwidth>0)return this.tech.systemBandwidth}catch(e){}return null}}])&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()).isUsing=function(e){return!!e.vhs}},257(e,t){function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function n(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,(t.default=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tech=t.vhs_,this.player=t.el().player},(t=[{key:"getResource",value:function(e){return this.tech.url}},{key:"getRenditionName",value:function(e){try{var t=this.tech.levels[this.tech.currentLevel];if(t&&t.name)return t.name}catch(e){}return null}},{key:"getRenditionBitrate",value:function(e){try{var t=this.tech.levels[this.tech.currentLevel];if(t&&t.bitrate)return t.bitrate}catch(e){}return null}},{key:"getRenditionWidth",value:function(e){try{var t=this.tech.levels[this.tech.currentLevel];if(t&&t.width)return t.width}catch(e){}return null}},{key:"getRenditionHeight",value:function(e){try{var t=this.tech.levels[this.tech.currentLevel];if(t&&t.height)return t.height}catch(e){}return null}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){try{if(this.tech.stats&&this.player){var e=this.tech.stats;if(e.mediaBytesTransferred>0&&e.mediaRequests>0){var t=this.player.currentTime()/(this.player.playbackRate()||1);if(t>0)return 8*e.mediaBytesTransferred/t}}}catch(e){}return null}}])&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()).isUsing=function(e){return!!e.vhs_}},338(e,t){function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function n(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,(t.default=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tech=t.shakaPlayer,this.player=t.el().player},(t=[{key:"getSrc",value:function(e){try{return this.tech.getManifestUri()}catch(e){}return null}},{key:"getRenditionBitrate",value:function(e){try{return this.tech.getStats().streamBandwidth}catch(e){}return null}},{key:"getRenditionWidth",value:function(e){try{var t=this.tech.getVariantTracks();for(var i in t){var r=t[i];if(r.active&&"video"===r.type)return r.width}}catch(e){}return null}},{key:"getRenditionHeight",value:function(e){try{var t=this.tech.getVariantTracks();for(var i in t){var r=t[i];if(r.active&&"video"===r.type)return r.height}}catch(e){}return null}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){try{var e=this.tech.getStats();if(e){if(e.estimatedBandwidth&&e.estimatedBandwidth>0)return e.estimatedBandwidth;if(e.streamBandwidth&&e.streamBandwidth>0)return e.streamBandwidth}}catch(e){}return null}}])&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()).isUsing=function(e){return!!e.shakaPlayer}},302(e,t,i){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BrightcoveImaAdsTracker",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"ContribHlsTech",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"FreewheelAdsTracker",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"HlsJsTech",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"ImaAdsTracker",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"ShakaTech",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"VideojsAdsTracker",{enumerable:!0,get:function(){return u.default}}),t.default=void 0;var n=y(i(555)),a=y(i(330)),s=y(i(409)),o=y(i(257)),d=y(i(338)),u=y(i(472)),l=y(i(298)),c=y(i(64)),h=y(i(38)),f=y(i(717));function y(e){return e&&e.__esModule?e:{default:e}}function p(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function v(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}function m(e,t,i){return t=A(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,g()?Reflect.construct(t,i||[],A(e).constructor):t.apply(e,i))}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}t.default=function(e){function t(e,i){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=m(this,t,[e,i])).isContentEnd=!1,r.imaAdCuePoints="",r.daiInitialized=!1,n.default.Core.addTracker(r,i),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(t,e),i=t,r=[{key:"getTech",value:function(){var e=this.player.tech({IWillNotUseThisInPlugins:!0});if(e){if(s.default.isUsing(e))return new s.default(e);if(o.default.isUsing(e))return new o.default(e);if(d.default.isUsing(e))return new d.default(e)}}},{key:"getTrackerName",value:function(){return"videojs"}},{key:"getInstrumentationProvider",value:function(){return"New Relic"}},{key:"getInstrumentationName",value:function(){return this.getPlayerName()}},{key:"getInstrumentationVersion",value:function(){return this.getPlayerVersion()}},{key:"getTrackerVersion",value:function(){return a.default.version}},{key:"getPlayhead",value:function(){return this.player.ads&&"ads-playback"===this.player.ads.state&&this.player.ads.snapshot&&this.player.ads.snapshot.currentTime?1e3*this.player.ads.snapshot.currentTime:this.player.absoluteTime?1e3*this.player.absoluteTime():1e3*this.player.currentTime()}},{key:"getDuration",value:function(){return this.player.mediainfo&&void 0!==this.player.mediainfo.duration?1e3*this.player.mediainfo.duration:1e3*this.player.duration()}},{key:"getTitle",value:function(){var e;return null===(e=this.player)||void 0===e||null===(e=e.mediainfo)||void 0===e?void 0:e.name}},{key:"getId",value:function(){var e;return null===(e=this.player)||void 0===e||null===(e=e.mediainfo)||void 0===e?void 0:e.id}},{key:"getLanguage",value:function(){var e;return null===(e=this.player)||void 0===e?void 0:e.language()}},{key:"getSrc",value:function(){var e=this.getTech();return e&&e.getSrc?e.getSrc():this.player.currentSrc()}},{key:"getPlayerName",value:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.name())||"videojs"}},{key:"getPlayerVersion",value:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.version)||videojs.VERSION}},{key:"isMuted",value:function(){return this.player.muted()}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){var e,t=this.player.tech({IWillNotUseThisInPlugins:!0});if(null!=t&&null!==(e=t.vhs)&&void 0!==e&&e.stats){var i=t.vhs.stats;if(i.mediaBytesTransferred>0&&i.mediaRequests>0){var r=this.player.currentTime()/(this.player.playbackRate()||1);if(r>0)return 8*i.mediaBytesTransferred/r}}var n=this.getTech();return null!=n&&n.getBitrate?n.getBitrate():null}},{key:"getRenditionName",value:function(){var e=this.getTech();if(e&&e.getRenditionName)return e.getRenditionName()}},{key:"getRenditionBitrate",value:function(){var e=this.getTech();if(e&&e.getRenditionBitrate)return e.getRenditionBitrate()}},{key:"getRenditionHeight",value:function(){var e=this.getTech();return e&&e.getRenditionHeight?e.getRenditionHeight():this.player.videoHeight()}},{key:"getRenditionWidth",value:function(){var e=this.getTech();return e&&e.getRenditionWidth?e.getRenditionWidth():this.player.videoWidth()}},{key:"getPlayrate",value:function(){return this.player.playbackRate()}},{key:"isAutoplayed",value:function(){return this.player.autoplay()}},{key:"isFullscreen",value:function(){return this.player.isFullscreen()}},{key:"getPreload",value:function(){return this.player.preload()}},{key:"registerListeners",value:function(){n.default.Log.debugCommonVideoEvents(this.player,["adstart","adend","adskip","adsready","adserror","dispose"]),this.onDownload=this.onDownload.bind(this),this.onAdsready=this.onAdsready.bind(this),this.onAdStart=this.onAdStart.bind(this),this.onAdEnd=this.onAdEnd.bind(this),this.onPlay=this.onPlay.bind(this),this.onPause=this.onPause.bind(this),this.onPlaying=this.onPlaying.bind(this),this.onAbort=this.onAbort.bind(this),this.onEnded=this.onEnded.bind(this),this.onDispose=this.onDispose.bind(this),this.onSeeking=this.onSeeking.bind(this),this.onSeeked=this.onSeeked.bind(this),this.onError=this.onError.bind(this),this.onWaiting=this.onWaiting.bind(this),this.onTimeupdate=this.onTimeupdate.bind(this),this.OnAdsAllpodsCompleted=this.OnAdsAllpodsCompleted.bind(this),this.onStreamManager=this.onStreamManager.bind(this),this.player.on("loadstart",this.onDownload),this.player.on("loadeddata",this.onDownload),this.player.on("loadedmetadata",this.onDownload),this.player.on("adsready",this.onAdsready),this.player.on("adstart",this.onAdStart),this.player.on("adend",this.onAdEnd),this.player.on("play",this.onPlay),this.player.on("pause",this.onPause),this.player.on("playing",this.onPlaying),this.player.on("abort",this.onAbort),this.player.on("ended",this.onEnded),this.player.on("dispose",this.onDispose),this.player.on("seeking",this.onSeeking),this.player.on("seeked",this.onSeeked),this.player.on("error",this.onError),this.player.on("waiting",this.onWaiting),this.player.on("timeupdate",this.onTimeupdate),this.player.on("ads-allpods-completed",this.OnAdsAllpodsCompleted),this.player.on("stream-manager",this.onStreamManager)}},{key:"unregisterListeners",value:function(){this.player.off("loadstart",this.onDownload),this.player.off("loadeddata",this.onDownload),this.player.off("loadedmetadata",this.onDownload),this.player.off("adsready",this.onAdsready),this.player.off("adstart",this.onAdStart),this.player.off("adend",this.onAdEnd),this.player.off("play",this.onPlay),this.player.off("pause",this.onPause),this.player.off("playing",this.onPlaying),this.player.off("abort",this.onAbort),this.player.off("ended",this.onEnded),this.player.off("dispose",this.onDispose),this.player.off("seeking",this.onSeeking),this.player.off("seeked",this.onSeeked),this.player.off("error",this.onError),this.player.off("waiting",this.onWaiting),this.player.off("timeupdate",this.onTimeupdate),this.player.off("ads-allpods-completed",this.OnAdsAllpodsCompleted),this.player.off("stream-manager",this.onStreamManager)}},{key:"onDownload",value:function(e){this.sendDownload({state:e.type})}},{key:"onStreamManager",value:function(e){if(!this.adsTracker&&e.StreamManager){var t=new f.default(this.player);t.setStreamManager(e.StreamManager),this.setAdsTracker(t)}}},{key:"onAdsready",value:function(){this.adsTracker||(c.default.isUsing(this.player)?this.setAdsTracker(new c.default(this.player)):l.default.isUsing(this.player)?this.setAdsTracker(new l.default(this.player)):h.default.isUsing(this.player)?this.setAdsTracker(new h.default(this.player)):this.setAdsTracker(new u.default(this.player)))}},{key:"onAdStart",value:function(){var e;this.currentAdPlaying=!0,this.imaAdCuePoints||(this.imaAdCuePoints=null===(e=this.player)||void 0===e||null===(e=e.ima)||void 0===e?void 0:e.getAdsManager().getCuePoints())}},{key:"onAdEnd",value:function(){this.isContentEnd&&this.sendEnd()}},{key:"OnAdsAllpodsCompleted",value:function(){this.onEnded.bind(this),this.FreewheelAdsCompleted=!0}},{key:"onPlay",value:function(){this.sendRequest()}},{key:"onPause",value:function(){this.sendPause()}},{key:"onPlaying",value:function(){this.sendResume(),this.sendBufferEnd()}},{key:"onAbort",value:function(){this.sendEnd()}},{key:"onEnded",value:function(){this.adsTracker?(this.isContentEnd=!0,this.imaAdCuePoints&&!this.imaAdCuePoints.includes(-1)&&this.sendEnd()):this.sendEnd()}},{key:"onDispose",value:function(){this.sendEnd()}},{key:"onSeeking",value:function(){this.sendSeekStart()}},{key:"onSeeked",value:function(){this.sendSeekEnd()}},{key:"onError",value:function(){var e=this.player.error(),t=e.code,i=e.message;this.player.error&&this.player.error()&&this.sendError({errorCode:t,errorMessage:i})}},{key:"onWaiting",value:function(e){this.sendBufferStart()}},{key:"onTimeupdate",value:function(e){this.getPlayhead()>.1&&this.sendStart()}}],r&&p(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r}(n.default.VideoTracker)},330(e){e.exports=JSON.parse('{"name":"@newrelic/video-videojs","version":"4.0.3","description":"New relic tracker for Videojs","main":"dist/cjs/index.js","module":"dist/esm/index.js","scripts":{"build":"webpack --mode production","build:dev":"webpack --mode development","watch":"webpack --mode production --progress --color --watch","watch:dev":"webpack --progress --color --watch --mode development","prezip":"npm run build","zip":"zip -P newrelic -x \'*.DS_Store\' -x \'samples/agent.js\' -r videojs.zip dist samples README.md CHANGELOG.md EULA.md","clean":"rm -rf dist *.zip","deploy":"node scripts/deploy.js","third-party-updates":"oss third-party manifest --includeOptDeps && oss third-party notices --includeOptDeps && git add THIRD_PARTY_NOTICES.md third_party_manifest.json"},"repository":{"type":"git","url":"https://github.com/newrelic/video-videojs-js.git"},"author":"Jordi Aguilar","contributors":["Andreu Santarén Llop","Bharat Saraswat","Malay Chandan"],"license":"Apache-2.0","devDependencies":{"@babel/core":"^7.24.5","@babel/plugin-transform-modules-commonjs":"^7.24.1","@babel/preset-env":"^7.24.5","@newrelic/newrelic-oss-cli":"^0.1.2","aws-sdk":"^2.920.0","babel-loader":"^9.1.3","videojs-ima":"2.1.0","webpack":"^5.91.0","webpack-cli":"^4.9.2"},"files":["THIRD_PARTY_NOTICES.md","dist","CHANGELOG.md","README.md","src","!test"],"publishConfig":{"access":"public"},"dependencies":{"@newrelic/video-core":"^4.0.0"}}')}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{var e=r;e.default=void 0;var t,n=(t=i(302))&&t.__esModule?t:{default:t};e.default=n.default})(),r.default})());
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VideojsTracker=e():t.VideojsTracker=e()}(self,()=>(()=>{"use strict";var t={555(t,e,i){i.r(e),i.d(e,{default:()=>P});var r={487(t,e,i){i.r(e),i.d(e,{videoAnalyticsHarvester:()=>u});var r=i(374),n=i(431),a=i(51),s=i(144),o=i(302);const u=new class{constructor(){this.isInitialized=!1,this.harvestScheduler=null,this.eventBuffer=null}initialize(){if(this.isInitialized)s.A.warn("Video analytics agent already initialized");else try{this.eventBuffer=new n.t,this.harvestScheduler=new r.n(this.eventBuffer),this.harvestScheduler.startScheduler(),this.isInitialized=!0,s.A.notice("Video analytics agent initialized successfully")}catch(t){s.A.error("Failed to initialize video analytics agent:",t.message)}}addEvent(t){this.isInitialized||(s.A.warn("Video analytics agent not initialized, initializing now"),this.initialize());try{return t.actionName&&t.actionName===o.A.Events.QOE_AGGREGATE?t.viewId?this.eventBuffer.addOrReplaceByActionNameAndViewId(o.A.Events.QOE_AGGREGATE,t.viewId,t):this.eventBuffer.addOrReplaceByActionName(o.A.Events.QOE_AGGREGATE,t):this.eventBuffer.add(t)}catch(t){return s.A.error("Failed to add event to harvesting system:",t.message),!1}}setHarvestInterval(t){this.isInitialized||this.initialize(),this.harvestScheduler.updateHarvestInterval(t)}forceNextQoeCycle(){this.harvestScheduler&&(this.harvestScheduler.forceNextQoeCycle=!0)}setBeforeDrainCallback(t){this.harvestScheduler&&(this.harvestScheduler.beforeDrainCallback=t)}refreshQoeKpis(t,e){if(!this.eventBuffer||!t)return;const i=e?this.eventBuffer.findByActionNameAndViewId(o.A.Events.QOE_AGGREGATE,e):this.eventBuffer.findByActionName(o.A.Events.QOE_AGGREGATE);if(i){const r={...i};for(const e of a.A.QOE_KPI_KEYS)e in t&&(r[e]=t[e]);e?this.eventBuffer.addOrReplaceByActionNameAndViewId(o.A.Events.QOE_AGGREGATE,e,r):this.eventBuffer.addOrReplaceByActionName(o.A.Events.QOE_AGGREGATE,r)}}}},455(t,e,i){i.d(e,{A:()=>n});class r{constructor(){this.reset()}reset(){this.startTime=0,this.stopTime=0,this.accumulator=0,this.offset=0}getDeltaTime(){return this.startTime?this.offset+((new Date).getTime()-this.startTime):null}start(){this.startTime=(new Date).getTime(),this.stopTime=0}stop(){return this.stopTime=(new Date).getTime(),this.startTime<this.stopTime&&(this.accumulator+=this.stopTime-this.startTime),this.getDeltaTime()}getDuration(){return this.stopTime?this.accumulator+this.offset:this.accumulator+(this.getDeltaTime()??0)}clone(){var t=new r;return t.startTime=this.startTime,t.stopTime=this.stopTime,t.offset=this.offset,t.accumulator=this.accumulator,t}}const n=r},51(t,e,i){i.d(e,{A:()=>n});class r{}r.AdPositions={PRE:"pre",MID:"mid",POST:"post"},r.COLLECTOR={US:["bam.nr-data.net","bam-cell.nr-data.net"],EU:"bam.eu01.nr-data.net",Staging:"staging-bam-cell.nr-data.net",GOV:"gov-bam.nr-data.net"},r.VALID_EVENT_TYPES=["VideoAction","VideoAdAction","VideoErrorAction","VideoCustomAction"],r.MAX_PAYLOAD_SIZE=1048576,r.MAX_BEACON_SIZE=61440,r.MAX_EVENTS_PER_BATCH=1e3,r.INTERVAL=1e4,r.QOE_KPI_KEYS=["startupTime","peakBitrate","averageBitrate","totalPlaytime","totalRebufferingTime","rebufferingRatio","hadStartupError","hadPlaybackError","numberOfErrors"],r.QOE_AGGREGATE_KEYS=["coreVersion","instrumentation.name","instrumentation.provider","instrumentation.version","isBackgroundEvent","playerName","playerVersion","src","viewId","viewSession","contentIsAutoplayed","contentIsMuted","contentRenditionHeight","contentRenditionWidth","contentSrc","numberOfVideos","pageUrl","trackerName","trackerVersion","contentDuration","contentPlayrate","contentPlayhead","contentPreload","elapsedTime","contentTitle","contentId","contentIsLive","deviceType","deviceGroup","deviceManufacturer","deviceModel","deviceName","deviceSize","deviceUuid","contentRenditionName","contentIsFullscreen","contentCdn","contentFps","asnOrganization","asnLongitude","asnLatitude","asn","timeSinceRequested","timeSinceStarted"];const n=r},568(t,e,i){i.d(e,{A:()=>r});const r=class{on(t,e){if(this._listeners=this._listeners||{},"function"==typeof e)return this._listeners[t]=this._listeners[t]||[],this._listeners[t].push(e),this}off(t,e){if(this._listeners=this._listeners||{},this._listeners[t]){var i=this._listeners[t].indexOf(e);-1!==i&&this._listeners[t].splice(i,1)}return this}emit(t,e,i){return this._listeners=this._listeners||{},i=i||{},Array.isArray(this._listeners[e])&&this._listeners[e].forEach(r=>{r.call(this,{eventType:t,type:e,data:i,target:this})}),Array.isArray(this._listeners["*"])&&this._listeners["*"].forEach(r=>{r.call(this,{eventType:t,type:e,data:i,target:this})}),this}}},431(t,e,i){i.d(e,{t:()=>u});var r=i(144),n=i(51),a=i(347);const{MAX_PAYLOAD_SIZE:s,MAX_EVENTS_PER_BATCH:o}=n.A;class u{constructor(){this.buffer=[],this.maxPayloadSize=s,this.maxEventsPerBatch=o,this.currentPayloadSize=0,this.totalEvents=0,this.smartHarvestPayloadThreshold=Math.floor(.6*this.maxPayloadSize),this.overflowPayloadThreshold=Math.floor(.9*this.maxPayloadSize),this.smartHarvestEventThreshold=Math.floor(.6*this.maxEventsPerBatch),this.overflowEventThreshold=Math.floor(.9*this.maxEventsPerBatch),this.onSmartHarvestTrigger=null}addOrReplaceByActionName(t,e){const i=this.buffer.findIndex(e=>e.actionName===t);try{return-1===i?this.add(e):this.add(e,i),!0}catch(t){return r.A.error("Failed to set or replace the event to buffer:",t.message),!1}}addOrReplaceByActionNameAndViewId(t,e,i){const n=this.buffer.findIndex(i=>i.actionName===t&&i.viewId===e);try{return-1===n?this.add(i):this.add(i,n),!0}catch(t){return r.A.error("Failed to set or replace the event to buffer:",t.message),!1}}findByActionNameAndViewId(t,e){return this.buffer.find(i=>i.actionName===t&&i.viewId===e)||null}findByActionName(t){return this.buffer.find(e=>e.actionName===t)||null}add(t,e){try{const i=(0,a.Q3)(t),r=this.currentPayloadSize+i>=this.maxPayloadSize,n=this.totalEvents+1>=this.maxEventsPerBatch;if((r||n)&&this.makeRoom(i),null!=e&&e>-1){const r=(0,a.Q3)(this.buffer[e]);this.buffer[e]=t,this.currentPayloadSize+=i-r}else this.buffer.push(t),this.totalEvents++,this.currentPayloadSize+=i;return this.checkSmartHarvestTrigger(),!0}catch(t){return r.A.error("Failed to add event to buffer:",t.message),!1}}checkSmartHarvestTrigger(){const t=this.currentPayloadSize/this.maxPayloadSize,e=this.totalEvents/this.maxEventsPerBatch,i=this.currentPayloadSize>=this.overflowPayloadThreshold,n=this.totalEvents>=this.overflowEventThreshold;if(i||n){const n=i?`payload ${this.currentPayloadSize}/${this.maxPayloadSize} bytes (${Math.round(100*t)}%)`:`events ${this.totalEvents}/${this.maxEventsPerBatch} (${Math.round(100*e)}%)`;r.A.warn(`OVERFLOW PREVENTION: ${n} - Emergency harvest triggered`),this.onSmartHarvestTrigger&&"function"==typeof this.onSmartHarvestTrigger&&this.onSmartHarvestTrigger("overflow",90)}else{const t=this.currentPayloadSize>=this.smartHarvestPayloadThreshold,e=this.totalEvents>=this.smartHarvestEventThreshold;(t||e)&&this.onSmartHarvestTrigger&&"function"==typeof this.onSmartHarvestTrigger&&this.onSmartHarvestTrigger("smart",60)}}setSmartHarvestCallback(t){this.onSmartHarvestTrigger=t}drain(){try{const t=this.buffer.splice(0);return this.totalEvents=0,this.currentPayloadSize=0,t}catch(t){return r.A.error("Failed to drain events from buffer:",t.message),[]}}isEmpty(){return 0===this.totalEvents}size(){return this.totalEvents}clear(){this.buffer=[],this.totalEvents=0}makeRoom(t){if(t>this.maxPayloadSize)r.A.error("Event dropped: Event size exceeds maximum payload size.");else for(;(this.totalEvents>=this.maxEventsPerBatch||this.currentPayloadSize+t>=this.maxPayloadSize)&&this.buffer.length>0;){const t=this.buffer.shift(),e=(0,a.Q3)(t);this.totalEvents--,this.currentPayloadSize-=e,r.A.warn("Event buffer full, oldest event removed.")}}}},374(t,e,i){i.d(e,{n:()=>d});var r=i(431),n=i(413),a=i(481),s=i(347),o=i(51),u=i(302),l=i(144);class d{constructor(t){this.eventBuffer=t,this.retryQueueHandler=new n.u,this.httpClient=new a.X,this.fallBackUrl="",this.retryCount=0,this.eventBuffer instanceof r.t&&this.eventBuffer.setSmartHarvestCallback((t,e)=>this.triggerSmartHarvest(t,e)),this.isStarted=!1,this.currentTimerId=null,this.harvestCycle=o.A.INTERVAL,this.isHarvesting=!1,this.qoeCycleCount=1,this.forceNextQoeCycle=!1,this.beforeDrainCallback=null,this._lastSentQoeKpis={},this.setupPageLifecycleHandlers()}startScheduler(){this.isStarted?l.A.warn("Harvest scheduler is already started"):(this.isStarted=!0,l.A.notice("Starting harvest scheduler",{harvestCycle:this.harvestCycle,eventBufferSize:this.eventBuffer?this.eventBuffer.size():0}),this.scheduleNextHarvest())}stopScheduler(){this.isStarted&&(this.isStarted=!1,this.currentTimerId&&(clearTimeout(this.currentTimerId),this.currentTimerId=null),l.A.notice("Harvest scheduler stopped"))}async triggerSmartHarvest(t,e){if(l.A.notice(`${t} harvest triggered at ${e}% threshold`,{type:t,threshold:e}),this.eventBuffer&&!this.eventBuffer.isEmpty()){this.currentTimerId&&(clearTimeout(this.currentTimerId),this.currentTimerId=null);try{await this.triggerHarvest({})}catch(e){l.A.error(`${t} harvest failed:`,e.message)}finally{this.isStarted&&this.scheduleNextHarvest()}}}scheduleNextHarvest(){if(!this.isStarted)return;const t=this.harvestCycle;this.currentTimerId=setTimeout(()=>this.onHarvestInterval(),t)}async onHarvestInterval(){try{const t=this.eventBuffer&&!this.eventBuffer.isEmpty(),e=this.retryQueueHandler&&this.retryQueueHandler.getQueueSize()>0;if(!t&&!e)return;await this.triggerHarvest({})}catch(t){l.A.error("Error during scheduled harvest:",t.message)}finally{this.scheduleNextHarvest()}}async triggerHarvest(t={}){if(this.isHarvesting)return{success:!1,reason:"harvest_in_progress"};this.isHarvesting=!0;try{let e=this.drainEvents(t);if(t.isFinalHarvest){const t=o.A.MAX_BEACON_SIZE;(0,s.Q3)(e)>t&&(e=this.trimEventsToFit(e,t))}const i=await this.sendChunk(e,t,!0);return{success:i.success,totalChunks:1,results:[i]}}catch(t){return l.A.error("Harvest cycle failed:",t.message),this.handleHarvestFailure(t),{success:!1,error:t.message,consecutiveFailures:this.consecutiveFailures}}finally{this.isHarvesting=!1}}trimEventsToFit(t,e){if(0===t.length)return t;const i=[];let r=0;for(let n=t.length-1;n>=0;n--){const a=t[n],o=(0,s.Q3)({ins:[a,...i]});o>e||(i.unshift(a),r=o)}const n=t.length-i.length;if(n>0){const a=t.slice(0,n);l.A.warn(`Discarded ${n} events to fit beacon size limit`,{originalCount:t.length,trimmedCount:i.length,finalSize:r,maxSize:e}),this.retryQueueHandler&&this.retryQueueHandler.addFailedEvents(a)}return i}drainEvents(t={}){const e=window.NRVIDEO?.config?.qoeIntervalFactor??1,i=!!t.isFinalHarvest||this.forceNextQoeCycle,r=(this.qoeCycleCount-1)%e==0||i;if(this.forceNextQoeCycle&&(this.forceNextQoeCycle=!1),this.beforeDrainCallback&&"function"==typeof this.beforeDrainCallback)try{this.beforeDrainCallback()}catch(t){l.A.error("Before drain callback failed:",t.message)}const n=this.eventBuffer.drain();let a;if(r)a=n;else{a=[];for(const t of n)t.actionName===u.A.Events.QOE_AGGREGATE?this.eventBuffer.add(t):a.push(t)}this.qoeCycleCount++;for(let t=a.length-1;t>=0;t--){const e=a[t];e.actionName===u.A.Events.QOE_AGGREGATE&&(!i&&this._qoeKpisUnchanged(e)?a.splice(t,1):this._saveQoeKpis(e))}let d=[...a],c=(0,s.Q3)(a);if(this.retryQueueHandler&&this.retryQueueHandler.getQueueSize()>0){const t=o.A.MAX_PAYLOAD_SIZE-c,e=o.A.MAX_EVENTS_PER_BATCH-d.length;if(t>0&&e>0){const i=this.retryQueueHandler.getRetryEventsToFit(t,e);i.length>0&&(d=[...i,...d])}}return d}async sendChunk(t,e,i){const r={url:(0,s.c$)(this.fallBackUrl),payload:{body:{ins:t}},options:{...e,isLastChunk:i}};return new Promise(e=>{this.httpClient.send(r,i=>{i.retry?this.handleRequestFailure(t):(this.retryCount=0,this.fallBackUrl=""),e({success:!i.retry,status:i.status,error:i.error,chunk:t,eventCount:t.length})})})}handleRequestFailure(t){this.retryQueueHandler.addFailedEvents(t),"US"===window.NRVIDEO?.info?.region&&(this.retryCount++,this.retryCount>5?(this.retryCount=0,this.fallBackUrl=""):this.retryCount>=2&&(this.fallBackUrl=o.A.COLLECTOR.US[1]))}handleHarvestFailure(t){this.consecutiveFailures++,l.A.warn("Harvest failure handled",{error:t.message,consecutiveFailures:this.consecutiveFailures})}updateHarvestInterval(t){"number"!=typeof t&&isNaN(t)?l.A.warn("Invalid newInterval provided to updateHarvestInterval"):t<1e3||t>3e5?l.A.warn("newInterval out of bounds (1000-300000), ignoring"):this.harvestCycle!==t&&(this.harvestCycle=t,l.A.notice("Updated harvestCycle:",this.harvestCycle),this.currentTimerId&&(clearTimeout(this.currentTimerId),this.currentTimerId=null),this.isStarted&&this.scheduleNextHarvest())}setupPageLifecycleHandlers(){let t=!1;const e=()=>{t||(t=!0,this.triggerHarvest({isFinalHarvest:!0,force:!0}))};document.addEventListener("visibilitychange",()=>{document.hidden&&e()}),window.addEventListener("pagehide",()=>{e()}),window.addEventListener("beforeunload",()=>{e()})}_qoeKpisUnchanged(t){const e=this._lastSentQoeKpis[t.viewId];if(!e)return!1;for(const i of o.A.QOE_KPI_KEYS)if(t[i]!==e[i])return!1;return!0}_saveQoeKpis(t){const e={};for(const i of o.A.QOE_KPI_KEYS)e[i]=t[i];this._lastSentQoeKpis[t.viewId]=e}}},144(t,e,i){i.d(e,{A:()=>o});class r{static error(...t){n(t,r.Levels.ERROR,"darkred")}static warn(...t){n(t,r.Levels.WARNING,"darkorange")}static notice(...t){n([].slice.call(arguments),r.Levels.NOTICE,"darkcyan")}static debug(...t){n(t,r.Levels.DEBUG,"indigo")}static debugCommonVideoEvents(t,e,i){try{if(r.level<=r.Levels.DEBUG){i=i||function(t){r.debug("Event: "+t.type)};var n=["canplay","buffering","waiting","ended","play","playing","pause","resume","error","abort","seek","seeking","seeked","stalled","dispose","loadeddata","loadstart","loadedmetadata"];e&&(null===e[0]?(e.shift(),n=e):n=n.concat(e));for(var a=0;a<n.length;a++)"function"==typeof t?t.call(window,n[a],i):t.on?t.on(n[a],i):t.addEventListener?t.addEventListener(n[a],i):t.addEventHandler?t.addEventHandler(n[a],i):r.warn("debugCommonVideoEvents: No common listener function found for ",t)}}catch(t){r.warn(t)}}}function n(t,e,i){e=e||r.Levels.NOTICE,i=i||"darkcyan";var n,o,u=r.prefix;r.includeTime&&(u+="["+("0"+(n=new Date).getDate()).slice(-2)+":"+("0"+n.getMinutes()).slice(-2)+":"+("0"+n.getSeconds()).slice(-2)+"."+("00"+n.getMilliseconds()).slice(-3)+"] "),u+=function(t){return s[t]}(e)+":",r.level<=e&&e!==r.Levels.SILENT&&(!r.colorful||"undefined"!=typeof document&&document.documentMode?a(t,u):(o=e===r.Levels.ERROR&&console.error?console.error:e===r.Levels.WARNING&&console.warn?console.warn:e===r.Levels.DEBUG&&console.debug&&null==window.cast?console.debug:console.log,u="%c"+u,t.splice(0,0,u,"color: "+i),o.apply(console,t)))}function a(t,e){if(t instanceof Array)for(var i in t)a(t[i],e);else"string"==typeof t?console.log(e+" "+t):(console.log(e+"↵"),console.log(t))}r.Levels={SILENT:5,ERROR:4,WARNING:3,NOTICE:2,DEBUG:1,ALL:0},r.level=r.Levels.ERROR,r.colorful=!0,r.includeTime=!0,r.prefix="[nrvideo]";const s={4:"e",3:"w",2:"n",1:"d"};!function(){if("undefined"!=typeof window&&window.location&&window.location.search){var t=/\?.*&*nrvideo-debug=(.+)/i.exec(window.location.search);null!==t&&("true"===t[1]?r.level=r.Levels.ALL:r.level=t[1]),null!==/\?.*&*nrvideo-colors=false/i.exec(window.location.search)&&(r.colorful=!1)}}();const o=r},481(t,e,i){i.d(e,{X:()=>a});var r=i(347),n=i(144);class a{async send(t,e){const{url:i,payload:r,options:a={}}=t;try{if(!i||!r)throw new Error("URL and payload are required");const t={url:i,payload:r,options:a,callback:e};await this.executeRequest(t)}catch(t){n.A.error("Failed to send request:",t.message),e({retry:!1,status:0,error:t.message})}}async executeRequest(t){const{url:e,payload:i,options:r,callback:a}=t,s=Date.now();try{const a=(o=JSON.stringify(i.body),u=window.NRVIDEO?.config?.obfuscate,u&&0!==u.length?u.reduce((t,e)=>{let i;try{if(e.regex instanceof RegExp){const t=e.regex.flags.includes("g")?e.regex.flags:e.regex.flags+"g";i=new RegExp(e.regex.source,t)}else i=new RegExp(e.regex,"g")}catch(i){return n.A.warn("applyObfuscationRules: invalid regex, skipping rule:",e.regex,i.message),t}return t.replace(i,e.replacement)},o):o);if(r.isFinalHarvest&&navigator.sendBeacon){const i=await this.sendWithBeacon(e,a),r={success:i,status:i?204:0};return void this.handleRequestComplete(t,r,s)}const l=await this.fetchWithTimeout(e,{method:"POST",body:a,headers:{"Content-Type":"application/json"},keepalive:r.isFinalHarvest},1e4),d={success:l.ok,status:l.status,statusText:l.statusText};this.handleRequestComplete(t,d,s)}catch(e){const i={success:!1,status:0,error:e.message};this.handleRequestComplete(t,i,s)}var o,u}handleRequestComplete(t,e){const{callback:i}=t;i({retry:!e.success&&(0===e.status||(0,r.Sc)(e.status)),status:e.status,error:e.error})}async sendWithBeacon(t,e){try{return navigator.sendBeacon(t,e)}catch(t){return n.A.warn("sendBeacon failed, falling back to fetch:",t.message),!1}}async fetchWithTimeout(t,e,i){const r=new AbortController,n=setTimeout(()=>r.abort(),i);try{const i=await fetch(t,{...e,signal:r.signal});return clearTimeout(n),i}catch(t){if(clearTimeout(n),"AbortError"===t.name)throw new Error(`Request timeout after ${i}ms`);throw t}}}},413(t,e,i){i.d(e,{u:()=>u});var r=i(144),n=i(347),a=i(51);const{MAX_PAYLOAD_SIZE:s,MAX_EVENTS_PER_BATCH:o}=a.A;class u{constructor(){this.retryQueue=[],this.maxQueueSize=o,this.maxQueueSizeBytes=s}addFailedEvents(t){try{const e=Array.isArray(t)?t:[t];r.A.notice(`Adding ${e.length} failed events to retry queue`,{queueSizeBefore:this.retryQueue.length});for(const t of e){this.retryQueue.length>=this.maxQueueSize&&this.evictOldestEvent();const e=(0,n.Q3)(t);for(;(0,n.Q3)(this.retryQueue)+e>this.maxQueueSizeBytes;)this.evictOldestEvent();this.retryQueue.push({...t})}}catch(t){r.A.error("Failed to add events to retry queue:",t.message)}}discardEvent(t,e){r.A.warn("Discarded event",{reason:e,eventType:t.eventType})}evictOldestEvent(){if(this.retryQueue.length>0){const t=this.retryQueue.shift();this.discardEvent(t,"Queue full - evicted oldest")}}getRetryEventsToFit(t,e){const i=[];let r=0,a=0;for(let s=this.retryQueue.length-1;s>=0;s--){const o=this.retryQueue[s];if(a>=e)break;const u=(0,n.Q3)(o);if(r+u>t)break;i.unshift(o),r+=u,a++,this.retryQueue.splice(s,1)}return i}getQueueSize(){return this.retryQueue.length}clear(){this.retryQueue=[]}}},302(t,e,i){i.d(e,{A:()=>d});var r=i(330),n=i(568),a=i(455),s=i(51),o=i(487),u=i(144);class l extends n.A{constructor(t){super(),this.customData={},this.heartbeat=null,this.parentTracker=null,this._trackerReadyChrono=new a.A,this._trackerReadyChrono.start(),this._actionTable=s.A.ACTION_TABLE,this._actionAdTable=s.A.ACTION_AD_TABLE,t=t||{},this.setOptions(t)}setOptions(t){t&&(t.parentTracker&&(this.parentTracker=t.parentTracker),t.customData&&(this.customData=t.customData),t.heartbeat&&(this.heartbeat=t.heartbeat))}dispose(){this.unregisterListeners()}registerListeners(){}unregisterListeners(){}getHeartbeat(){return this.state._isAd?2e3:this.heartbeat?this.heartbeat:this.parentTracker&&this.parentTracker.heartbeat?this.parentTracker.heartbeat:3e4}startHeartbeat(){this._heartbeatInterval=setInterval(this.sendHeartbeat.bind(this),Math.max(this.getHeartbeat(),2e3))}stopHeartbeat(){this._heartbeatInterval&&clearInterval(this._heartbeatInterval)}sendHeartbeat(t){this.sendVideoAction(l.Events.HEARTBEAT,t)}getAttributes(t,e){(t=t||{}).trackerName=this.getTrackerName(),t.trackerVersion=this.getTrackerVersion(),t.coreVersion=r.rE,t.timeSinceTrackerReady=this._trackerReadyChrono.getDeltaTime();for(let e in this.customData)t[e]=this.customData[e];return null!=document.hidden&&(t.isBackgroundEvent=document.hidden),t}getTrackerVersion(){return r.rE}getTrackerName(){return"base-tracker"}sendVideoAction(t,e){this.emit("VideoAction",t,this.getAttributes(e))}sendVideoAdAction(t,e){this.emit("VideoAdAction",t,this.getAttributes(e))}sendVideoErrorAction(t,e){let i=this.isAd()?"adError":"videoError";this.emit("VideoErrorAction",t,this.getAttributes(e,i))}sendVideoCustomAction(t,e){this.emit("VideoCustomAction",t,this.getAttributes(e,"customAction"))}setHarvestInterval(t){if(o.videoAnalyticsHarvester)try{o.videoAnalyticsHarvester.setHarvestInterval(t)}catch(t){return void u.A.error("Failed to set harvest interval:",t.message)}else u.A.error("VideoAnalyticsHarvester is not available")}}l.Events={HEARTBEAT:"HEARTBEAT",QOE_AGGREGATE:"QOE_AGGREGATE"};const d=l},347(t,e,i){i.d(e,{Q3:()=>s,Sc:()=>o,c$:()=>a,z8:()=>u});var r=i(330),n=i(144);function a(t){try{if(!window.NRVIDEO||!window.NRVIDEO.info)throw new Error("NRVIDEO info is not available.");let{beacon:e,licenseKey:i,applicationID:n}=window.NRVIDEO.info;if(!e||!i)throw new Error("Options object provided by New Relic is not correctly initialized");return n?`https://${t||e}/ins/1/${i}?a=${n}&v=${r.rE}&ref=${window.location.href}&ca=VA`:`https://${t||e}/ins/1/${i}?&v=${r.rE}&ref=${window.location.href}&ca=VA`}catch(t){return console.error(t.message),null}}function s(t){if("string"==typeof t&&t.length)return t.length;if("object"==typeof t){if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&t.byteLength)return t.byteLength;if("undefined"!=typeof Blob&&t instanceof Blob&&t.size)return t.size;if(!("undefined"!=typeof FormData&&t instanceof FormData))try{return function(t){try{return JSON.stringify(t,(()=>{const t=new WeakSet;return(e,i)=>{if("object"==typeof i&&null!==i){if(t.has(i))return;t.add(i)}return i}})())??""}catch(t){return n.A.error("Error stringifying value:",t.message),""}}(t).length}catch(t){return}}}function o(t){switch(t){case 408:case 429:case 500:return!0;case 401:case 403:case 404:return!1}return t>=502&&t<=504||t>=512&&t<=530}function u(t,e){return t&&Array.isArray(t)&&0!==t.length?e&&"object"==typeof e?t.reduce((t,i)=>(i in e&&(t[i]=e[i]),t),{}):{}:e}},330(t){t.exports={rE:"4.1.5"}}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,a),i.exports}a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s=a(144),o=a(487),u=a(51),l=a(302),d=a(347);function c(t,e={}){try{if(!u.A.VALID_EVENT_TYPES.includes(t))return s.A.warn("Invalid event type provided to recordEvent",{eventType:t}),!1;if(!window?.NRVIDEO?.info)return;const{appName:i,applicationID:r}=window.NRVIDEO.info,{qoe:n,...a}=e,c=n?{...n}:{},h={...r?{}:{appName:i},timestamp:Date.now(),timeSinceLoad:window.performance?window.performance.now()/1e3:null},f={...a,eventType:t,...h},y=(0,d.z8)(u.A.QOE_AGGREGATE_KEYS,e);let p=null;"VideoAction"===t&&(p={eventType:"VideoAction",actionName:l.A.Events.QOE_AGGREGATE,qoeAggregateVersion:"1.0.0",...c,...y,...h});const m=o.videoAnalyticsHarvester.addEvent(f);if(p&&window?.NRVIDEO?.config?.qoeAggregate){const t=o.videoAnalyticsHarvester.addEvent(p);return m&&t}return m}catch(t){return s.A.error("Failed to record event:",t.message),!1}}const{COLLECTOR:h}=u.A,f=new class{setConfiguration(t,e){return!!this.validateRequiredFields(t)&&!!this.validateConfigFields(e)&&(this.initializeGlobalConfig(t,e),s.A.notice("Video analytics configuration initialized successfully"),!0)}validateRequiredFields(t){if(!t||"object"!=typeof t)return s.A.error("Configuration must be an object"),!1;const{licenseKey:e,appName:i,region:r,applicationID:n,beacon:a}=t;if(!e)return s.A.error("licenseKey is required"),!1;if(n){if(!a)return s.A.error("beacon is required when applicationID is provided"),!1;if(!Object.values(h).flatMap(t=>t).includes(a))return s.A.error(`Invalid beacon: ${a}`),!1}else{if(!i||!r)return s.A.error("appName and region are required when applicationID is not provided"),!1;if(!h[r])return s.A.error(`Invalid region: ${r}. Valid regions are: ${Object.keys(h).join(", ")}`),!1}return!0}validateConfigFields(t){if(null==t)return!0;if("object"!=typeof t||Array.isArray(t))return s.A.error("config must be an object"),!1;const{qoeAggregate:e,obfuscate:i}=t;return void 0!==e&&"boolean"!=typeof e?(s.A.error("qoeAggregate must be a boolean"),!1):!(void 0!==i&&!Array.isArray(i)&&(s.A.error("obfuscate must be an array"),1))}filterObfuscateRules(t){return t?t.filter(t=>{const e=void 0!==t.regex&&("string"==typeof t.regex||t.regex instanceof RegExp),i=void 0!==t.replacement&&"string"==typeof t.replacement;return!(!e||!i)||(s.A.warn("obfuscate rule missing required 'regex' (string|RegExp) and/or 'replacement' (string), skipping:",t),!1)}):[]}sanitizeQoeIntervalFactor(t){return null==t?1:"number"==typeof t&&Number.isInteger(t)&&t>=1?t:(console.warn(`[nrvideo] Invalid qoeIntervalFactor "${t}" — must be a positive integer. Defaulting to 1.`),1)}initializeGlobalConfig(t,e){let{licenseKey:i,appName:r,region:n,beacon:a,applicationID:s}=t;a="US"===n?u.A.COLLECTOR.US[0]:a||h[n],window.NRVIDEO={info:{...n?{region:n}:{},beacon:a,licenseKey:i,applicationID:s,...s?{}:{appName:r}},config:{qoeAggregate:e?.qoeAggregate??!1,qoeIntervalFactor:this.sanitizeQoeIntervalFactor(e?.qoeIntervalFactor),obfuscate:this.filterObfuscateRules(e?.obfuscate)}}}};class y{static addTracker(t,e){var i,r;e?.info&&(i=e.info,r=e?.config,f.setConfiguration(i,r)),t.on&&t.emit?(p.push(t),t.on("*",m),"function"==typeof t.trackerInit&&t.trackerInit()):s.A.error("Tried to load a non-tracker.",t)}static removeTracker(t){t.off("*",m),t.dispose();let e=p.indexOf(t);-1!==e&&p.splice(e,1)}static getTrackers(){return p}static send(t,e,i){return c(t,{actionName:e,...i})}static sendError(t){return c("VideoErrorAction",{actionName:"ERROR",...t})}static async forceHarvest(){try{const{videoAnalyticsHarvester:t}=a(487);return await t.forceHarvest()}catch(t){return s.A.error("Failed to force harvest:",t.message),{success:!1,error:t.message}}}}let p=[];function m(t){try{let e=function(t){let e={};for(let i in t)null!==t[i]&&void 0!==t[i]&&(e[i]=t[i]);return e}(t.data);s.A.level<=s.A.Levels.DEBUG?s.A.notice("Sent",t.type,e):s.A.notice("Sent",t.type),y.send(t.eventType,t.type,e)}catch(t){s.A.error("Error in event handler:",t.message)}}const v=y;var g=a(455),A=a(568);const E=class{constructor(){this.reset(),this._createdAt=Date.now(),this._hb=!0,this._acc=0,this._bufferAcc=0}reset(){this._viewSession=null,this._viewCount=0,this._isAd=!1,this.numberOfErrors=0,this.numberOfAds=0,this.numberOfVideos=0,this.totalPlaytime=0,this.weightedAverageBitrate=0,this.totalAdPlaytime=0,this.isAdBreak=!1,this.initialBufferingHappened=!1,this.startupTime=null,this.peakBitrate=0,this._lastBitrate=null,this._lastBitrateChangeTimestamp=null,this.partialAverageBitrate=0,this._totalBitrateDuration=0,this.hadStartupError=!1,this.hadPlaybackError=!1,this.totalRebufferingTime=0,this.resetFlags(),this.resetChronos()}resetFlags(){this.isPlayerReady=!1,this.isRequested=!1,this.isStarted=!1,this.isPaused=!1,this.isSeeking=!1,this.isBuffering=!1,this.isPlaying=!1}resetChronos(){this.timeSinceRequested=new g.A,this.timeSinceStarted=new g.A,this.timeSincePaused=new g.A,this.timeSinceSeekBegin=new g.A,this.timeSinceBufferBegin=new g.A,this.timeSinceAdBreakStart=new g.A,this.timeSinceLastDownload=new g.A,this.timeSinceLastHeartbeat=new g.A,this.timeSinceLastRenditionChange=new g.A,this.timeSinceLastAdQuartile=new g.A,this.timeSinceLastAd=new g.A,this.timeSinceLastError=new g.A,this.timeSinceLastAdError=new g.A,this.timeSinceResumed=new g.A,this.timeSinceSeekEnd=new g.A,this.playtimeSinceLastEvent=new g.A,this.customTimeSinceAttributes={},this.elapsedTime=new g.A,this.bufferElapsedTime=new g.A,this._totalAdPlaytime=new g.A}isAd(){return this._isAd}setIsAd(t){this._isAd=t}setTimeSinceAttribute(t){this.customTimeSinceAttributes[t]=new g.A,this.customTimeSinceAttributes[t].start()}removeTimeSinceAttribute(t){delete this.customTimeSinceAttributes[t]}getViewSession(){if(!this._viewSession){let t=(new Date).getTime(),e=Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2);this._viewSession=t+"-"+e}return this._viewSession}getViewId(){return this.getViewSession()+"-"+this._viewCount}getStateAttributes(t){t=t||{},this.isAd()?(this.isRequested&&(t.timeSinceAdRequested=this.timeSinceRequested.getDeltaTime(),t.timeSinceLastAdHeartbeat=this.timeSinceLastHeartbeat.getDeltaTime()),this.isStarted&&(t.timeSinceAdStarted=this.timeSinceStarted.getDeltaTime()),this.isPaused&&(t.timeSinceAdPaused=this.timeSincePaused.getDeltaTime()),this.isBuffering&&(t.timeSinceAdBufferBegin=this.timeSinceBufferBegin.getDeltaTime()),this.isSeeking&&(t.timeSinceAdSeekBegin=this.timeSinceSeekBegin.getDeltaTime()),this.isAdBreak&&(t.timeSinceAdBreakBegin=this.timeSinceAdBreakStart.getDeltaTime()),this.numberOfErrors>0&&this.timeSinceLastAdError.startTime>0&&(t.timeSinceLastAdError=this.timeSinceLastAdError.getDeltaTime()),t.numberOfAds=this.numberOfAds):(this.isRequested&&(t.timeSinceRequested=this.timeSinceRequested.getDeltaTime(),t.timeSinceLastHeartbeat=this.timeSinceLastHeartbeat.getDeltaTime()),this.isStarted&&(t.timeSinceStarted=this.timeSinceStarted.getDeltaTime()),this.isPaused&&(t.timeSincePaused=this.timeSincePaused.getDeltaTime()),this.isBuffering&&(t.timeSinceBufferBegin=this.timeSinceBufferBegin.getDeltaTime()),this.isSeeking&&(t.timeSinceSeekBegin=this.timeSinceSeekBegin.getDeltaTime()),t.timeSinceLastAd=this.timeSinceLastAd.getDeltaTime(),this.numberOfErrors>0&&this.timeSinceLastError.startTime>0&&(t.timeSinceLastError=this.timeSinceLastError.getDeltaTime()),t.numberOfVideos=this.numberOfVideos),t.numberOfErrors=this.numberOfErrors,this.isAd()||(this.playtimeSinceLastEvent.startTime>0?t.playtimeSinceLastEvent=this.playtimeSinceLastEvent.getDeltaTime():t.playtimeSinceLastEvent=0,this.isPlaying?this.playtimeSinceLastEvent.start():this.playtimeSinceLastEvent.reset(),this.totalPlaytime+=t.playtimeSinceLastEvent,t.totalPlaytime=this.totalPlaytime);for(const[e,i]of Object.entries(this.customTimeSinceAttributes))t[e]=i.getDeltaTime();return t}getQoeAttributes(t){t=t||{};const e={};try{null!==this.startupTime&&(e.startupTime=this.startupTime),this.peakBitrate>0&&(e.peakBitrate=this.peakBitrate),e.hadStartupError=this.hadStartupError,e.hadPlaybackError=this.hadPlaybackError,e.totalRebufferingTime=this.totalRebufferingTime,e.rebufferingRatio=this.totalPlaytime>0?this.totalRebufferingTime/this.totalPlaytime*100:0,e.totalPlaytime=this.totalPlaytime,e.averageBitrate=this.weightedBitrate,e.numberOfErrors=this.numberOfErrors}catch(t){s.A.error("Failed to add attributes for QOE KPIs",t.message)}return t.qoe=e,t}calculateBufferType(t){let e="";return e=t?"initial":this.isSeeking?"seek":this.isPaused?"pause":"connection",s.A.debug("Buffer Type = "+e),e}goViewCountUp(){this._viewCount++}goPlayerReady(){return!this.isPlayerReady&&(this.isPlayerReady=!0,!0)}goRequest(){return!this.isRequested&&(this.isRequested=!0,this.timeSinceLastAd.reset(),this.timeSinceRequested.start(),!0)}goStart(){return!(!this.isRequested||this.isStarted||(this.isAd()?this.numberOfAds++:this.numberOfVideos++,this.isStarted=!0,this.isPlaying=!0,this.timeSinceStarted.start(),this.playtimeSinceLastEvent.start(),0))}goEnd(){return!!this.isRequested&&(this.numberOfErrors=0,this.resetFlags(),this.timeSinceRequested.stop(),this.timeSinceStarted.stop(),this.playtimeSinceLastEvent.stop(),this.isPlaying=!1,!0)}goPause(){return!(!this.isStarted||this.isPaused||(this.isPaused=!0,this.isPlaying=!1,this.timeSincePaused.start(),this.playtimeSinceLastEvent.stop(),this.timeSinceResumed.reset(),this.isBuffering&&(this._bufferAcc+=this.bufferElapsedTime.getDeltaTime()),this.elapsedTime.start(),0))}goResume(){return!(!this.isStarted||!this.isPaused||(this.isPaused=!1,this.isPlaying=!0,this.timeSincePaused.stop(),this.timeSinceResumed.start(),this._hb?(this._acc=this.elapsedTime.getDeltaTime(),this._hb=!1):(this.isBuffering&&this.bufferElapsedTime.start(),this._acc+=this.elapsedTime.getDeltaTime()),0))}goBufferStart(){return!(!this.isRequested||this.isBuffering||(this.isBuffering=!0,this.isPlaying=!1,this.timeSinceBufferBegin.start(),this.bufferElapsedTime.start(),0))}goBufferEnd(){return!(!this.isRequested||!this.isBuffering||(this.isBuffering=!1,this.isPlaying=!0,this.timeSinceBufferBegin.stop(),this._hb?(this._bufferAcc=this.bufferElapsedTime.getDeltaTime(),this._hb=!1):this._bufferAcc+=this.bufferElapsedTime.getDeltaTime(),!this.isAd()&&this.initialBufferingHappened&&(this.totalRebufferingTime+=this.timeSinceBufferBegin.stopTime-this.timeSinceBufferBegin.startTime),0))}goSeekStart(){return!(!this.isStarted||this.isSeeking||(this.isSeeking=!0,this.isPlaying=!1,this.timeSinceSeekBegin.start(),this.timeSinceSeekEnd.reset(),0))}goSeekEnd(){return!(!this.isStarted||!this.isSeeking||(this.isSeeking=!1,this.isPlaying=!0,this.timeSinceSeekBegin.stop(),this.timeSinceSeekEnd.start(),0))}goAdBreakStart(){return!this.isAdBreak&&(this.isAdBreak=!0,this.timeSinceAdBreakStart.start(),!0)}goAdBreakEnd(){return!!this.isAdBreak&&(this.isRequested=!1,this.isAdBreak=!1,this.totalAdPlaytime=this.timeSinceAdBreakStart.getDeltaTime(),this.timeSinceAdBreakStart.stop(),!0)}goDownload(){this.timeSinceLastDownload.start()}goHeartbeat(){this.timeSinceLastHeartbeat.start()}goRenditionChange(){this.timeSinceLastRenditionChange.start()}goAdQuartile(){this.timeSinceLastAdQuartile.start()}goError(){this.isError=!0,this.numberOfErrors++,this.isAd()?this.timeSinceLastAdError.start():(this.timeSinceLastError.start(),this.isStarted?this.hadPlaybackError=!0:this.hadStartupError=!0)}goLastAd(){this.timeSinceLastAd.start()}trackContentBitrateState(t){if(t&&"number"==typeof t){this.peakBitrate=Math.max(this.peakBitrate,t);const e=Date.now();if(!this.isPlaying){if(null!==this._lastBitrate&&null!==this._lastBitrateChangeTimestamp){const t=e-this._lastBitrateChangeTimestamp;t>0&&(this.partialAverageBitrate+=this._lastBitrate*t,this._totalBitrateDuration+=t),this._lastBitrateChangeTimestamp=null}return void(this._lastBitrate=t)}if(null===this._lastBitrateChangeTimestamp&&null!==this._lastBitrate&&(this._lastBitrateChangeTimestamp=e),null!==this._lastBitrate&&this._lastBitrate!==t&&null!==this._lastBitrateChangeTimestamp){const t=e-this._lastBitrateChangeTimestamp;t>0&&(this.partialAverageBitrate+=this._lastBitrate*t,this._totalBitrateDuration+=t),this._lastBitrateChangeTimestamp=e}null===this._lastBitrateChangeTimestamp&&(this._lastBitrateChangeTimestamp=e),this._lastBitrate=t;let i=this.partialAverageBitrate,r=this._totalBitrateDuration;const n=e-this._lastBitrateChangeTimestamp;n>0&&(i+=t*n,r+=n),this.weightedBitrate=r>0?Math.round(i/r):t}}resetViewIdTrackedState(){this.peakBitrate=0,this.partialAverageBitrate=0,this._totalBitrateDuration=0,this.startupTime=null,this._lastBitrate=null,this._lastBitrateChangeTimestamp=null}clearTotalAdsTime(){s.A.debug("clear total ads time",this.totalAdTime),this._totalAdPlaytime.reset()}totalAdTime(){return this._totalAdPlaytime.getDuration()}startAdsTime(){return s.A.debug("startAdsTime"),this._totalAdPlaytime.start()}stopAdsTime(){return s.A.debug("stopAdsTime"),this._totalAdPlaytime.stop()}setStartupTime(t){null===this.startupTime&&(this.startupTime=Math.max(this.timeSinceRequested.getDeltaTime()-t,0))}};var b=a(330);class T extends l.A{constructor(t,e){super(),this.state=new E,this.adsTracker=null,this._lastBufferType=null,this._userId=null,e=e||{},this.setOptions(e),t&&this.setPlayer(t,e.tag),s.A.notice("Tracker "+this.getTrackerName()+" v"+this.getTrackerVersion()+" is ready.")}setUserId(t){this._userId=t}setOptions(t){t&&(t.adsTracker&&this.setAdsTracker(t.adsTracker),"boolean"==typeof t.isAd&&this.setIsAd(t.isAd),l.A.prototype.setOptions.apply(this,arguments))}setPlayer(t,e){(this.player||this.tag)&&this.dispose(),"undefined"!=typeof document&&document.getElementById&&("string"==typeof t&&(t=document.getElementById(t)),"string"==typeof e&&(e=document.getElementById(e))),e=e||t,this.player=t,this.tag=e,this.registerListeners()}isAd(){return this.state.isAd()}setIsAd(t){this.state.setIsAd(t)}setAdsTracker(t){this.disposeAdsTracker(),t&&(this.adsTracker=t,this.adsTracker.setIsAd(!0),this.adsTracker.parentTracker=this,this.adsTracker.on("*",S.bind(this)))}disposeAdsTracker(){this.adsTracker&&(this.adsTracker.off("*",S),this.adsTracker.dispose())}dispose(){this.stopHeartbeat(),this.disposeAdsTracker(),this.unregisterListeners(),this.player=null,this.tag=null}registerListeners(){}unregisterListeners(){}getViewId(){return this.parentTracker?this.parentTracker.getViewId():this.state.getViewId()}getViewSession(){return this.parentTracker?this.parentTracker.getViewSession():this.state.getViewSession()}getVideoId(){return null}getTitle(){return null}isLive(){return null}getBitrate(){return null}getManifestBitrate(){return null}getSegmentDownloadBitrate(){return null}getNetworkDownloadBitrate(){return null}getWebkitBitrate(){if(this.tag&&this.tag.webkitVideoDecodedByteCount){let t;if(this._lastWebkitBitrate){t=this.tag.webkitVideoDecodedByteCount;let e=t-this._lastWebkitBitrate,i=this.getHeartbeat()/1e3;t=Math.round(e/i*8)}return this._lastWebkitBitrate=this.tag.webkitVideoDecodedByteCount,t||null}}getRenditionName(){return null}getRenditionBitrate(){return null}getRenditionShift(t){let e,i=this.getRenditionBitrate();return this.isAd()?(e=this._lastAdRendition,t&&(this._lastAdRendition=i)):(e=this._lastRendition,t&&(this._lastRendition=i)),i&&e?i>e?"up":i<e?"down":null:null}getRenditionHeight(){return this.tag?this.tag.videoHeight:null}getRenditionWidth(){return this.tag?this.tag.videoWidth:null}getDuration(){return this.tag?this.tag.duration:null}getPlayhead(){return this.tag?this.tag.currentTime:null}getLanguage(){return null}getSrc(){return this.tag?this.tag.currentSrc:null}getPlayrate(){return this.tag?this.tag.playbackRate:null}isMuted(){return this.tag?this.tag.muted:null}isFullscreen(){return null}getCdn(){return null}getPlayerName(){return this.getTrackerName()}getPlayerVersion(){return b.rE}getFps(){return null}isAutoplayed(){return this.tag?this.tag.autoplay:null}getPreload(){return this.tag?this.tag.preload:null}getAdQuartile(){return null}getAdPosition(){return this.parentTracker?this.parentTracker.state.isStarted?"mid":"pre":null}getAdPartner(){return null}getAdCreativeId(){return null}getInstrumentationProvider(){return null}getInstrumentationName(){return null}getInstrumentationVersion(){return null}getAttributes(t,e){if(void 0===(t=l.A.prototype.getAttributes.apply(this,arguments)).isAd&&(t.isAd=this.isAd()),t.viewSession=this.getViewSession(),t.viewId=this.getViewId(),t.playerName=this.getPlayerName(),t.playerVersion=this.getPlayerVersion(),t["instrumentation.provider"]=this.getInstrumentationProvider(),t["instrumentation.name"]=this.getInstrumentationName(),t["instrumentation.version"]=this.getInstrumentationVersion(),t["enduser.id"]=this._userId,t.src="Browser","customAction"===e)return t;try{t.pageUrl=window.location.href}catch(t){}this.isAd()?(t.adId=this.getVideoId(),t.adTitle=this.getTitle(),t.adSrc=this.getSrc(),t.adCdn=this.getCdn(),this.state.isStarted&&(t.adBitrate=this.getBitrate()||0),t.adRenditionName=this.getRenditionName(),t.adRenditionHeight=this.getRenditionHeight(),t.adRenditionWidth=this.getRenditionWidth(),t.adDuration=this.getDuration(),t.adPlayhead=this.getPlayhead(),t.adLanguage=this.getLanguage(),t.adIsMuted=this.isMuted(),t.adFps=this.getFps(),t.adPosition=this.getAdPosition(),t.adCreativeId=this.getAdCreativeId(),t.adPartner=this.getAdPartner()):(t.contentId=this.getVideoId(),t.contentTitle=this.getTitle(),t.contentSrc=this.getSrc(),t.contentCdn=this.getCdn(),t.contentPlayhead=this.getPlayhead(),t.contentIsLive=this.isLive(),this.state.isStarted&&(t.contentBitrate=this.getBitrate()||0,t.contentManifestBitrate=this.getManifestBitrate()||0,t.contentSegmentDownloadBitrate=this.getSegmentDownloadBitrate()||0,t.contentNetworkDownloadBitrate=this.getNetworkDownloadBitrate()||0),t.contentRenditionName=this.getRenditionName(),t.contentRenditionHeight=this.getRenditionHeight(),t.contentRenditionWidth=this.getRenditionWidth(),t.contentDuration=this.getDuration(),t.contentLanguage=this.getLanguage(),t.contentPlayrate=this.getPlayrate(),t.contentIsFullscreen=this.isFullscreen(),t.contentIsMuted=this.isMuted(),t.contentIsAutoplayed=this.isAutoplayed(),t.contentPreload=this.getPreload(),t.contentFps=this.getFps(),null!=this.adsTracker&&this.adsTracker.state.totalAdPlaytime>0&&(t.totalAdPlaytime=this.adsTracker.state.totalAdPlaytime)),this.state.getStateAttributes(t),this.state.isStarted&&!this.isAd()&&this.state.trackContentBitrateState(t.contentBitrate);for(let e in this.customData)t[e]=this.customData[e];return this.addQoeAttributes(t),t}addQoeAttributes(t){const e=(t=this.state.getQoeAttributes(t)).qoe;for(let t in this.customData)e[t]=this.customData[t]}sendCustom(t,e,i){i=i||{},this.sendVideoCustomAction(t,i),this.state.setTimeSinceAttribute(e)}sendPlayerReady(t){this.state.goPlayerReady()&&(t=t||{},this.sendVideoAction(T.Events.PLAYER_READY,t))}sendRequest(t){if(this.state.goRequest()){let e;this.isAd()?(e=T.Events.AD_REQUEST,this.sendVideoAdAction(e,t)):(e=T.Events.CONTENT_REQUEST,this.sendVideoAction(e,t))}}sendStart(t){if(this.state.goStart()){let e;if(this.isAd())e=T.Events.AD_START,this.parentTracker&&(this.parentTracker.state.isPlaying=!1),this.sendVideoAdAction(e,t),this.state.startAdsTime();else{e=T.Events.CONTENT_START;let i=0;this.adsTracker&&((this.adsTracker.state.isPlaying||this.adsTracker.state.isBuffering)&&(this.adsTracker.state.stopAdsTime(),this.adsTracker.state.isPlaying=!1,this.adsTracker.state.isBuffering=!1),i=this.adsTracker.state.totalAdTime()??0),this.state.setStartupTime(i),this.sendVideoAction(e,t),o.videoAnalyticsHarvester.setBeforeDrainCallback(()=>{if(this.state){const t=this.state.getQoeAttributes({}).qoe;o.videoAnalyticsHarvester.refreshQoeKpis(t,this.getViewId())}})}this.startHeartbeat(),this.state.goHeartbeat()}}sendEnd(t){if(this.state.goEnd()){let e;t=t||{},this.isAd()?(e=T.Events.AD_END,t.timeSinceAdRequested=this.state.timeSinceRequested.getDeltaTime(),t.timeSinceAdStarted=this.state.timeSinceStarted.getDeltaTime(),this.parentTracker&&(this.parentTracker.state.isPlaying=!0),this.state.stopAdsTime()):(e=T.Events.CONTENT_END,t.timeSinceRequested=this.state.timeSinceRequested.getDeltaTime(),t.timeSinceStarted=this.state.timeSinceStarted.getDeltaTime()),this.stopHeartbeat(),this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t),this.parentTracker&&this.isAd()&&this.parentTracker.state.goLastAd(),this.state.goViewCountUp(),this.state.totalPlaytime=0,this.isAd()||(o.videoAnalyticsHarvester.forceNextQoeCycle(),o.videoAnalyticsHarvester.setBeforeDrainCallback(null),this.adsTracker&&this.adsTracker.state.clearTotalAdsTime(),this.state.resetViewIdTrackedState())}}sendPause(t){if(this.state.goPause()){let e=this.isAd()?T.Events.AD_PAUSE:T.Events.CONTENT_PAUSE;this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t)}}sendResume(t){if(this.state.goResume()){let e;t=t||{},this.isAd()?(e=T.Events.AD_RESUME,t.timeSinceAdPaused=this.state.timeSincePaused.getDeltaTime()):(e=T.Events.CONTENT_RESUME,t.timeSincePaused=this.state.timeSincePaused.getDeltaTime()),this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t)}}sendBufferStart(t){if(this.state.goBufferStart()){let e;t=t||{},e=this.isAd()?T.Events.AD_BUFFER_START:T.Events.CONTENT_BUFFER_START,t=this.buildBufferAttributes(t),this._lastBufferType=t.bufferType,this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t)}}sendBufferEnd(t){if(this.state.goBufferEnd()){let e;t=t||{},this.isAd()?(e=T.Events.AD_BUFFER_END,t.timeSinceAdBufferBegin=this.state.timeSinceBufferBegin.getDeltaTime()):(e=T.Events.CONTENT_BUFFER_END,t.timeSinceBufferBegin=this.state.timeSinceBufferBegin.getDeltaTime()),t=this.buildBufferAttributes(t),null!=this._lastBufferType&&(t.bufferType=this._lastBufferType),this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t),this.state.initialBufferingHappened=!0}}buildBufferAttributes(t){return null==t.timeSinceStarted||t.timeSinceStarted<100?t.isInitialBuffering=!this.state.initialBufferingHappened:t.isInitialBuffering=!1,t.bufferType=this.state.calculateBufferType(t.isInitialBuffering),t.timeSinceResumed=this.state.timeSinceResumed.getDeltaTime(),t.timeSinceSeekEnd=this.state.timeSinceSeekEnd.getDeltaTime(),t}sendSeekStart(t){if(this.state.goSeekStart()){let e;e=this.isAd()?T.Events.AD_SEEK_START:T.Events.CONTENT_SEEK_START,this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t)}}sendSeekEnd(t){if(this.state.goSeekEnd()){let e;t=t||{},this.isAd()?(e=T.Events.AD_SEEK_END,t.timeSinceAdSeekBegin=this.state.timeSinceSeekBegin.getDeltaTime()):(e=T.Events.CONTENT_SEEK_END,t.timeSinceSeekBegin=this.state.timeSinceSeekBegin.getDeltaTime()),this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t)}}sendDownload(t){(t=t||{}).state||s.A.warn("Called sendDownload without { state: xxxxx }."),this.sendVideoAction(T.Events.DOWNLOAD,t),this.state.goDownload()}sendError(t){(t=t||{}).isAd=this.isAd(),this.state.goError();let e=this.isAd()?T.Events.AD_ERROR:T.Events.CONTENT_ERROR;this.sendVideoErrorAction(e,t)}sendRenditionChanged(t){let e;(t=t||{}).timeSinceLastRenditionChange=this.state.timeSinceLastRenditionChange.getDeltaTime(),t.shift=this.getRenditionShift(!0),e=this.isAd()?T.Events.AD_RENDITION_CHANGE:T.Events.CONTENT_RENDITION_CHANGE,this.isAd()?this.sendVideoAdAction(e,t):this.sendVideoAction(e,t),this.state.goRenditionChange()}sendHeartbeat(t){if(this.state.isRequested){let e,i=this.getHeartbeat();this.state._hb=!0,i=this.adjustElapsedTimeForPause(i),this.isAd()?(e=T.Events.AD_HEARTBEAT,"bitmovin-ads"===this.getPlayerName()?this.sendVideoAdAction(e,t):this.sendVideoAdAction(e,{elapsedTime:i,...t})):(e=T.Events.CONTENT_HEARTBEAT,this.sendVideoAction(e,{elapsedTime:i,...t})),this.state.goHeartbeat()}}adjustElapsedTimeForPause(t){return this.state._acc&&(t-=this.state._acc,this.state._acc=0),this.state.isPaused&&((t-=this.state.elapsedTime.getDeltaTime())<10&&(t=0),this.state.elapsedTime.start()),this.state._bufferAcc?(t-=this.state._bufferAcc,this.state._bufferAcc=0):this.state.isBuffering&&((t-=this.state.bufferElapsedTime.getDeltaTime())<5&&(t=0),this.state.bufferElapsedTime.start()),Math.max(0,t)}sendAdBreakStart(t){this.isAd()&&this.state.goAdBreakStart()&&(this.state.totalAdPlaytime=0,this.parentTracker&&(this.parentTracker.state.isPlaying=!1),this.sendVideoAdAction(T.Events.AD_BREAK_START,t))}sendAdBreakEnd(t){this.isAd()&&this.state.goAdBreakEnd()&&((t=t||{}).timeSinceAdBreakBegin=this.state.timeSinceAdBreakStart.getDeltaTime(),this.sendVideoAdAction(T.Events.AD_BREAK_END,t),this.parentTracker&&(this.parentTracker.state.isPlaying=!0),this.stopHeartbeat(),this.parentTracker&&this.isAd()&&this.parentTracker.state.goLastAd())}sendAdQuartile(t){this.isAd()&&((t=t||{}).quartile||s.A.warn("Called sendAdQuartile without { quartile: xxxxx }."),t.timeSinceLastAdQuartile=this.state.timeSinceLastAdQuartile.getDeltaTime(),this.sendVideoAdAction(T.Events.AD_QUARTILE,t),this.state.goAdQuartile())}sendAdClick(t){this.isAd()&&((t=t||{}).url||s.A.warn("Called sendAdClick without { url: xxxxx }."),this.sendVideoAdAction(T.Events.AD_CLICK,t))}}function S(t){t.type!==T.Events.AD_ERROR?this.sendVideoAdAction(t.type,t.data):this.sendVideoErrorAction(t.type,t.data)}T.Events={PLAYER_READY:"PLAYER_READY",DOWNLOAD:"DOWNLOAD",ERROR:"ERROR",CONTENT_REQUEST:"CONTENT_REQUEST",CONTENT_START:"CONTENT_START",CONTENT_END:"CONTENT_END",CONTENT_PAUSE:"CONTENT_PAUSE",CONTENT_RESUME:"CONTENT_RESUME",CONTENT_SEEK_START:"CONTENT_SEEK_START",CONTENT_SEEK_END:"CONTENT_SEEK_END",CONTENT_BUFFER_START:"CONTENT_BUFFER_START",CONTENT_BUFFER_END:"CONTENT_BUFFER_END",CONTENT_HEARTBEAT:"CONTENT_HEARTBEAT",CONTENT_RENDITION_CHANGE:"CONTENT_RENDITION_CHANGE",CONTENT_ERROR:"CONTENT_ERROR",AD_REQUEST:"AD_REQUEST",AD_START:"AD_START",AD_END:"AD_END",AD_PAUSE:"AD_PAUSE",AD_RESUME:"AD_RESUME",AD_SEEK_START:"AD_SEEK_START",AD_SEEK_END:"AD_SEEK_END",AD_BUFFER_START:"AD_BUFFER_START",AD_BUFFER_END:"AD_BUFFER_END",AD_HEARTBEAT:"AD_HEARTBEAT",AD_RENDITION_CHANGE:"AD_RENDITION_CHANGE",AD_ERROR:"AD_ERROR",AD_BREAK_START:"AD_BREAK_START",AD_BREAK_END:"AD_BREAK_END",AD_QUARTILE:"AD_QUARTILE",AD_CLICK:"AD_CLICK"};const k=T;var D=a(431),_=a(413),R=a(481),w=a(374);const P={Constants:u.A,Chrono:g.A,Log:s.A,Emitter:A.A,Tracker:l.A,VideoTracker:k,VideoTrackerState:E,Core:v,version:b.rE,NrVideoEventAggregator:D.t,RetryQueueHandler:_.u,OptimizedHttpClient:R.X,HarvestScheduler:w.n,recordEvent:c}},64(t,e,i){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(i(555)),a=s(i(472));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function u(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function l(t,e,i){return e=c(e),function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,d()?Reflect.construct(e,i||[],c(t).constructor):e.apply(t,i))}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}e.default=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),i=e,a=[{key:"isUsing",value:function(t){return!!t.ima3}}],(r=[{key:"getTrackerName",value:function(){return"brightcove-ima-ads"}},{key:"getPlayerName",value:function(){return"brightcove-ima-ads"}},{key:"getPlayhead",value:function(){var t;return null===(t=this.player)||void 0===t||null===(t=t.ima3)||void 0===t||null===(t=t.adPlayer)||void 0===t?void 0:t.currentTime()}},{key:"registerListeners",value:function(){n.default.Log.debugCommonVideoEvents(this.player,[null,"ima3-ready","ima3error","ima3-ad-error","ima3-started","ima3-complete","ima3-paused","ima3-resumed","ads-request","ads-load","ads-ad-started","ads-ad-ended","ads-pause","ads-play","ads-click","ads-pod-started","ads-pod-ended","ads-allpods-completed"]),this.player.on("ima3-started",this.onStarted.bind(this)),this.player.on("ima3-paused",this.onPaused.bind(this)),this.player.on("ima3-resumed",this.onResume.bind(this)),this.player.on("ima3-complete",this.onComplete.bind(this)),this.player.on("ima3-skipped",this.onSkipped.bind(this)),this.player.on("adserror",this.onError.bind(this)),this.player.on("ads-click",this.onClick.bind(this))}},{key:"unregisterListeners",value:function(){this.player.off("ima3-started",this.onStarted),this.player.off("ima3-paused",this.onPaused),this.player.off("ima3-resumed",this.onResume),this.player.off("ima3-complete",this.onComplete),this.player.off("ima3-skipped",this.onSkipped),this.player.off("adserror",this.onError),this.player.off("ads-click",this.onClick)}},{key:"onStarted",value:function(t){this.sendRequest(),this.sendStart()}},{key:"onPaused",value:function(t){this.sendPause()}},{key:"onResume",value:function(t){this.sendResume()}},{key:"onComplete",value:function(t){this.sendEnd()}},{key:"onSkipped",value:function(t){this.sendEnd({skipped:!0})}},{key:"onError",value:function(t){this.sendError()}},{key:"onClick",value:function(t){this.sendClick()}}])&&o(i.prototype,r),a&&o(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(a.default)},717(t,e,i){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(i(555)),a=s(i(472));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var r,n,a,s,o=[],u=!0,l=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;u=!1}else for(;!(u=(r=a.call(i)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(t){l=!0,n=t}finally{try{if(!u&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function l(t,e,i){return(e=c(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function d(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function c(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function h(t,e,i){return e=m(e),function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,i||[],m(t).constructor):e.apply(t,i))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}function y(t,e,i,r){var n=p(m(1&r?t.prototype:t),e,i);return 2&r&&"function"==typeof n?function(t){return n.apply(i,t)}:n}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=m(t)););return t}(t,e);if(r){var n=Object.getOwnPropertyDescriptor(r,e);return n.get?n.get.call(arguments.length<3?t:i):n.value}},p.apply(null,arguments)}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var g={DAI_STREAM_INITIALIZED:"dai-stream-initialized",DAI_STREAM_LOADED:"dai-stream-loaded",DAI_STREAM_ERROR:"dai-stream-error",DAI_AD_BREAK_STARTED:"dai-ad-break-started",DAI_AD_BREAK_ENDED:"dai-ad-break-ended",DAI_AD_PERIOD_STARTED:"dai-ad-period-started",DAI_AD_PERIOD_ENDED:"dai-ad-period-ended",DAI_AD_STARTED:"dai-ad-started",DAI_AD_FIRST_QUARTILE:"dai-ad-first-quartile",DAI_AD_MIDPOINT:"dai-ad-midpoint",DAI_AD_THIRD_QUARTILE:"dai-ad-third-quartile",DAI_AD_COMPLETE:"dai-ad-complete",DAI_AD_SKIPPED:"dai-ad-skipped",DAI_AD_PAUSED:"dai-ad-paused",DAI_AD_RESUMED:"dai-ad-resumed",DAI_AD_CLICKED:"dai-ad-clicked",DAI_AD_ERROR:"dai-ad-error",DAI_CUEPOINTS_CHANGED:"dai-cuepoints-changed",DAI_TIMED_METADATA:"dai-timed-metadata"};e.default=function(t){function e(t){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=h(this,e,[t])).streamManager=null,i.currentAdData=null,i.adBreakData=null,i.streamData=null,i.cuePoints=[],i.initialized=!1,i.eventHandlers=null,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(e,t),i=e,a=[{key:"isUsing",value:function(t){return t.imaDai&&"function"==typeof t.imaDai||t.dai&&void 0!==t.dai.VERSION||t.ima&&t.ima.dai||t.streamManager}}],(r=[{key:"setStreamManager",value:function(t){this.streamManager=t,this.setupStreamManagerListeners(),this.initialized=!0,n.default.Log.debug("DaiAdsTracker: StreamManager set and listeners registered")}},{key:"setupStreamManagerListeners",value:function(){var t,e,i=this;if(this.streamManager&&null!==(t=google)&&void 0!==t&&null!==(t=t.ima)&&void 0!==t&&null!==(t=t.dai)&&void 0!==t&&null!==(t=t.api)&&void 0!==t&&t.StreamEvent){var r=google.ima.dai.api.StreamEvent.Type;this.eventHandlers=(l(l(l(l(l(l(l(l(l(l(e={},r.LOADED,this.onStreamLoaded.bind(this)),r.STREAM_INITIALIZED,this.onStreamInitialized.bind(this)),r.ERROR,this.onStreamError.bind(this)),r.AD_BREAK_STARTED,this.onAdBreakStarted.bind(this)),r.AD_BREAK_ENDED,this.onAdBreakEnded.bind(this)),r.AD_PERIOD_STARTED,this.onAdPeriodStarted.bind(this)),r.AD_PERIOD_ENDED,this.onAdPeriodEnded.bind(this)),r.STARTED,this.onAdStarted.bind(this)),r.FIRST_QUARTILE,this.onAdFirstQuartile.bind(this)),r.MIDPOINT,this.onAdMidpoint.bind(this)),l(l(l(l(l(l(l(l(l(e,r.THIRD_QUARTILE,this.onAdThirdQuartile.bind(this)),r.COMPLETE,this.onAdComplete.bind(this)),r.SKIPPED,this.onAdSkipped.bind(this)),r.PAUSED,this.onAdPaused.bind(this)),r.RESUMED,this.onAdResumed.bind(this)),r.CLICK,this.onAdClicked.bind(this)),r.VIDEO_CLICKED,this.onAdClicked.bind(this)),r.CUEPOINTS_CHANGED,this.onCuePointsChanged.bind(this)),r.TIMED_METADATA,this.onTimedMetadata.bind(this))),Object.entries(this.eventHandlers).forEach(function(t){var e=o(t,2),r=e[0],n=e[1];i.streamManager.addEventListener(r,n)}),n.default.Log.debug("DaiAdsTracker: StreamManager listeners registered")}else n.default.Log.warn("DaiAdsTracker: StreamManager or DAI API not available")}},{key:"registerListeners",value:function(){y(e,"registerListeners",this,3)([]),n.default.Log.debugCommonVideoEvents(this.player,[null,Object.values(g)])}},{key:"unregisterListeners",value:function(){var t=this;y(e,"unregisterListeners",this,3)([]),this.streamManager&&this.eventHandlers&&Object.entries(this.eventHandlers).forEach(function(e){var i=o(e,2),r=i[0],n=i[1];t.streamManager.removeEventListener(r,n)}),this.streamManager=null,this.currentAdData=null,this.adBreakData=null,this.streamData=null,this.cuePoints=[],this.initialized=!1,this.eventHandlers=null}},{key:"onStreamLoaded",value:function(t){this.streamData=this.extractStreamData(t),n.default.Log.debug("DaiAdsTracker: Stream loaded",this.streamData),this.sendRequest()}},{key:"onStreamInitialized",value:function(t){n.default.Log.debug("DaiAdsTracker: Stream initialized"),this.sendDownload({state:"stream-initialized"})}},{key:"onStreamError",value:function(t){var e=this.extractErrorData(t);n.default.Log.error("DaiAdsTracker: Stream error",e),this.sendError(e)}},{key:"onAdBreakStarted",value:function(t){this.adBreakData=this.extractAdBreakData(t),n.default.Log.debug("DaiAdsTracker: Ad break started",this.adBreakData),this.sendAdBreakStart(this.adBreakData)}},{key:"onAdBreakEnded",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad break ended"),this.sendAdBreakEnd(),this.adBreakData=null}},{key:"onAdPeriodStarted",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad period started"),this.adBreakData||this.onAdBreakStarted(t)}},{key:"onAdPeriodEnded",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad period ended")}},{key:"onAdStarted",value:function(t){this.currentAdData=this.extractAdData(t),n.default.Log.debug("DaiAdsTracker: Ad started",this.currentAdData),this.sendStart()}},{key:"onAdFirstQuartile",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad first quartile"),this.sendAdQuartile({quartile:1})}},{key:"onAdMidpoint",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad midpoint"),this.sendAdQuartile({quartile:2})}},{key:"onAdThirdQuartile",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad third quartile"),this.sendAdQuartile({quartile:3})}},{key:"onAdComplete",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad complete"),this.sendEnd(),this.currentAdData=null}},{key:"onAdSkipped",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad skipped"),this.sendEnd({skipped:!0}),this.currentAdData=null}},{key:"onAdPaused",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad paused"),this.sendPause()}},{key:"onAdResumed",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad resumed"),this.sendResume()}},{key:"onAdClicked",value:function(t){n.default.Log.debug("DaiAdsTracker: Ad clicked"),this.sendAdClick({url:this.getClickThroughUrl()})}},{key:"onCuePointsChanged",value:function(t){this.cuePoints=this.extractCuePoints(t),n.default.Log.debug("DaiAdsTracker: Cue points changed",this.cuePoints)}},{key:"onTimedMetadata",value:function(t){var e=this.extractTimedMetadata(t);n.default.Log.debug("DaiAdsTracker: Timed metadata",e)}},{key:"extractStreamData",value:function(t){try{var e=t.getStreamData();return{streamId:null==e?void 0:e.streamId,url:null==e?void 0:e.url,adTagParameters:null==e?void 0:e.adTagParameters,streamType:this.getStreamType()}}catch(t){return n.default.Log.warn("DaiAdsTracker: Failed to extract stream data",t),{}}}},{key:"extractAdBreakData",value:function(t){try{var e,i=t.getAdBreak();return{adBreakId:null==i?void 0:i.id,adBreakTitle:null==i?void 0:i.title,adCount:(null==i||null===(e=i.ads)||void 0===e?void 0:e.length)||0,position:this.getAdPosition()}}catch(t){return n.default.Log.warn("DaiAdsTracker: Failed to extract ad break data",t),{}}}},{key:"extractAdData",value:function(t){try{var e=t.getAd();return{adId:null==e?void 0:e.getAdId(),creativeId:null==e?void 0:e.getCreativeId(),duration:null==e?void 0:e.getDuration(),title:null==e?void 0:e.getTitle(),description:null==e?void 0:e.getDescription(),advertiserName:null==e?void 0:e.getAdvertiserName(),clickThroughUrl:null==e?void 0:e.getClickThroughUrl(),dealId:null==e?void 0:e.getDealId(),wrapperAdIds:null==e?void 0:e.getWrapperAdIds(),position:this.getAdPosition()}}catch(t){return n.default.Log.warn("DaiAdsTracker: Failed to extract ad data",t),{}}}},{key:"extractErrorData",value:function(t){try{var e=t.getError();return{errorCode:null==e?void 0:e.getErrorCode(),errorMessage:null==e?void 0:e.getMessage(),innerError:null==e?void 0:e.getInnerError()}}catch(e){return n.default.Log.warn("DaiAdsTracker: Failed to extract error data",e),{errorMessage:"Unknown DAI error"}}}},{key:"extractCuePoints",value:function(t){try{return t.getCuepoints()||[]}catch(t){return n.default.Log.warn("DaiAdsTracker: Failed to extract cue points",t),[]}}},{key:"extractTimedMetadata",value:function(t){try{return{type:t.getType(),data:t.getData()}}catch(t){return n.default.Log.warn("DaiAdsTracker: Failed to extract timed metadata",t),{}}}},{key:"getTrackerName",value:function(){return"dai-ads"}},{key:"getPlayerName",value:function(){return"videojs-dai"}},{key:"getPlayerVersion",value:function(){var t,e;return null!==(t=this.player.dai)&&void 0!==t&&t.VERSION?this.player.dai.VERSION:null!==(e=this.player.ima)&&void 0!==e&&e.VERSION?"ima-dai: ".concat(this.player.ima.VERSION):"unknown"}},{key:"getAdCuePoints",value:function(){return this.cuePoints}},{key:"getAdPosition",value:function(){if(!this.currentAdData&&!this.adBreakData)return null;var t=this.player.currentTime(),e=this.player.duration();return t<5?"pre":e&&t>e-10?"post":"mid"}},{key:"getDuration",value:function(){var t;return void 0!==(null===(t=this.currentAdData)||void 0===t?void 0:t.duration)?1e3*this.currentAdData.duration:null}},{key:"getVideoId",value:function(){var t;return(null===(t=this.currentAdData)||void 0===t?void 0:t.adId)||null}},{key:"getAdCreativeId",value:function(){var t;return(null===(t=this.currentAdData)||void 0===t?void 0:t.creativeId)||null}},{key:"getTitle",value:function(){var t;return(null===(t=this.currentAdData)||void 0===t?void 0:t.title)||null}},{key:"getSrc",value:function(){var t;return(null===(t=this.streamData)||void 0===t?void 0:t.url)||null}},{key:"getPlayhead",value:function(){if(this.streamManager)try{return 1e3*this.streamManager.getStreamTime()}catch(t){return 1e3*this.player.currentTime()}return 1e3*this.player.currentTime()}},{key:"getAdPartner",value:function(){return"google-dai"}},{key:"getClickThroughUrl",value:function(){var t;return(null===(t=this.currentAdData)||void 0===t?void 0:t.clickThroughUrl)||null}},{key:"getStreamType",value:function(){var t;return null!==(t=this.streamData)&&void 0!==t&&t.streamType?this.streamData.streamType:this.player.duration()===1/0?"live":"vod"}},{key:"isLiveStream",value:function(){return"live"===this.getStreamType()}},{key:"getCurrentAdBreak",value:function(){return this.adBreakData}},{key:"getCurrentAd",value:function(){return this.currentAdData}},{key:"getStreamData",value:function(){return this.streamData}},{key:"getBitrate",value:function(){var t=this.getTech();if(t&&t.tech&&t.tech.stats)return t.tech.stats.bandwidth}},{key:"getRenditionBitrate",value:function(){var t=this.getTech();if(t&&t.getRenditionBitrate)return t.getRenditionBitrate()}}])&&d(i.prototype,r),a&&d(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(a.default)},38(t,e,i){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,a=(n=i(472))&&n.__esModule?n:{default:n};function s(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,o(r.key),r)}}function o(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function u(t,e,i){return e=d(e),function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,l()?Reflect.construct(e,i||[],d(t).constructor):e.apply(t,i))}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}e.default=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),u(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),function(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"getTrackerName",value:function(){return"freewheel-ads"}},{key:"getPlayerName",value:function(){return"freewheel-ads"}},{key:"getPlayerVersion",value:function(){return this.player.FreeWheelPlugin.VERSION}},{key:"getPlayhead",value:function(){if(this.player.ads.ad.currentTime)return 1e3*this.player.ads.ad.currentTime()}},{key:"getDuration",value:function(){if(this.player.ads.ad.duration)return 1e3*this.player.ads.ad.duration}},{key:"getVideoId",value:function(){return this.player.ads.ad.id}},{key:"getAdPartner",value:function(){return"freewheel"}},{key:"getAdCreativeId",value:function(){try{return this.player.ads.provider.event.adInstance.getActiveCreativeRendition().getId()}catch(t){}}},{key:"getSrc",value:function(){try{return this.player.ads.provider.event.adInstance.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl()}catch(t){}}},{key:"getTitle",value:function(){try{return this.player.ads.provider.event.adInstance.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getName()}catch(t){}}},{key:"getAdPosition",value:function(){switch(this.player.ads.ad.type){case"PREROLL":return nrvideo.Constants.AdPositions.PRE;case"MIDROLL":return nrvideo.Constants.AdPositions.MID;case"POSTROLL":return nrvideo.Constants.AdPositions.POST}}}],[{key:"isUsing",value:function(t){return!!t.FreeWheelPlugin&&"undefined"!=typeof tv&&tv.freewheel}}])}(a.default)},298(t,e,i){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(i(555)),a=s(i(472));function s(t){return t&&t.__esModule?t:{default:t}}function o(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function u(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function l(t,e,i){return e=c(e),function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,d()?Reflect.construct(e,i||[],c(t).constructor):e.apply(t,i))}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}e.default=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),i=e,r=[{key:"getTrackerName",value:function(){return"ima-ads"}},{key:"getPlayerName",value:function(){return"ima"}},{key:"getPlayerVersion",value:function(){return"ima: "+google.ima.VERSION+"; contrib-ads: "+this.player.ads.VERSION}},{key:"getCuePoints",value:function(){return this.player.ima.getAdsManager().getCuePoints()}},{key:"getAdPosition",value:function(){if(this.lastAdData&&this.lastAdData.podInfo&&void 0!==this.lastAdData.podInfo.podIndex){var t=this.lastAdData.podInfo.podIndex;return 0===t?"pre":-1===t?"post":"mid"}return null}},{key:"getDuration",value:function(){return this.lastAdData&&void 0!==this.lastAdData.duration?1e3*this.lastAdData.duration:null}},{key:"getVideoId",value:function(){return this.lastAdData&&this.lastAdData.adId?this.lastAdData.adId:null}},{key:"getAdCreativeId",value:function(){return this.lastAdData&&this.lastAdData.creativeId?this.lastAdData.creativeId:null}},{key:"getSrc",value:function(){return this.lastAdData&&this.lastAdData.mediaUrl?this.lastAdData.mediaUrl:null}},{key:"getTitle",value:function(){return this.lastAdData&&this.lastAdData.title?this.lastAdData.title:null}},{key:"getPlayhead",value:function(){var t=this.player.ima.getAdsManager();if(t)return 1e3*(this.getDuration()-t.getRemainingTime())}},{key:"getPlayrate",value:function(){return this.player.playbackRate()}},{key:"getAdPartner",value:function(){return"ima"}},{key:"getWebkitBitrate",value:function(){var t=this.getAdVideoElement();if(t&&t.webkitVideoDecodedByteCount){var e;if(this._lastAdWebkitBitrate>0){var i=t.webkitVideoDecodedByteCount-this._lastAdWebkitBitrate,r=this.getHeartbeat()/1e3;e=Math.round(i/r*8)}return this._lastAdWebkitBitrate=t.webkitVideoDecodedByteCount,null!=e?e:null}return null}},{key:"getRenditionBitrate",value:function(){if(this.lastAdData)return this.lastAdData.renditionBitrate}},{key:"registerListeners",value:function(){var t=google.ima.AdEvent.Type,e=google.ima.AdErrorEvent.Type.AD_ERROR;this.lastAdData=null,n.default.Log.debugCommonVideoEvents(this.player.ima.addEventListener,[null,t.ALL_ADS_COMPLETED,t.LINEAR_CHANGED,t.COMPLETE,t.USER_CLOSE,t.IMPRESSION,t.CONTENT_PAUSE_REQUESTED,t.CONTENT_RESUME_REQUESTED,t.SKIPPED,t.SKIPPABLE_STATE_CHANGED,t.LOADED,t.PAUSED,t.RESUMED,t.STARTED,t.AD_CAN_PLAY,t.AD_METADATA,t.EXPANDED_CHANGED,t.AD_BREAK_READY,t.LOG,t.CLICK,t.FIRST_QUARTILE,t.MIDPOINT,t.THIRD_QUARTILE,e]),this.player.ima.addEventListener(t.LOADED,this.onLoaded.bind(this)),this.player.ima.addEventListener(t.STARTED,this.onStart.bind(this)),this.player.ima.addEventListener(t.PAUSED,this.onPaused.bind(this)),this.player.ima.addEventListener(t.RESUMED,this.onResumed.bind(this)),this.player.ima.addEventListener(t.COMPLETE,this.onComplete.bind(this)),this.player.ima.addEventListener(t.SKIPPED,this.onSkipped.bind(this)),this.player.ima.addEventListener(t.CLICK,this.onClick.bind(this)),this.player.ima.addEventListener(t.FIRST_QUARTILE,this.onFirstQuartile.bind(this)),this.player.ima.addEventListener(t.MIDPOINT,this.onMidpoint.bind(this)),this.player.ima.addEventListener(t.THIRD_QUARTILE,this.onThirdQuartile.bind(this)),this.player.ima.addEventListener(e,this.onError.bind(this))}},{key:"unregisterListeners",value:function(){var t=google.ima.AdEvent.Type,e=google.ima.AdErrorEvent.Type.AD_ERROR;this.player.ima.removeEventListener(t.LOADED,this.onLoaded),this.player.ima.removeEventListener(t.STARTED,this.onLoaded.bind(this)),this.player.ima.removeEventListener(t.IMPRESSION,this.onImpression),this.player.ima.removeEventListener(t.PAUSED,this.onPaused),this.player.ima.removeEventListener(t.RESUMED,this.onResumed),this.player.ima.removeEventListener(t.COMPLETE,this.onComplete),this.player.ima.removeEventListener(t.SKIPPED,this.onSkipped),this.player.ima.removeEventListener(t.CLICK,this.onClick),this.player.ima.removeEventListener(t.FIRST_QUARTILE,this.onFirstQuartile),this.player.ima.removeEventListener(t.MIDPOINT,this.onMidpoint),this.player.ima.removeEventListener(t.THIRD_QUARTILE,this.onThirdQuartile),this.player.ima.removeEventListener(e,this.onError),this.lastAdData=null}},{key:"onLoaded",value:function(t){this.lastAdData=this.getAdData(),this.sendRequest()}},{key:"onStart",value:function(t){this.lastAdData=this.getAdData(),this._lastAdWebkitBitrate=0,this.sendStart()}},{key:"onComplete",value:function(t){this.sendEnd(),this.lastAdData=null}},{key:"onSkipped",value:function(t){this.sendEnd({skipped:!0}),this.lastAdData=null}},{key:"onError",value:function(t){var e=t.getError(),i=e.getErrorCode(),r=e.getMessage();this.sendError({adError:e,errorCode:i,errorMessage:r})}},{key:"onClick",value:function(t){this.sendAdClick()}},{key:"onFirstQuartile",value:function(){this.sendAdQuartile({adQuartile:1})}},{key:"onMidpoint",value:function(){this.sendAdQuartile({adQuartile:2})}},{key:"onThirdQuartile",value:function(){this.sendAdQuartile({adQuartile:3})}},{key:"onPaused",value:function(){this.sendPause()}},{key:"onResumed",value:function(){this.sendResume()}},{key:"getAdData",value:function(){try{var t=this.player.ima.getAdsManager();if(t){var e,i=t.getCurrentAd();if(i)return{adId:i.getAdId(),creativeId:i.getCreativeId(),duration:i.getDuration(),mediaUrl:i.getMediaUrl(),title:i.getTitle(),podInfo:null===(e=i.getAdPodInfo())||void 0===e?void 0:e.data,renditionBitrate:i.getVastMediaBitrate()}}return null}catch(t){return null}}},{key:"getAdVideoElement",value:function(){if(this.player.ima&&this.player.ima.controller&&this.player.ima.controller.adUi){var t=this.player.ima.controller.adUi.adContainerDiv;if(t){var e=t.querySelector("video");if(e)return e}}}}],a=[{key:"isUsing",value:function(t){return t.ima&&"undefined"!=typeof google}}],r&&o(i.prototype,r),a&&o(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(a.default)},472(t,e,i){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(i(555)),a=l(i(330)),s=l(i(409)),o=l(i(257)),u=l(i(338));function l(t){return t&&t.__esModule?t:{default:t}}function d(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function c(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function h(t,e,i){return e=y(e),function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,i||[],y(t).constructor):e.apply(t,i))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}e.default=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),h(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(e,t),i=e,(r=[{key:"getTech",value:function(){var t=this.player.tech({IWillNotUseThisInPlugins:!0});if(t){if(s.default.isUsing(t))return new s.default(t);if(o.default.isUsing(t))return new o.default(t);if(u.default.isUsing(t))return new u.default(t)}}},{key:"getTrackerName",value:function(){return"videojs-ads"}},{key:"getTrackerVersion",value:function(){return a.default.version}},{key:"isMuted",value:function(){return this.player.muted()}},{key:"getRenditionHeight",value:function(){return null}},{key:"getRenditionWidth",value:function(){return null}},{key:"getPlayerName",value:function(){return"videojs-ads"}},{key:"getPlayerVersion",value:function(){return this.player.ads.VERSION}},{key:"registerListeners",value:function(){n.default.Log.debugCommonVideoEvents(this.player,[null,"ads-request","ads-load","adstart","adend","adskip","adserror","ads-click","ads-pod-started","ads-pod-ended","ads-first-quartile","ads-midpoint","ads-third-quartile","ads-pause","ads-play","adtimeout"]),this.player.on("ads-request",this.onAdrequest.bind(this)),this.player.on("ads-load",this.onAdload.bind(this)),this.player.on("adstart",this.onAdstart.bind(this)),this.player.on("adend",this.onAdend.bind(this)),this.player.on("adskip",this.onAdskip.bind(this)),this.player.on("adserror",this.onAdserror.bind(this)),this.player.on("ads-click",this.onAdsClick.bind(this)),this.player.on("ads-pod-started",this.onPodStart.bind(this)),this.player.on("ads-pod-ended",this.onPodEnd.bind(this)),this.player.on("ads-first-quartile",this.onFirstQuartile.bind(this)),this.player.on("ads-midpoint",this.onMidpoint.bind(this)),this.player.on("ads-third-quartile",this.onThirdQuartile.bind(this)),this.player.on("ads-pause",this.onAdspause.bind(this)),this.player.on("ads-play",this.onAdsplay.bind(this))}},{key:"unregisterListeners",value:function(){this.player.off("ads-request",this.onAdrequest),this.player.off("ads-load",this.onAdload),this.player.off("adstart",this.onAdstart),this.player.off("adend",this.onAdend),this.player.off("adskip",this.onAdskip),this.player.off("adserror",this.onAdserror),this.player.off("ads-click",this.onAdsClick),this.player.off("ads-pod-started",this.onPodStart),this.player.off("ads-pod-ended",this.onPodEnd),this.player.off("ads-first-quartile",this.onFirstQuartile),this.player.off("ads-midpoint",this.onMidpoint),this.player.off("ads-third-quartile",this.onThirdQuartile),this.player.off("ads-pause",this.onAdspause),this.player.off("ads-play",this.onAdsplay)}},{key:"onAdrequest",value:function(t){this.sendRequest(),this.sendDownload({state:"ads-request"})}},{key:"onAdload",value:function(t){this.sendDownload({state:"ads-load"})}},{key:"onAdstart",value:function(t){this.sendRequest(),this.sendStart()}},{key:"onAdend",value:function(t){this.sendEnd()}},{key:"onAdskip",value:function(t){this.sendEnd({skipped:!0})}},{key:"onAdserror",value:function(t){this.sendError()}},{key:"onAdsClick",value:function(t){this.sendAdClick({url:"unknown"})}},{key:"onPodStart",value:function(t){this.sendAdBreakStart()}},{key:"onPodEnd",value:function(t){this.sendAdBreakEnd()}},{key:"onFirstQuartile",value:function(){this.sendAdQuartile({quartile:1})}},{key:"onMidpoint",value:function(){this.sendAdQuartile({quartile:2})}},{key:"onThirdQuartile",value:function(){this.sendAdQuartile({quartile:3})}},{key:"onAdspause",value:function(){this.sendPause()}},{key:"onAdsplay",value:function(){this.sendResume()}}])&&d(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r}(n.default.VideoTracker)},409(t,e){function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function n(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,a(r.key),r)}}function a(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,(e.default=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tech=e.vhs,this.player=e.el().player},(e=[{key:"getRenditionName",value:function(){try{var t=this.tech.playlists.media();if(t&&t.attributes)return t.attributes.NAME}catch(t){}return null}},{key:"getRenditionBitrate",value:function(){try{var t=this.tech.playlists.media();if(t&&t.attributes)return t.attributes.BANDWIDTH}catch(t){}return null}},{key:"getRenditionWidth",value:function(){try{var t=this.tech.playlists.media();if(t&&t.attributes&&t.attributes.RESOLUTION)return t.attributes.RESOLUTION.width}catch(t){}return null}},{key:"getRenditionHeight",value:function(){try{var t=this.tech.playlists.media();if(t&&t.attributes&&t.attributes.RESOLUTION)return t.attributes.RESOLUTION.height}catch(t){}return null}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getManifestBitrate",value:function(){try{var t=this.tech.playlists.master.playlists;if(t&&t.length>0)return Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.map(function(t){return t.attributes.BANDWIDTH})))}catch(t){}return null}},{key:"getSegmentDownloadBitrate",value:function(){var t;return void 0!==(null===(t=this.tech.stats)||void 0===t?void 0:t.bandwidth)&&this.tech.stats.bandwidth>0?this.tech.stats.bandwidth:null}},{key:"getNetworkDownloadBitrate",value:function(){return void 0!==this.tech.throughput&&this.tech.throughput>0?this.tech.throughput:null}},{key:"getContentBitratePlayback",value:function(){try{var t=this.tech.playlists.media();if(t&&t.attributes)return t.attributes["AVERAGE-BANDWIDTH"]||t.attributes.BANDWIDTH||null}catch(t){}return null}}])&&n(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}()).isUsing=function(t){return!!t.vhs}},257(t,e){function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function n(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,a(r.key),r)}}function a(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,(e.default=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tech=e.vhs_,this.player=e.el().player},(e=[{key:"getResource",value:function(t){return this.tech.url}},{key:"getRenditionName",value:function(t){try{var e=this.tech.levels[this.tech.currentLevel];if(e&&e.name)return e.name}catch(t){}return null}},{key:"getRenditionBitrate",value:function(t){try{var e=this.tech.levels[this.tech.currentLevel];if(e&&e.bitrate)return e.bitrate}catch(t){}return null}},{key:"getRenditionWidth",value:function(t){try{var e=this.tech.levels[this.tech.currentLevel];if(e&&e.width)return e.width}catch(t){}return null}},{key:"getRenditionHeight",value:function(t){try{var e=this.tech.levels[this.tech.currentLevel];if(e&&e.height)return e.height}catch(t){}return null}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){try{var t=this.tech.levels[this.tech.currentLevel];if(t&&t.bitrate)return t.bitrate}catch(t){}return null}},{key:"getManifestBitrate",value:function(){try{if(this.tech.levels&&this.tech.levels.length>0)return Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this.tech.levels.map(function(t){return t.bitrate})))}catch(t){}return null}},{key:"getSegmentDownloadBitrate",value:function(){try{if(this.tech.stats&&this.tech.stats.bandwidth>0)return this.tech.stats.bandwidth}catch(t){}return null}},{key:"getNetworkDownloadBitrate",value:function(){return this.tech.throughput&&this.tech.throughput>0?this.tech.throughput:null}}])&&n(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}()).isUsing=function(t){return!!t.vhs_}},338(t,e){function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function n(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,a(r.key),r)}}function a(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,(e.default=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tech=e.shakaPlayer,this.player=e.el().player},e=[{key:"getSrc",value:function(t){try{return this.tech.getManifestUri()}catch(t){}return null}},{key:"getRenditionBitrate",value:function(t){try{return this.tech.getStats().streamBandwidth}catch(t){}return null}},{key:"getManifestBitrate",value:function(){try{var t=this.tech.getVariantTracks();if(t&&t.length>0)return Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.map(function(t){return t.videoBandwidth+(t.audioBandwidth||0)})))}catch(t){}return null}},{key:"getRenditionWidth",value:function(t){try{var e=this.tech.getVariantTracks();for(var i in e){var r=e[i];if(r.active&&"video"===r.type)return r.width}}catch(t){}return null}},{key:"getRenditionHeight",value:function(t){try{var e=this.tech.getVariantTracks();for(var i in e){var r=e[i];if(r.active&&"video"===r.type)return r.height}}catch(t){}return null}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){try{var t=this.tech.getStats();if(t&&t.streamBandwidth&&t.streamBandwidth>0)return t.streamBandwidth}catch(t){}return null}},{key:"getSegmentDownloadBitrate",value:function(){try{var t=this.tech.getStats();if(t&&t.estimatedBandwidth>0)return t.estimatedBandwidth}catch(t){}return null}},{key:"getNetworkDownloadBitrate",value:function(){try{var t=this.tech.getStats();if(t&&t.estimatedBandwidth>0)return t.estimatedBandwidth}catch(t){}return null}}],e&&n(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}()).isUsing=function(t){return!!t.shakaPlayer}},302(t,e,i){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BrightcoveImaAdsTracker",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"ContribHlsTech",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"FreewheelAdsTracker",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"HlsJsTech",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ImaAdsTracker",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"ShakaTech",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"VideojsAdsTracker",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var n=y(i(555)),a=y(i(330)),s=y(i(409)),o=y(i(257)),u=y(i(338)),l=y(i(472)),d=y(i(298)),c=y(i(64)),h=y(i(38)),f=y(i(717));function y(t){return t&&t.__esModule?t:{default:t}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function m(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,v(r.key),r)}}function v(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function g(t,e,i){return e=E(e),function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,A()?Reflect.construct(e,i||[],E(t).constructor):e.apply(t,i))}function A(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(A=function(){return!!t})()}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}e.default=function(t){function e(t,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=g(this,e,[t,i])).isContentEnd=!1,r.imaAdCuePoints="",r.daiInitialized=!1,n.default.Core.addTracker(r,i),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(e,t),i=e,r=[{key:"getTech",value:function(){var t=this.player.tech({IWillNotUseThisInPlugins:!0});if(t){if(s.default.isUsing(t))return new s.default(t);if(o.default.isUsing(t))return new o.default(t);if(u.default.isUsing(t))return new u.default(t)}}},{key:"getTrackerName",value:function(){return"videojs"}},{key:"getInstrumentationProvider",value:function(){return"New Relic"}},{key:"getInstrumentationName",value:function(){return this.getPlayerName()}},{key:"getInstrumentationVersion",value:function(){return this.getPlayerVersion()}},{key:"getTrackerVersion",value:function(){return a.default.version}},{key:"getPlayhead",value:function(){return this.player.ads&&"ads-playback"===this.player.ads.state&&this.player.ads.snapshot&&this.player.ads.snapshot.currentTime?1e3*this.player.ads.snapshot.currentTime:this.player.absoluteTime?1e3*this.player.absoluteTime():1e3*this.player.currentTime()}},{key:"getDuration",value:function(){return this.player.mediainfo&&void 0!==this.player.mediainfo.duration?1e3*this.player.mediainfo.duration:1e3*this.player.duration()}},{key:"getTitle",value:function(){var t;return null===(t=this.player)||void 0===t||null===(t=t.mediainfo)||void 0===t?void 0:t.name}},{key:"getId",value:function(){var t;return null===(t=this.player)||void 0===t||null===(t=t.mediainfo)||void 0===t?void 0:t.id}},{key:"getLanguage",value:function(){var t;return null===(t=this.player)||void 0===t?void 0:t.language()}},{key:"getSrc",value:function(){var t=this.getTech();return t&&t.getSrc?t.getSrc():this.player.currentSrc()}},{key:"getPlayerName",value:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.name())||"videojs"}},{key:"getPlayerVersion",value:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.version)||videojs.VERSION}},{key:"isMuted",value:function(){return this.player.muted()}},{key:"getBitrate",value:function(){return this.getContentBitratePlayback()}},{key:"getContentBitratePlayback",value:function(){try{var t,e=this.player.tech({IWillNotUseThisInPlugins:!0});if(null!=e&&null!==(t=e.vhs)&&void 0!==t&&null!==(t=t.playlists)&&void 0!==t&&t.media()){var i=e.vhs.playlists.media();return i.attributes["AVERAGE-BANDWIDTH"]||i.attributes.BANDWIDTH||null}var r=this.getTech();if(null!=r&&r.getBitrate)return r.getBitrate()}catch(t){}return null}},{key:"getRenditionName",value:function(){var t=this.getTech();if(t&&t.getRenditionName)return t.getRenditionName()}},{key:"getManifestBitrate",value:function(){try{var t,e=this.player.tech({IWillNotUseThisInPlugins:!0}),i=null==e||null===(t=e.vhs)||void 0===t||null===(t=t.playlists)||void 0===t||null===(t=t.master)||void 0===t?void 0:t.playlists;if(i&&i.length>0){var r=Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return p(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(i.map(function(t){return t.attributes.BANDWIDTH||0})));return r>0?r:null}var n=this.getTech();if(null!=n&&n.getManifestBitrate)return n.getManifestBitrate()}catch(t){}return null}},{key:"getSegmentDownloadBitrate",value:function(){try{var t,e=this.player.tech({IWillNotUseThisInPlugins:!0});if(null!=e&&null!==(t=e.vhs)&&void 0!==t&&null!==(t=t.stats)&&void 0!==t&&t.bandwidth&&e.vhs.stats.bandwidth>0)return e.vhs.stats.bandwidth;var i=this.getTech();if(null!=i&&i.getSegmentDownloadBitrate)return i.getSegmentDownloadBitrate()}catch(t){}return null}},{key:"getNetworkDownloadBitrate",value:function(){var t,e=this.player.tech({IWillNotUseThisInPlugins:!0});if(null!=e&&null!==(t=e.vhs)&&void 0!==t&&t.throughput&&e.vhs.throughput>0)return e.vhs.throughput;var i=this.getTech();return null!=i&&i.getNetworkDownloadBitrate?i.getNetworkDownloadBitrate():null}},{key:"getRenditionHeight",value:function(){var t=this.getTech();return t&&t.getRenditionHeight?t.getRenditionHeight():this.player.videoHeight()}},{key:"getRenditionWidth",value:function(){var t=this.getTech();return t&&t.getRenditionWidth?t.getRenditionWidth():this.player.videoWidth()}},{key:"getPlayrate",value:function(){return this.player.playbackRate()}},{key:"isAutoplayed",value:function(){return this.player.autoplay()}},{key:"isFullscreen",value:function(){return this.player.isFullscreen()}},{key:"getPreload",value:function(){return this.player.preload()}},{key:"registerListeners",value:function(){n.default.Log.debugCommonVideoEvents(this.player,["adstart","adend","adskip","adsready","adserror","dispose"]),this.onDownload=this.onDownload.bind(this),this.onAdsready=this.onAdsready.bind(this),this.onAdStart=this.onAdStart.bind(this),this.onAdEnd=this.onAdEnd.bind(this),this.onPlay=this.onPlay.bind(this),this.onPause=this.onPause.bind(this),this.onPlaying=this.onPlaying.bind(this),this.onAbort=this.onAbort.bind(this),this.onEnded=this.onEnded.bind(this),this.onDispose=this.onDispose.bind(this),this.onSeeking=this.onSeeking.bind(this),this.onSeeked=this.onSeeked.bind(this),this.onError=this.onError.bind(this),this.onWaiting=this.onWaiting.bind(this),this.onTimeupdate=this.onTimeupdate.bind(this),this.OnAdsAllpodsCompleted=this.OnAdsAllpodsCompleted.bind(this),this.onStreamManager=this.onStreamManager.bind(this),this.player.on("loadstart",this.onDownload),this.player.on("loadeddata",this.onDownload),this.player.on("loadedmetadata",this.onDownload),this.player.on("adsready",this.onAdsready),this.player.on("adstart",this.onAdStart),this.player.on("adend",this.onAdEnd),this.player.on("play",this.onPlay),this.player.on("pause",this.onPause),this.player.on("playing",this.onPlaying),this.player.on("abort",this.onAbort),this.player.on("ended",this.onEnded),this.player.on("dispose",this.onDispose),this.player.on("seeking",this.onSeeking),this.player.on("seeked",this.onSeeked),this.player.on("error",this.onError),this.player.on("waiting",this.onWaiting),this.player.on("timeupdate",this.onTimeupdate),this.player.on("ads-allpods-completed",this.OnAdsAllpodsCompleted),this.player.on("stream-manager",this.onStreamManager)}},{key:"unregisterListeners",value:function(){this.player.off("loadstart",this.onDownload),this.player.off("loadeddata",this.onDownload),this.player.off("loadedmetadata",this.onDownload),this.player.off("adsready",this.onAdsready),this.player.off("adstart",this.onAdStart),this.player.off("adend",this.onAdEnd),this.player.off("play",this.onPlay),this.player.off("pause",this.onPause),this.player.off("playing",this.onPlaying),this.player.off("abort",this.onAbort),this.player.off("ended",this.onEnded),this.player.off("dispose",this.onDispose),this.player.off("seeking",this.onSeeking),this.player.off("seeked",this.onSeeked),this.player.off("error",this.onError),this.player.off("waiting",this.onWaiting),this.player.off("timeupdate",this.onTimeupdate),this.player.off("ads-allpods-completed",this.OnAdsAllpodsCompleted),this.player.off("stream-manager",this.onStreamManager)}},{key:"onDownload",value:function(t){this.sendDownload({state:t.type})}},{key:"onStreamManager",value:function(t){if(!this.adsTracker&&t.StreamManager){var e=new f.default(this.player);e.setStreamManager(t.StreamManager),this.setAdsTracker(e)}}},{key:"onAdsready",value:function(){this.adsTracker||(c.default.isUsing(this.player)?this.setAdsTracker(new c.default(this.player)):d.default.isUsing(this.player)?this.setAdsTracker(new d.default(this.player)):h.default.isUsing(this.player)?this.setAdsTracker(new h.default(this.player)):this.setAdsTracker(new l.default(this.player)))}},{key:"onAdStart",value:function(){var t;this.currentAdPlaying=!0,this.imaAdCuePoints||(this.imaAdCuePoints=null===(t=this.player)||void 0===t||null===(t=t.ima)||void 0===t?void 0:t.getAdsManager().getCuePoints())}},{key:"onAdEnd",value:function(){this.isContentEnd&&this.sendEnd()}},{key:"OnAdsAllpodsCompleted",value:function(){this.onEnded.bind(this),this.FreewheelAdsCompleted=!0}},{key:"onPlay",value:function(){this.sendRequest()}},{key:"onPause",value:function(){this.sendPause()}},{key:"onPlaying",value:function(){this.sendResume(),this.sendBufferEnd()}},{key:"onAbort",value:function(){this.sendEnd()}},{key:"onEnded",value:function(){this.adsTracker?(this.isContentEnd=!0,this.imaAdCuePoints&&!this.imaAdCuePoints.includes(-1)&&this.sendEnd()):this.sendEnd()}},{key:"onDispose",value:function(){this.sendEnd()}},{key:"onSeeking",value:function(){this.sendSeekStart()}},{key:"onSeeked",value:function(){this.sendSeekEnd()}},{key:"onError",value:function(){var t=this.player.error(),e=t.code,i=t.message;this.player.error&&this.player.error()&&this.sendError({errorCode:e,errorMessage:i})}},{key:"onWaiting",value:function(t){this.sendBufferStart()}},{key:"onTimeupdate",value:function(t){this.getPlayhead()>.1&&this.sendStart()}}],r&&m(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r}(n.default.VideoTracker)},330(t){t.exports=JSON.parse('{"name":"@newrelic/video-videojs","version":"4.1.1","description":"New relic tracker for Videojs","main":"dist/cjs/index.js","module":"dist/esm/index.js","scripts":{"build":"webpack --mode production","build:dev":"webpack --mode development","watch":"webpack --mode production --progress --color --watch","watch:dev":"webpack --progress --color --watch --mode development","prezip":"npm run build","zip":"zip -P newrelic -x \'*.DS_Store\' -x \'samples/agent.js\' -r videojs.zip dist samples README.md CHANGELOG.md EULA.md","clean":"rm -rf dist *.zip","deploy":"node scripts/deploy.js","third-party-updates":"oss third-party manifest --includeOptDeps && oss third-party notices --includeOptDeps && git add THIRD_PARTY_NOTICES.md third_party_manifest.json"},"repository":{"type":"git","url":"https://github.com/newrelic/video-videojs-js.git"},"author":"Jordi Aguilar","contributors":["Andreu Santarén Llop","Bharat Saraswat","Malay Chandan"],"license":"Apache-2.0","devDependencies":{"@babel/core":"^7.24.5","@babel/plugin-transform-modules-commonjs":"^7.24.1","@babel/preset-env":"^7.24.5","@newrelic/newrelic-oss-cli":"^0.1.2","aws-sdk":"^2.920.0","babel-loader":"^9.1.3","videojs-ima":"2.1.0","webpack":"^5.91.0","webpack-cli":"^4.9.2"},"files":["THIRD_PARTY_NOTICES.md","dist","CHANGELOG.md","README.md","src","!test"],"publishConfig":{"access":"public"},"dependencies":{"@newrelic/video-core":"^4.0.0"}}')}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,i),a.exports}i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{var t=r;t.default=void 0;var e,n=(e=i(302))&&e.__esModule?e:{default:e};t.default=n.default})(),r.default})());
|
|
3
3
|
//# sourceMappingURL=newrelic-video-videojs.min.js.map
|