text: /*!
   * Pod Picker - A Podcast Timeline Generator
   * https://github.com/RoberMac/PodPicker
   *
   * Copyright (c) 2015 RoberTu <robertu0717@gmail.com>
   * @license MIT
   * @version v0.2.1
   */
  !function(e,t){"use strict";function r(e,r,i){this.itemsIndex=0,this.preTime=0,this.startTimeSet=[],this.seekingIndex=0,"undefined"==typeof e?this.throwError("Pod Picker: `container` parameter is required"):e.constructor!==String?this.throwError("Pod Picker: `container` parameter must be an string"):e=t.getElementById(e),e?null:this.throwError("Pod Picker: `container` parameter is not related to an existing ID"),"undefined"==typeof r?this.throwError("Pod Picker: `items` parameter is required"):r.constructor!==Array?this.throwError("Pod Picker: `items` parameter must be an array"):r.length<=0?this.throwError("Pod Picker: `items` parameter cannot be an empty array"):null,"undefined"!=typeof i&&i.constructor!==Object?this.throwError("Pod Picker: `options` parameter must be an object"):i=i||{};var n=this;r=r.sort(function(e,t){var e=n.convertTime(e.start),t=n.convertTime(t.start);return e>t?1:t>e?-1:0}),this.setup(e,r,i)}r.prototype.setup=function(r,i,n){function o(){for(var n=t.createDocumentFragment(""),o=t.createElement("div"),d=t.createElement("span"),c=t.createElement("ul"),p=i.length,u=0;p>u;u++){var h=t.createElement("li"),f=t.createElement("span"),P=m.convertTime(i[u].start),E=l?i[u].start+" - "+i[u].title:i[u].title;m.startTimeSet.push(P),function(r,i){r.addEventListener("click",function(){s.play(),s.currentTime=i,m.seekingIndex=e.setTimeout(function(){t.getElementById("pp-pointer").className="seeking"},500)})}(f,P),h.className="pp-item",f.appendChild(t.createTextNode(E)),h.appendChild(f),c.appendChild(h)}s.addEventListener("timeupdate",function(){var e=s.currentTime,t=m.startTimeSet,r=t.length;if(Math.abs(m.preTime-e)>1)for(var i=0;r>i;i++)t[i+1]?e>=t[i]&&e<=t[i+1]?m.setPointerPosition(i+1):null:e>=t[i]?m.setPointerPosition(i+1):null;else for(var i=0;r>i;i++)e>t[i]-1&&e<=t[i]+1&&m.itemsIndex!==i+1?m.setPointerPosition(i+1):null;m.preTime=e}),s.addEventListener("seeking",function(){s.pause()}),s.addEventListener("seeked",function(){e.clearTimeout(m.seekingIndex),s.play(),t.getElementById("pp-pointer").removeAttribute("class")}),c.style.color=a,d.id="pp-pointer",o.id="pp-timeline",o.appendChild(c),o.appendChild(d),n.appendChild(o),r.appendChild(n)}"undefined"!=typeof n.audioElem&&"string"!=typeof n.audioElem?this.throwError("Pod Picker: `options.audioElem` must be an string"):null,"undefined"!=typeof n.timelineColor?"string"!=typeof n.timelineColor?this.throwError("Pod Picker: `options.timelineColor` must be an string"):/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n.timelineColor)?null:this.throwError("Pod Picker: `options.timelineColor` must be an hex color"):null,"undefined"!=typeof n.isShowStartTime&&"boolean"!=typeof n.isShowStartTime?this.throwError("Pod Picker: `options.isShowStartTime` must be an boolean"):null;var s=n.audioElem?t.getElementById(n.audioElem):t.getElementsByTagName("audio")[0],a=n.timelineColor||"#CECECF",l=n.isShowStartTime,m=this,d=setInterval(function(){var e=s.currentSrc;e&&(clearInterval(d),e.match(/\.mp3/i)?m.throwError("Pod Picker: does not support MP3 file format"):o())},10)},r.prototype.setPointerPosition=function(e){var r=t.getElementsByClassName("pp-item"),i=t.getElementById("pp-pointer"),n=r[0].offsetHeight,o=r.length;this.itemsIndex=e,r[e-1].children[0].className="currentSection";for(var s=0;o>s;s++)s!==e-1?r[s].children[0].removeAttribute("class"):null;i.style.top=e*n-n/2-6+"px"},r.prototype.convertTime=function(e){/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/.test(e)?null:this.throwError('Pod Picker: `start` time string must be "hh:mm:ss", "mm:ss" or "ss" format');var t=e.split(":"),r=t.length;switch(r){case 1:return 1*t[0];case 2:return 60*t[0]+1*t[1];case 3:return 60*t[0]*60+60*t[1]+1*t[2];default:this.throwError('Pod Picker: `start` time string must be "hh:mm:ss", "mm:ss" or "ss" format')}},r.prototype.throwError=function(e){throw new Error(e)},e.PodPicker||(e.PodPicker=r)}(window,document);
  //# sourceMappingURL=PodPicker.min.js.map