",".arrow":"",".play":"",".pause":"",".redo":""};for(var n in i)document.styleSheets[0].insertRule(n+' {background-image: url("'+(e+i[n]+t).replace(//g,"%3E")+'"); background-repeat: no-repeat; background-position: center center; background-size: contain;}',0);var s=document.createElement("canvas");s.width=16,s.height=16;var o=new Image;o.onload=function(){s.getContext("2d").drawImage(o,0,0,16,16);var e=document.createElement("link");e.type="image/png",e.rel="shortcut icon",e.href=s.toDataURL(),document.head.appendChild(e)},o.src=e+""+i[".logo"]+t}(),$.transition.push(function(e,t){"episode"===e[0]&&"episode"===t[0]&&t[2]!==e[2]&&$.getEpisode(t[1]).changeSlide(parseInt(t[2]))}),$.transition.push(function(e,t){if("episode"===e[0]&&"episode"===t[0]&&t[1]===e[1]&&t[2]===e[2]||""===e[0]&&"episode"===t[0]&&3===t.length){var i=$.getEpisode(t[1],t[2]);i.show(t[2],!1)}}),$.transition.push(function(e,t){if("episode"===e[0]&&"menu"===t[0]&&2===t.length){var i=$.getScreen("menu");$.animate(i,"top"),$.getEpisode(e[1]).hide(),i.show(t[1],e[2],"instant")}}),$.transition.push(function(e,t){"menu"===e[0]&&1===e.length&&"menu"===t[0]&&1===t.length&&$.animate($.getScreen("menu"),"instant")}),$.transition.push(function(e,t){"menu"===e[0]&&1===e.length&&"menu"===t[0]&&2===t.length&&$.getScreen("menu").show(t[1],0,!0)}),$.transition.push(function(e,t){"menu"===e[0]&&1===e.length&&""===t[0]&&$.animate($.getScreen("title"),"top")}),$.transition.push(function(e,t){if("menu"===e[0]&&"menu"===t[0]&&2===e.length&&t[1]===e[1]||""===e[0]&&"menu"===t[0]&&2===t.length){var i=$.getScreen("menu");$.animate(i,"instant"),i.show(t[1],0,!1)}}),$.transition.push(function(e,t){"menu"===e[0]&&2===e.length&&"episode"===t[0]&&$.getEpisode(t[1]).show(t[2],!0)}),$.transition.push(function(e,t){"menu"===e[0]&&2===e.length&&"menu"===t[0]&&1===t.length&&$.getScreen("menu").enter()}),$.transition.push(function(e,t){""===e[0]&&"menu"===t[0]&&1===t.length&&$.animate($.getScreen("menu"),"bottom")}),$.screen.audio=function(e){$.screen.slide.call(this,e),this.content.querySelector(".text").innerHTML=e.text,this.player=$.player(e.id),this.action=this.content.querySelector(".btn"),this.action.addEventListener("click",this),this.track=this.content.querySelector(".track"),this.grip=this.content.querySelector(".grip"),this.grip.addEventListener("mousedown",this),this.grip.addEventListener("touchstart",this),this.progress=this.content.querySelector(".progress"),this.progress.addEventListener("click",this),this.progressTime=e.start,this.currentTime=e.start},$.extend($.screen.slide,$.screen.audio),$.screen.audio.prototype.enter=function(){if(this.complete=!0,$.screen.slide.prototype.enter.call(this),$.player.canplay)this.player.currentTime=this.currentTime,this.player.addEventListener("timeupdate",this);else{var e=function(){setTimeout(function(){$.player.canplay?(this.player.currentTime=this.currentTime,this.player.addEventListener("timeupdate",this)):e()}.bind(this),300)}.bind(this);e()}},$.screen.audio.prototype.exit=function(){this.player.removeEventListener("timeupdate",this),this.action.classList.contains("pause")&&this.pause(),this.currentTime=this.player.currentTime},$.screen.audio.prototype.handleEvent=function(e){"click"===e.type?this.handleClick(e):"timeupdate"===e.type?this.timeupdate(e):"mousedown"===e.type?this.dragstart(e):"touchstart"===e.type?this.dragstart(e):"mouseup"===e.type?this.dragend(e):"touchend"===e.type?this.dragend(e):"mousemove"===e.type?this.dragmove(e):"touchmove"===e.type&&this.dragmove(e)},$.screen.audio.prototype.handleClick=function(e){e.target===this.action?this.actionClick(e):e.target===this.progress&&this.progressClick(e)},$.screen.audio.prototype.actionClick=function(){this.action.classList.contains("play")?this.play():this.pause()},$.screen.audio.prototype.progressClick=function(e){var t=this.config.start+(e.clientX-this.progress.getBoundingClientRect().left)*(this.config.end-this.config.start)/this.track.getBoundingClientRect().width;tthis.config.end&&(t=this.config.end),this.player.currentTime=t},$.screen.audio.prototype.play=function(){this.player.play(),this.action.classList.remove("play"),this.action.classList.add("pause")},$.screen.audio.prototype.pause=function(){this.player.pause(),this.action.classList.remove("pause"),this.action.classList.add("play")},$.screen.audio.prototype.timeupdate=function(){this.player.currentTime>=this.config.end&&(this.pause(),this.player.currentTime=this.config.start,this.progress.style.width=100*this.track.getBoundingClientRect().width/document.documentElement.clientWidth+"vw",this.complete=!0);var e=(this.player.currentTime-this.config.start)/(this.config.end-this.config.start);0>e?e=0:e>1&&(e=1),this.grip.style.left=100*(this.track.getBoundingClientRect().width*e-this.grip.getBoundingClientRect().width/2)/document.documentElement.clientWidth+"vw",this.progressTimethis.config.end&&(e=this.config.end),this.player.currentTime=e,this.isPlaying&&this.player.play()},$.screen.audio.prototype.dragmove=function(e){var t=$.getClientX(e),i=this.gripDragPosition.left+t-this.gripDragPosition.client;i<-this.grip.getBoundingClientRect().width/2?i=-this.grip.getBoundingClientRect().width/2:i>this.progress.getBoundingClientRect().width-this.grip.getBoundingClientRect().width/2&&(i=this.progress.getBoundingClientRect().width-this.grip.getBoundingClientRect().width/2),this.grip.style.left=100*i/document.documentElement.clientWidth+"vw",this.gripDragPosition.left=i,this.gripDragPosition.client=t},$.screen.html=function(e){$.screen.slide.call(this,e),this.content.innerHTML=e.content},$.extend($.screen.slide,$.screen.html),$.screen.html.prototype.enter=function(){this.complete=!0,$.screen.slide.prototype.enter.call(this)},$.screen.loading=function(){$.screen.slide.call(this,{type:"loading"})},$.extend($.screen.slide,$.screen.loading),$.screen.menu=function(){$.screen.call(this,"menu");var e,t,i,n=this.node,s=n.innerHTML;for(n.innerHTML='',n=n.children[0],t=0;t<$.series.length;t++)e=$.series[t],i=document.createElement("div"),i.setAttribute("class","episode"),i.innerHTML=s,i.querySelector(".title").innerHTML=''+(t+1)+". "+e.title+"",i.querySelector(".subtitle").innerHTML=e.subtitle,i.querySelector(".summary").innerHTML=e.summary,n.appendChild(i)},$.extend($.screen,$.screen.menu),$.screen.menu.prototype.show=function(e,t,i){i?this.node.classList.add("animate"):this.node.classList.remove("animate"),this.node.classList.add("episode-active");var n=this.node.children[0].children[e-1];n.querySelector(".start").href="#episode/"+e+"/"+t,n.classList.add("active"),this.node.children[0].style.top=this.node.scrollTop-n.offsetTop+"px"},$.screen.menu.prototype.enter=function(){this.node.classList.add("animate"),this.node.classList.remove("episode-active"),this.node.children[0].style.top=0;for(var e=0;ethis.track.getBoundingClientRect().width-this.grip.getBoundingClientRect().width/2&&(i=this.track.getBoundingClientRect().width-this.grip.getBoundingClientRect().width/2),this.value=(i+this.grip.getBoundingClientRect().width/2)/this.track.getBoundingClientRect().width,this.grip.style.left=i+"px",this.position.left=i,this.position.client=t},$.screen.slider.prototype.trackClick=function(e){var t=e.clientX-this.track.getBoundingClientRect().left-this.grip.getBoundingClientRect().width/2;this.grip.style.left=100*t/document.documentElement.clientWidth+"vw",this.gripMoved((t+this.grip.getBoundingClientRect().width/2)/this.track.getBoundingClientRect().width)},$.screen.slider.prototype.gripMoved=function(e){var t=1===e?this.config.answers.length-1:Math.floor(e*this.config.answers.length);this.showFeedback(this.answerList.children[t],this.attempt(this.config.answers[t]))},$.screen.slider.prototype.showFeedback=function(e,t){$.screen.feedback.prototype.showFeedback.call(this,e,t),0!==t.feedback.length&&this.trackContainer.classList.add("inactive")},$.screen.slider.prototype.hideFeedback=function(){$.screen.feedback.prototype.hideFeedback.call(this),this.centreGrip()},$.screen.slider.prototype.feedbackAnimateDone=function(){"0px"===this.feedback.style.height&&this.trackContainer.classList.remove("inactive"),$.screen.feedback.prototype.feedbackAnimateDone.call(this)},$.screen.slider.prototype.centreGrip=function(){this.grip.style.left=100*(.35*document.documentElement.clientWidth-.05*document.documentElement.clientHeight)/document.documentElement.clientWidth+"vw"};$();