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V,EAAK,aAAc,CACrB,CAEA,SAAS,IACP,IAAI,EAAW,IACb,EAAM,IAlER,EAAK,YAAc,EAAK,SAAS,aAAe,EAAK,QACrD,EAAK,QAAU,EAAK,SAAS,YAsEJ,IAArB,EAAK,aAGP,EAAW,CAAE,SAAU,EAAU,OAAQ,QAAS,MAAO,GAE7D,CAMA,SAAS,EAAW,QACO,IAAd,OAAO,KAIG,iBAAV,OAMmB,IAAnB,EAAM,cAKW,IAAjB,EAAM,YAKU,IAAhB,EAAM,MAKO,cAApB,EAAK,WACP,OAAO,GAAG,OAAQ,QAAS,EAAM,SAAU,EAAM,OAAQ,EAAM,MAAO,CACpE,eAAgB,IAEW,YAApB,EAAK,YACd,OAAO,KAAK,KAAK,CACf,cACA,EAAM,SACN,EAAM,OACN,EAAM,WACN,GACA,IAfF,QAAQ,MAAM,wBALd,QAAQ,MAAM,yBALd,QAAQ,MAAM,2BANd,QAAQ,MAAM,mBAkClB,CAjIA,KAAK,WAAa,YAElB,KAAK,aAAc,EACnB,KAAK,QAAU,GACf,KAAK,SAAW,EA+HhB,KAAK,KAAO,SAAS,QAGO,IAAf,EAAK,OACd,QAAQ,MAAM,wCAEY,IAAjB,EAAK,UAEd,EAAK,WACc,cAAjB,EAAK,SAA4C,YAAjB,EAAK,QACjC,EAAK,QACL,EAAK,YAGb,EAAK,SAAW,EAAK,MACrB,EAAK,SAAS,iBAAiB,aAAc,GAC7C,EAAK,SAAS,iBAAiB,QAAS,GACxC,EAAK,SAAS,iBAAiB,OAAQ,GACvC,EAAK,SAAS,iBAAiB,QAAS,EAC1C,CACF,EAGA,EAAQ,aAAe,EACvB,EAAQ,OAAS,EAEjB,OAAO,eAAe,EAAS,aAAc,CAAE,OAAO,GAEvD","file":"/npm/apm-html5-player@1.1.3/dist/bundle.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/apm-html5-player@1.1.3/dist/bundle.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n  typeof define === 'function' && define.amd ? define(['exports'], factory) :\n  (global = global || self, factory(global.ApmPlayer = {}));\n}(this, (function (exports) { 'use strict';\n\n  // Formats an ugly time (in seconds) to a nice readable format\n  // e.g. 125 > 2:05, or 4226 > 1:10:26\n  function toFormatted(timeInSeconds) {\n    timeInSeconds = Math.round(timeInSeconds);\n\n    var formattedTime = '';\n    var formattedMinutes = '';\n    var formattedSeconds = '';\n    var hours = Math.floor(timeInSeconds / 3600);\n    var minutes = Math.floor(timeInSeconds / 60 - hours * 60);\n    var seconds = timeInSeconds - minutes * 60 - hours * 3600;\n\n    if (hours !== 0) {\n      formattedTime = hours + ':';\n\n      if (minutes < 10) {\n        formattedMinutes = '0' + minutes;\n      } else {\n        formattedMinutes = minutes.toString();\n      }\n    } else {\n      formattedMinutes = minutes.toString();\n    }\n\n    if (seconds < 10) {\n      formattedSeconds = '0' + seconds;\n    } else {\n      formattedSeconds = seconds.toString();\n    }\n\n    formattedTime = formattedTime + formattedMinutes + ':' + formattedSeconds;\n\n    return formattedTime;\n  }\n\n  // Required modules for page load\n\n  // Constructor\n  // The 'parent' argument passed in is the parent object from Player.js.\n  // This script is only intended to be used with that Player.js.\n  var Playlist = function(parent) {\n    this.player = parent;\n    // The containing DOM element\n    this.el = this.player.playlistEl;\n  };\n\n  // -----------------------------\n  // Setup functions\n  // -----------------------------\n\n  Playlist.prototype.init = function() {\n    this.selectElements()\n      .setNextItem()\n      .bindEventHandlers();\n  };\n\n  Playlist.prototype.selectElements = function() {\n    this.itemEls = this.el.querySelectorAll('.js-playlist-item');\n\n    return this;\n  };\n\n  Playlist.prototype.setNextItem = function() {\n    Array.prototype.forEach.call(this.itemEls, function(currentItemEl) {\n      var nextItemEl = currentItemEl.nextElementSibling;\n      var nextSrc;\n\n      if (!nextItemEl) {\n        return;\n      }\n\n      nextSrc = nextItemEl.getAttribute('data-src');\n      currentItemEl.setAttribute('data-next', nextSrc);\n    });\n\n    return this;\n  };\n\n  Playlist.prototype.bindEventHandlers = function() {\n    var self = this;\n\n    Array.prototype.forEach.call(this.itemEls, function(el) {\n      el.addEventListener('click', self.onItemClick.bind(self));\n    });\n\n    return this;\n  };\n\n  // -----------------------------\n  // Event Handlers\n  // -----------------------------\n\n  Playlist.prototype.onItemClick = function(e) {\n    e.preventDefault();\n    var targetEl = e.currentTarget;\n    var src = targetEl.getAttribute('data-src');\n    var title = targetEl.getAttribute('data-title');\n    var artist = targetEl.getAttribute('data-artist');\n\n    this.player.el.setAttribute('data-src', src);\n    this.player.loadAudioFromSources(src);\n    this.player.playAudio();\n    this.displayPlayedState(targetEl);\n    this.displayBufferingState(targetEl);\n    this.populatePlayerInfo(title, artist);\n  };\n\n  // -----------------------------\n  // Helpers\n  // -----------------------------\n\n  Playlist.prototype.displayPlayedState = function(el) {\n    this.removeDisplayStates();\n    el.classList.add('is-playing');\n  };\n\n  Playlist.prototype.displayPlayingState = function(el) {\n    this.removeBufferingState(el);\n    this.removePausedState(el);\n  };\n\n  Playlist.prototype.displayPausedState = function(el) {\n    el.classList.add('is-paused');\n  };\n\n  Playlist.prototype.removePausedState = function(el) {\n    el.classList.remove('is-paused');\n  };\n\n  Playlist.prototype.displayBufferingState = function(el) {\n    el.classList.add('is-loading');\n  };\n\n  Playlist.prototype.removeBufferingState = function(el) {\n    el.classList.remove('is-loading');\n  };\n\n  Playlist.prototype.removeDisplayStates = function() {\n    var self = this;\n\n    Array.prototype.forEach.call(this.itemEls, function(el) {\n      self.removeBufferingState(el);\n      self.removePausedState(el);\n      el.classList.remove('is-playing');\n      el.classList.remove('is-active');\n    });\n  };\n\n  Playlist.prototype.populatePlayerInfo = function(title, artist) {\n    this.player.titleEl.textContent = title;\n    this.player.artistEl.textContent = artist;\n  };\n\n  // import Playlist from './Playlist';\n\n  // Constants\n  var PLAYING_CLASS = 'is-playing';\n  var PAUSED_CLASS = 'is-paused';\n  var LOADING_CLASS = 'is-loading';\n  var MUTED_CLASS = 'is-muted';\n\n  // Constructor\n  var Player = function(el, options) {\n    // The containing DOM element\n    this.el = el;\n\n    // An object with player options\n    this.options = options;\n\n    // The playing/paused state of the Player\n    this.isPlaying = false;\n\n    // A variable to store the previous volume the player was set at.\n    this.storedVolume = 1;\n\n    // References to the playlist\n    this.playlistSelector = this.el.getAttribute('data-playlist');\n    this.playlistEl = document.querySelector(this.playlistSelector);\n    // The playlist module, initialized later\n    this.playlist;\n    // Set to true when playlist is initialized\n    this.hasPlaylist = false;\n    // Set to true when mousedown on audio timelineEl\n    this.isSeeking = false;\n  };\n\n  // -----------------------------\n  // Initialized functions\n  // -----------------------------\n\n  // Initialize the module\n  Player.prototype.init = function() {\n    this.selectElements()\n      .initPlaylist()\n      .getSources()\n      .bindEventHandlers()\n      .initTime()\n      .displayCurrentVolume();\n\n    return this;\n  };\n\n  // Descendant elements of the containing DOM element\n  Player.prototype.selectElements = function() {\n    // The audio element used for playback\n    this.audioEl = this.el.querySelector('audio');\n    // Controls\n    this.playButtonEls = this.el.querySelectorAll('.js-player-play');\n    this.skipForwardButtonEl = this.el.querySelector('[data-skip-forward]');\n    this.skipBackButtonEl = this.el.querySelector('[data-skip-back]');\n    this.timelineEl = this.el.querySelector('.js-player-timeline');\n    this.timelineProgressEl =\n      this.timelineEl && this.timelineEl.querySelector('.js-player-progress');\n    this.timelineBufferedEl =\n      this.timelineEl && this.timelineEl.querySelector('.js-player-buffered');\n    this.volumeBarEl = this.el.querySelector('.js-player-volume');\n    this.currentVolumeEl =\n      this.volumeBarEl &&\n      this.volumeBarEl.querySelector('.js-player-volume-current');\n    this.muteButtonEl = this.el.querySelector('.js-player-mute');\n    // Info\n    this.durationEl = this.el.querySelector('.js-player-duration');\n    this.currentTimeEl = this.el.querySelector('.js-player-currentTime');\n    this.titleEl = this.el.querySelector('.js-player-title');\n    this.artistEl = this.el.querySelector('.js-player-artist');\n\n    return this;\n  };\n\n  Player.prototype.getSources = function() {\n    // Get data-src attribute each time this is called in case the attribute changes\n    try {\n      this.sources = JSON.parse(\n        // decodeURI is used in case any URL characters (like %20 for spaces) are in the string\n        decodeURI(this.el.getAttribute('data-src')).replace(/'/g, '\"')\n      );\n    } catch (e) {\n      if (typeof console !== 'undefined') {\n        // If the error is anything other than not evaluating to JSON, print to console\n        var syntaxReg = /^\\s*SyntaxError: Unexpected token|^\\s*SyntaxError: Unexpected end of JSON input/;\n        if (!syntaxReg.test(e)) {\n          // eslint-disable-next-line\n          console.log(e);\n        }\n      }\n\n      this.sources = this.el.getAttribute('data-src');\n    }\n\n    return this;\n  };\n\n  // Setup and bind event handlers\n  Player.prototype.bindEventHandlers = function() {\n    var self = this;\n\n    // Click events\n\n    // Apply click event to all play buttons\n    Array.prototype.forEach.call(this.playButtonEls, function(el) {\n      el.addEventListener('click', self.onPlayClick.bind(self));\n    });\n\n    this.skipForwardButtonEl &&\n      this.skipForwardButtonEl.addEventListener(\n        'click',\n        this.onSkipForwardClick.bind(this)\n      );\n\n    this.skipBackButtonEl &&\n      this.skipBackButtonEl.addEventListener(\n        'click',\n        this.onSkipBackClick.bind(this)\n      );\n\n    if (this.timelineEl) {\n      this.timelineEl.addEventListener(\n        'mousedown',\n        this.onTimelineMousedown.bind(this)\n      );\n      this.timelineEl.addEventListener(\n        'mouseup',\n        this.onTimelineMouseup.bind(this)\n      );\n      this.timelineEl.addEventListener(\n        'mousemove',\n        this.onTimelineMousemove.bind(this)\n      );\n    }\n    this.volumeBarEl &&\n      this.volumeBarEl.addEventListener('click', this.onVolumeClick.bind(this));\n\n    this.muteButtonEl &&\n      this.muteButtonEl.addEventListener('click', this.onMuteClick.bind(this));\n\n    // Audio element events\n    this.audioEl.addEventListener('play', this.onAudioPlay.bind(this));\n    this.audioEl.addEventListener('pause', this.onAudioPause.bind(this));\n    this.audioEl.addEventListener(\n      'timeupdate',\n      this.onAudioTimeupdate.bind(this)\n    );\n    this.audioEl.addEventListener('waiting', this.onAudioWaiting.bind(this));\n    this.audioEl.addEventListener('playing', this.onAudioPlaying.bind(this));\n    this.audioEl.addEventListener('ended', this.onAudioEnded.bind(this));\n    this.audioEl.addEventListener('volumechange', this.onVolumeChange.bind(this));\n    this.audioEl.addEventListener(\n      'loadedmetadata',\n      this.onLoadedMetadata.bind(this)\n    );\n    this.audioEl.addEventListener('progress', this.onProgress.bind(this));\n\n    return this;\n  };\n\n  Player.prototype.initTime = function() {\n    this.displayCurrentTime();\n    return this;\n  };\n\n  Player.prototype.initPlaylist = function() {\n    if (this.playlistEl) {\n      this.playlist = new Playlist(this);\n      this.playlist.init();\n      this.hasPlaylist = true;\n    }\n\n    return this;\n  };\n\n  // -----------------------------\n  // Event Handlers\n  // -----------------------------\n\n  Player.prototype.onPlayClick = function(e) {\n    e.preventDefault();\n    const button = e.target.closest('.js-player-play');\n    button.disabled = true;\n    setTimeout(() => {\n      this.handlePlay();\n      button.disabled = false;\n    }, 200);\n  };\n\n  // handler is separated from actual click event so it can be called\n  // externally (e.g. from play buttons outside of the player interface)\n  Player.prototype.handlePlay = function() {\n    if (this.isPlaying === false) {\n      if (this.audioEl.readyState === 0) {\n        // get sources from data attribute in case it changed\n        this.getSources();\n        this.loadAudioFromSources(this.sources);\n      }\n      this.playAudio();\n    } else {\n      this.pauseAudio();\n      if (this.audioEl.duration === Infinity) {\n        this.unloadAudio();\n      }\n    }\n  };\n\n  Player.prototype.onSkipForwardClick = function(e) {\n    var targetEl = e.currentTarget;\n    var seconds = targetEl.getAttribute('data-skip-forward');\n\n    e.preventDefault();\n\n    if (this.audioEl.duration === Infinity) {\n      return;\n    }\n\n    this.skipForward(seconds);\n  };\n\n  Player.prototype.onSkipBackClick = function(e) {\n    var targetEl = e.currentTarget;\n    var seconds = targetEl.getAttribute('data-skip-back');\n\n    e.preventDefault();\n\n    if (this.audioEl.duration === Infinity) {\n      return;\n    }\n\n    this.skipBack(seconds);\n  };\n\n  Player.prototype.onTimelineMousedown = function(e) {\n    var targetEl = e.currentTarget;\n    var clickXPosition = e.pageX;\n    var seconds = this.getSecondsByClickPosition(targetEl, clickXPosition);\n\n    e.preventDefault(e);\n\n    this.seekTime(seconds);\n    this.isSeeking = true;\n  };\n\n  Player.prototype.onTimelineMouseup = function(e) {\n    e.preventDefault(e);\n\n    this.isSeeking = false;\n  };\n\n  Player.prototype.onTimelineMousemove = function(e) {\n    e.preventDefault(e);\n    if (this.isSeeking) {\n      this.onTimelineMousedown(e);\n    }\n  };\n\n  Player.prototype.onVolumeClick = function(e) {\n    var targetEl = e.currentTarget;\n    var volume;\n\n    if (targetEl.getAttribute('data-volume-direction') === 'h') {\n      var clickXPosition = e.pageX;\n      volume = this.getVolumeByHorizClickPosition(targetEl, clickXPosition);\n    } else {\n      var clickYPosition = e.pageY;\n      volume = this.getVolumeByVertClickPosition(targetEl, clickYPosition);\n    }\n\n    e.preventDefault();\n\n    this.changeVolume(volume);\n  };\n\n  Player.prototype.onMuteClick = function(e) {\n    e.preventDefault();\n\n    if (this.audioEl.volume !== 0) {\n      this.muteAudio();\n    } else {\n      this.unmuteAudio();\n    }\n  };\n\n  // HTMLMediaElement 'play' event fires when a request\n  // to play the audio has occurred. Does not necessarily mean the\n  // audio is actually playing. (see 'playing' event)\n  Player.prototype.onAudioPlay = function() {\n    this.isPlaying = true;\n    this.displayPlayedState();\n  };\n\n  // HTMLMediaElement 'pause' event fires when the audio gets paused\n  Player.prototype.onAudioPause = function() {\n    this.isPlaying = false;\n    this.displayPausedState();\n  };\n\n  // HTMLMediaElement 'timeupdate' event fires while the audio is playing\n  // and the current time changes, usually several times per second\n  Player.prototype.onAudioTimeupdate = function() {\n    this.displayCurrentTime();\n    this.sendToNielsen('setPlayheadPosition', Date.now() / 1000);\n  };\n\n  // HTMLMediaElement 'waiting' event fires when audio is downloading\n  // or interrupted, such as when buffering at first play\n  Player.prototype.onAudioWaiting = function() {\n    this.displayBufferingState();\n  };\n\n  // HTMLMediaElement 'playing' event fires when audio has actually\n  // begun playing (after being loaded)\n  Player.prototype.onAudioPlaying = function() {\n    this.displayPlayingState();\n  };\n\n  // HTMLMediaElement 'ended' event fires when audio playback has\n  // finished for the current file\n  Player.prototype.onAudioEnded = function() {\n    this.displayStoppedState();\n    if (this.hasPlaylist === true) {\n      this.playNext();\n    }\n  };\n\n  // HTMLMediaElement 'volumechange' event fires when the audio's\n  // volume changes\n  Player.prototype.onVolumeChange = function() {\n    this.displayCurrentVolume();\n  };\n\n  // HTMLMediaElement 'onLoadedMetadata' event fires when the audio's\n  // metadata has been downloaded\n  Player.prototype.onLoadedMetadata = function() {\n    this.displayDuration();\n    this.sendToNielsen('loadMetadata', window.nielsenMetadataObject);\n  };\n\n  // HTMLMediaElement 'progress' event fires when any data\n  // gets downloaded\n  Player.prototype.onProgress = function() {\n    this.displayTimeRanges();\n  };\n\n  // -----------------------------\n  // Audio Element Methods\n  // -----------------------------\n\n  Player.prototype.loadAudioFromSources = function(sources) {\n    // Remove the src attribute on the audio element in case it was left in the HTML.\n    // An empty src attribute will interfere with the inner <source> elements.\n    this.audioEl.removeAttribute('src');\n    // Clear any existing <source> elements\n    this.audioEl.innerHTML = '';\n\n    if (typeof sources === 'string') {\n      // Turn a string value into an array with one item\n      // This is in this function so that loadAudioFromSources()\n      // can be called externally with a string if needed\n      sources = sources.split();\n    }\n\n    this.createSourceEls(sources);\n    this.audioEl.load();\n  };\n\n  Player.prototype.createSourceEls = function(sources) {\n    var self = this;\n    // Append <source> elements to the <audio> element\n    sources.forEach(function(source) {\n      var sourceUrl;\n      var sourceType;\n\n      // if using a source object, get the type from the object,\n      // fall back to figure it out based on the filename\n      if (typeof source === 'object' && !Array.isArray(source)) {\n        sourceUrl = source.url;\n        sourceType = source.type;\n      } else {\n        sourceUrl = source;\n        sourceType = self.getSourceType(source);\n      }\n\n      // Generate the html\n      var sourceEl = document.createElement('source');\n      sourceEl.setAttribute('src', sourceUrl);\n      // Only set a type if sourceType is not null\n      if (sourceType !== null) {\n        sourceEl.setAttribute('type', sourceType);\n      }\n      self.audioEl.appendChild(sourceEl);\n    });\n  };\n\n  Player.prototype.getSourceType = function(source) {\n    // We don't test for only the end of the filename in case\n    // there is a cache busting string on the end\n    var aacReg = /\\.aac/;\n    var mp4Reg = /\\.mp4/;\n    var m4aReg = /\\.m4a/;\n    var oggReg = /\\.ogg|\\.oga/;\n    var mp3Reg = /\\.mp3/;\n\n    if (aacReg.test(source)) {\n      return 'audio/aac';\n    } else if (mp4Reg.test(source)) {\n      return 'audio/mp4';\n    } else if (oggReg.test(source)) {\n      return 'audio/ogg';\n    } else if (m4aReg.test(source)) {\n      return 'audio/m4a';\n    } else if (mp3Reg.test(source)) {\n      return 'audio/mpeg';\n    } else {\n      return null;\n    }\n  };\n\n  Player.prototype.sendToNielsen = function(key, value) {\n    if (window.nSdkInstance && this.audioEl.duration === Infinity) {\n      window.nSdkInstance.ggPM(key, value);\n    }\n  };\n\n  Player.prototype.unloadAudio = function() {\n    this.isPlaying = false;\n    // Remove inner <source> elements\n    this.audioEl.innerHTML = '';\n    // Forces the audio element to read the (nonexistent) <source> elements and update\n    this.audioEl.load();\n    this.displayStoppedState();\n    this.sendToNielsen('stop', Date.now() / 1000);\n  };\n\n  Player.prototype.playAudio = async function() {\n    this.pauseAllAudio();\n    // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n    // Don't load audio if it's already loaded because that causes it to go back to the beginning.\n    if (this.audioEl.readyState != 4) await this.audioEl.load();\n    this.audioEl.play();\n  };\n\n  Player.prototype.pauseAudio = function(currentAudio) {\n    if (typeof currentAudio !== 'undefined') {\n      currentAudio.pause();\n    } else {\n      this.audioEl.pause();\n    }\n  };\n\n  Player.prototype.pauseAllAudio = function() {\n    // Pause any audio that may already be playing on the page.\n    var self = this;\n    var audioEls = document.querySelectorAll('audio');\n    Array.prototype.forEach.call(audioEls, function(el) {\n      self.pauseAudio(el);\n    });\n  };\n\n  Player.prototype.playNext = function() {\n    var nextSrc = this.getNextPlaylistSrc();\n\n    var nextItemEl;\n\n    if (typeof nextSrc === 'undefined' || nextSrc === null) return;\n\n    this.el.setAttribute('data-src', nextSrc);\n    nextItemEl = this.findNext(nextSrc);\n    this.playlist.populatePlayerInfo(\n      nextItemEl.getAttribute('data-title'),\n      nextItemEl.getAttribute('data-artist')\n    );\n    this.loadAudioFromSources(nextSrc);\n    this.playAudio();\n  };\n\n  Player.prototype.findNext = function(src) {\n    return this.playlistEl.querySelector('li[data-src=\"' + src + '\"]');\n  };\n\n  Player.prototype.getSecondsByClickPosition = function(element, clickXPosition) {\n    var timelineRect = element.getBoundingClientRect();\n    var timelineOffset = timelineRect.left;\n    var timelineWidth = element.offsetWidth;\n    var positionInElement = clickXPosition - timelineOffset;\n    var percent = positionInElement / timelineWidth;\n    var time = this.audioEl.duration * percent;\n    var seconds = Number(time.toFixed());\n\n    return seconds;\n  };\n\n  Player.prototype.seekTime = function(seconds) {\n    this.audioEl.currentTime = seconds;\n  };\n\n  Player.prototype.skipForward = function(seconds) {\n    this.audioEl.currentTime = this.audioEl.currentTime + Number(seconds);\n  };\n\n  Player.prototype.skipBack = function(seconds) {\n    this.audioEl.currentTime = this.audioEl.currentTime - Number(seconds);\n  };\n\n  Player.prototype.getVolumeByHorizClickPosition = function(\n    element,\n    clickXPosition\n  ) {\n    var volumeBarRect = element.getBoundingClientRect();\n    var volumeBarOffset = volumeBarRect.left + window.pageXOffset;\n    var volumeBarWidth = element.offsetWidth;\n    var positionInElement = clickXPosition - volumeBarOffset;\n    var percent = positionInElement / volumeBarWidth;\n    var volume = Number(percent.toFixed(2));\n\n    return volume;\n  };\n\n  Player.prototype.getVolumeByVertClickPosition = function(\n    element,\n    clickYPosition\n  ) {\n    var volumeBarRect = element.getBoundingClientRect();\n    var volumeBarOffset = volumeBarRect.top + window.pageYOffset;\n    var volumeBarHeight = element.offsetHeight;\n    var positionInElement = clickYPosition - volumeBarOffset;\n    var positionFromBottom = volumeBarHeight - positionInElement;\n    var percent = positionFromBottom / volumeBarHeight;\n    var volume = Number(percent.toFixed(2));\n\n    return volume;\n  };\n\n  Player.prototype.getCurrentPlaylistItem = function() {\n    var srcString = this.el.getAttribute('data-src');\n    var items = Array.prototype.filter.call(this.playlist.itemEls, function(el) {\n      return el.matches('[data-src=\"' + srcString + '\"]');\n    });\n    var itemEl = items[0];\n    return itemEl;\n  };\n\n  Player.prototype.getNextPlaylistSrc = function() {\n    var itemEl = this.getCurrentPlaylistItem();\n    return itemEl.getAttribute('data-next');\n  };\n\n  Player.prototype.changeVolume = function(volume) {\n    this.audioEl.volume = volume;\n  };\n\n  Player.prototype.muteAudio = function() {\n    this.storedVolume = this.audioEl.volume;\n\n    this.displayMutedState();\n    this.changeVolume(0);\n  };\n\n  Player.prototype.unmuteAudio = function() {\n    this.displayUnmutedState();\n    if (this.storedVolume) {\n      this.changeVolume(this.storedVolume);\n    } else {\n      this.changeVolume(1);\n    }\n  };\n\n  // Displays the length of the audio file\n  Player.prototype.displayDuration = function() {\n    // Exit if no duration element in DOM\n    if (!this.durationEl) return;\n\n    var duration;\n\n    if (this.audioEl.duration !== Infinity) {\n      duration = toFormatted(this.audioEl.duration);\n      this.durationEl.innerHTML = duration;\n    }\n  };\n\n  // Changes the current time numbers while playing\n  Player.prototype.displayCurrentTime = function() {\n    // Exit if current time element isn't in DOM\n    if (!this.currentTimeEl) return;\n\n    var currentTime = toFormatted(this.audioEl.currentTime);\n    this.currentTimeEl.innerHTML = currentTime;\n    if (this.audioEl.duration === Infinity) {\n      return;\n    } else {\n      this.updateTimelineProgress();\n    }\n\n    return this;\n  };\n\n  // Modifies timeline length based on progress\n  Player.prototype.updateTimelineProgress = function() {\n    // Exit if there is no timeline in DOM\n    if (!this.timelineEl) return;\n\n    var progress = (this.audioEl.currentTime / this.audioEl.duration) * 100;\n    this.timelineProgressEl.style.width = progress + '%';\n  };\n\n  // Show the portions of the file that have been downloaded\n  // (i.e. 'buffered') on the timeline\n  Player.prototype.displayTimeRanges = function() {\n    // Exit if there is no timeline element\n    if (!this.timelineBufferedEl) return;\n    // Exit if audio isn't playing\n    if (this.isPlaying !== true) return;\n    // Exit if live audio is playing\n    if (this.audioEl.duration === Infinity) return;\n\n    for (var i = 0; i < this.audioEl.buffered.length; i++) {\n      var currentBuffer = i;\n\n      if (this.audioEl.buffered.start(currentBuffer) < this.audioEl.currentTime) {\n        var startX = this.audioEl.buffered.start(currentBuffer);\n        var endX = this.audioEl.buffered.end(currentBuffer);\n        var posXPercent = (startX / this.audioEl.duration) * 100;\n        var widthPercent = ((endX - startX) / this.audioEl.duration) * 100;\n        var timeRangeEls = this.timelineBufferedEl.children;\n\n        if (timeRangeEls[currentBuffer]) {\n          timeRangeEls[currentBuffer].style.left = posXPercent + '%';\n          timeRangeEls[currentBuffer].style.width = widthPercent + '%';\n        } else {\n          this.timelineBufferedEl.appendChild(document.createElement('div'));\n          timeRangeEls[currentBuffer].style.left = posXPercent + '%';\n          timeRangeEls[currentBuffer].style.width = widthPercent + '%';\n        }\n      }\n    }\n  };\n\n  // Modifies the play/pause button state\n  Player.prototype.displayPlayedState = function() {\n    this.el.classList.remove(PAUSED_CLASS);\n    this.el.classList.add(PLAYING_CLASS);\n\n    if (this.hasPlaylist === true) {\n      this.playlist.displayPlayedState(this.getCurrentPlaylistItem());\n    }\n  };\n\n  // Modifies the play/pause button state\n  Player.prototype.displayPausedState = function() {\n    this.el.classList.remove(PLAYING_CLASS);\n    this.el.classList.add(PAUSED_CLASS);\n\n    if (this.hasPlaylist === true) {\n      this.playlist.displayPausedState(this.getCurrentPlaylistItem());\n    }\n  };\n\n  // Modifies the timeline\n  Player.prototype.displayPlayingState = function() {\n    this.removeBufferingState();\n\n    if (this.hasPlaylist === true) {\n      this.playlist.displayPlayingState(this.getCurrentPlaylistItem());\n    }\n  };\n\n  // Modifies the timeline, button displays paused state\n  Player.prototype.displayStoppedState = function() {\n    this.el.classList.remove(PLAYING_CLASS);\n    this.el.classList.remove(PAUSED_CLASS);\n    this.removeBufferingState();\n\n    if (this.hasPlaylist === true) {\n      this.playlist.removeDisplayStates();\n    }\n  };\n\n  // Adds buffering styles to timeline\n  Player.prototype.displayBufferingState = function() {\n    this.el.classList.add(LOADING_CLASS);\n\n    if (this.hasPlaylist === true) {\n      this.playlist.displayBufferingState(this.getCurrentPlaylistItem());\n    }\n  };\n\n  // Removes buffering styles from timeline\n  Player.prototype.removeBufferingState = function() {\n    this.el.classList.remove(LOADING_CLASS);\n\n    if (this.hasPlaylist === true) {\n      this.playlist.removeBufferingState(this.getCurrentPlaylistItem());\n    }\n  };\n\n  Player.prototype.displayCurrentVolume = function() {\n    if (!this.volumeBarEl) return;\n\n    var volumePercent = this.audioEl.volume * 100;\n\n    if (this.audioEl.volume === 0) {\n      this.displayMutedState();\n    } else {\n      this.displayUnmutedState();\n    }\n\n    if (this.volumeBarEl.getAttribute('data-volume-direction') === 'h') {\n      this.currentVolumeEl.style.width = volumePercent + '%';\n    } else {\n      this.currentVolumeEl.style.height = volumePercent + '%';\n    }\n\n    return this;\n  };\n\n  Player.prototype.displayMutedState = function() {\n    this.el.classList.add(MUTED_CLASS);\n  };\n\n  Player.prototype.displayUnmutedState = function() {\n    this.el.classList.remove(MUTED_CLASS);\n  };\n\n  var NielsenSetup = function() {};\n\n  NielsenSetup.prototype.init = function(params, metadata) {\n    window.nielsenMetadataObject = metadata;\n    window.nSdkInstance = window.NOLCMB.getInstance(params);\n    window.nSdkInstance.ggInitialize(params);\n  };\n\n  /*\n   * Google Analytics plug-in for HTML5 Player\n   *\n   * Example Usage:\n   * var example_analytics = new HTML5PlayerGoogleAnalytics();\n   * example_analytics.init({ version: 'classic' ,  audio: $('#audio') }); // omit 'version' property to default to 'universal'\n   * Note Marketplace uses universal anaylics now.\n   * Conceptually its probably easiest ot think about this piece of code as something that registers\n   * event listeners (start, end and timeupdate) for the HTML5 audio player. Then we send a Google Analytics event on START,\n   * FINISH and 25, 50 amd 75% the way through aka Quartiles.\n   */\n\n  function HTML5PlayerGoogleAnalytics(args) {\n    var self = this;\n\n    /* Default to Google Analytics Universal API */\n    this.ga_version = 'universal';\n    //@todo  rethink the use of isFirstPlay as a statemachine and make it its own object?\n    this.isFirstPlay = true;\n    this.lastsrc = '';\n    this.quartile = 0;\n\n    function checkSources() {\n      self.isFirstPlay = self.audioele.currentSrc === self.lastsrc ? false : true;\n      self.lastsrc = self.audioele.currentSrc;\n    }\n\n    /* Return category 'Live Audio', 'On-Demand Audio' or in rare instances 'Underwriting' */\n    function getCategory() {\n      var cat;\n      if (self.audioele.currentSrc.indexOf('stream.publicradio.org') > -1) {\n        cat = 'Live Audio';\n      } else {\n        cat = 'On-Demand Audio';\n      }\n      return cat;\n    }\n\n    function audioSrcForReporting() {\n      return self.audioele.currentSrc.replace(\n        'http://play.publicradio.org/api-2.0.1/o',\n        ''\n      );\n    }\n\n    function percent_played() {\n      return self.audioele.currentTime / self.audioele.duration;\n    }\n\n    /* Triggered every 100ms with position update data */\n    function onPositionUpdate() {\n      if (self.audioele.duration === Infinity) {\n        return; // bail if it is live audio\n      }\n      var category = getCategory();\n      var src = audioSrcForReporting();\n      var percent = percent_played();\n      var quartile = Math.floor((percent + 0.02) * 4);\n\n      // Track quartiles played for static audio, but not underwriting.\n      // Log 'QUARTILE-2', and 'QUARTILE-3', but not 'QUARTILE-1', or 'QUARTILE-4'.\n      // We don't need to log QUARTILE-1 because START is the same thing.\n      // We don't need to log QUARTILE-4 because FINISHED is the same thing.\n      if (quartile > self.quartile && percent > 0 && percent !== 1) {\n        self.quartile = quartile;\n\n        if (quartile <= 3) {\n          //console.log('About to call with: ' );\n          //console.log({ category: category, action: 'QUARTILE-'+quartile, label: src});\n          trackEvent({\n            category: category,\n            action: 'QUARTILE-' + quartile,\n            label: src\n          });\n        }\n      }\n    }\n\n    function onMediaFinished() {\n      var category = getCategory();\n      var src = audioSrcForReporting();\n      //console.log('About to call with: ' );\n      //console.log({ category: category, action: 'FINISHED', label: src});\n      trackEvent({ category: category, action: 'FINISHED', label: src });\n      self.isFirstPlay = true;\n    }\n\n    function onPlayPause() {\n      var category = getCategory(),\n        src = audioSrcForReporting();\n\n      checkSources();\n\n      // Track only the first 'PLAY' event as 'START' (we don't care about 'PAUSE' status)\n      if (self.isFirstPlay === true) {\n        //console.log('About to call with: ' );\n        //console.log({ category: category, action: 'START', label: src});\n        trackEvent({ category: category, action: 'START', label: src });\n      }\n    }\n\n    /* Handle Google Universal or Classic API calls\n     * @example trackEvent({ category: 'Live Audio' action: 'START', label: meta.identifier });\n     * @example trackEvent({ category: 'On-Demand Audio' action: 'FINISHED', label: meta.identifier });\n     */\n    function trackEvent(event) {\n      if (typeof window.ga === 'undefined') {\n        return; // bail if no google analytics or ad blocker\n      }\n      // Test that an object was passed\n      if (typeof event !== 'object') {\n        console.error('object expected');\n        return;\n      }\n\n      // Test that the object contains required attributes\n      if (typeof event.category === 'undefined') {\n        console.error('event category expected');\n        return;\n      }\n\n      if (typeof event.action === 'undefined') {\n        console.error('event action expected');\n        return;\n      }\n\n      if (typeof event.label === 'undefined') {\n        console.error('event label expected');\n        return;\n      }\n\n      if (self.ga_version === 'universal') {\n        window.ga('send', 'event', event.category, event.action, event.label, {\n          nonInteraction: 1\n        });\n      } else if (self.ga_version === 'classic') {\n        window._gaq.push([\n          '_trackEvent',\n          event.category,\n          event.action,\n          event.label,\n          undefined,\n          true\n        ]);\n      }\n    }\n\n    this.init = function(args) {\n      // Set ga_version to 'universal' or 'classic'.\n      // Events will be tracked using the proper Javascript API in trackEvent().\n      if (typeof args.audio === 'undefined') {\n        console.error('Audio element must be passed in');\n      }\n      if (typeof args.version !== 'undefined') {\n        // Otherwise use provided argument, whitelisting options 'universal' or 'classic'.\n        self.ga_version =\n          args.version === 'universal' || args.version === 'classic'\n            ? args.version\n            : self.ga_version;\n      }\n\n      self.audioele = args.audio;\n      self.audioele.addEventListener('timeupdate', onPositionUpdate);\n      self.audioele.addEventListener('ended', onMediaFinished);\n      self.audioele.addEventListener('play', onPlayPause);\n      self.audioele.addEventListener('pause', onPlayPause);\n    };\n  }\n\n  exports.AudioAnalytics = HTML5PlayerGoogleAnalytics;\n  exports.NielsenSetup = NielsenSetup;\n  exports.Player = Player;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n"]}