From 7cfe75faaa70fc3073aea27972f75d0043daedcb Mon Sep 17 00:00:00 2001 From: Nick Elsbree Date: Tue, 14 Apr 2015 18:05:00 -0700 Subject: [PATCH] Fixed download links for private tracks. --- sdk/js/templates/player-feed.hbs | 2 +- sdk/js/templates/player-mini.hbs | 2 +- sdk/js/templates/player-solo.hbs | 2 +- sdk/js/templates/player.hbs | 2 +- sdk/js/vendor/td-interface.js | 8 ++++++++ test/index.html | 5 +---- toneden.js | 6 +++--- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/sdk/js/templates/player-feed.hbs b/sdk/js/templates/player-feed.hbs index 9c3bb4f..8eb64db 100644 --- a/sdk/js/templates/player-feed.hbs +++ b/sdk/js/templates/player-feed.hbs @@ -87,7 +87,7 @@ {{else}} {{#if download_url}}
- +
diff --git a/sdk/js/templates/player-mini.hbs b/sdk/js/templates/player-mini.hbs index 0d1eb7d..44af186 100644 --- a/sdk/js/templates/player-mini.hbs +++ b/sdk/js/templates/player-mini.hbs @@ -81,7 +81,7 @@ {{else}}
- + DOWNLOAD
diff --git a/sdk/js/templates/player-solo.hbs b/sdk/js/templates/player-solo.hbs index c80398e..3885b37 100644 --- a/sdk/js/templates/player-solo.hbs +++ b/sdk/js/templates/player-solo.hbs @@ -57,7 +57,7 @@ {{else}} {{#if download_url}}
- + DOWNLOAD
diff --git a/sdk/js/templates/player.hbs b/sdk/js/templates/player.hbs index a152aea..b84b4d7 100644 --- a/sdk/js/templates/player.hbs +++ b/sdk/js/templates/player.hbs @@ -69,7 +69,7 @@ {{else}} {{#if download_url}}
- + DOWNLOAD
diff --git a/sdk/js/vendor/td-interface.js b/sdk/js/vendor/td-interface.js index 8c3546a..8a37575 100755 --- a/sdk/js/vendor/td-interface.js +++ b/sdk/js/vendor/td-interface.js @@ -800,6 +800,14 @@ define(['vendor/soundmanager2', 'jquery', 'vendor/jquery-jsonp', 'vendor/d3', 'v } } + if(track.download_url) { + if(track.sharing === 'private') { + track.download_url += '&client_id=6f85bdf51b0a19b7ab2df7b969233901'; + } else { + track.download_url += '?client_id=6f85bdf51b0a19b7ab2df7b969233901'; + } + } + return cb(track); }; diff --git a/test/index.html b/test/index.html index c668557..a34a278 100644 --- a/test/index.html +++ b/test/index.html @@ -42,10 +42,7 @@

A fresh new customizable SoundCloud player.

dom: '#player', keyboardEvents: false, urls: [ - 'https://soundcloud.com/giraffage/music-sounds-better-with-you', - 'https://soundcloud.com/wave-racer/wave-racer-streamers', - 'https://soundcloud.com/flume/sleepless-feat-jezzabell-doran', - 'https://soundcloud.com/ryanhemsworth/ribs-lets-have-a-sleepover' + 'https://soundcloud.com/killparis/sets/galaxies-between-us-free-download/s-LMUbm' ], single: false, mini: false, diff --git a/toneden.js b/toneden.js index 006fa2e..8cb1b62 100644 --- a/toneden.js +++ b/toneden.js @@ -10,9 +10,9 @@ else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0] },d()}function eg(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.invertExtent=function(b){return b=c.indexOf(b),b=0>b?0/0:b/f+a,[b,b+1/f]},d.copy=function(){return eg(a,b,c)},e()}function fg(a,b){function c(c){return c>=c?b[Zg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return fg(a,b)},c}function gg(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return Xf(a,b)},b.tickFormat=function(b,c){return Yf(a,b,c)},b.copy=function(){return gg(a)},b}function hg(a){return a.innerRadius}function ig(a){return a.outerRadius}function jg(a){return a.startAngle}function kg(a){return a.endAngle}function lg(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=Ab(c),o=Ab(d);++l1&&e.push("H",d[0]),e.join("")}function pg(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Fg(a){return a.length<3?mg(a):a[0]+ug(a,Eg(a))}function Gg(a){for(var b,c,d,e=-1,f=a.length;++ec?j():(e.active=c,f.event&&f.event.start.call(a,k,b),f.tween.forEach(function(c,d){(d=d.call(a,k,b))&&p.push(d)}),void Zg.timer(function(){return o.c=i(d||1)?Bc:i,1},0,h))}function i(d){if(e.active!==c)return j();for(var g=d/n,h=l(g),i=p.length;i>0;)p[--i].call(a,h);return g>=1?(f.event&&f.event.end.call(a,k,b),j()):void 0}function j(){return--e.count?delete e[c]:delete a.__transition__,1}var k=a.__data__,l=f.ease,m=f.delay,n=f.duration,o=ai,p=[];return o.t=m+h,d>=m?g(d-m):void(o.c=g)},0,h)}}function Sg(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function Tg(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function Ug(a){return a.toISOString()}function Vg(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=Zg.bisect(Qj,e);return f==Qj.length?[b.year,Wf(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/Qj[f-1]1?{floor:function(b){for(;c(b=a.floor(b));)b=Wg(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=Wg(+b+1);return b}}:a))},d.ticks=function(a,b){var c=Nf(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],Wg(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return Vg(a.copy(),b,c)},Uf(d,a)}function Wg(a){return new Date(a)}function Xg(a){return JSON.parse(a.responseText)}function Yg(a){var b=ah.createRange();return b.selectNode(ah.body),b.createContextualFragment(a.responseText)}var Zg={version:"3.4.4"};Date.now||(Date.now=function(){return+new Date});var $g=[].slice,_g=function(a){return $g.call(a)},ah=document,bh=ah.documentElement,ch=window;try{_g(bh.childNodes)[0].nodeType}catch(dh){_g=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}try{ah.createElement("div").style.setProperty("opacity",0,"")}catch(eh){var fh=ch.Element.prototype,gh=fh.setAttribute,hh=fh.setAttributeNS,ih=ch.CSSStyleDeclaration.prototype,jh=ih.setProperty;fh.setAttribute=function(a,b){gh.call(this,a,b+"")},fh.setAttributeNS=function(a,b,c){hh.call(this,a,b,c+"")},ih.setProperty=function(a,b,c){jh.call(this,a,b+"",c)}}Zg.ascending=a,Zg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:0/0},Zg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e=c);)c=void 0;for(;++ed&&(c=d)}else{for(;++e=c);)c=void 0;for(;++ed&&(c=d)}return c},Zg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e=c);)c=void 0;for(;++ec&&(c=d)}else{for(;++e=c);)c=void 0;for(;++ec&&(c=d)}return c},Zg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f=c);)c=e=void 0;for(;++fd&&(c=d),d>e&&(e=d))}else{for(;++f=c);)c=void 0;for(;++fd&&(c=d),d>e&&(e=d))}return[c,e]},Zg.sum=function(a,b){var c,d=0,e=a.length,f=-1;if(1===arguments.length)for(;++f1&&(c=c.map(d)),c=c.filter(b),c.length?Zg.quantile(c.sort(a),.5):void 0};var kh=c(a);Zg.bisectLeft=kh.left,Zg.bisect=Zg.bisectRight=kh.right,Zg.bisector=function(b){return c(1===b.length?function(c,d){return a(b(c),d)}:b)},Zg.shuffle=function(a){for(var b,c,d=a.length;d;)c=Math.random()*d--|0,b=a[d],a[d]=a[c],a[c]=b;return a},Zg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},Zg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},Zg.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=Zg.min(arguments,d),c=new Array(b);++a=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var lh=Math.abs;Zg.range=function(a,b,c){if(arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0)),(b-a)/c===1/0)throw new Error("infinite range");var d,f=[],g=e(lh(c)),h=-1;if(a*=g,b*=g,c*=g,0>c)for(;(d=a+c*++h)>b;)f.push(d/g);else for(;(d=a+c*++h)=f.length)return d?d.call(e,h):c?h.sort(c):h;for(var j,k,l,m,n=-1,o=h.length,p=f[i++],q=new g;++n=f.length)return a;var d=[],e=h[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},f=[],h=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(Zg.map,c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return h[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},Zg.set=function(a){var b=new m;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},f(m,{has:h,add:function(a){return this[mh+a]=!0,a},remove:function(a){return a=mh+a,a in this&&delete this[a]},values:j,size:k,empty:l,forEach:function(a){for(var b in this)b.charCodeAt(0)===nh&&a.call(this,b.substring(1))}}),Zg.behavior={},Zg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d=0&&(d=a.substring(c+1),a=a.substring(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},Zg.event=null,Zg.requote=function(a){return a.replace(ph,"\\$&")};var ph=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,qh={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},rh=function(a,b){return b.querySelector(a)},sh=function(a,b){return b.querySelectorAll(a)},th=bh[o(bh,"matchesSelector")],uh=function(a,b){return th.call(a,b)};"function"==typeof Sizzle&&(rh=function(a,b){return Sizzle(a,b)[0]||null},sh=Sizzle,uh=Sizzle.matchesSelector),Zg.selection=function(){return yh};var vh=Zg.selection.prototype=[];vh.select=function(a){var b,c,d,e,f=[];a=w(a);for(var g=-1,h=this.length;++g=0&&(c=a.substring(0,b),a=a.substring(b+1)),wh.hasOwnProperty(c)?{space:wh[c],local:a}:a}},vh.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=Zg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(y(b,a[b]));return this}return this.each(y(a,b))},vh.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=B(a)).length,e=-1;if(b=c.classList){for(;++ed){if("string"!=typeof a){2>d&&(b="");for(c in a)this.each(E(c,a[c],b));return this}if(2>d)return ch.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(E(a,b,c))},vh.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(F(b,a[b]));return this}return this.each(F(a,b))},vh.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},vh.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},vh.append=function(a){return a=G(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},vh.insert=function(a,b){return a=G(a),b=w(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},vh.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},vh.data=function(a,b){function c(a,c){var d,e,f,h=a.length,l=c.length,m=Math.min(h,l),n=new Array(l),o=new Array(l),p=new Array(h);if(b){var q,r=new g,s=new g,t=[];for(d=-1;++dd;++d)o[d]=H(c[d]);for(;h>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,i.push(o),j.push(n),k.push(p)}var d,e,f=-1,h=this.length;if(!arguments.length){for(a=new Array(h=(d=this[0]).length);++ff;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return v(e)},vh.order=function(){for(var a=-1,b=this.length;++a=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},vh.sort=function(a){a=J.apply(this,arguments);for(var b=-1,c=this.length;++ba;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},vh.size=function(){var a=0;return this.each(function(){++a}),a};var xh=[];Zg.selection.enter=L,Zg.selection.enter.prototype=xh,xh.append=vh.append,xh.empty=vh.empty,xh.node=vh.node,xh.call=vh.call,xh.size=vh.size,xh.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++hd){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(O(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(O(a,b,c))};var zh=Zg.map({mouseenter:"mouseover",mouseleave:"mouseout"});zh.forEach(function(a){"on"+a in ah&&zh.remove(a)});var Ah="onselectstart"in ah?null:o(bh.style,"userSelect"),Bh=0;Zg.mouse=function(a){return S(a,t())},Zg.touches=function(a,b){return arguments.length<2&&(b=t().touches),b?_g(b).map(function(b){var c=S(a,b);return c.identifier=b.identifier,c}):[]},Zg.behavior.drag=function(){function a(){this.on("mousedown.drag",e).on("touchstart.drag",f)}function b(a,b,e,f,g){return function(){function h(){var a,c,d=b(m,p);d&&(a=d[0]-t[0],c=d[1]-t[1],o|=a|c,t=d,n({type:"drag",x:d[0]+j[0],y:d[1]+j[1],dx:a,dy:c}))}function i(){b(m,p)&&(r.on(f+q,null).on(g+q,null),s(o&&Zg.event.target===l),n({type:"dragend"}))}var j,k=this,l=Zg.event.target,m=k.parentNode,n=c.of(k,arguments),o=0,p=a(),q=".drag"+(null==p?"":"-"+p),r=Zg.select(e()).on(f+q,h).on(g+q,i),s=R(),t=b(m,p);d?(j=d.apply(k,arguments),j=[j.x-t[0],j.y-t[1]]):j=[0,0],n({type:"dragstart"})}}var c=u(a,"drag","dragstart","dragend"),d=null,e=b(p,Zg.mouse,V,"mousemove","mouseup"),f=b(T,Zg.touch,U,"touchmove","touchend");return a.origin=function(b){return arguments.length?(d=b,a):d},Zg.rebind(a,c,"on")};var Ch=Math.PI,Dh=2*Ch,Eh=Ch/2,Fh=1e-6,Gh=Fh*Fh,Hh=Ch/180,Ih=180/Ch,Jh=Math.SQRT2,Kh=2,Lh=4;Zg.interpolateZoom=function(a,b){function c(a){var b=a*s;if(r){var c=_(p),g=f/(Kh*m)*(c*ab(Jh*b+p)-$(p));return[d+g*j,e+g*k,f*c/_(Jh*b+p)]}return[d+a*j,e+a*k,f*Math.exp(Jh*b)]}var d=a[0],e=a[1],f=a[2],g=b[0],h=b[1],i=b[2],j=g-d,k=h-e,l=j*j+k*k,m=Math.sqrt(l),n=(i*i-f*f+Lh*l)/(2*f*Kh*m),o=(i*i-f*f-Lh*l)/(2*i*Kh*m),p=Math.log(Math.sqrt(n*n+1)-n),q=Math.log(Math.sqrt(o*o+1)-o),r=q-p,s=(r||Math.log(i/f))/Jh;return c.duration=1e3*s,c},Zg.behavior.zoom=function(){function a(a){a.on(B,j).on(Oh+".zoom",l).on(C,m).on("dblclick.zoom",n).on(E,k)}function b(a){return[(a[0]-y.x)/y.k,(a[1]-y.y)/y.k]}function c(a){return[a[0]*y.k+y.x,a[1]*y.k+y.y]}function d(a){y.k=Math.max(A[0],Math.min(A[1],a))}function e(a,b){b=c(b),y.x+=a[0]-b[0],y.y+=a[1]-b[1]}function f(){v&&v.domain(t.range().map(function(a){return(a-y.x)/y.k}).map(t.invert)),x&&x.domain(w.range().map(function(a){return(a-y.y)/y.k}).map(w.invert))}function g(a){a({type:"zoomstart"})}function h(a){f(),a({type:"zoom",scale:y.k,translate:[y.x,y.y]})}function i(a){a({type:"zoomend"})}function j(){function a(){k=1,e(Zg.mouse(d),n),h(j)}function c(){l.on(C,ch===d?m:null).on(D,null),o(k&&Zg.event.target===f),i(j)}var d=this,f=Zg.event.target,j=F.of(d,arguments),k=0,l=Zg.select(ch).on(C,a).on(D,c),n=b(Zg.mouse(d)),o=R();N.call(d),g(j)}function k(){function a(){var a=Zg.touches(n);return m=y.k,a.forEach(function(a){a.identifier in p&&(p[a.identifier]=b(a))}),a}function c(){for(var b=Zg.event.changedTouches,c=0,f=b.length;f>c;++c)p[b[c].identifier]=null;var g=a(),i=Date.now();if(1===g.length){if(500>i-r){var j=g[0],k=p[j.identifier];d(2*y.k),e(j,k),s(),h(o)}r=i}else if(g.length>1){var j=g[0],l=g[1],m=j[0]-l[0],n=j[1]-l[1];q=m*m+n*n}}function f(){for(var a,b,c,f,g=Zg.touches(n),i=0,j=g.length;j>i;++i,f=null)if(c=g[i],f=p[c.identifier]){if(b)break;a=c,b=f}if(f){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=q&&Math.sqrt(k/q);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+f[0])/2,(b[1]+f[1])/2],d(l*m)}r=null,e(a,b),h(o)}function l(){if(Zg.event.touches.length){for(var b=Zg.event.changedTouches,c=0,d=b.length;d>c;++c)delete p[b[c].identifier];for(var e in p)return void a()}w.on(t,null),x.on(B,j).on(E,k),z(),i(o)}var m,n=this,o=F.of(n,arguments),p={},q=0,t=".zoom-"+Zg.event.changedTouches[0].identifier,u="touchmove"+t,v="touchend"+t,w=Zg.select(Zg.event.target).on(u,f).on(v,l),x=Zg.select(n).on(B,null).on(E,c),z=R();N.call(n),c(),g(o)}function l(){var a=F.of(this,arguments);q?clearTimeout(q):(N.call(this),g(a)),q=setTimeout(function(){q=null,i(a)},50),s();var c=p||Zg.mouse(this);o||(o=b(c)),d(Math.pow(2,.002*Mh())*y.k),e(c,o),h(a)}function m(){o=null}function n(){var a=F.of(this,arguments),c=Zg.mouse(this),f=b(c),j=Math.log(y.k)/Math.LN2;g(a),d(Math.pow(2,Zg.event.shiftKey?Math.ceil(j)-1:Math.floor(j)+1)),e(c,f),h(a),i(a)}var o,p,q,r,t,v,w,x,y={x:0,y:0,k:1},z=[960,500],A=Nh,B="mousedown.zoom",C="mousemove.zoom",D="mouseup.zoom",E="touchstart.zoom",F=u(a,"zoomstart","zoom","zoomend");return a.event=function(a){a.each(function(){var a=F.of(this,arguments),b=y;Dj?Zg.select(this).transition().each("start.zoom",function(){y=this.__chart__||{x:0,y:0,k:1},g(a)}).tween("zoom:zoom",function(){var c=z[0],d=z[1],e=c/2,f=d/2,g=Zg.interpolateZoom([(e-y.x)/y.k,(f-y.y)/y.k,c/y.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),i=c/d[2];this.__chart__=y={x:e-d[0]*i,y:f-d[1]*i,k:i},h(a)}}).each("end.zoom",function(){i(a)}):(this.__chart__=y,g(a),h(a),i(a))})},a.translate=function(b){return arguments.length?(y={x:+b[0],y:+b[1],k:y.k},f(),a):[y.x,y.y]},a.scale=function(b){return arguments.length?(y={x:y.x,y:y.y,k:+b},f(),a):y.k},a.scaleExtent=function(b){return arguments.length?(A=null==b?Nh:[+b[0],+b[1]],a):A},a.center=function(b){return arguments.length?(p=b&&[+b[0],+b[1]],a):p},a.size=function(b){return arguments.length?(z=b&&[+b[0],+b[1]],a):z},a.x=function(b){return arguments.length?(v=b,t=b.copy(),y={x:0,y:0,k:1},a):v},a.y=function(b){return arguments.length?(x=b,w=b.copy(),y={x:0,y:0,k:1},a):x},Zg.rebind(a,F,"on")};var Mh,Nh=[0,1/0],Oh="onwheel"in ah?(Mh=function(){return-Zg.event.deltaY*(Zg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ah?(Mh=function(){return Zg.event.wheelDelta},"mousewheel"):(Mh=function(){return-Zg.event.detail},"MozMousePixelScroll");cb.prototype.toString=function(){return this.rgb()+""},Zg.hsl=function(a,b,c){return 1===arguments.length?a instanceof eb?db(a.h,a.s,a.l):vb(""+a,wb,db):db(+a,+b,+c)};var Ph=eb.prototype=new cb;Ph.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),db(this.h,this.s,this.l/a)},Ph.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),db(this.h,this.s,a*this.l)},Ph.rgb=function(){return fb(this.h,this.s,this.l)},Zg.hcl=function(a,b,c){return 1===arguments.length?a instanceof hb?gb(a.h,a.c,a.l):a instanceof kb?mb(a.l,a.a,a.b):mb((a=xb((a=Zg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):gb(+a,+b,+c)};var Qh=hb.prototype=new cb;Qh.brighter=function(a){return gb(this.h,this.c,Math.min(100,this.l+Rh*(arguments.length?a:1)))},Qh.darker=function(a){return gb(this.h,this.c,Math.max(0,this.l-Rh*(arguments.length?a:1)))},Qh.rgb=function(){return ib(this.h,this.c,this.l).rgb()},Zg.lab=function(a,b,c){return 1===arguments.length?a instanceof kb?jb(a.l,a.a,a.b):a instanceof hb?ib(a.l,a.c,a.h):xb((a=Zg.rgb(a)).r,a.g,a.b):jb(+a,+b,+c)};var Rh=18,Sh=.95047,Th=1,Uh=1.08883,Vh=kb.prototype=new cb;Vh.brighter=function(a){return jb(Math.min(100,this.l+Rh*(arguments.length?a:1)),this.a,this.b)},Vh.darker=function(a){return jb(Math.max(0,this.l-Rh*(arguments.length?a:1)),this.a,this.b)},Vh.rgb=function(){return lb(this.l,this.a,this.b)},Zg.rgb=function(a,b,c){return 1===arguments.length?a instanceof tb?sb(a.r,a.g,a.b):vb(""+a,sb,fb):sb(~~a,~~b,~~c)};var Wh=tb.prototype=new cb;Wh.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),sb(Math.min(255,~~(b/a)),Math.min(255,~~(c/a)),Math.min(255,~~(d/a)))):sb(e,e,e)},Wh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),sb(~~(a*this.r),~~(a*this.g),~~(a*this.b))},Wh.hsl=function(){return wb(this.r,this.g,this.b)},Wh.toString=function(){return"#"+ub(this.r)+ub(this.g)+ub(this.b)};var Xh=Zg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Xh.forEach(function(a,b){Xh.set(a,qb(b))}),Zg.functor=Ab,Zg.xhr=Cb(Bb),Zg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=Db(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),i=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=j)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==i)continue; return a.substring(b,k-h)}return a.substring(b)}for(var d,e,f={},g={},h=[],j=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();(!b||(m=b(m,l++)))&&h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new m,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(g).join(a)].concat(b.map(function(b){return e.map(function(a){return g(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c},Zg.csv=Zg.dsv(",","text/csv"),Zg.tsv=Zg.dsv(" ","text/tab-separated-values"),Zg.touch=function(a,b,c){if(arguments.length<3&&(c=b,b=t().changedTouches),b)for(var d,e=0,f=b.length;f>e;++e)if((d=b[e]).identifier===c)return S(a,d)};var Yh,Zh,$h,_h,ai,bi=ch[o(ch,"requestAnimationFrame")]||function(a){setTimeout(a,17)};Zg.timer=function(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,f:!1,n:null};Zh?Zh.n=f:Yh=f,Zh=f,$h||(_h=clearTimeout(_h),$h=1,bi(Fb))},Zg.timer.flush=function(){Gb(),Hb()},Zg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var ci=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(Jb);Zg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=Zg.round(a,Ib(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c-1)/3)))),ci[8+c/3]};var di=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ei=Zg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=Zg.round(a,Ib(a,b))).toFixed(Math.max(0,Math.min(20,Ib(a*(1+1e-15),b))))}}),fi=Zg.time={},gi=Date;Mb.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){hi.setUTCDate.apply(this._,arguments)},setDay:function(){hi.setUTCDay.apply(this._,arguments)},setFullYear:function(){hi.setUTCFullYear.apply(this._,arguments)},setHours:function(){hi.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hi.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hi.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hi.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hi.setUTCSeconds.apply(this._,arguments)},setTime:function(){hi.setTime.apply(this._,arguments)}};var hi=Date.prototype;fi.year=Nb(function(a){return a=fi.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),fi.years=fi.year.range,fi.years.utc=fi.year.utc.range,fi.day=Nb(function(a){var b=new gi(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),fi.days=fi.day.range,fi.days.utc=fi.day.utc.range,fi.dayOfYear=function(a){var b=fi.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(a,b){b=7-b;var c=fi[a]=Nb(function(a){return(a=fi.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=fi.year(a).getDay();return Math.floor((fi.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});fi[a+"s"]=c.range,fi[a+"s"].utc=c.utc.range,fi[a+"OfYear"]=function(a){var c=fi.year(a).getDay();return Math.floor((fi.dayOfYear(a)+(c+b)%7)/7)}}),fi.week=fi.sunday,fi.weeks=fi.sunday.range,fi.weeks.utc=fi.sunday.utc.range,fi.weekOfYear=fi.sundayOfYear;var ii={"-":"",_:" ",0:"0"},ji=/^\s*\d+/,ki=/^%/;Zg.locale=function(a){return{numberFormat:Kb(a),timeFormat:Pb(a)}};var li=Zg.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Zg.format=li.numberFormat,Zg.geo={},ic.prototype={s:0,t:0,add:function(a){jc(a,this.t,mi),jc(mi.s,this.s,this),this.s?this.t+=mi.t:this.s=mi.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var mi=new ic;Zg.geo.stream=function(a,b){a&&ni.hasOwnProperty(a.type)?ni[a.type](a,b):kc(a,b)};var ni={Feature:function(a,b){kc(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++da?4*Ch+a:a,ri.lineStart=ri.lineEnd=ri.point=p}};Zg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=oc([b*Hh,c*Hh]);if(r){var e=qc(r,d),f=[e[1],-e[0],0],g=qc(f,e);tc(g),g=uc(g);var i=b-o,j=i>0?1:-1,p=g[0]*Ih*j,q=lh(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Ih;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Ih;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=lh(d)>180?d+(d>0?360:-360):d}else p=a,q=c;ri.point(a,c),b(a,c)}function f(){ri.lineStart()}function g(){e(p,q),ri.lineEnd(),lh(s)>Fh&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:aqi?(k=-(m=180),l=-(n=90)):s>Fh?n=90:-Fh>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],Zg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-1/0,b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,1/0===k||1/0===l?[[0/0,0/0],[0/0,0/0]]:[[k,l],[m,n]]}}(),Zg.geo.centroid=function(a){si=ti=ui=vi=wi=xi=yi=zi=Ai=Bi=Ci=0,Zg.geo.stream(a,Di);var b=Ai,c=Bi,d=Ci,e=b*b+c*c+d*d;return Gh>e&&(b=xi,c=yi,d=zi,Fh>ti&&(b=ui,c=vi,d=wi),e=b*b+c*c+d*d,Gh>e)?[0/0,0/0]:[Math.atan2(c,b)*Ih,Z(d/Math.sqrt(e))*Ih]};var si,ti,ui,vi,wi,xi,yi,zi,Ai,Bi,Ci,Di={sphere:p,point:wc,lineStart:yc,lineEnd:zc,polygonStart:function(){Di.lineStart=Ac},polygonEnd:function(){Di.lineStart=yc}},Ei=Fc(Bc,Kc,Mc,[-Ch,-Ch/2]),Fi=1e9;Zg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=Pc(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(Zg.geo.conicEqualArea=function(){return Rc(Sc)}).raw=Sc,Zg.geo.albers=function(){return Zg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Zg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=Zg.geo.albers(),g=Zg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=Zg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Fh,l+.12*j+Fh],[k-.214*j-Fh,l+.234*j-Fh]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Fh,l+.166*j+Fh],[k-.115*j-Fh,l+.234*j-Fh]]).stream(i).point,a},a.scale(1070)};var Gi,Hi,Ii,Ji,Ki,Li,Mi={point:p,lineStart:p,lineEnd:p,polygonStart:function(){Hi=0,Mi.lineStart=Tc},polygonEnd:function(){Mi.lineStart=Mi.lineEnd=Mi.point=p,Gi+=lh(Hi/2)}},Ni={point:Uc,lineStart:p,lineEnd:p,polygonStart:p,polygonEnd:p},Oi={point:Xc,lineStart:Yc,lineEnd:Zc,polygonStart:function(){Oi.lineStart=$c},polygonEnd:function(){Oi.point=Xc,Oi.lineStart=Yc,Oi.lineEnd=Zc}};Zg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),Zg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Gi=0,Zg.geo.stream(a,e(Mi)),Gi},a.centroid=function(a){return ui=vi=wi=xi=yi=zi=Ai=Bi=Ci=0,Zg.geo.stream(a,e(Oi)),Ci?[Ai/Ci,Bi/Ci]:zi?[xi/zi,yi/zi]:wi?[ui/wi,vi/wi]:[0/0,0/0]},a.bounds=function(a){return Ki=Li=-(Ii=Ji=1/0),Zg.geo.stream(a,e(Ni)),[[Ii,Ji],[Ki,Li]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||bd(a):Bb,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new Vc:new _c(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(Zg.geo.albersUsa()).context(null)},Zg.geo.transform=function(a){return{stream:function(b){var c=new cd(b);for(var d in a)c[d]=a[d];return c}}},cd.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zg.geo.projection=ed,Zg.geo.projectionMutator=fd,(Zg.geo.equirectangular=function(){return ed(hd)}).raw=hd.invert=hd,Zg.geo.rotation=function(a){function b(b){return b=a(b[0]*Hh,b[1]*Hh),b[0]*=Ih,b[1]*=Ih,b}return a=jd(a[0]%360*Hh,a[1]*Hh,a.length>2?a[2]*Hh:0),b.invert=function(b){return b=a.invert(b[0]*Hh,b[1]*Hh),b[0]*=Ih,b[1]*=Ih,b},b},id.invert=hd,Zg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=jd(-a[0]*Hh,-a[1]*Hh,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Ih,a[1]*=Ih}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=nd((b=+d)*Hh,e*Hh),a):b},a.precision=function(d){return arguments.length?(c=nd(b*Hh,(e=+d)*Hh),a):e},a.angle(90)},Zg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Hh,e=a[1]*Hh,f=b[1]*Hh,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},Zg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return Zg.range(Math.ceil(f/q)*q,e,q).map(m).concat(Zg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(Zg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return lh(a%q)>Fh}).map(k)).concat(Zg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return lh(a%r)>Fh}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=pd(h,g,90),l=qd(d,c,s),m=pd(j,i,90),n=qd(f,e,s),a):s},a.majorExtent([[-180,-90+Fh],[180,90-Fh]]).minorExtent([[-180,-80-Fh],[180,80+Fh]])},Zg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=rd,e=sd;return a.distance=function(){return Zg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},Zg.geo.interpolate=function(a,b){return td(a[0]*Hh,a[1]*Hh,b[0]*Hh,b[1]*Hh)},Zg.geo.length=function(a){return Pi=0,Zg.geo.stream(a,Qi),Pi};var Pi,Qi={sphere:p,point:p,lineStart:ud,lineEnd:p,polygonStart:p,polygonEnd:p},Ri=vd(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(Zg.geo.azimuthalEqualArea=function(){return ed(Ri)}).raw=Ri;var Si=vd(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},Bb);(Zg.geo.azimuthalEquidistant=function(){return ed(Si)}).raw=Si,(Zg.geo.conicConformal=function(){return Rc(wd)}).raw=wd,(Zg.geo.conicEquidistant=function(){return Rc(xd)}).raw=xd;var Ti=vd(function(a){return 1/a},Math.atan);(Zg.geo.gnomonic=function(){return ed(Ti)}).raw=Ti,yd.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Eh]},(Zg.geo.mercator=function(){return zd(yd)}).raw=yd;var Ui=vd(function(){return 1},Math.asin);(Zg.geo.orthographic=function(){return ed(Ui)}).raw=Ui;var Vi=vd(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(Zg.geo.stereographic=function(){return ed(Vi)}).raw=Vi,Ad.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Eh]},(Zg.geo.transverseMercator=function(){var a=zd(Ad),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[-a[1],a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},a.rotate([0,0])}).raw=Ad,Zg.geom={},Zg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e=Ab(c),f=Ab(d),g=a.length,h=[],i=[];for(b=0;g>b;b++)h.push([+e.call(this,a[b],b),+f.call(this,a[b],b),b]);for(h.sort(Ed),b=0;g>b;b++)i.push([h[b][0],-h[b][1]]);var j=Dd(h),k=Dd(i),l=k[0]===j[0],m=k[k.length-1]===j[j.length-1],n=[];for(b=j.length-1;b>=0;--b)n.push(a[h[j[b]][2]]);for(b=+l;b=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Fh)*Fh,y:Math.round(g(a,b)/Fh)*Fh,i:b}})}var d=Bd,e=Cd,f=d,g=e,h=cj;return a?b(a):(b.links=function(a){return fe(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return fe(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(Rd),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i=j,m=d>=k,n=(m<<1)+l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=ke()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=Ab(h),u=Ab(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.xr&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=ke();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){le(a,z,p,q,r,s)},n=-1,null==b){for(;++n=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=fj.get(c)||ej,d=gj.get(d)||Bb,se(d(c.apply(null,$g.call(arguments,1))))},Zg.interpolateHcl=Fe,Zg.interpolateHsl=Ge,Zg.interpolateLab=He,Zg.interpolateRound=Ie,Zg.transform=function(a){var b=ah.createElementNS(Zg.ns.prefix.svg,"g");return(Zg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Je(c?c.matrix:hj)})(a)},Je.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var hj={a:1,b:0,c:0,d:1,e:0,f:0};Zg.interpolateTransform=Ne,Zg.layout={},Zg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++ch*h/q){if(o>i){var j=b.charge/i;a.px-=f*j,a.py-=g*j}return!0}if(b.point&&i&&o>i){var j=b.pointCharge/i;a.px-=f*j,a.py-=g*j}}return!b.charge}}function b(a){a.px=Zg.event.x,a.py=Zg.event.y,h.resume()}var c,d,e,f,g,h={},i=Zg.dispatch("start","tick","end"),j=[1,1],k=.9,l=ij,m=jj,n=-30,o=kj,p=.1,q=.64,r=[],s=[];return h.tick=function(){if((d*=.99)<.005)return i.end({type:"end",alpha:d=0}),!0;var b,c,h,l,m,o,q,t,u,v=r.length,w=s.length;for(c=0;w>c;++c)h=s[c],l=h.source,m=h.target,t=m.x-l.x,u=m.y-l.y,(o=t*t+u*u)&&(o=d*f[c]*((o=Math.sqrt(o))-e[c])/o,t*=o,u*=o,m.x-=t*(q=l.weight/(m.weight+l.weight)),m.y-=u*q,l.x+=t*(q=1-q),l.y+=u*q);if((q=d*p)&&(t=j[0]/2,u=j[1]/2,c=-1,q))for(;++c0?a:0:a>0&&(i.start({type:"start",alpha:d=a}),Zg.timer(h.tick)),h):d},h.start=function(){function a(a,d){if(!c){for(c=new Array(i),h=0;i>h;++h)c[h]=[];for(h=0;j>h;++h){var e=s[h];c[e.source.index].push(e.target),c[e.target.index].push(e.source)}}for(var f,g=c[b],h=-1,j=g.length;++hb;++b)(d=r[b]).index=b,d.weight=0;for(b=0;k>b;++b)d=s[b],"number"==typeof d.source&&(d.source=r[d.source]),"number"==typeof d.target&&(d.target=r[d.target]),++d.source.weight,++d.target.weight;for(b=0;i>b;++b)d=r[b],isNaN(d.x)&&(d.x=a("x",o)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(e=[],"function"==typeof l)for(b=0;k>b;++b)e[b]=+l.call(this,s[b],b);else for(b=0;k>b;++b)e[b]=l;if(f=[],"function"==typeof m)for(b=0;k>b;++b)f[b]=+m.call(this,s[b],b);else for(b=0;k>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;i>b;++b)g[b]=+n.call(this,r[b],b);else for(b=0;i>b;++b)g[b]=n;return h.resume()},h.resume=function(){return h.alpha(.1)},h.stop=function(){return h.alpha(0)},h.drag=function(){return c||(c=Zg.behavior.drag().origin(Bb).on("dragstart.force",Te).on("drag.force",b).on("dragend.force",Ue)),arguments.length?void this.on("mouseover.force",Ve).on("mouseout.force",We).call(c):c},Zg.rebind(h,i,"on")};var ij=20,jj=1,kj=1/0;Zg.layout.hierarchy=function(){function a(b,g,h){var i=e.call(c,b,g);if(b.depth=g,h.push(b),i&&(j=i.length)){for(var j,k,l=-1,m=b.children=new Array(j),n=0,o=g+1;++ln;++n)for(e.call(a,j[0][n],o=p[n],k[0][n][1]),m=1;q>m;++m)e.call(a,j[m][n],o+=k[m-1][n][1],k[m][n][1]);return h}var b=Bb,c=ef,d=ff,e=df,f=bf,g=cf;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:mj.get(b)||ef,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:nj.get(b)||ff,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var mj=Zg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(gf),f=a.map(hf),g=Zg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return Zg.range(a.length).reverse()},"default":ef}),nj=Zg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand:function(a){var b,c,d,e=a.length,f=a[0].length,g=1/e,h=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=g}for(c=0;f>c;++c)h[c]=0;return h},zero:ff});Zg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f0)for(f=-1;++f=k[0]&&h<=k[1]&&(g=i[Zg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f])); return i}var b=!0,c=Number,d=mf,e=kf;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Ab(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return lf(a,b)}:Ab(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},Zg.layout.tree=function(){function a(a,f){function g(a,b){var d=a.children,e=a._tree;if(d&&(f=d.length)){for(var f,h,j,k=d[0],l=k,m=-1;++m0&&(wf(xf(h,a,d),a,e),j+=e,k+=e),l+=h._tree.mod,j+=f._tree.mod,m+=i._tree.mod,k+=g._tree.mod;h&&!pf(g)&&(g._tree.thread=h,g._tree.mod+=l-k),f&&!of(i)&&(i._tree.thread=f,i._tree.mod+=j-m,d=a)}return d}var j=b.call(this,a,f),k=j[0];uf(k,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),g(k),h(k,-k._tree.prelim);var l=qf(k,sf),m=qf(k,rf),n=qf(k,tf),o=l.x-c(l,m)/2,p=m.x+c(m,l)/2,q=n.depth||1;return uf(k,e?function(a){a.x*=d[0],a.y=a.depth*d[1],delete a._tree}:function(a){a.x=(a.x-o)/(p-o)*d[0],a.y=a.depth/q*d[1],delete a._tree}),j}var b=Zg.layout.hierarchy().sort(null).value(null),c=nf,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},Ye(a,b)},Zg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,uf(h,function(a){a.r=+k(a.value)}),uf(h,Cf),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;uf(h,function(a){a.r+=l}),uf(h,Cf),uf(h,function(a){a.r-=l})}return Ff(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=Zg.layout.hierarchy().sort(yf),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},Ye(a,c)},Zg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;uf(i,function(a){var b=a.children;b&&b.length?(a.x=If(b),a.y=Hf(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Jf(i),l=Kf(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return uf(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=Zg.layout.hierarchy().sort(null).value(null),c=nf,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},Ye(a,b)},Zg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++eb?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++gc&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++fc.dx)&&(k=c.dx);++fc&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=Zg.random.normal.apply(Zg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=Zg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},Zg.scale={};var oj={floor:Bb,ceil:Bb};Zg.scale.linear=function(){return Tf([0,1],[0,1],qe,!1)};var pj={s:1,g:1,p:1,r:1,e:1};Zg.scale.log=function(){return _f(Zg.scale.linear().domain([0,1]),10,!0,[1,10])};var qj=Zg.format(".0e"),rj={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};Zg.scale.pow=function(){return ag(Zg.scale.linear(),1,[0,1])},Zg.scale.sqrt=function(){return Zg.scale.pow().exponent(.5)},Zg.scale.ordinal=function(){return cg([],{t:"range",a:[[]]})},Zg.scale.category10=function(){return Zg.scale.ordinal().range(sj)},Zg.scale.category20=function(){return Zg.scale.ordinal().range(tj)},Zg.scale.category20b=function(){return Zg.scale.ordinal().range(uj)},Zg.scale.category20c=function(){return Zg.scale.ordinal().range(vj)};var sj=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(rb),tj=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(rb),uj=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(rb),vj=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(rb);Zg.scale.quantile=function(){return dg([],[])},Zg.scale.quantize=function(){return eg(0,1,[0,1])},Zg.scale.threshold=function(){return fg([.5],[0,1])},Zg.scale.identity=function(){return gg([0,1])},Zg.svg={},Zg.svg.arc=function(){function a(){var a=b.apply(this,arguments),f=c.apply(this,arguments),g=d.apply(this,arguments)+wj,h=e.apply(this,arguments)+wj,i=(g>h&&(i=g,g=h,h=i),h-g),j=Ch>i?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=xj?a?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+a+"A"+a+","+a+" 0 1,0 0,"+-a+"A"+a+","+a+" 0 1,0 0,"+a+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":a?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+a*m+","+a*n+"A"+a+","+a+" 0 "+j+",0 "+a*k+","+a*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0Z"}var b=hg,c=ig,d=jg,e=kg;return a.innerRadius=function(c){return arguments.length?(b=Ab(c),a):b},a.outerRadius=function(b){return arguments.length?(c=Ab(b),a):c},a.startAngle=function(b){return arguments.length?(d=Ab(b),a):d},a.endAngle=function(b){return arguments.length?(e=Ab(b),a):e},a.centroid=function(){var a=(b.apply(this,arguments)+c.apply(this,arguments))/2,f=(d.apply(this,arguments)+e.apply(this,arguments))/2+wj;return[Math.cos(f)*a,Math.sin(f)*a]},a};var wj=-Eh,xj=Dh-Fh;Zg.svg.line=function(){return lg(Bb)};var yj=Zg.map({linear:mg,"linear-closed":ng,step:og,"step-before":pg,"step-after":qg,basis:wg,"basis-open":xg,"basis-closed":yg,bundle:zg,cardinal:tg,"cardinal-open":rg,"cardinal-closed":sg,monotone:Fg});yj.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var zj=[0,2/3,1/3,0],Aj=[0,1/3,2/3,0],Bj=[0,1/6,2/3,1/6];Zg.svg.line.radial=function(){var a=lg(Gg);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},pg.reverse=qg,qg.reverse=pg,Zg.svg.area=function(){return Hg(Bb)},Zg.svg.area.radial=function(){var a=Hg(Gg);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},Zg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)+wj,k=j.call(a,e,d)+wj;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Ch)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=rd,g=sd,h=Ig,i=jg,j=kg;return a.radius=function(b){return arguments.length?(h=Ab(b),a):h},a.source=function(b){return arguments.length?(f=Ab(b),a):f},a.target=function(b){return arguments.length?(g=Ab(b),a):g},a.startAngle=function(b){return arguments.length?(i=Ab(b),a):i},a.endAngle=function(b){return arguments.length?(j=Ab(b),a):j},a},Zg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=rd,c=sd,d=Jg;return a.source=function(c){return arguments.length?(b=Ab(c),a):b},a.target=function(b){return arguments.length?(c=Ab(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},Zg.svg.diagonal.radial=function(){var a=Zg.svg.diagonal(),b=Jg,c=a.projection;return a.projection=function(a){return arguments.length?c(Kg(b=a)):b},a},Zg.svg.symbol=function(){function a(a,d){return(Cj.get(b.call(this,a,d))||Ng)(c.call(this,a,d))}var b=Mg,c=Lg;return a.type=function(c){return arguments.length?(b=Ab(c),a):b},a.size=function(b){return arguments.length?(c=Ab(b),a):c},a};var Cj=Zg.map({circle:Ng,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Gj)),c=b*Gj;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Fj),c=b*Fj/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Fj),c=b*Fj/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});Zg.svg.symbolTypes=Cj.keys();var Dj,Ej,Fj=Math.sqrt(3),Gj=Math.tan(30*Hh),Hj=[],Ij=0;Hj.call=vh.call,Hj.empty=vh.empty,Hj.node=vh.node,Hj.size=vh.size,Zg.transition=function(a){return arguments.length?Dj?a.transition():a:yh.transition()},Zg.transition.prototype=Hj,Hj.select=function(a){var b,c,d,e=this.id,f=[];a=w(a);for(var g=-1,h=this.length;++gf;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return Og(e,this.id)},Hj.tween=function(a,b){var c=this.id;return arguments.length<2?this.node().__transition__[c].tween.get(a):K(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})},Hj.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?Ne:qe,h=Zg.ns.qualify(a);return Pg(this,"attr."+a,b,h.local?f:e)},Hj.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=Zg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Hj.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(b){return null==b?d:(b+="",function(){var d,e=ch.getComputedStyle(this,null).getPropertyValue(a);return e!==b&&(d=qe(e,b),function(b){this.style.setProperty(a,d(b),c)})})}var f=arguments.length;if(3>f){if("string"!=typeof a){2>f&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return Pg(this,"style."+a,b,e)},Hj.styleTween=function(a,b,c){function d(d,e){var f=b.call(this,d,e,ch.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}}return arguments.length<3&&(c=""),this.tween("style."+a,d)},Hj.text=function(a){return Pg(this,"text",a,Qg)},Hj.remove=function(){return this.each("end.transition",function(){var a;this.__transition__.count<2&&(a=this.parentNode)&&a.removeChild(this)})},Hj.ease=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].ease:("function"!=typeof a&&(a=Zg.ease.apply(Zg,arguments)),K(this,function(c){c.__transition__[b].ease=a}))},Hj.delay=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].delay:K(this,"function"==typeof a?function(c,d,e){c.__transition__[b].delay=+a.call(c,c.__data__,d,e)}:(a=+a,function(c){c.__transition__[b].delay=a}))},Hj.duration=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].duration:K(this,"function"==typeof a?function(c,d,e){c.__transition__[b].duration=Math.max(1,a.call(c,c.__data__,d,e))}:(a=Math.max(1,a),function(c){c.__transition__[b].duration=a}))},Hj.each=function(a,b){var c=this.id;if(arguments.length<2){var d=Ej,e=Dj;Dj=c,K(this,function(b,d,e){Ej=b.__transition__[c],a.call(b,b.__data__,d,e)}),Ej=d,Dj=e}else K(this,function(d){var e=d.__transition__[c];(e.event||(e.event=Zg.dispatch("start","end"))).on(a,b)});return this},Hj.transition=function(){for(var a,b,c,d,e=this.id,f=++Ij,g=[],h=0,i=this.length;i>h;h++){g.push(a=[]);for(var b=this[h],j=0,k=b.length;k>j;j++)(c=b[j])&&(d=Object.create(c.__transition__[e]),d.delay+=d.duration,Rg(c,j,f,d)),a.push(c)}return Og(g,f)},Zg.svg.axis=function(){function a(a){a.each(function(){var a,j=Zg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):Bb:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Fh),q=Zg.transition(o.exit()).style("opacity",Fh).remove(),r=Zg.transition(o.order()).style("opacity",1),s=Of(l),t=j.selectAll(".domain").data([0]),u=(t.enter().append("path").attr("class","domain"),Zg.transition(t));p.append("line"),p.append("text");var v=p.select("line"),w=r.select("line"),x=o.select("text").text(n),y=p.select("text"),z=r.select("text");switch(d){case"bottom":a=Sg,v.attr("y2",e),y.attr("y",Math.max(e,0)+g),w.attr("x2",0).attr("y2",e),z.attr("x",0).attr("y",Math.max(e,0)+g),x.attr("dy",".71em").style("text-anchor","middle"),u.attr("d","M"+s[0]+","+f+"V0H"+s[1]+"V"+f);break;case"top":a=Sg,v.attr("y2",-e),y.attr("y",-(Math.max(e,0)+g)),w.attr("x2",0).attr("y2",-e),z.attr("x",0).attr("y",-(Math.max(e,0)+g)),x.attr("dy","0em").style("text-anchor","middle"),u.attr("d","M"+s[0]+","+-f+"V0H"+s[1]+"V"+-f);break;case"left":a=Tg,v.attr("x2",-e),y.attr("x",-(Math.max(e,0)+g)),w.attr("x2",-e).attr("y2",0),z.attr("x",-(Math.max(e,0)+g)).attr("y",0),x.attr("dy",".32em").style("text-anchor","end"),u.attr("d","M"+-f+","+s[0]+"H0V"+s[1]+"H"+-f);break;case"right":a=Tg,v.attr("x2",e),y.attr("x",Math.max(e,0)+g),w.attr("x2",e).attr("y2",0),z.attr("x",Math.max(e,0)+g).attr("y",0),x.attr("dy",".32em").style("text-anchor","start"),u.attr("d","M"+f+","+s[0]+"H0V"+s[1]+"H"+f)}if(l.rangeBand){var A=l,B=A.rangeBand()/2;k=l=function(a){return A(a)+B}}else k.rangeBand?k=l:q.call(a,l);p.call(a,k),r.call(a,l)})}var b,c=Zg.scale.linear(),d=Jj,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Kj?b+"":Jj,a):d},a.ticks=function(){return arguments.length?(h=arguments,a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Jj="bottom",Kj={top:1,right:1,bottom:1,left:1};Zg.svg.brush=function(){function a(f){f.each(function(){var f=Zg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",e).on("touchstart.brush",e),g=f.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=f.selectAll(".resize").data(o,Bb);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Lj[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var k,l=Zg.transition(f),m=Zg.transition(g);i&&(k=Of(i),m.attr("x",k[0]).attr("width",k[1]-k[0]),c(l)),j&&(k=Of(j),m.attr("y",k[0]).attr("height",k[1]-k[0]),d(l)),b(l)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+k[+/e$/.test(a)]+","+l[+/^s/.test(a)]+")"})}function c(a){a.select(".extent").attr("x",k[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",k[1]-k[0])}function d(a){a.select(".extent").attr("y",l[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function e(){function e(){32==Zg.event.keyCode&&(C||(t=null,E[0]-=k[1],E[1]-=l[1],C=2),s())}function o(){32==Zg.event.keyCode&&2==C&&(E[0]+=k[1],E[1]+=l[1],C=0,s())}function p(){var a=Zg.mouse(v),e=!1;u&&(a[0]+=u[0],a[1]+=u[1]),C||(Zg.event.altKey?(t||(t=[(k[0]+k[1])/2,(l[0]+l[1])/2]),E[0]=k[+(a[0]o?(e=d,d=o):e=o),p[0]!=d||p[1]!=e?(c?g=null:f=null,p[0]=d,p[1]=e,!0):void 0}function r(){p(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),Zg.select("body").style("cursor",null),F.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),x({type:"brushend"})}var t,u,v=this,w=Zg.select(Zg.event.target),x=h.of(v,arguments),y=Zg.select(v),z=w.datum(),A=!/^(n|s)$/.test(z)&&i,B=!/^(e|w)$/.test(z)&&j,C=w.classed("extent"),D=R(),E=Zg.mouse(v),F=Zg.select(ch).on("keydown.brush",e).on("keyup.brush",o);if(Zg.event.changedTouches?F.on("touchmove.brush",p).on("touchend.brush",r):F.on("mousemove.brush",p).on("mouseup.brush",r),y.interrupt().selectAll("*").interrupt(),C)E[0]=k[0]-E[0],E[1]=l[0]-E[1];else if(z){var G=+/w$/.test(z),H=+/^n/.test(z);u=[k[1-G]-E[0],l[1-H]-E[1]],E[0]=k[G],E[1]=l[H]}else Zg.event.altKey&&(t=E.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),Zg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),p()}var f,g,h=u(a,"brushstart","brush","brushend"),i=null,j=null,k=[0,0],l=[0,0],m=!0,n=!0,o=Mj[0];return a.event=function(a){a.each(function(){var a=h.of(this,arguments),b={x:k,y:l,i:f,j:g},c=this.__chart__||b;this.__chart__=b,Dj?Zg.select(this).transition().each("start.brush",function(){f=c.i,g=c.j,k=c.x,l=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=re(k,b.x),d=re(l,b.y);return f=g=null,function(e){k=b.x=c(e),l=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){f=b.i,g=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(i=b,o=Mj[!i<<1|!j],a):i},a.y=function(b){return arguments.length?(j=b,o=Mj[!i<<1|!j],a):j},a.clamp=function(b){return arguments.length?(i&&j?(m=!!b[0],n=!!b[1]):i?m=!!b:j&&(n=!!b),a):i&&j?[m,n]:i?m:j?n:null},a.extent=function(b){var c,d,e,h,m;return arguments.length?(i&&(c=b[0],d=b[1],j&&(c=c[0],d=d[0]),f=[c,d],i.invert&&(c=i(c),d=i(d)),c>d&&(m=c,c=d,d=m),(c!=k[0]||d!=k[1])&&(k=[c,d])),j&&(e=b[0],h=b[1],i&&(e=e[1],h=h[1]),g=[e,h],j.invert&&(e=j(e),h=j(h)),e>h&&(m=e,e=h,h=m),(e!=l[0]||h!=l[1])&&(l=[e,h])),a):(i&&(f?(c=f[0],d=f[1]):(c=k[0],d=k[1],i.invert&&(c=i.invert(c),d=i.invert(d)),c>d&&(m=c,c=d,d=m))),j&&(g?(e=g[0],h=g[1]):(e=l[0],h=l[1],j.invert&&(e=j.invert(e),h=j.invert(h)),e>h&&(m=e,e=h,h=m))),i&&j?[[c,e],[d,h]]:i?[c,d]:j&&[e,h])},a.clear=function(){return a.empty()||(k=[0,0],l=[0,0],f=g=null),a},a.empty=function(){return!!i&&k[0]==k[1]||!!j&&l[0]==l[1]},Zg.rebind(a,h,"on")};var Lj={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Mj=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Nj=fi.format=li.timeFormat,Oj=Nj.utc,Pj=Oj("%Y-%m-%dT%H:%M:%S.%LZ");Nj.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ug:Pj,Ug.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Ug.toString=Pj.toString,fi.second=Nb(function(a){return new gi(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),fi.seconds=fi.second.range,fi.seconds.utc=fi.second.utc.range,fi.minute=Nb(function(a){return new gi(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),fi.minutes=fi.minute.range,fi.minutes.utc=fi.minute.utc.range,fi.hour=Nb(function(a){var b=a.getTimezoneOffset()/60;return new gi(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),fi.hours=fi.hour.range,fi.hours.utc=fi.hour.utc.range,fi.month=Nb(function(a){return a=fi.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),fi.months=fi.month.range,fi.months.utc=fi.month.utc.range;var Qj=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Rj=[[fi.second,1],[fi.second,5],[fi.second,15],[fi.second,30],[fi.minute,1],[fi.minute,5],[fi.minute,15],[fi.minute,30],[fi.hour,1],[fi.hour,3],[fi.hour,6],[fi.hour,12],[fi.day,1],[fi.day,2],[fi.week,1],[fi.month,1],[fi.month,3],[fi.year,1]],Sj=Nj.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Bc]]),Tj={range:function(a,b,c){return Zg.range(Math.ceil(a/c)*c,+b,c).map(Wg)},floor:Bb,ceil:Bb};Rj.year=fi.year,fi.scale=function(){return Vg(Zg.scale.linear(),Rj,Sj)};var Uj=Rj.map(function(a){return[a[0].utc,a[1]]}),Vj=Oj.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Bc]]);Uj.year=fi.year.utc,fi.scale.utc=function(){return Vg(Zg.scale.linear(),Uj,Vj)},Zg.text=Cb(function(a){return a.responseText}),Zg.json=function(a,b){return Db(a,"application/json",Xg,b)},Zg.html=function(a,b){return Db(a,"text/html",Yg,b)},Zg.xml=Cb(function(a){return a.responseXML}),"function"==typeof ToneDen.define&&ToneDen.define.amd?ToneDen.define("vendor/d3",Zg):"object"==typeof module&&module.exports?module.exports=Zg:this.d3=Zg}(),function(){function a(a){var c=!1;return function(){if(c)throw new Error("Callback was already called.");c=!0,a.apply(b,arguments)}}var b,c,d={};b=this,null!=b&&(c=b.async),d.noConflict=function(){return b.async=c,d};var e=function(a,b){if(a.forEach)return a.forEach(b);for(var c=0;c=b.length&&d(null))}))})},d.forEach=d.each,d.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c(null):e())})};e()},d.forEachSeries=d.eachSeries,d.eachLimit=function(a,b,c,d){var e=i(b);e.apply(null,[a,c,d])},d.forEachLimit=d.eachLimit;var i=function(a){return function(b,c,d){if(d=d||function(){},!b.length||0>=a)return d();var e=0,f=0,g=0;!function h(){if(e>=b.length)return d();for(;a>g&&f=b.length?d():h())})}()}},j=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[d.each].concat(b))}},k=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[i(a)].concat(c))}},l=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[d.eachSeries].concat(b))}},m=function(a,b,c,d){var e=[];b=f(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c,d){e[a.index]=d,b(c)})},function(a){d(a,e)})};d.map=j(m),d.mapSeries=l(m),d.mapLimit=function(a,b,c,d){return n(b)(a,c,d)};var n=function(a){return k(a,m)};d.reduce=function(a,b,c,e){d.eachSeries(a,function(a,d){c(b,a,function(a,c){b=c,d(a)})},function(a){e(a,b)})},d.inject=d.reduce,d.foldl=d.reduce,d.reduceRight=function(a,b,c,e){var g=f(a,function(a){return a}).reverse();d.reduce(g,b,c,e)},d.foldr=d.reduceRight;var o=function(a,b,c,d){var e=[];b=f(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c&&e.push(a),b()})},function(){d(f(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};d.filter=j(o),d.filterSeries=l(o),d.select=d.filter,d.selectSeries=d.filterSeries;var p=function(a,b,c,d){var e=[];b=f(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c||e.push(a),b()})},function(){d(f(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};d.reject=j(p),d.rejectSeries=l(p);var q=function(a,b,c,d){a(b,function(a,b){c(a,function(c){c?(d(a),d=function(){}):b()})},function(){d()})};d.detect=j(q),d.detectSeries=l(q),d.some=function(a,b,c){d.each(a,function(a,d){b(a,function(a){a&&(c(!0),c=function(){}),d()})},function(){c(!1)})},d.any=d.some,d.every=function(a,b,c){d.each(a,function(a,d){b(a,function(a){a||(c(!1),c=function(){}),d()})},function(){c(!0)})},d.all=d.every,d.sortBy=function(a,b,c){d.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);var d=function(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0};c(null,f(b.sort(d),function(a){return a.value}))})},d.auto=function(a,b){b=b||function(){};var c=h(a);if(!c.length)return b(null);var f={},i=[],j=function(a){i.unshift(a)},k=function(a){for(var b=0;bb;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},d.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},d.times=function(a,b,c){for(var e=[],f=0;a>f;f++)e.push(f);return d.map(e,b,c)},d.timesSeries=function(a,b,c){for(var e=[],f=0;a>f;f++)e.push(f);return d.mapSeries(e,b,c)},d.compose=function(){var a=Array.prototype.reverse.call(arguments);return function(){var b=this,c=Array.prototype.slice.call(arguments),e=c.pop();d.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){e.apply(b,[a].concat(c))})}};var u=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};d.applyEach=j(u),d.applyEachSeries=l(u),d.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof ToneDen.define&&ToneDen.define.amd?ToneDen.define("vendor/async",[],function(){return d}):"undefined"!=typeof module&&module.exports?module.exports=d:b.async=d}(),ToneDen.define("vendor/td-interface",["vendor/soundmanager2","jquery","vendor/jquery-jsonp","vendor/d3","vendor/async","constants"],function(a,b,c,d,e,f){var g=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0==1;__slice=[].slice,"undefined"!=typeof a&&a.setup({debugMode:!1,flashVersion:9,url:"swf",useFlashBlock:!1,useHighPerformance:!1,waitForWindowLoad:!0,useConsole:!0,useHTML5Audio:!0,wmode:"transparent"});var h=function(c,d){var h,i={autoplay:!1,autoswitch:!0,cache:!0,cachePrefix:"",debug:!1,flashVersion:9,loop:!1,loopTrack:!1,onTrackFinished:null,preload:!0,startOn:0,togglePause:!0,tracksPerArtist:10,useEQData:!0,useHTML5Audio:!0,useWaveformData:!1,volume:100},j=f.protocol+"//api.soundcloud.com/resolve?url=http://soundcloud.com",k=f.protocol+"//api.soundcloud.com/",l=new RegExp(/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi),m=64,n=256/m,o=this,p=b(this);return this.tracks=[],this.config=b.extend(i,d),this.currentTrackIndex=this.config.startOn,this.currentTrack=null,this.sound=null,this.loopTrack=!1,a.setup({debugMode:d.debug}),this.inited=!1,this.playWhenReady=!1,this.cache={},this.init=function(){o.inited||(o.changeTrack(),o.trigger("tdplayer.init"),o.config.autoplay&&o.play(),o.inited=!0)},this.changeTrack=function(a){var b,c;return o.log("changeTrack"),o.sound&&(o.sound.destruct(),o.sound=null),b="undefined"!=typeof a?a:o.currentTrackIndex,a===o.currentTrackIndex&&a||(c=o.tracks[b],o.resolveTrack(c,function(a){o.setSound(a)}),o.trigger("tdplayer.changing_track",b)),o},this.play=function(){return o.log("play"),o.sound&&3==o.sound.readyState?o.sound.play():o.playWhenReady=!0,o.trigger("tdplayer.play",o.currentTrackIndex),o},this.pause=function(a){return a||(a=!1),o.sound&&(o.config.togglePause&&!a?o.sound.togglePause():o.sound.pause(),o.trigger("tdplayer.pause",o.sound.paused)),o},this.resume=function(a){return a||(a=!1),o.sound&&(o.config.togglePause&&!a?o.sound.togglePause():o.sound.resume(),o.trigger("tdplayer.pause",o.sound.paused)),o},this.stop=function(){return o.sound&&o.sound.stop(),o.trigger("tdplayer.stop"),o.log("stop"),o},this.next=function(a){return o.log("next"),o.playWhenReady="undefined"==typeof a?o.config.autoswitch:a,o.log(o.playWhenReady),o.config.loopTrack?(o.trigger("tdplayer.playlist.trackLooped"),o.changeTrack()):o.tracks[o.currentTrackIndex+1]?(o.currentTrackIndex+=1,o.changeTrack(),o.trigger("tdplayer.playlist.next",o.currentTrackIndex-1,o.currentTrackIndex),o.log("has next")):o.config.loop?(o.currentTrackIndex=0,o.changeTrack(),o.trigger("tdplayer.playlist.looped"),o.log("looped")):(o.currentTrackIndex=o.tracks.length-1,o.trigger("tdplayer.playlist.ended",o.config.onPlaylistFinished),o.log("no mas")),o},this.prev=function(a){return o.playWhenReady="undefined"==typeof a?o.config.autoswitch:a,o.tracks[o.currentTrackIndex-1]?(o.currentTrackIndex-=1,o.changeTrack(),o.trigger("tdplayer.playlist.prev")):o.config.loop?(o.currentTrackIndex=o.tracks.length-1,o.changeTrack(),o.trigger("tdplayer.playlist.looped")):(o.currentTrackIndex=0,o.trigger("tdplayer.playlist.restarted")),o},this.goto=function(a,b){return o.log("goto"),o.playWhenReady="undefined"==typeof b?o.config.autoswitch:b,o.tracks[a]&&(o.currentTrackIndex=a,o.trigger("tdplayer.playlist.goto"),o.changeTrack()),o},this.restartTrack=function(){return o.position(0),o},this.mute=function(){return o.sound&&o.sound.toggleMute(),o.trigger("tdplayer.mute",o.sound.muted),o},this.hasNext=function(){return o.log("has next"),o.tracks[o.currentTrackIndex+1]?!0:o.config.loop&&o.tracks.length>1?!0:!1},this.hasPrev=function(){return o.tracks[o.currentTrackIndex-1]?!0:o.config.loop&&o.tracks.length>1?!0:!1},this.getTime=function(){var a=this.position(),b=Math.floor(a/1e3%60),c=Math.floor(a/6e4%60),d=Math.floor(a/36e5%24),e=c+":"+o.pad(b);return d>0&&(e=d+":"+e),e},this.position=function(a){return o.sound?a||0===a?(a=Math.min(o.sound.duration,a),a=Math.max(0,a),o.trigger("tdplayer.position",a),o.sound.setPosition(a)):(o.trigger("tdplayer.position",o.sound.position),o.sound.position):0},this.volume=function(a){return o.sound?a||0===a?(a=Math.min(100,a),a=Math.max(0,a),o.trigger("tdplayer.volume",a),o.config.volume=a,o.sound.setVolume(a)):(o.trigger("tdplayer.volume",o.sound.volume),o.sound.volume):o.config.volume},this.seek=function(a){var b=o.currentTrack.duration*a;return o.position(b),o},this.loop=function(a){return a&&(o.config.loop=a,o.trigger("tdplayer.loop_changed",o.config.loop)),o.config.loop},this.trackInfo=function(a,b){return o.isNumeric(a)&&(a=o.tracks[a]),o.resolveTrack(a,b)},this.on=function(a,b){return p.on(a,b)},this.trigger=function(a){var b=arguments.length>1?__slice.call(arguments,1):[];return p.trigger(a,b)},this.destroy=function(){o.sound&&o.sound.destruct(),o.tracks=[],p.off(),p.remove(),o.tracks=[],o.track=null},o.getTrack=function(){return o.currentTrack},o.getTracks=function(a){var b=o.getPlaylist();e.map(b,function(a,b){o.trackInfo(a,function(a){return b(null,a)})},function(b,c){return a(b?[]:c)})},o.getTrackIndex=function(){return o.currentTrackIndex},o.getSound=function(){return o.sound},o.getPlaylist=function(){return o.tracks},o.setCache=function(a,b){o.config.cache===!0&&(o.cache[o.config.cachePrefix+a]=b)},o.getCache=function(a){return o.config.cache===!0?o.cache[o.config.cachePrefix+a]||null:null},o.setSound=function(b){var c,d=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(d===!0&&(c=!0),o.currentTrack=b,o.log("setSound"),o.trigger("tdplayer.track.info_loaded",b),b&&b.streamable){var e=b.stream_url;e+=-1===e.indexOf("secret_token")?"?":"&",e+="consumer_key="+o.config.consumerKey,e=e+"&ts="+Math.round((new Date).getTime()/1e3),o.sound=a.createSound({flashVersion:9,autoLoad:!0,useHighPerformance:!1,id:"track_"+b.id+o.config.cachePrefix,multiShot:!1,loops:1,url:e,volume:o.config.volume,waitForWindowLoad:!0,wmode:"transparent",useEQData:!0,useWaveformData:!1,preferFlash:c,whileloading:function(){var a=Math.round(this.bytesLoaded/this.bytesTotal*100);o.trigger("tdplayer.track.whileloading",a)},whileplaying:function(){if(h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],1==o.config.visualizer&&this.eqData)for(var a=0;256>a;a++)h[a/n>>0]+=this.eqData.left[a];var c=h.slice().reverse(),d=c.concat(h),e=Math.round(this.position/b.duration*100*10)/10;o.trigger("tdplayer.track.whileplaying",e,d)},onplay:function(){o.log("track.onplay"),o.trigger("tdplayer.track.played")},onresume:function(){o.trigger("tdplayer.track.resumed")},onstop:function(){o.trigger("tdplayer.track.stopped")},onpause:function(){o.trigger("tdplayer.track.paused")},onfinish:function(){o.config.onTrackFinished&&o.config.onTrackFinished(arguments),o.trigger("tdplayer.track.finished")},onload:function(){o.log("onload"),o.trigger("tdplayer.track.ready",o.config.onTrackReady)}}),o.trigger("tdplayer.track.bindable",b,o.sound)}},o.resolveTrack=function(a,c){var d=a;if(a){a=a.replace(/https?\:\/\/(www\.)?soundcloud\.com/gi,"");var e,f=new b.Deferred,h=o.getCache(a);if(a.match(l)&&-1===a.search(/soundcloud\.com/i)&&(e={stream_url:a,id:0,permalink_url:a,duration:0},f.resolve(e)),o.config.cache===!0&&h)c&&f.done(function(){c(h)}).resolve();else{f.done(function(a){return c?c(a):void 0});var i,k,m;g?(m="jsonp",i="jsonp",k=j+a+"&format=json&consumer_key="+o.config.consumerKey+"&callback=?"):(m="ajax",i="json",k=j+a+"&format=json&consumer_key="+o.config.consumerKey),b[m]({type:"GET",datatype:i,url:k,crossDomain:!0,error:function(){var b={error:!0,errorMessage:"We couldn't load that track :("};o.config.cache&&o.setCache(a,b),f.resolve(b)},success:function(b){"user"===b.kind?o.getTracksForUser(b,o.config.tracksPerArtist,function(a){o.parseTracks(d,a,function(a){b=a[0],f.resolve(b)})}):b.tracks&&b.tracks.length>0?o.parseTracks(d,b.tracks,function(a){b=a[0],f.resolve(b)}):o.processTrack(b,function(b){o.config.cache&&o.setCache(a,b),f.resolve(b)})}})}return f}},o.getTracksForUser=function(a,c,d){var e=k+"users/"+a.id+"/tracks.json?consumer_key="+o.config.consumerKey;b.ajax({url:e,error:function(){return d([])},success:function(a){return a=a.slice(0,Math.min(c,a.length)),d(a)}})},o.getComments=function(a,c){var d=/secret_token=([\w-]+)/g,e=d.exec(a.stream_url),f=k+"tracks/"+a.id+"/comments.json?consumer_key="+o.config.consumerKey;e&&(f+="&secret_token="+e[1]),b.ajax({url:f,error:function(){return c([])},success:c})},o.preloadSCTracks=function(a){var b=JSON.parse(JSON.stringify(o.tracks));e.each(b,function(a,b){o.resolveTrack(a,function(){b()})},function(b){return b&&o.log("Failed to preload tracks."),o.trigger("tdplayer.playlist.preloaded"),"function"==typeof a?a():void 0})},o.processTrack=function(a,b){if(a.artwork_url){a.artwork_url=a.artwork_url.replace("large.jpg","t500x500.jpg");var c=Math.round(3*Math.random())+1;-1!==a.artwork_url.indexOf("i1.sndcdn")&&(a.artwork_url=a.artwork_url.replace("i1.sndcdn","i"+c+".sndcdn"))}return b(a)},o.parseTracks=function(a,b,c){var d=o.tracks.indexOf(a);return b&&0!==b.length?void e.map(b,function(a,b){o.processTrack(a,function(a){var c=a.permalink_url.substring(21);return o.config.cache===!0&&o.setCache(c,a),b(null,a)})},function(a,b){return a?(console.error("Error processing tracks."),console.error(a),c([])):(o.tracks=o.tracks.slice(0,d).concat(b.map(function(a){return a.permalink_url.substring(21)})).concat(o.tracks.slice(d+1)),c(b))}):c([])},o.addTracks=function(a){"string"==typeof a&&(a=[a]),null!=a&&a.length>0&&(o.tracks=o.tracks.concat(a),1==o.config.preload?o.preloadSCTracks.call(o,o.init):o.init.call(o))},o.removeTracks=function(a,b){return o.getTrackIndex()>=a&&o.getTrackIndex()<=a+b&&o.changeTrack(o.tracks.length>a+b?a+b:a>0?a-1:0),o.tracks.splice(a,b)},o.setTracks=function(a){"string"==typeof a&&(a=[a]),null!=a&&a.length>0&&(o.tracks=a,1==o.config.preload?o.preloadSCTracks.call(o,o.init):o.init.call(o))},o.log=function(){o.config.debug&&window.console&&console.log.apply(console,arguments)},o.isNumeric=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},o.pad=function(a){return 10>a?"0"+a:""+a},o.on("tdplayer.track.ready",function(a,b){o.log("track.onready!!!"),1==o.playWhenReady&&(o.playWhenReady=!1,o.play()),"function"==typeof b&&b()}),o.on("tdplayer.track.finished",function(a,b){o.log("track finished"),o.config.autoswitch&&(o.config.loop||o.hasNext())&&(o.log("finished and autoswitch"),o.next().play()),"function"==typeof b&&b()}),o.on("tdplayer.playlist.ended",function(a,b){o.log("playlist ended"),o.config.loop||o.stop(),"function"==typeof b&&b()}),a.onready(function(){o.log("SOUNDMANAGER2 ready!!"),o.addTracks(c)}),a.ontimeout(function(){o.log("SOUNDMANAGER2 TIMEDOUT!!")}),{config:this.config,play:this.play,pause:this.pause,resume:this.resume,stop:this.stop,next:this.next,prev:this.prev,mute:this.mute,getTime:this.getTime,volume:this.volume,restartTrack:this.restartTrack,"goto":this.goto,position:this.position,seek:this.seek,trackInfo:this.trackInfo,hasNext:this.hasNext,hasPrev:this.hasPrev,on:this.on,addTracks:this.addTracks,removeTracks:this.removeTracks,setTracks:this.setTracks,trigger:this.trigger,track:this.getTrack,tracks:this.getTracks,trackIndex:this.getTrackIndex,sound:this.getSound,playlist:this.getPlaylist,destroy:this.destroy}};return h});var Handlebars=function(){var a=function(){function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){function b(a){return h[a]||"&"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=""+a,j.test(a)?a.replace(i,b):a):""}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=/[&<>"'`]/g,j=/[&<>"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return"function"==typeof a};l(/x/)&&(l=function(a){return"function"==typeof a&&"[object Function]"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g="";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper("if",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i="1.3.0";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o="[object Object]";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h("Arg not supported with multiple helpers");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e),g=function(a){function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d,f){var g,h;3===arguments.length?(f=d,d=null):2===arguments.length&&(f=c,c=null),b.call(this,f),this.type="program",this.statements=a,this.strip={},d?(h=d[0],h?(g={first_line:h.firstLine,last_line:h.lastLine,last_column:h.lastColumn,first_column:h.firstColumn},this.inverse=new e.ProgramNode(d,c,g)):this.inverse=new e.ProgramNode(d,c),this.strip.right=c.left):c&&(this.strip.left=c.right)},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1),g=this.eligibleHelper=e.isSimple;this.isHelper=g&&(f.length||c)},PartialNode:function(a,c,d,e){b.call(this,e),this.type="partial",this.partialName=a,this.context=c,this.strip=d},BlockNode:function(a,c,e,f,g){if(b.call(this,g),a.sexpr.id.original!==f.path.original)throw new d(a.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=a,this.program=c,this.inverse=e,this.strip={left:a.strip.left,right:f.strip.right},(c||e).strip.left=a.strip.right,(e||c).strip.right=f.strip.left,e&&!c&&(this.isInverse=!0)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h=0,i=a.length;i>h;h++){var j=a[h].part;if(e+=(a[h].separator||"")+j,".."===j||"."===j||"this"===j){if(f.length>0)throw new d("Invalid path: "+e,this);".."===j?g++:this.isScoped=!0}else f.push(j)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},IntegerNode:function(a,c){b.call(this,c),this.type="INTEGER",this.original=this.integer=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a}};return c=e}(c),h=function(){var a,b=function(){function a(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(0)||"~"===b.charAt(1)}}function b(){this.yy={}}var c={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(b,c,d,e,f,g){var h=g.length-1;switch(f){case 1:return new e.ProgramNode(g[h-1],this._$);case 2:return new e.ProgramNode([],this._$);case 3:this.$=new e.ProgramNode([],g[h-1],g[h],this._$);break;case 4:this.$=new e.ProgramNode(g[h-2],g[h-1],g[h],this._$);break;case 5:this.$=new e.ProgramNode(g[h-1],g[h],[],this._$);break;case 6:this.$=new e.ProgramNode(g[h],this._$);break;case 7:this.$=new e.ProgramNode([],this._$);break;case 8:this.$=new e.ProgramNode([],this._$);break;case 9:this.$=[g[h]];break;case 10:g[h-1].push(g[h]),this.$=g[h-1];break;case 11:this.$=new e.BlockNode(g[h-2],g[h-1].inverse,g[h-1],g[h],this._$);break;case 12:this.$=new e.BlockNode(g[h-2],g[h-1],g[h-1].inverse,g[h],this._$);break;case 13:this.$=g[h];break;case 14:this.$=g[h];break;case 15:this.$=new e.ContentNode(g[h],this._$);break;case 16:this.$=new e.CommentNode(g[h],this._$);break;case 17:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 18:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 19:this.$={path:g[h-1],strip:a(g[h-2],g[h])};break;case 20:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 21:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 22:this.$=new e.PartialNode(g[h-2],g[h-1],a(g[h-3],g[h]),this._$);break;case 23:this.$=a(g[h-1],g[h]);break;case 24:this.$=new e.SexprNode([g[h-2]].concat(g[h-1]),g[h],this._$);break;case 25:this.$=new e.SexprNode([g[h]],null,this._$);break;case 26:this.$=g[h];break;case 27:this.$=new e.StringNode(g[h],this._$);break;case 28:this.$=new e.IntegerNode(g[h],this._$);break;case 29:this.$=new e.BooleanNode(g[h],this._$);break;case 30:this.$=g[h];break;case 31:g[h-1].isHelper=!0,this.$=g[h-1];break;case 32:this.$=new e.HashNode(g[h],this._$);break;case 33:this.$=[g[h-2],g[h]];break;case 34:this.$=new e.PartialNameNode(g[h],this._$);break;case 35:this.$=new e.PartialNameNode(new e.StringNode(g[h],this._$),this._$);break;case 36:this.$=new e.PartialNameNode(new e.IntegerNode(g[h],this._$));break;case 37:this.$=new e.DataNode(g[h],this._$);break;case 38:this.$=new e.IdNode(g[h],this._$);break;case 39:g[h-2].push({part:g[h],separator:g[h-1]}),this.$=g[h-2];break;case 40:this.$=[{part:g[h]}];break;case 43:this.$=[];break;case 44:g[h-1].push(g[h]);break;case 47:this.$=[g[h]];break;case 48:g[h-1].push(g[h])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(a){throw new Error(a) +};return d.next=function(){return cb;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},d.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},d.times=function(a,b,c){for(var e=[],f=0;a>f;f++)e.push(f);return d.map(e,b,c)},d.timesSeries=function(a,b,c){for(var e=[],f=0;a>f;f++)e.push(f);return d.mapSeries(e,b,c)},d.compose=function(){var a=Array.prototype.reverse.call(arguments);return function(){var b=this,c=Array.prototype.slice.call(arguments),e=c.pop();d.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){e.apply(b,[a].concat(c))})}};var u=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};d.applyEach=j(u),d.applyEachSeries=l(u),d.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof ToneDen.define&&ToneDen.define.amd?ToneDen.define("vendor/async",[],function(){return d}):"undefined"!=typeof module&&module.exports?module.exports=d:b.async=d}(),ToneDen.define("vendor/td-interface",["vendor/soundmanager2","jquery","vendor/jquery-jsonp","vendor/d3","vendor/async","constants"],function(a,b,c,d,e,f){var g=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0==1;__slice=[].slice,"undefined"!=typeof a&&a.setup({debugMode:!1,flashVersion:9,url:"swf",useFlashBlock:!1,useHighPerformance:!1,waitForWindowLoad:!0,useConsole:!0,useHTML5Audio:!0,wmode:"transparent"});var h=function(c,d){var h,i={autoplay:!1,autoswitch:!0,cache:!0,cachePrefix:"",debug:!1,flashVersion:9,loop:!1,loopTrack:!1,onTrackFinished:null,preload:!0,startOn:0,togglePause:!0,tracksPerArtist:10,useEQData:!0,useHTML5Audio:!0,useWaveformData:!1,volume:100},j=f.protocol+"//api.soundcloud.com/resolve?url=http://soundcloud.com",k=f.protocol+"//api.soundcloud.com/",l=new RegExp(/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi),m=64,n=256/m,o=this,p=b(this);return this.tracks=[],this.config=b.extend(i,d),this.currentTrackIndex=this.config.startOn,this.currentTrack=null,this.sound=null,this.loopTrack=!1,a.setup({debugMode:d.debug}),this.inited=!1,this.playWhenReady=!1,this.cache={},this.init=function(){o.inited||(o.changeTrack(),o.trigger("tdplayer.init"),o.config.autoplay&&o.play(),o.inited=!0)},this.changeTrack=function(a){var b,c;return o.log("changeTrack"),o.sound&&(o.sound.destruct(),o.sound=null),b="undefined"!=typeof a?a:o.currentTrackIndex,a===o.currentTrackIndex&&a||(c=o.tracks[b],o.resolveTrack(c,function(a){o.setSound(a)}),o.trigger("tdplayer.changing_track",b)),o},this.play=function(){return o.log("play"),o.sound&&3==o.sound.readyState?o.sound.play():o.playWhenReady=!0,o.trigger("tdplayer.play",o.currentTrackIndex),o},this.pause=function(a){return a||(a=!1),o.sound&&(o.config.togglePause&&!a?o.sound.togglePause():o.sound.pause(),o.trigger("tdplayer.pause",o.sound.paused)),o},this.resume=function(a){return a||(a=!1),o.sound&&(o.config.togglePause&&!a?o.sound.togglePause():o.sound.resume(),o.trigger("tdplayer.pause",o.sound.paused)),o},this.stop=function(){return o.sound&&o.sound.stop(),o.trigger("tdplayer.stop"),o.log("stop"),o},this.next=function(a){return o.log("next"),o.playWhenReady="undefined"==typeof a?o.config.autoswitch:a,o.log(o.playWhenReady),o.config.loopTrack?(o.trigger("tdplayer.playlist.trackLooped"),o.changeTrack()):o.tracks[o.currentTrackIndex+1]?(o.currentTrackIndex+=1,o.changeTrack(),o.trigger("tdplayer.playlist.next",o.currentTrackIndex-1,o.currentTrackIndex),o.log("has next")):o.config.loop?(o.currentTrackIndex=0,o.changeTrack(),o.trigger("tdplayer.playlist.looped"),o.log("looped")):(o.currentTrackIndex=o.tracks.length-1,o.trigger("tdplayer.playlist.ended",o.config.onPlaylistFinished),o.log("no mas")),o},this.prev=function(a){return o.playWhenReady="undefined"==typeof a?o.config.autoswitch:a,o.tracks[o.currentTrackIndex-1]?(o.currentTrackIndex-=1,o.changeTrack(),o.trigger("tdplayer.playlist.prev")):o.config.loop?(o.currentTrackIndex=o.tracks.length-1,o.changeTrack(),o.trigger("tdplayer.playlist.looped")):(o.currentTrackIndex=0,o.trigger("tdplayer.playlist.restarted")),o},this.goto=function(a,b){return o.log("goto"),o.playWhenReady="undefined"==typeof b?o.config.autoswitch:b,o.tracks[a]&&(o.currentTrackIndex=a,o.trigger("tdplayer.playlist.goto"),o.changeTrack()),o},this.restartTrack=function(){return o.position(0),o},this.mute=function(){return o.sound&&o.sound.toggleMute(),o.trigger("tdplayer.mute",o.sound.muted),o},this.hasNext=function(){return o.log("has next"),o.tracks[o.currentTrackIndex+1]?!0:o.config.loop&&o.tracks.length>1?!0:!1},this.hasPrev=function(){return o.tracks[o.currentTrackIndex-1]?!0:o.config.loop&&o.tracks.length>1?!0:!1},this.getTime=function(){var a=this.position(),b=Math.floor(a/1e3%60),c=Math.floor(a/6e4%60),d=Math.floor(a/36e5%24),e=c+":"+o.pad(b);return d>0&&(e=d+":"+e),e},this.position=function(a){return o.sound?a||0===a?(a=Math.min(o.sound.duration,a),a=Math.max(0,a),o.trigger("tdplayer.position",a),o.sound.setPosition(a)):(o.trigger("tdplayer.position",o.sound.position),o.sound.position):0},this.volume=function(a){return o.sound?a||0===a?(a=Math.min(100,a),a=Math.max(0,a),o.trigger("tdplayer.volume",a),o.config.volume=a,o.sound.setVolume(a)):(o.trigger("tdplayer.volume",o.sound.volume),o.sound.volume):o.config.volume},this.seek=function(a){var b=o.currentTrack.duration*a;return o.position(b),o},this.loop=function(a){return a&&(o.config.loop=a,o.trigger("tdplayer.loop_changed",o.config.loop)),o.config.loop},this.trackInfo=function(a,b){return o.isNumeric(a)&&(a=o.tracks[a]),o.resolveTrack(a,b)},this.on=function(a,b){return p.on(a,b)},this.trigger=function(a){var b=arguments.length>1?__slice.call(arguments,1):[];return p.trigger(a,b)},this.destroy=function(){o.sound&&o.sound.destruct(),o.tracks=[],p.off(),p.remove(),o.tracks=[],o.track=null},o.getTrack=function(){return o.currentTrack},o.getTracks=function(a){var b=o.getPlaylist();e.map(b,function(a,b){o.trackInfo(a,function(a){return b(null,a)})},function(b,c){return a(b?[]:c)})},o.getTrackIndex=function(){return o.currentTrackIndex},o.getSound=function(){return o.sound},o.getPlaylist=function(){return o.tracks},o.setCache=function(a,b){o.config.cache===!0&&(o.cache[o.config.cachePrefix+a]=b)},o.getCache=function(a){return o.config.cache===!0?o.cache[o.config.cachePrefix+a]||null:null},o.setSound=function(b){var c,d=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(d===!0&&(c=!0),o.currentTrack=b,o.log("setSound"),o.trigger("tdplayer.track.info_loaded",b),b&&b.streamable){var e=b.stream_url;e+=-1===e.indexOf("secret_token")?"?":"&",e+="consumer_key="+o.config.consumerKey,e=e+"&ts="+Math.round((new Date).getTime()/1e3),o.sound=a.createSound({flashVersion:9,autoLoad:!0,useHighPerformance:!1,id:"track_"+b.id+o.config.cachePrefix,multiShot:!1,loops:1,url:e,volume:o.config.volume,waitForWindowLoad:!0,wmode:"transparent",useEQData:!0,useWaveformData:!1,preferFlash:c,whileloading:function(){var a=Math.round(this.bytesLoaded/this.bytesTotal*100);o.trigger("tdplayer.track.whileloading",a)},whileplaying:function(){if(h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],1==o.config.visualizer&&this.eqData)for(var a=0;256>a;a++)h[a/n>>0]+=this.eqData.left[a];var c=h.slice().reverse(),d=c.concat(h),e=Math.round(this.position/b.duration*100*10)/10;o.trigger("tdplayer.track.whileplaying",e,d)},onplay:function(){o.log("track.onplay"),o.trigger("tdplayer.track.played")},onresume:function(){o.trigger("tdplayer.track.resumed")},onstop:function(){o.trigger("tdplayer.track.stopped")},onpause:function(){o.trigger("tdplayer.track.paused")},onfinish:function(){o.config.onTrackFinished&&o.config.onTrackFinished(arguments),o.trigger("tdplayer.track.finished")},onload:function(){o.log("onload"),o.trigger("tdplayer.track.ready",o.config.onTrackReady)}}),o.trigger("tdplayer.track.bindable",b,o.sound)}},o.resolveTrack=function(a,c){var d=a;if(a){a=a.replace(/https?\:\/\/(www\.)?soundcloud\.com/gi,"");var e,f=new b.Deferred,h=o.getCache(a);if(a.match(l)&&-1===a.search(/soundcloud\.com/i)&&(e={stream_url:a,id:0,permalink_url:a,duration:0},f.resolve(e)),o.config.cache===!0&&h)c&&f.done(function(){c(h)}).resolve();else{f.done(function(a){return c?c(a):void 0});var i,k,m;g?(m="jsonp",i="jsonp",k=j+a+"&format=json&consumer_key="+o.config.consumerKey+"&callback=?"):(m="ajax",i="json",k=j+a+"&format=json&consumer_key="+o.config.consumerKey),b[m]({type:"GET",datatype:i,url:k,crossDomain:!0,error:function(){var b={error:!0,errorMessage:"We couldn't load that track :("};o.config.cache&&o.setCache(a,b),f.resolve(b)},success:function(b){"user"===b.kind?o.getTracksForUser(b,o.config.tracksPerArtist,function(a){o.parseTracks(d,a,function(a){b=a[0],f.resolve(b)})}):b.tracks&&b.tracks.length>0?o.parseTracks(d,b.tracks,function(a){b=a[0],f.resolve(b)}):o.processTrack(b,function(b){o.config.cache&&o.setCache(a,b),f.resolve(b)})}})}return f}},o.getTracksForUser=function(a,c,d){var e=k+"users/"+a.id+"/tracks.json?consumer_key="+o.config.consumerKey;b.ajax({url:e,error:function(){return d([])},success:function(a){return a=a.slice(0,Math.min(c,a.length)),d(a)}})},o.getComments=function(a,c){var d=/secret_token=([\w-]+)/g,e=d.exec(a.stream_url),f=k+"tracks/"+a.id+"/comments.json?consumer_key="+o.config.consumerKey;e&&(f+="&secret_token="+e[1]),b.ajax({url:f,error:function(){return c([])},success:c})},o.preloadSCTracks=function(a){var b=JSON.parse(JSON.stringify(o.tracks));e.each(b,function(a,b){o.resolveTrack(a,function(){b()})},function(b){return b&&o.log("Failed to preload tracks."),o.trigger("tdplayer.playlist.preloaded"),"function"==typeof a?a():void 0})},o.processTrack=function(a,b){if(a.artwork_url){a.artwork_url=a.artwork_url.replace("large.jpg","t500x500.jpg");var c=Math.round(3*Math.random())+1;-1!==a.artwork_url.indexOf("i1.sndcdn")&&(a.artwork_url=a.artwork_url.replace("i1.sndcdn","i"+c+".sndcdn"))}return a.download_url&&(a.download_url+="private"===a.sharing?"&client_id=6f85bdf51b0a19b7ab2df7b969233901":"?client_id=6f85bdf51b0a19b7ab2df7b969233901"),b(a)},o.parseTracks=function(a,b,c){var d=o.tracks.indexOf(a);return b&&0!==b.length?void e.map(b,function(a,b){o.processTrack(a,function(a){var c=a.permalink_url.substring(21);return o.config.cache===!0&&o.setCache(c,a),b(null,a)})},function(a,b){return a?(console.error("Error processing tracks."),console.error(a),c([])):(o.tracks=o.tracks.slice(0,d).concat(b.map(function(a){return a.permalink_url.substring(21)})).concat(o.tracks.slice(d+1)),c(b))}):c([])},o.addTracks=function(a){"string"==typeof a&&(a=[a]),null!=a&&a.length>0&&(o.tracks=o.tracks.concat(a),1==o.config.preload?o.preloadSCTracks.call(o,o.init):o.init.call(o))},o.removeTracks=function(a,b){return o.getTrackIndex()>=a&&o.getTrackIndex()<=a+b&&o.changeTrack(o.tracks.length>a+b?a+b:a>0?a-1:0),o.tracks.splice(a,b)},o.setTracks=function(a){"string"==typeof a&&(a=[a]),null!=a&&a.length>0&&(o.tracks=a,1==o.config.preload?o.preloadSCTracks.call(o,o.init):o.init.call(o))},o.log=function(){o.config.debug&&window.console&&console.log.apply(console,arguments)},o.isNumeric=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},o.pad=function(a){return 10>a?"0"+a:""+a},o.on("tdplayer.track.ready",function(a,b){o.log("track.onready!!!"),1==o.playWhenReady&&(o.playWhenReady=!1,o.play()),"function"==typeof b&&b()}),o.on("tdplayer.track.finished",function(a,b){o.log("track finished"),o.config.autoswitch&&(o.config.loop||o.hasNext())&&(o.log("finished and autoswitch"),o.next().play()),"function"==typeof b&&b()}),o.on("tdplayer.playlist.ended",function(a,b){o.log("playlist ended"),o.config.loop||o.stop(),"function"==typeof b&&b()}),a.onready(function(){o.log("SOUNDMANAGER2 ready!!"),o.addTracks(c)}),a.ontimeout(function(){o.log("SOUNDMANAGER2 TIMEDOUT!!")}),{config:this.config,play:this.play,pause:this.pause,resume:this.resume,stop:this.stop,next:this.next,prev:this.prev,mute:this.mute,getTime:this.getTime,volume:this.volume,restartTrack:this.restartTrack,"goto":this.goto,position:this.position,seek:this.seek,trackInfo:this.trackInfo,hasNext:this.hasNext,hasPrev:this.hasPrev,on:this.on,addTracks:this.addTracks,removeTracks:this.removeTracks,setTracks:this.setTracks,trigger:this.trigger,track:this.getTrack,tracks:this.getTracks,trackIndex:this.getTrackIndex,sound:this.getSound,playlist:this.getPlaylist,destroy:this.destroy}};return h});var Handlebars=function(){var a=function(){function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){function b(a){return h[a]||"&"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=""+a,j.test(a)?a.replace(i,b):a):""}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=/[&<>"'`]/g,j=/[&<>"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return"function"==typeof a};l(/x/)&&(l=function(a){return"function"==typeof a&&"[object Function]"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g="";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper("if",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i="1.3.0";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o="[object Object]";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h("Arg not supported with multiple helpers");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e),g=function(a){function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d,f){var g,h;3===arguments.length?(f=d,d=null):2===arguments.length&&(f=c,c=null),b.call(this,f),this.type="program",this.statements=a,this.strip={},d?(h=d[0],h?(g={first_line:h.firstLine,last_line:h.lastLine,last_column:h.lastColumn,first_column:h.firstColumn},this.inverse=new e.ProgramNode(d,c,g)):this.inverse=new e.ProgramNode(d,c),this.strip.right=c.left):c&&(this.strip.left=c.right)},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1),g=this.eligibleHelper=e.isSimple;this.isHelper=g&&(f.length||c)},PartialNode:function(a,c,d,e){b.call(this,e),this.type="partial",this.partialName=a,this.context=c,this.strip=d},BlockNode:function(a,c,e,f,g){if(b.call(this,g),a.sexpr.id.original!==f.path.original)throw new d(a.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=a,this.program=c,this.inverse=e,this.strip={left:a.strip.left,right:f.strip.right},(c||e).strip.left=a.strip.right,(e||c).strip.right=f.strip.left,e&&!c&&(this.isInverse=!0)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h=0,i=a.length;i>h;h++){var j=a[h].part;if(e+=(a[h].separator||"")+j,".."===j||"."===j||"this"===j){if(f.length>0)throw new d("Invalid path: "+e,this);".."===j?g++:this.isScoped=!0}else f.push(j)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},IntegerNode:function(a,c){b.call(this,c),this.type="INTEGER",this.original=this.integer=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a}};return c=e}(c),h=function(){var a,b=function(){function a(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(0)||"~"===b.charAt(1)}}function b(){this.yy={}}var c={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(b,c,d,e,f,g){var h=g.length-1;switch(f){case 1:return new e.ProgramNode(g[h-1],this._$);case 2:return new e.ProgramNode([],this._$);case 3:this.$=new e.ProgramNode([],g[h-1],g[h],this._$);break;case 4:this.$=new e.ProgramNode(g[h-2],g[h-1],g[h],this._$);break;case 5:this.$=new e.ProgramNode(g[h-1],g[h],[],this._$);break;case 6:this.$=new e.ProgramNode(g[h],this._$);break;case 7:this.$=new e.ProgramNode([],this._$);break;case 8:this.$=new e.ProgramNode([],this._$);break;case 9:this.$=[g[h]];break;case 10:g[h-1].push(g[h]),this.$=g[h-1];break;case 11:this.$=new e.BlockNode(g[h-2],g[h-1].inverse,g[h-1],g[h],this._$);break;case 12:this.$=new e.BlockNode(g[h-2],g[h-1],g[h-1].inverse,g[h],this._$);break;case 13:this.$=g[h];break;case 14:this.$=g[h];break;case 15:this.$=new e.ContentNode(g[h],this._$);break;case 16:this.$=new e.CommentNode(g[h],this._$);break;case 17:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 18:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 19:this.$={path:g[h-1],strip:a(g[h-2],g[h])};break;case 20:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 21:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 22:this.$=new e.PartialNode(g[h-2],g[h-1],a(g[h-3],g[h]),this._$);break;case 23:this.$=a(g[h-1],g[h]);break;case 24:this.$=new e.SexprNode([g[h-2]].concat(g[h-1]),g[h],this._$);break;case 25:this.$=new e.SexprNode([g[h]],null,this._$);break;case 26:this.$=g[h];break;case 27:this.$=new e.StringNode(g[h],this._$);break;case 28:this.$=new e.IntegerNode(g[h],this._$);break;case 29:this.$=new e.BooleanNode(g[h],this._$);break;case 30:this.$=g[h];break;case 31:g[h-1].isHelper=!0,this.$=g[h-1];break;case 32:this.$=new e.HashNode(g[h],this._$);break;case 33:this.$=[g[h-2],g[h]];break;case 34:this.$=new e.PartialNameNode(g[h],this._$);break;case 35:this.$=new e.PartialNameNode(new e.StringNode(g[h],this._$),this._$);break;case 36:this.$=new e.PartialNameNode(new e.IntegerNode(g[h],this._$));break;case 37:this.$=new e.DataNode(g[h],this._$);break;case 38:this.$=new e.IdNode(g[h],this._$);break;case 39:g[h-2].push({part:g[h],separator:g[h-1]}),this.$=g[h-2];break;case 40:this.$=[{part:g[h]}];break;case 43:this.$=[];break;case 44:g[h-1].push(g[h]);break;case 47:this.$=[g[h]];break;case 48:g[h-1].push(g[h])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(a){throw new Error(a) },parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},d=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return e(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState(),this.begin("com");break;case 14:return e(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 20:break;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return b.yytext=e(1,2).replace(/\\"/g,'"'),32;case 24:return b.yytext=e(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return b.yytext=e(1,2),40;case 31:return"INVALID";case 32:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},a}();return c.lexer=d,b.prototype=c,c.Parser=b,new b}();return a=b}(),i=function(a,b){function c(a){return a.constructor===f.ProgramNode?a:(e.yy=f,e.parse(a))}var d={},e=a,f=b;return d.parser=e,d.parse=c,d}(h,g),j=function(a){function b(){}function c(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function d(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var e;return function(a,b){return e||(e=d()),e.call(this,a,b)}}var e={},f=a;return e.Compiler=b,b.prototype={compiler:b,disassemble:function(){for(var a,b,c,d=this.opcodes,e=[],f=0,g=d.length;g>f;f++)if(a=d[f],"DECLARE"===a.opcode)e.push("DECLARE "+a.name+"="+a.value);else{b=[];for(var h=0;hc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||d.args.length!==e.args.length)return!1;for(var f=0;fc;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){var b,c=a.strip||{};return c.left&&this.opcode("strip"),b=this[a.type](a),c.right&&this.opcode("strip"),b},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;this.opcode("pushHash");for(var e=0,f=d.length;f>e;e++)b=d[e],c=b[1],this.options.stringParams?(c.depth&&this.addDepth(c.depth),this.opcode("getContext",c.depth||0),this.opcode("pushStringParam",c.stringModeValue,c.type),"sexpr"===c.type&&this.sexpr(c)):this.accept(c),this.opcode("assignToHash",b[0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.context?this.ID(a.context):this.opcode("push","depth0"),this.opcode("invokePartial",b.name),this.opcode("append")},content:function(a){this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),this.opcode(a.escaped&&!this.options.noEscape?"appendEscaped":"append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id.parts[0];if(this.options.knownHelpers[e])this.opcode("invokeKnownHelper",d.length,e);else{if(this.options.knownHelpersOnly)throw new f("You specified knownHelpersOnly, but used the unknown helper "+e,a);this.opcode("invokeHelper",d.length,e,a.isRoot)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts[0]):this.opcode("pushContext");for(var c=1,d=a.parts.length;d>c;c++)this.opcode("lookup",a.parts[c])},DATA:function(a){if(this.options.data=!0,a.id.isScoped||a.id.depth)throw new f("Scoped data references are not supported: "+a.original,a);this.opcode("lookupData");for(var b=a.id.parts,c=0,d=b.length;d>c;c++)this.opcode("lookup",b[c])},STRING:function(a){this.opcode("pushString",a.string)},INTEGER:function(a){this.opcode("pushLiteral",a.integer)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:[].slice.call(arguments,1)})},declare:function(a,b){this.opcodes.push({opcode:"DECLARE",name:a,value:b})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b,c=a.length;c--;)b=a[c],this.options.stringParams?(b.depth&&this.addDepth(b.depth),this.opcode("getContext",b.depth||0),this.opcode("pushStringParam",b.stringModeValue,b.type),"sexpr"===b.type&&this.sexpr(b)):this[b.type](b)},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},e.precompile=c,e.compile=d,e}(c),k=function(a,b){function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=a.log,i=b;d.prototype={nameLookup:function(a,b){var c,e;return 0===a.indexOf("depth")&&(c=!0),e=/^[0-9]+$/.test(b)?a+"["+b+"]":d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']",c?"("+a+" && "+e+")":e},compilerInfo:function(){var a=f,b=g[a];return"this.compilerInfo = ["+a+",'"+b+"'];\n"},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b||{},h("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b);var e,f=a.opcodes;this.i=0;for(var g=f.length;this.ie;e++)d.push("depth"+this.environment.depths.list[e]);var g=this.mergeSource();if(this.isChild||(g=this.compilerInfo()+g),a)return d.push(g),Function.apply(this,d);var i="function "+(this.name||"")+"("+d.join(",")+") {\n "+g+"}";return h("debug",i+"\n\n"),i},mergeSource:function(){for(var a,b="",c=0,d=this.source.length;d>c;c++){var e=this.source[c];e.appendToBuffer?a=a?a+"\n + "+e.content:e.content:(a&&(b+="buffer += "+a+";\n ",a=void 0),b+=e+"\n ")}return b},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a),this.replaceStack(function(b){return a.splice(1,0,b),"blockHelperMissing.call("+a.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a);var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.stripNext&&(a=a.replace(/^\s+/,"")),this.pendingContent=a},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,"")),this.stripNext="strip"},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if("+a+" || "+a+" === 0) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext!==a&&(this.lastContext=a)},lookupOnContext:function(a){this.push(this.nameLookup("depth"+this.lastContext,a,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(a){return"typeof "+a+" === functionType ? "+a+".apply(depth0) : "+a})},lookup:function(a){this.replaceStack(function(b){return b+" == null || "+b+" === false ? "+b+" : "+this.nameLookup(b,a,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(a,b){this.pushStackLiteral("depth"+this.lastContext),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.options.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){this.pushStackLiteral(null!=a?this.programExpression(a):null)},invokeHelper:function(a,b,c){this.context.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var d=this.lastHelper=this.setupHelper(a,b,!0),e=this.nameLookup("depth"+this.lastContext,b,"context"),f="helper = "+d.name+" || "+e;d.paramsInit&&(f+=","+d.paramsInit),this.push("("+f+",helper ? helper.call("+d.callParams+") : helperMissing.call("+d.helperMissingParams+"))"),c||this.flushInline()},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.context.aliases.functionType='"function"',this.useRegister("helper"),this.emptyHash();var c=this.setupHelper(0,a,b),d=this.lastHelper=this.nameLookup("helpers",a,"helper"),e=this.nameLookup("depth"+this.lastContext,a,"context"),f=this.nextStack();c.paramsInit&&this.pushSource(c.paramsInit),this.pushSource("if (helper = "+d+") { "+f+" = helper.call("+c.callParams+"); }"),this.pushSource("else { helper = "+e+"; "+f+" = typeof helper === functionType ? helper.call("+c.callParams+") : helper; }")},invokePartial:function(a){var b=[this.nameLookup("partials",a,"partial"),"'"+a+"'",this.popStack(),"helpers","partials"];this.options.data&&b.push("data"),this.context.aliases.self="this",this.push("self.invokePartial("+b.join(", ")+")")},assignToHash:function(a){var b,c,d=this.popStack();this.options.stringParams&&(c=this.popStack(),b=this.popStack());var e=this.hash;b&&e.contexts.push("'"+a+"': "+b),c&&e.types.push("'"+a+"': "+c),e.values.push("'"+a+"': ("+d+")")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context),this.context.environments[h]=c):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){if(this.context.aliases.self="this",null==a)return"self.noop";for(var b,c=this.environment.children[a],d=c.depths.list,e=[c.index,c.name,"data"],f=0,g=d.length;g>f;f++)b=d[f],e.push(1===b?"depth0":"depth"+(b-1));return(0===d.length?"self.program(":"self.programWithDepth(")+e.join(", ")+")"},register:function(a,b){this.useRegister(a),this.pushSource(a+" = "+b+";")},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return a&&this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){var b,d,e,f="",g=this.isInline();if(g){var h=this.popStack(!0);if(h instanceof c)b=h.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+h+"),",b=this.topStack()}}else b=this.topStack();var j=a.call(this,b);return g?(e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")):(/^stack/.test(b)||(b=this.nextStack()),this.pushSource(b+" = ("+f+j+");")),b},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new i("Invalid stack pop");this.stackSlot--}return d},topStack:function(a){var b=this.isInline()?this.inlineStack:this.compileStack,d=b[b.length-1];return!a&&d instanceof c?d.value:d},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(a,b,c){var d=[],e=this.setupParams(a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:["depth0"].concat(d).join(", "),helperMissingParams:c&&["depth0",this.quotedString(b)].concat(d).join(", ")}},setupOptions:function(a,b){var c,d,e,f=[],g=[],h=[];f.push("hash:"+this.popStack()),this.options.stringParams&&(f.push("hashTypes:"+this.popStack()),f.push("hashContexts:"+this.popStack())),d=this.popStack(),e=this.popStack(),(e||d)&&(e||(this.context.aliases.self="this",e="self.noop"),d||(this.context.aliases.self="this",d="self.noop"),f.push("inverse:"+d),f.push("fn:"+e));for(var i=0;a>i;i++)c=this.popStack(),b.push(c),this.options.stringParams&&(h.push(this.popStack()),g.push(this.popStack()));return this.options.stringParams&&(f.push("contexts:["+g.join(",")+"]"),f.push("types:["+h.join(",")+"]")),this.options.data&&f.push("data:data"),f},setupParams:function(a,b,c){var d="{"+this.setupOptions(a,b).join(",")+"}";return c?(this.useRegister("options"),b.push("options"),"options="+d):(b.push(d),"")}};for(var j="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),k=d.RESERVED_WORDS={},l=0,m=j.length;m>l;l++)k[j[l]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)?!0:!1},e=d}(d,c),l=function(a,b,c,d,e){var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,f=g}(f,g,i,j,k);return l}();ToneDen.define("vendor/handlebars",function(){}),ToneDen.define("hbs/handlebars",[],function(){var a=function(){var a=function(){function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){function b(a){return h[a]||"&"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=""+a,j.test(a)?a.replace(i,b):a):""}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=/[&<>"'`]/g,j=/[&<>"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return"function"==typeof a};l(/x/)&&(l=function(a){return"function"==typeof a&&"[object Function]"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g="";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper("if",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i="1.3.0";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o="[object Object]";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h("Arg not supported with multiple helpers");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e),g=function(a){function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d,f){var g,h;3===arguments.length?(f=d,d=null):2===arguments.length&&(f=c,c=null),b.call(this,f),this.type="program",this.statements=a,this.strip={},d?(h=d[0],h?(g={first_line:h.firstLine,last_line:h.lastLine,last_column:h.lastColumn,first_column:h.firstColumn},this.inverse=new e.ProgramNode(d,c,g)):this.inverse=new e.ProgramNode(d,c),this.strip.right=c.left):c&&(this.strip.left=c.right) },MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1),g=this.eligibleHelper=e.isSimple;this.isHelper=g&&(f.length||c)},PartialNode:function(a,c,d,e){b.call(this,e),this.type="partial",this.partialName=a,this.context=c,this.strip=d},BlockNode:function(a,c,e,f,g){if(b.call(this,g),a.sexpr.id.original!==f.path.original)throw new d(a.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=a,this.program=c,this.inverse=e,this.strip={left:a.strip.left,right:f.strip.right},(c||e).strip.left=a.strip.right,(e||c).strip.right=f.strip.left,e&&!c&&(this.isInverse=!0)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h=0,i=a.length;i>h;h++){var j=a[h].part;if(e+=(a[h].separator||"")+j,".."===j||"."===j||"this"===j){if(f.length>0)throw new d("Invalid path: "+e,this);".."===j?g++:this.isScoped=!0}else f.push(j)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},IntegerNode:function(a,c){b.call(this,c),this.type="INTEGER",this.original=this.integer=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a}};return c=e}(c),h=function(){var a,b=function(){function a(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(0)||"~"===b.charAt(1)}}function b(){this.yy={}}var c={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(b,c,d,e,f,g){var h=g.length-1;switch(f){case 1:return new e.ProgramNode(g[h-1],this._$);case 2:return new e.ProgramNode([],this._$);case 3:this.$=new e.ProgramNode([],g[h-1],g[h],this._$);break;case 4:this.$=new e.ProgramNode(g[h-2],g[h-1],g[h],this._$);break;case 5:this.$=new e.ProgramNode(g[h-1],g[h],[],this._$);break;case 6:this.$=new e.ProgramNode(g[h],this._$);break;case 7:this.$=new e.ProgramNode([],this._$);break;case 8:this.$=new e.ProgramNode([],this._$);break;case 9:this.$=[g[h]];break;case 10:g[h-1].push(g[h]),this.$=g[h-1];break;case 11:this.$=new e.BlockNode(g[h-2],g[h-1].inverse,g[h-1],g[h],this._$);break;case 12:this.$=new e.BlockNode(g[h-2],g[h-1],g[h-1].inverse,g[h],this._$);break;case 13:this.$=g[h];break;case 14:this.$=g[h];break;case 15:this.$=new e.ContentNode(g[h],this._$);break;case 16:this.$=new e.CommentNode(g[h],this._$);break;case 17:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 18:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 19:this.$={path:g[h-1],strip:a(g[h-2],g[h])};break;case 20:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 21:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 22:this.$=new e.PartialNode(g[h-2],g[h-1],a(g[h-3],g[h]),this._$);break;case 23:this.$=a(g[h-1],g[h]);break;case 24:this.$=new e.SexprNode([g[h-2]].concat(g[h-1]),g[h],this._$);break;case 25:this.$=new e.SexprNode([g[h]],null,this._$);break;case 26:this.$=g[h];break;case 27:this.$=new e.StringNode(g[h],this._$);break;case 28:this.$=new e.IntegerNode(g[h],this._$);break;case 29:this.$=new e.BooleanNode(g[h],this._$);break;case 30:this.$=g[h];break;case 31:g[h-1].isHelper=!0,this.$=g[h-1];break;case 32:this.$=new e.HashNode(g[h],this._$);break;case 33:this.$=[g[h-2],g[h]];break;case 34:this.$=new e.PartialNameNode(g[h],this._$);break;case 35:this.$=new e.PartialNameNode(new e.StringNode(g[h],this._$),this._$);break;case 36:this.$=new e.PartialNameNode(new e.IntegerNode(g[h],this._$));break;case 37:this.$=new e.DataNode(g[h],this._$);break;case 38:this.$=new e.IdNode(g[h],this._$);break;case 39:g[h-2].push({part:g[h],separator:g[h-1]}),this.$=g[h-2];break;case 40:this.$=[{part:g[h]}];break;case 43:this.$=[];break;case 44:g[h-1].push(g[h]);break;case 47:this.$=[g[h]];break;case 48:g[h-1].push(g[h])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},d=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return e(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState(),this.begin("com");break;case 14:return e(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 20:break;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return b.yytext=e(1,2).replace(/\\"/g,'"'),32;case 24:return b.yytext=e(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return b.yytext=e(1,2),40;case 31:return"INVALID";case 32:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},a}();return c.lexer=d,b.prototype=c,c.Parser=b,new b}();return a=b}(),i=function(a,b){function c(a){return a.constructor===f.ProgramNode?a:(e.yy=f,e.parse(a))}var d={},e=a,f=b;return d.parser=e,d.parse=c,d}(h,g),j=function(a){function b(){}function c(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function d(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var e;return function(a,b){return e||(e=d()),e.call(this,a,b)}}var e={},f=a;return e.Compiler=b,b.prototype={compiler:b,disassemble:function(){for(var a,b,c,d=this.opcodes,e=[],f=0,g=d.length;g>f;f++)if(a=d[f],"DECLARE"===a.opcode)e.push("DECLARE "+a.name+"="+a.value);else{b=[];for(var h=0;hc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||d.args.length!==e.args.length)return!1;for(var f=0;fc;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){var b,c=a.strip||{};return c.left&&this.opcode("strip"),b=this[a.type](a),c.right&&this.opcode("strip"),b},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;this.opcode("pushHash");for(var e=0,f=d.length;f>e;e++)b=d[e],c=b[1],this.options.stringParams?(c.depth&&this.addDepth(c.depth),this.opcode("getContext",c.depth||0),this.opcode("pushStringParam",c.stringModeValue,c.type),"sexpr"===c.type&&this.sexpr(c)):this.accept(c),this.opcode("assignToHash",b[0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.context?this.ID(a.context):this.opcode("push","depth0"),this.opcode("invokePartial",b.name),this.opcode("append")},content:function(a){this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),this.opcode(a.escaped&&!this.options.noEscape?"appendEscaped":"append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id.parts[0];if(this.options.knownHelpers[e])this.opcode("invokeKnownHelper",d.length,e);else{if(this.options.knownHelpersOnly)throw new f("You specified knownHelpersOnly, but used the unknown helper "+e,a);this.opcode("invokeHelper",d.length,e,a.isRoot)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts[0]):this.opcode("pushContext");for(var c=1,d=a.parts.length;d>c;c++)this.opcode("lookup",a.parts[c])},DATA:function(a){if(this.options.data=!0,a.id.isScoped||a.id.depth)throw new f("Scoped data references are not supported: "+a.original,a);this.opcode("lookupData");for(var b=a.id.parts,c=0,d=b.length;d>c;c++)this.opcode("lookup",b[c])},STRING:function(a){this.opcode("pushString",a.string)},INTEGER:function(a){this.opcode("pushLiteral",a.integer)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:[].slice.call(arguments,1)})},declare:function(a,b){this.opcodes.push({opcode:"DECLARE",name:a,value:b})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b,c=a.length;c--;)b=a[c],this.options.stringParams?(b.depth&&this.addDepth(b.depth),this.opcode("getContext",b.depth||0),this.opcode("pushStringParam",b.stringModeValue,b.type),"sexpr"===b.type&&this.sexpr(b)):this[b.type](b)},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},e.precompile=c,e.compile=d,e}(c),k=function(a,b){function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=a.log,i=b;d.prototype={nameLookup:function(a,b){var c,e;return 0===a.indexOf("depth")&&(c=!0),e=/^[0-9]+$/.test(b)?a+"["+b+"]":d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']",c?"("+a+" && "+e+")":e},compilerInfo:function(){var a=f,b=g[a];return"this.compilerInfo = ["+a+",'"+b+"'];\n"},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b||{},h("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b);var e,f=a.opcodes;this.i=0;for(var g=f.length;this.ie;e++)d.push("depth"+this.environment.depths.list[e]);var g=this.mergeSource();if(this.isChild||(g=this.compilerInfo()+g),a)return d.push(g),Function.apply(this,d);var i="function "+(this.name||"")+"("+d.join(",")+") {\n "+g+"}";return h("debug",i+"\n\n"),i},mergeSource:function(){for(var a,b="",c=0,d=this.source.length;d>c;c++){var e=this.source[c];e.appendToBuffer?a=a?a+"\n + "+e.content:e.content:(a&&(b+="buffer += "+a+";\n ",a=void 0),b+=e+"\n ")}return b},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a),this.replaceStack(function(b){return a.splice(1,0,b),"blockHelperMissing.call("+a.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a);var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.stripNext&&(a=a.replace(/^\s+/,"")),this.pendingContent=a},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,"")),this.stripNext="strip"},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if("+a+" || "+a+" === 0) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext!==a&&(this.lastContext=a)},lookupOnContext:function(a){this.push(this.nameLookup("depth"+this.lastContext,a,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(a){return"typeof "+a+" === functionType ? "+a+".apply(depth0) : "+a})},lookup:function(a){this.replaceStack(function(b){return b+" == null || "+b+" === false ? "+b+" : "+this.nameLookup(b,a,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(a,b){this.pushStackLiteral("depth"+this.lastContext),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.options.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){this.pushStackLiteral(null!=a?this.programExpression(a):null)},invokeHelper:function(a,b,c){this.context.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var d=this.lastHelper=this.setupHelper(a,b,!0),e=this.nameLookup("depth"+this.lastContext,b,"context"),f="helper = "+d.name+" || "+e;d.paramsInit&&(f+=","+d.paramsInit),this.push("("+f+",helper ? helper.call("+d.callParams+") : helperMissing.call("+d.helperMissingParams+"))"),c||this.flushInline()},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.context.aliases.functionType='"function"',this.useRegister("helper"),this.emptyHash();var c=this.setupHelper(0,a,b),d=this.lastHelper=this.nameLookup("helpers",a,"helper"),e=this.nameLookup("depth"+this.lastContext,a,"context"),f=this.nextStack();c.paramsInit&&this.pushSource(c.paramsInit),this.pushSource("if (helper = "+d+") { "+f+" = helper.call("+c.callParams+"); }"),this.pushSource("else { helper = "+e+"; "+f+" = typeof helper === functionType ? helper.call("+c.callParams+") : helper; }")},invokePartial:function(a){var b=[this.nameLookup("partials",a,"partial"),"'"+a+"'",this.popStack(),"helpers","partials"];this.options.data&&b.push("data"),this.context.aliases.self="this",this.push("self.invokePartial("+b.join(", ")+")")},assignToHash:function(a){var b,c,d=this.popStack();this.options.stringParams&&(c=this.popStack(),b=this.popStack());var e=this.hash;b&&e.contexts.push("'"+a+"': "+b),c&&e.types.push("'"+a+"': "+c),e.values.push("'"+a+"': ("+d+")")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context),this.context.environments[h]=c):(c.index=h,c.name="program"+h) }},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){if(this.context.aliases.self="this",null==a)return"self.noop";for(var b,c=this.environment.children[a],d=c.depths.list,e=[c.index,c.name,"data"],f=0,g=d.length;g>f;f++)b=d[f],e.push(1===b?"depth0":"depth"+(b-1));return(0===d.length?"self.program(":"self.programWithDepth(")+e.join(", ")+")"},register:function(a,b){this.useRegister(a),this.pushSource(a+" = "+b+";")},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return a&&this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){var b,d,e,f="",g=this.isInline();if(g){var h=this.popStack(!0);if(h instanceof c)b=h.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+h+"),",b=this.topStack()}}else b=this.topStack();var j=a.call(this,b);return g?(e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")):(/^stack/.test(b)||(b=this.nextStack()),this.pushSource(b+" = ("+f+j+");")),b},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new i("Invalid stack pop");this.stackSlot--}return d},topStack:function(a){var b=this.isInline()?this.inlineStack:this.compileStack,d=b[b.length-1];return!a&&d instanceof c?d.value:d},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(a,b,c){var d=[],e=this.setupParams(a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:["depth0"].concat(d).join(", "),helperMissingParams:c&&["depth0",this.quotedString(b)].concat(d).join(", ")}},setupOptions:function(a,b){var c,d,e,f=[],g=[],h=[];f.push("hash:"+this.popStack()),this.options.stringParams&&(f.push("hashTypes:"+this.popStack()),f.push("hashContexts:"+this.popStack())),d=this.popStack(),e=this.popStack(),(e||d)&&(e||(this.context.aliases.self="this",e="self.noop"),d||(this.context.aliases.self="this",d="self.noop"),f.push("inverse:"+d),f.push("fn:"+e));for(var i=0;a>i;i++)c=this.popStack(),b.push(c),this.options.stringParams&&(h.push(this.popStack()),g.push(this.popStack()));return this.options.stringParams&&(f.push("contexts:["+g.join(",")+"]"),f.push("types:["+h.join(",")+"]")),this.options.data&&f.push("data:data"),f},setupParams:function(a,b,c){var d="{"+this.setupOptions(a,b).join(",")+"}";return c?(this.useRegister("options"),b.push("options"),"options="+d):(b.push(d),"")}};for(var j="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),k=d.RESERVED_WORDS={},l=0,m=j.length;m>l;l++)k[j[l]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)?!0:!1},e=d}(d,c),l=function(a,b,c,d,e){var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,f=g}(f,g,i,j,k);return l}();return a}),ToneDen.define("hbs/underscore",[],function(){function a(b,c,d){if(b===c)return 0!==b||1/b==1/c;if(null==b||null==c)return b===c;if(b._chain&&(b=b._wrapped),c._chain&&(c=c._wrapped),b.isEqual&&v.isFunction(b.isEqual))return b.isEqual(c);if(c.isEqual&&v.isFunction(c.isEqual))return c.isEqual(b);var e=h.call(b);if(e!=h.call(c))return!1;switch(e){case"[object String]":return b==String(c);case"[object Number]":return b!=+b?c!=+c:0==b?1/b==1/c:b==+c;case"[object Date]":case"[object Boolean]":return+b==+c;case"[object RegExp]":return b.source==c.source&&b.global==c.global&&b.multiline==c.multiline&&b.ignoreCase==c.ignoreCase}if("object"!=typeof b||"object"!=typeof c)return!1;for(var f=d.length;f--;)if(d[f]==b)return!0;d.push(b);var g=0,i=!0;if("[object Array]"==e){if(g=b.length,i=g==c.length)for(;g--&&(i=g in b==g in c&&a(b[g],c[g],d)););}else{if("constructor"in b!="constructor"in c||b.constructor!=c.constructor)return!1;for(var j in b)if(v.has(b,j)&&(g++,!(i=v.has(c,j)&&a(b[j],c[j],d))))break;if(i){for(j in c)if(v.has(c,j)&&!g--)break;i=!g}}return d.pop(),i}var b={},c=Array.prototype,d=Object.prototype,e=Function.prototype,f=c.slice,g=c.unshift,h=d.toString,i=d.hasOwnProperty,j=c.forEach,k=c.map,l=c.reduce,m=c.reduceRight,n=c.filter,o=c.every,p=c.some,q=c.indexOf,r=c.lastIndexOf,s=Array.isArray,t=Object.keys,u=e.bind,v=function(a){return new G(a)};v.VERSION="1.3.3";var w=v.each=v.forEach=function(a,c,d){if(null!=a)if(j&&a.forEach===j)a.forEach(c,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(e in a&&c.call(d,a[e],e,a)===b)return}else for(var g in a)if(v.has(a,g)&&c.call(d,a[g],g,a)===b)return};v.map=v.collect=function(a,b,c){var d=[];return null==a?d:k&&a.map===k?a.map(b,c):(w(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),a.length===+a.length&&(d.length=a.length),d)},v.reduce=v.foldl=v.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),l&&a.reduce===l)return d&&(b=v.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(w(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError("Reduce of empty array with no initial value");return c},v.reduceRight=v.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),m&&a.reduceRight===m)return d&&(b=v.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=v.toArray(a).reverse();return d&&!e&&(b=v.bind(b,d)),e?v.reduce(f,b,c,d):v.reduce(f,b)},v.find=v.detect=function(a,b,c){var d;return x(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},v.filter=v.select=function(a,b,c){var d=[];return null==a?d:n&&a.filter===n?a.filter(b,c):(w(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},v.reject=function(a,b,c){var d=[];return null==a?d:(w(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)}),d)},v.every=v.all=function(a,c,d){var e=!0;return null==a?e:o&&a.every===o?a.every(c,d):(w(a,function(a,f,g){return(e=e&&c.call(d,a,f,g))?void 0:b}),!!e)};var x=v.some=v.any=function(a,c,d){c||(c=v.identity);var e=!1;return null==a?e:p&&a.some===p?a.some(c,d):(w(a,function(a,f,g){return e||(e=c.call(d,a,f,g))?b:void 0}),!!e)};v.include=v.contains=function(a,b){var c=!1;return null==a?c:q&&a.indexOf===q?-1!=a.indexOf(b):c=x(a,function(a){return a===b})},v.invoke=function(a,b){var c=f.call(arguments,2);return v.map(a,function(a){return(v.isFunction(b)?b||a:a[b]).apply(a,c)})},v.pluck=function(a,b){return v.map(a,function(a){return a[b]})},v.max=function(a,b,c){if(!b&&v.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&v.isEmpty(a))return-1/0;var d={computed:-1/0};return w(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},v.min=function(a,b,c){if(!b&&v.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&v.isEmpty(a))return 1/0;var d={computed:1/0};return w(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gc?-1:c>d?1:0}),"value")},v.groupBy=function(a,b){var c={},d=v.isFunction(b)?b:function(a){return a[b]};return w(a,function(a,b){var e=d(a,b);(c[e]||(c[e]=[])).push(a)}),c},v.sortedIndex=function(a,b,c){c||(c=v.identity);for(var d=0,e=a.length;e>d;){var f=d+e>>1;c(a[f])=0})})},v.difference=function(a){var b=v.flatten(f.call(arguments,1),!0);return v.filter(a,function(a){return!v.include(b,a)})},v.zip=function(){for(var a=f.call(arguments),b=v.max(v.pluck(a,"length")),c=new Array(b),d=0;b>d;d++)c[d]=v.pluck(a,""+d);return c},v.indexOf=function(a,b,c){if(null==a)return-1;var d,e;if(c)return d=v.sortedIndex(a,b),a[d]===b?d:-1;if(q&&a.indexOf===q)return a.indexOf(b);for(d=0,e=a.length;e>d;d++)if(d in a&&a[d]===b)return d;return-1},v.lastIndexOf=function(a,b){if(null==a)return-1;if(r&&a.lastIndexOf===r)return a.lastIndexOf(b);for(var c=a.length;c--;)if(c in a&&a[c]===b)return c;return-1},v.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f};var y=function(){};v.bind=function(a,b){var c,d;if(a.bind===u&&u)return u.apply(a,f.call(arguments,1));if(!v.isFunction(a))throw new TypeError;return d=f.call(arguments,2),c=function(){if(!(this instanceof c))return a.apply(b,d.concat(f.call(arguments)));y.prototype=a.prototype;var e=new y,g=a.apply(e,d.concat(f.call(arguments)));return Object(g)===g?g:e}},v.bindAll=function(a){var b=f.call(arguments,1);return 0==b.length&&(b=v.functions(a)),w(b,function(b){a[b]=v.bind(a[b],a)}),a},v.memoize=function(a,b){var c={};return b||(b=v.identity),function(){var d=b.apply(this,arguments);return v.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},v.delay=function(a,b){var c=f.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},v.defer=function(a){return v.delay.apply(v,[a,1].concat(f.call(arguments,1)))},v.throttle=function(a,b){var c,d,e,f,g,h,i=v.debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var j=function(){e=null,g&&a.apply(c,d),i()};return e||(e=setTimeout(j,b)),f?g=!0:h=a.apply(c,d),i(),f=!0,h}},v.debounce=function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,c||a.apply(e,f)};c&&!d&&a.apply(e,f),clearTimeout(d),d=setTimeout(g,b)}},v.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments))}},v.wrap=function(a,b){return function(){var c=[a].concat(f.call(arguments,0));return b.apply(this,c)}},v.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},v.after=function(a,b){return 0>=a?b():function(){return--a<1?b.apply(this,arguments):void 0}},v.keys=t||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)v.has(a,c)&&(b[b.length]=c);return b},v.values=function(a){return v.map(a,v.identity)},v.functions=v.methods=function(a){var b=[];for(var c in a)v.isFunction(a[c])&&b.push(c);return b.sort()},v.extend=function(a){return w(f.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},v.pick=function(a){var b={};return w(v.flatten(f.call(arguments,1)),function(c){c in a&&(b[c]=a[c])}),b},v.defaults=function(a){return w(f.call(arguments,1),function(b){for(var c in b)null==a[c]&&(a[c]=b[c])}),a},v.clone=function(a){return v.isObject(a)?v.isArray(a)?a.slice():v.extend({},a):a},v.tap=function(a,b){return b(a),a},v.isEqual=function(b,c){return a(b,c,[])},v.isEmpty=function(a){if(null==a)return!0;if(v.isArray(a)||v.isString(a))return 0===a.length;for(var b in a)if(v.has(a,b))return!1;return!0},v.isElement=function(a){return!(!a||1!=a.nodeType)},v.isArray=s||function(a){return"[object Array]"==h.call(a)},v.isObject=function(a){return a===Object(a)},v.isArguments=function(a){return"[object Arguments]"==h.call(a)},v.isArguments(arguments)||(v.isArguments=function(a){return!(!a||!v.has(a,"callee"))}),v.isFunction=function(a){return"[object Function]"==h.call(a)},v.isString=function(a){return"[object String]"==h.call(a)},v.isNumber=function(a){return"[object Number]"==h.call(a)},v.isFinite=function(a){return v.isNumber(a)&&isFinite(a)},v.isNaN=function(a){return a!==a},v.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==h.call(a)},v.isDate=function(a){return"[object Date]"==h.call(a)},v.isRegExp=function(a){return"[object RegExp]"==h.call(a)},v.isNull=function(a){return null===a},v.isUndefined=function(a){return void 0===a},v.has=function(a,b){return i.call(a,b)},v.noConflict=function(){return root._=previousUnderscore,this},v.identity=function(a){return a},v.times=function(a,b,c){for(var d=0;a>d;d++)b.call(c,d)},v.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},v.result=function(a,b){if(null==a)return null;var c=a[b];return v.isFunction(c)?c.call(a):c},v.mixin=function(a){w(v.functions(a),function(b){I(b,v[b]=a[b])})};var z=0;v.uniqueId=function(a){var b=z++;return a?a+b:b},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/.^/,B={"\\":"\\","'":"'",r:"\r",n:"\n",t:" ",u2028:"\u2028",u2029:"\u2029"};for(var C in B)B[B[C]]=C;var D=/\\|'|\r|\n|\t|\u2028|\u2029/g,E=/\\(\\|'|r|n|t|u2028|u2029)/g,F=function(a){return a.replace(E,function(a,b){return B[b]})};v.template=function(a,b,c){c=v.defaults(c||{},v.templateSettings);var d="__p+='"+a.replace(D,function(a){return"\\"+B[a]}).replace(c.escape||A,function(a,b){return"'+\n_.escape("+F(b)+")+\n'"}).replace(c.interpolate||A,function(a,b){return"'+\n("+F(b)+")+\n'"}).replace(c.evaluate||A,function(a,b){return"';\n"+F(b)+"\n;__p+='"})+"';\n";c.variable||(d="with(obj||{}){\n"+d+"}\n"),d="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+d+"return __p;\n";var e=new Function(c.variable||"obj","_",d);if(b)return e(b,v);var f=function(a){return e.call(this,a,v)};return f.source="function("+(c.variable||"obj")+"){\n"+d+"}",f},v.chain=function(a){return v(a).chain()};var G=function(a){this._wrapped=a};v.prototype=G.prototype;var H=function(a,b){return b?v(a).chain():a},I=function(a,b){G.prototype[a]=function(){var a=f.call(arguments);return g.call(a,this._wrapped),H(b.apply(v,a),this._chain)}};return v.mixin(v),w(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=c[a];G.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);var d=c.length;return"shift"!=a&&"splice"!=a||0!==d||delete c[0],H(c,this._chain)}}),w(["concat","join","slice"],function(a){var b=c[a];G.prototype[a]=function(){return H(b.apply(this._wrapped,arguments),this._chain)}}),G.prototype.chain=function(){return this._chain=!0,this},G.prototype.value=function(){return this._wrapped},v}),ToneDen.define("hbs/i18nprecompile",["hbs/handlebars","hbs/underscore"],function(a,b){function c(d,e,f){return f=f||{},e=e||{},d&&"program"===d.type&&d.statements&&(b(d.statements).forEach(function(b,g){var h="";if("mustache"===b.type&&b.id&&"$"===b.id.original){if(b.params.length&&b.params[0].string){var i=b.params[0].string;h=e[i]||(f.originalKeyFallback?i:h)}d.statements[g]=new a.AST.ContentNode(h)}else b.program&&(b.program=c(b.program,e,f))}),d.inverse&&c(d.inverse,e,f)),d}return function(b,d,e){e=e||{};var f,g;return f=a.parse(b),d!==!1&&(f=c(f,d,e)),g=(new a.Compiler).compile(f,e),(new a.JavaScriptCompiler).compile(g,e)}}),function(window){var JSON=window.JSON||{};!function(){function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[\n"+gap+g.join(",\n"+gap)+"\n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{\n"+gap+g.join(",\n"+gap)+"\n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),ToneDen.define("hbs/json2",[],function(){return JSON})}.call(this,this),ToneDen.define("hbs",["hbs/handlebars","hbs/underscore","hbs/i18nprecompile","hbs/json2"],function(a,b,c,d){var e,f,g=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],h=function(){throw new Error("Environment unsupported.")},i=[],j="w+",k="hbs",l="@hbs",m="/styles/",n="/demo-build/styles/",o="templates/helpers/",p="templates/i18n/",q="screen.build.css";a.registerHelper("$",function(){}),"undefined"!=typeof window&&window.navigator&&window.document&&!window.navigator.userAgent.match(/Node.js/)?(f=function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return arguments[0]===!0?new XDomainRequest:new XMLHttpRequest;for(b=0;3>b;b++){c=g[b];try{a=new ActiveXObject(c)}catch(d){}if(a){g=[c];break}}if(!a)throw new Error("getXhr(): XMLHttpRequest not available");return a},h=function(a,b){var c=!1;if(0!=a.indexOf("http"))c=!1;else{var d="https"===a.substr(0,5)?8:7,e="https"===window.location.href.substr(0,5)?8:7,g=a.substr(d).split("/").shift(),h=getIEVersion();c=g!=window.location.href.substr(e).split("/").shift()&&h>=7}if(c){var i=f(!0);i.open("GET",a),i.onload=function(){b(i.responseText)},i.onprogress=function(){},i.ontimeout=function(){},i.onerror=function(){},setTimeout(function(){i.send()},0)}else{var j=f();j.open("GET",a,!0),j.onreadystatechange=function(){4===j.readyState&&b(j.responseText)},j.send(null)}}):"undefined"!=typeof process&&process.versions&&process.versions.node?(e=require.nodeRequire("fs"),h=function(a,b){var c=e.readFileSync(a,"utf8")||"";c=c.replace(/^\uFEFF/,""),b(c)}):"undefined"!=typeof java&&"undefined"!=typeof java.io&&(h=function(a,b){for(var c,d=new java.io.File(a),e=new java.io.FileReader(d),f=new java.io.BufferedReader(e),g="";null!==(c=f.readLine());)g+=new String(c)+"\n";f.close(),b(g)});var r={},s=function(a,b){r[a]?b(r[a]):h(a,function(c){r[a]=c,b.call(this,c)})},t=[],u={};return{get:function(){return a},write:function(a,b,c){if(b+l in i){var d=i[b+l];c.asModule(a+"!"+b,d)}},version:"0.5.0",load:function(f,g,r,v){function w(a,c){return b(a).forEach(function(a){a&&a.type&&"partial"===a.type&&c.push(a.partialName.name),a&&a.program&&a.program.statements&&w(a.program.statements,c),a&&a.program&&a.program.inverse&&a.program.inverse.statements&&w(a.program.inverse.statements,c)}),c}function x(a){var c=[];return a&&a.statements&&(c=w(a.statements,[])),b(c).unique()}function y(a){var b,c,e;if(a&&a.statements&&(b=a.statements[0],b&&"comment"===b.type))try{return c=b.comment.replace(new RegExp("^[\\s]+|[\\s]+$","g"),""),e=d.parse(c),c}catch(f){return'{ "description" : "'+b.comment+'" }'}return"{}"}function z(a){if(!a)return[];var b,c=[a[0]],d=a[0];for(b=1;b",N="",O="t.meta = "+I+";\nt.helpers = "+d.stringify(L)+";\nt.deps = "+d.stringify(P)+";\nt.vars = "+d.stringify(K)+";\n");var V=F?!1:b.extend(k,v.localeMapping),W=v.hbs||{},X=b.extend(W.compileOptions||{},{originalKeyFallback:W.originalKeyFallback}),Y=c(h,V,X),Z=v.isBuild?"":"'"+f+"',";l&&(l=", '"+l+"'");var $=[];require.config.hbs._partials[f]&&($=require.config.hbs._partials[f].references),h="/* START_TEMPLATE */\ndefine("+Z+"['hbs','hbs/handlebars'"+l+p+"], function( hbs, Handlebars ){ \nvar t = Handlebars.template("+Y+");\n";for(var S=0;S<$.length;S++)h+="Handlebars.registerPartial('"+$[S]+"', t);\n";h+=O+"return t;\n});\n/* END_TEMPLATE */\n",v.isBuild&&(i[E]=h),v.isBuild||(h+="\r\n//@ sourceURL="+T),v.isBuild?(r.fromText(f,h),g([f],function(a){r(a)})):require(P,function(){r.fromText(h),g([f],function(a){r(a)})}),v.removeCombined&&e.unlinkSync(T)})}var E=f+l;v.hbs=v.hbs||{};var F=!(1==v.hbs.i18n),G=0==v.hbs.helpers,H="";v.hbs.partialsUrl&&(H=v.hbs.partialsUrl,H.match(/\/$/)||(H+="/"));var I,J=v.hbs&&v.hbs.templateExtension===!1;if(I=g.toUrl(J?f:f+"."+(v.hbs&&v.hbs.templateExtension?v.hbs.templateExtension:k)),F)D(!1);else{var K=(v.hbs&&v.hbs.i18nDirectory?v.hbs.i18nDirectory:p)+(v.locale||"en_us")+".json";try{s(g.toUrl(K),function(a){D(d.parse(a))})}catch(L){if(v.hbs)throw L;console.warn("hbs: Error reading "+K+", disabling i18n. Ignore this if you're using jam, otherwise check your i18n configuration.\n"),v.hbs={i18n:!1,helpers:!0},D(!1)}}}}}),ToneDen.define("templates/helpers/ifCond",["hbs/handlebars"],function(a){function b(a,b,c){return a||b?c.fn(this):c.inverse(this)}return a.registerHelper("ifCond",b),b}),ToneDen.define("templates/helpers/commanator",["hbs/handlebars"],function(a){function b(a){return a?a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):"-"}return a.registerHelper("commanator",b),b}),ToneDen.define("templates/helpers/msToTimestamp",["hbs/handlebars"],function(a){function b(a){var b=Math.round(a/1e3),c=Math.floor(b/60),d=b-60*c;return isNaN(c)&&(c=""),isNaN(d)?"":(10>d&&(d="0"+d),c+":"+d)}return a.registerHelper("msToTimestamp",b),b}),ToneDen.define("hbs!templates/player",["hbs","hbs/handlebars","templates/helpers/ifCond","templates/helpers/commanator","templates/helpers/msToTimestamp"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b,d){var e,f,g,m="";return m+='\n
\n
\n
\n ',e=c["if"].call(a,a&&a.artwork_url,{hash:{},inverse:G.program(6,i,b),fn:G.program(4,h,b),data:b}),(e||0===e)&&(m+=e),m+='\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n ',e=c["if"].call(a,d&&d.repeat,{hash:{},inverse:G.program(22,r,b),fn:G.program(20,q,b),data:b}),(e||0===e)&&(m+=e),m+='\n
\n
\n \n \n \n
\n
\n \n \n
\n
\n
\n ',e=c["if"].call(a,a&&a.error,{hash:{},inverse:G.program(26,t,b),fn:G.program(24,s,b),data:b}),(e||0===e)&&(m+=e),m+="\n " -}function h(a,b){var d,e,f="";return f+='\n \n '}function i(a){var b,c="";return c+='\n \n '}function j(a,b){var d,e,f="";return f+='\n \n '}function k(a,b){var d,e,f="";return f+='\n \n '}function l(a,b){var d,e,f="";return f+='\n \n "}function m(a,b){var d,e,f="";return f+="\n ",(e=c.purchase_title)?d=e.call(a,{hash:{},data:b}):(e=a&&a.purchase_title,d=typeof e===E?e.call(a,{hash:{},data:b}):e),f+=F(d)+"\n "}function n(){return"\n BUY\n "}function o(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.download_url,{hash:{},inverse:G.noop,fn:G.program(18,p,b),data:b}),(d||0===d)&&(e+=d),e+="\n "}function p(a,b){var d,e,f="";return f+='\n \n '}function q(){return'\n \n '}function r(){return'\n \n '}function s(a,b){var d,e,f="";return f+='\n
\n
\n
\n ',(e=c.errorMessage)?d=e.call(a,{hash:{},data:b}):(e=a&&a.errorMessage,d=typeof e===E?e.call(a,{hash:{},data:b}):e),f+=F(d)+" \n
\n
\n
\n "}function t(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:G.program(29,v,b),fn:G.program(27,u,b),data:b}),(d||0===d)&&(e+=d),e+="\n "}function u(a,b){var d,e,f,g="";return g+='\n
\n
\n
0:00
\n
\n \n
\n
\n '+F((e=c.msToTimestamp||a&&a.msToTimestamp,f={hash:{},data:b},e?e.call(a,(d=a&&a.nowPlaying,null==d||d===!1?d:d.duration),f):H.call(a,"msToTimestamp",(d=a&&a.nowPlaying,null==d||d===!1?d:d.duration),f)))+'\n \n
\n
\n
\n '}function v(){return'\n
\n
\n
\n This track is not streamable.\n
\n
\n
\n '}function w(a,b){var d,e,f,g="";return g+="\n ",d=c["if"].call(a,a&&a.playing,{hash:{},inverse:G.program(34,y,b),fn:G.program(32,x,b),data:b}),(d||0===d)&&(g+=d),g+="\n ",d=c["if"].call(a,a&&a.playing,{hash:{},inverse:G.program(38,A,b),fn:G.program(36,z,b),data:b}),(d||0===d)&&(g+=d),g+='\n \n
\n ',(e=c.title)?d=e.call(a,{hash:{},data:b}):(e=a&&a.title,d=typeof e===E?e.call(a,{hash:{},data:b}):e),g+=F(d)+'\n
\n \n \n
\n
\n \n '+F((e=c.commanator||a&&a.commanator,f={hash:{},data:b},e?e.call(a,a&&a.playback_count,f):H.call(a,"commanator",a&&a.playback_count,f)))+'\n
\n
\n \n '+F((e=c.commanator||a&&a.commanator,f={hash:{},data:b},e?e.call(a,a&&a.favoritings_count,f):H.call(a,"commanator",a&&a.favoritings_count,f)))+"\n
\n \n
\n \n \n "}function x(){return'\n \n '}function y(a,b){var c,d="";return d+='\n
\n ',B=c["if"].call(b,b&&b.loading,{hash:{},inverse:G.noop,fn:G.program(1,f,e),data:e}),(B||0===B)&&(D+=B),D+='\n
\n \n ',B=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:G.noop,fn:G.programWithDepth(3,g,e,b),data:e}),(B||0===B)&&(D+=B),D+='\n
\n \n ',B=c.each.call(b,b&&b.tracks,{hash:{},inverse:G.noop,fn:G.program(31,w,e),data:e}),(B||0===B)&&(D+=B),D+="\n \n \n \n\n"});return c}),ToneDen.define("hbs!templates/player-solo",["hbs","hbs/handlebars","templates/helpers/ifCond","templates/helpers/msToTimestamp","templates/helpers/commanator"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b,d){var e,f,g,m="";return m+='\n
\n
\n
\n ',e=c["if"].call(a,a&&a.artwork_url,{hash:{},inverse:B.program(6,i,b),fn:B.program(4,h,b)}),(e||0===e)&&(m+=e),m+='\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n ',f=c.ifCond||a&&a.ifCond,g={hash:{},inverse:B.program(10,k,b),fn:B.program(8,j,b)},e=f?f.call(a,a&&a.purchase_url,a&&a.download_url,g):C.call(a,"ifCond",a&&a.purchase_url,a&&a.download_url,g),(e||0===e)&&(m+=e),m+="\n ",e=c["if"].call(a,a&&a.purchase_url,{hash:{},inverse:B.program(17,o,b),fn:B.program(12,l,b)}),(e||0===e)&&(m+=e),m+='\n
\n
\n
\n
\n
\n ',e=c["if"].call(a,d&&d.repeat,{hash:{},inverse:B.program(22,r,b),fn:B.program(20,q,b)}),(e||0===e)&&(m+=e),m+='\n
\n \n
\n \n \n
\n
\n ',e=c["if"].call(a,a&&a.error,{hash:{},inverse:B.program(26,t,b),fn:B.program(24,s,b)}),(e||0===e)&&(m+=e),m+='\n \n "}function h(a){var b,d,e="";return e+='\n \n '}function i(a){var b,c="";return c+='\n \n '}function j(a){var b,d,e="";return e+='\n \n '}function k(a){var b,d,e="";return e+='\n \n '}function l(a,b){var d,e,f="";return f+='\n \n "}function m(a){var b,d,e="";return e+="\n ",(d=c.purchase_title)?b=d.call(a,{hash:{}}):(d=a&&a.purchase_title,b=typeof d===z?d.call(a,{hash:{}}):d),e+=A(b)+"\n "}function n(){return"\n BUY\n "}function o(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.download_url,{hash:{},inverse:B.noop,fn:B.program(18,p,b)}),(d||0===d)&&(e+=d),e+="\n "}function p(a){var b,d,e="";return e+=' \n \n '}function q(){return'\n \n '}function r(){return'\n \n '}function s(a){var b,d,e="";return e+='\n
\n
\n
\n ',(d=c.errorMessage)?b=d.call(a,{hash:{}}):(d=a&&a.errorMessage,b=typeof d===z?d.call(a,{hash:{}}):d),e+=A(b)+" \n
\n
\n
\n "}function t(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:B.program(29,v,b),fn:B.program(27,u,b)}),(d||0===d)&&(e+=d),e+="\n "}function u(a){var b,d,e,f="";return f+='\n
\n
\n
0:00
\n
\n \n
\n
\n '+A((d=c.msToTimestamp||a&&a.msToTimestamp,e={hash:{}},d?d.call(a,(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e):C.call(a,"msToTimestamp",(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e)))+'\n \n
\n
\n
\n '}function v(){return'\n
\n
\n
\n This track is not streamable.\n
\n
\n
\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var w,x,y="",z="function",A=this.escapeExpression,B=this,C=c.helperMissing;return y+='
\n ',w=c.unless.call(b,b&&b.nowPlaying,{hash:{},inverse:B.noop,fn:B.program(1,f,e)}),(w||0===w)&&(y+=w),y+='\n
\n \n ',w=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:B.noop,fn:B.programWithDepth(3,g,e,b)}),(w||0===w)&&(y+=w),y+="\n
\n
\n
\n"});return c}),ToneDen.define("hbs!templates/player-mini",["hbs","hbs/handlebars","templates/helpers/msToTimestamp","templates/helpers/commanator","templates/helpers/ifCond"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b){var d,e,f,g="";return g+='\n
\n
\n \n \n \n
\n
\n ',d=c["if"].call(a,a&&a.error,{hash:{},inverse:w.program(6,i,b),fn:w.program(4,h,b)}),(d||0===d)&&(g+=d),g+='\n \n
    \n
  • \n \n '+u((e=c.commanator||a&&a.commanator,f={hash:{}},e?e.call(a,a&&a.playback_count,f):v.call(a,"commanator",a&&a.playback_count,f)))+'\n
  • \n
  • \n \n '+u((e=c.commanator||a&&a.commanator,f={hash:{}},e?e.call(a,a&&a.favoritings_count,f):v.call(a,"commanator",a&&a.favoritings_count,f)))+'\n
  • \n \n
\n
\n ',d=c["if"].call(a,a&&a.purchase_url,{hash:{},inverse:w.program(16,o,b),fn:w.program(11,l,b)}),(d||0===d)&&(g+=d),g+=" \n ",e=c.ifCond||a&&a.ifCond,f={hash:{},inverse:w.program(18,p,b),fn:w.program(18,p,b)},d=e?e.call(a,a&&a.purchase_url,a&&a.download_url,f):v.call(a,"ifCond",a&&a.purchase_url,a&&a.download_url,f),(d||0===d)&&(g+=d),g+="\n \n
\n \n "}function i(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:w.program(9,k,b),fn:w.program(7,j,b)}),(d||0===d)&&(e+=d),e+="\n "}function j(a){var b,d,e,f="";return f+='\n
\n
\n
0:00
\n
\n \n
\n
\n '+u((d=c.msToTimestamp||a&&a.msToTimestamp,e={hash:{}},d?d.call(a,(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e):v.call(a,"msToTimestamp",(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e)))+'\n \n
\n
\n
\n '}function k(){return'\n
\n
\n This track is not streamable.\n
\n
\n '}function l(a,b){var d,e,f="";return f+='\n \n "}function m(a){var b,d,e="";return e+="\n ",(d=c.purchase_title)?b=d.call(a,{hash:{}}):(d=a&&a.purchase_title,b=typeof d===t?d.call(a,{hash:{}}):d),e+=u(b)+"\n "}function n(){return"\n BUY\n "}function o(a){var b,d,e="";return e+='\n \n '}function p(a){var b,d,e="";return e+='\n \n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var q,r,s="",t="function",u=this.escapeExpression,v=c.helperMissing,w=this;return s+='
\n ',q=c.unless.call(b,b&&b.nowPlaying,{hash:{},inverse:w.noop,fn:w.program(1,f,e)}),(q||0===q)&&(s+=q),s+="\n ",q=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:w.noop,fn:w.program(3,g,e)}),(q||0===q)&&(s+=q),s+="\n
\n"});return c}),ToneDen.define("hbs!templates/player-feed",["hbs","hbs/handlebars","templates/helpers/commanator","templates/helpers/ifCond"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b){var d,e,f,g="";return g+='\n
\n
\n
\n ',d=c["if"].call(a,a&&a.artwork_url,{hash:{},inverse:x.program(6,i,b),fn:x.program(4,h,b)}),(d||0===d)&&(g+=d),g+='\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n ",d=c["if"].call(a,a&&a.error,{hash:{},inverse:x.program(10,k,b),fn:x.program(8,j,b)}),(d||0===d)&&(g+=d),g+='\n \n "}function h(a){var b,d,e="";return e+='\n \n '}function i(a){var b,c="";return c+='\n \n '}function j(a){var b,d,e="";return e+='\n
\n
\n
\n ',(d=c.errorMessage)?b=d.call(a,{hash:{}}):(d=a&&a.errorMessage,b=typeof d===v?d.call(a,{hash:{}}):d),e+=w(b)+" \n
\n
\n
\n "}function k(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:x.program(13,m,b),fn:x.program(11,l,b)}),(d||0===d)&&(e+=d),e+="\n " -}function l(){return'\n
\n '}function m(){return'\n
\n
\n
\n This track is not streamable.\n
\n
\n
\n '}function n(a){var b,d,e="";return e+='\n \n '}function o(a){var b,d,e="";return e+='\n \n '}function p(a){var b,d,e="";return e+='\n
\n \n \n \n
\n '}function q(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.download_url,{hash:{},inverse:x.noop,fn:x.program(22,r,b)}),(d||0===d)&&(e+=d),e+="\n "}function r(a){var b,d,e="";return e+=' \n
\n \n \n \n
\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var s,t,u="",v="function",w=this.escapeExpression,x=this,y=c.helperMissing;return u+='
\n ',s=c.unless.call(b,b&&b.nowPlaying,{hash:{},inverse:x.noop,fn:x.program(1,f,e)}),(s||0===s)&&(u+=s),u+='\n
\n ',s=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:x.noop,fn:x.program(3,g,e)}),(s||0===s)&&(u+=s),u+="\n
\n
\n
\n"});return c}),ToneDen.define("hbs!templates/player-empty",["hbs","hbs/handlebars"],function(a,b){var c=b.template(function(a,b,c){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var d,e,f="",g="function",h=this.escapeExpression;return f+='
\n
\n \n There are no tracks to play.\n
\n
\n'});return c}),ToneDen.define("player",["jquery","vendor/simple-slider","underscore","vendor/td-interface","vendor/handlebars","hbs!templates/player","hbs!templates/player-solo","hbs!templates/player-mini","hbs!templates/player-feed","hbs!templates/player-empty","templates/helpers/msToTimestamp","vendor/d3","analytics","constants"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){return{create:function(b,e,o){function p(a,b){window.console&&("error"===b?console.error(a):"warning"===b?console.warn(a):L.debug&&console.debug(a))}function q(a){a=JSON.parse(JSON.stringify(a)),a.repeat=X.config.loopTrack;var b=!L.urls||!c.any(L.urls)||!c.any(a.tracks)&&!a.loading;if(a.nowPlaying){a.nowPlaying.purchase_title&&(a.nowPlaying.useCustomPurchaseTitle=L.useCustomPurchaseTitle);for(var d=0;d1?(N.find(".prev").show(),N.find(".next").show()):(N.find(".prev").hide(),N.find(".next").hide()),N.width()<400&&(N.find(".header").addClass("header-small").css("width","100%"),N.find(".solo-container").addClass("solo-container-small").css("width","100%").prependTo(N.find(".solo-buttons")),N.find(".scrubber").hide())):a.mini===!0?N.html(h(a)):a.feed===!0?N.html(i(a)):(N.html(f(a)),s(),N.width()<500&&(N.find(".current-song-info").css("width","100%").prependTo(N.find(".social")),N.find(".buy").hide(),N.find(".follow").hide(),N.find(".track-info-stats").hide()),N.height()<500&&a.shrink===!0&&N.find(".player").addClass("shrink")),N.find(".scrubber-slider").simpleSlider({highlight:!0})}function r(a){function b(a,b){"waves"===L.visualizerType?(a.selectAll("path").data([b]).attr("d",n).attr("visibility","visible").transition().ease("linear").duration(100),e.selectAll("rect").attr("visibility","hidden")):"bars"==L.visualizerType&&(e.selectAll("rect").data(b).transition().duration(100).attr("y",function(a){return i-m(a)}).attr("height",function(a){return m(a)}).attr("visibility","visible"),a.selectAll("path").attr("visibility","hidden"))}if(!a)for(var a=[],c=0;128>c;c++)a.push(0);var d=l.select(N[0]),e=d.select(".waveform svg"),f=128,g={top:0,right:0,bottom:0,left:0},h=N.find(".cover").width(),i=N.find(".cover").height(),j=(h-f)/f,k=l.scale.linear().domain([0,f-1]).range([0,h]),m=l.scale.linear().domain([0,1.5]).range([0,i]),n=l.svg.line().x(function(a,b){return k(b)}).y(function(a){return i-m(a)}).interpolate("basis");e.node()||(e=d.select(".waveform").append("svg:svg").attr("width",h+g.left+g.right).attr("height",i+g.top+g.bottom).append("g"),e.selectAll("path").data([a]).enter().append("svg:path").attr("d",n).attr("stroke-width",3),e.selectAll("rect").data(a).enter().append("rect").attr("x",function(a,b){return k(b)}).attr("y",function(a){return i-m(a)}).attr("width",j).attr("height",function(a){return m(a)})),b(e,a)}function s(){100==J?(N.find(".volume-init").removeClass().addClass("tdicon-volume-up volume-init"),N.find(".volume-select i.volume-active").removeClass("volume-active"),N.find(".volume-select i.volume-max").addClass("volume-active")):0==J?(N.find(".volume-init").removeClass().addClass("tdicon-volume-off volume-init"),N.find(".volume-select i.volume-active").removeClass("volume-active"),N.find(".volume-select i.volume-off").addClass("volume-active")):(N.find(".volume-init").removeClass().addClass("tdicon-volume-down volume-init"),N.find(".volume-select i.volume-active").removeClass("volume-active"),N.find(".volume-select i.volume-med").addClass("volume-active"))}function t(a){var b="tdicon-play-circle-outline",c="tdicon-pause-circle-outline",d=N.find(".play");a?(d.removeClass(c),d.addClass(b)):(d.removeClass(b),d.addClass(c))}function u(a){return X.addTracks(a),L.urls=X.playlist(),L.urls}function v(){N.off(),N.html(""),X.destroy(),ToneDen.players.splice(ToneDen.players.indexOf(I),1),delete I}function w(){X.pause()}function x(){X.play()}function y(){X.volume(0),N.find(".volume-select i").removeClass("volume-active"),target.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(newClass+" volume-init"),N.find(".volume-select").hide(),J=0}function z(a){X.next(a)}function A(a,b){X.on(a,b)}function B(a){X.prev(a)}function C(a,b){if("number"!=typeof a)return p("Index argument is not a number.","error"),[];L.urls.splice(a,b);var c=X.removeTracks(a,b);return X.tracks(function(a){q({feed:L.feed,loading:!1,mini:L.mini,nowPlaying:X.track(),shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),X.pause(!0)}),c}function D(a,b){X.goto(a,b)}function E(){return X.track()}function F(){return X.playlist()}function G(){return X.sound()}function H(a){var b=!1;a.dom&&(p("Updating the DOM parameter is not allowed, ignoring.","error"),delete a.dom),a.urls&&!c.isEqual(a.urls,L.urls)?(X.setTracks(a.urls),X.goto(0,!1),c.extend(L,a)):(c.extend(L,a),X.tracks(function(a){q({feed:L.feed,loading:b,mini:L.mini,nowPlaying:X.track(),shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),X.sound().paused||t(!1)}))}ToneDen.players=ToneDen.players||[];var I,J=100,K=!0,L={debug:!1,feed:!1,keyboardEvents:!1,mini:!1,onTrackReady:null,onTrackFinished:null,onPlaylistFinished:null,shrink:!0,single:null,skin:"light",staticUrl:n.protocol+"//sd.toneden.io/",togglePause:!0,tracksPerArtist:10,useCustomPurchaseTitle:!0,visualizerType:"waves"};1===arguments.length&&"object"==typeof arguments[0]?c.extend(L,arguments[0]):(L.urls=b,L.dom=e,delete o.urls,delete o.dom,c.extend(L,o),"/"!==L.staticUrl.charAt(L.staticUrl.length-1)&&(L.staticUrl+="/")),-1===navigator.userAgent.toLowerCase().indexOf("chrome")&&(K=!1),"none"===L.visualizerType&&(K=!1);{var M={cache:!0,cachePrefix:(new Date).getTime(),consumerKey:"6f85bdf51b0a19b7ab2df7b969233901",debug:L.debug,preload:!0,togglePause:L.togglePause,tracksPerArtist:L.tracksPerArtist,visualizer:K,onTrackReady:L.onTrackReady,onTrackFinished:L.onTrackFinished,onPlaylistFinished:L.onPlaylistFinished},e=L.dom,b=L.urls,N=a(e),O=null,P=null,Q=5e3,R=1e4,S=null,T=null,U=null,V=!1,W=!1,X=new d(b,M);N.find(".title")}return N.length>0?(q({feed:L.feed,loading:!0,mini:L.mini,shrink:L.shrink,single:L.single,skin:L.skin,tracks:[],tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),N.on("click",".controls",function(b){b.preventDefault();var c=a(b.target);c.hasClass("play")?X.pause():c.hasClass("next")?X.next():c.hasClass("prev")&&(X.position()>4e3?X.seek(0):X.prev())}),N.on("click",".repeat-init",function(b){b.preventDefault();var c=a(b.target);c.hasClass("repeat-on")?(c.removeClass("repeat-on"),X.config.loopTrack=!1):(c.addClass("repeat-on"),X.config.loopTrack=!0)}),N.on("click",".volume-controls",function(b){b.preventDefault();var c=a(b.target),d=c.attr("data-class");c.hasClass("volume-init")?(N.find(".volume-init").hide(),N.find(".volume-select").fadeIn()):c.hasClass("volume-off")?(X.volume(0),N.find(".volume-select i").removeClass("volume-active"),c.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(d+" volume-init"),N.find(".volume-select").hide(),J=0):c.hasClass("volume-med")?(X.volume(50),N.find(".volume-select i").removeClass("volume-active"),c.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(d+" volume-init"),N.find(".volume-select").hide(),J=50):c.hasClass("volume-max")&&(X.volume(100),N.find(".volume-select i").removeClass("volume-active"),c.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(d+" volume-init"),N.find(".volume-select").hide(),J=50)}),N.on("click",".track-info",function(){var b=a(this),c=b.attr("class"),d=Number(b.attr("data-index"));-1===c.indexOf("playing")&&X.goto(d)}),N.on("slider:changed",".scrubber-slider",function(a,b){X.play(),p("Slider Ratio: "+b.ratio),X.seek(b.ratio)}),L.keyboardEvents&&document.addEventListener("keydown",function(a){32==a.keyCode?(X&&X.pause(),a.preventDefault()):39==a.keyCode?(X&&X.next(),a.preventDefault()):37==a.keyCode&&(X&&X.prev(),a.preventDefault())},!1),X.on("tdplayer.play",function(){p("Playing."),t(!1)}),X.on("tdplayer.pause",function(){var a=X.sound(),b=a.paused,c=a.position/a.duration;t(b),0!==c||b||m("ToneDenTracker.send",{hitType:"event",eventCategory:"track",action:"started",label:a.url.replace(/stream\?.+$/,"")})}),X.on("tdplayer.stop",function(){p("Stopped."),N.find(".play").attr("src",L.staticUrl+"img/play.png")}),X.on("tdplayer.track.whileloading",function(a,b){S=b,T=b/100*X.sound().duration,N.find(".buffer").css("width",b+"%"),W&&T-X.position()>R&&(X.pause(),W=!1)}),X.on("tdplayer.track.whileplaying",function(b,c,d){1!=K||"number"!=typeof d[0]||isNaN(d[0])||r(d);var e=c/100,f=X.position(),g=k(f),h=k(X.track().duration-f);U=Math.round(c),e=e.toFixed(3),e!==O&&N.find(".scrubber-slider").simpleSlider("setRatio",e,!0),g!==P&&(N.find(".start-time").html(g),N.find(".stop-time").html(h)),O=e,P=g;var i=Q>T-f&&h>Q||!d||O>S/100;if(i){var j=a('');100!=U&&(X.pause(),W=!0,N.find(".stop-time").empty().append(j))}}),X.on("tdplayer.playlist.preloaded",function(){X.tracks(function(a){var b=X.track();p(a),1===a.length&&L.single!==!1&&0==L.mini&&0==L.feed&&(L.single=!0),N.find(".tdspinner").hide(),q({feed:L.feed,mini:L.mini,nowPlaying:b,shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),X.sound()&&!X.sound().paused&&t(!1)})}),X.on("tdplayer.track.ready",function(){V=!0}),X.on("tdplayer.changing_track",function(a,b){p("New track index: "+b),N.find(".played").css("width","0%"),N.find(".buffer").css("width","0%"),X.tracks(function(a){q({feed:L.feed,mini:L.mini,nowPlaying:X.track(),shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType})})}),I={addTracks:u,destroy:v,getAllTracks:F,getSound:G,getTrack:E,mute:y,next:z,on:A,parameters:L,pause:w,play:x,prev:B,removeTracks:C,skipTo:D,update:H},ToneDen.players.push(I),I):void p('ToneDen Player: the container specified by "'+L.dom+'" does not exist.',"error")},getInstanceByDom:function(b){if(ToneDen.players)for(var c,d=0;d\n '}function i(a){var b,c="";return c+='\n \n '}function j(a,b){var d,e,f="";return f+='\n \n '}function k(a,b){var d,e,f="";return f+='\n \n '}function l(a,b){var d,e,f="";return f+='\n \n "}function m(a,b){var d,e,f="";return f+="\n ",(e=c.purchase_title)?d=e.call(a,{hash:{},data:b}):(e=a&&a.purchase_title,d=typeof e===E?e.call(a,{hash:{},data:b}):e),f+=F(d)+"\n "}function n(){return"\n BUY\n "}function o(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.download_url,{hash:{},inverse:G.noop,fn:G.program(18,p,b),data:b}),(d||0===d)&&(e+=d),e+="\n "}function p(a,b){var d,e,f="";return f+='\n \n '}function q(){return'\n \n '}function r(){return'\n \n '}function s(a,b){var d,e,f="";return f+='\n
\n
\n
\n ',(e=c.errorMessage)?d=e.call(a,{hash:{},data:b}):(e=a&&a.errorMessage,d=typeof e===E?e.call(a,{hash:{},data:b}):e),f+=F(d)+" \n
\n
\n
\n "}function t(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:G.program(29,v,b),fn:G.program(27,u,b),data:b}),(d||0===d)&&(e+=d),e+="\n "}function u(a,b){var d,e,f,g="";return g+='\n
\n
\n
0:00
\n
\n \n
\n
\n '+F((e=c.msToTimestamp||a&&a.msToTimestamp,f={hash:{},data:b},e?e.call(a,(d=a&&a.nowPlaying,null==d||d===!1?d:d.duration),f):H.call(a,"msToTimestamp",(d=a&&a.nowPlaying,null==d||d===!1?d:d.duration),f)))+'\n \n
\n
\n
\n '}function v(){return'\n
\n
\n
\n This track is not streamable.\n
\n
\n
\n '}function w(a,b){var d,e,f,g="";return g+="\n ",d=c["if"].call(a,a&&a.playing,{hash:{},inverse:G.program(34,y,b),fn:G.program(32,x,b),data:b}),(d||0===d)&&(g+=d),g+="\n ",d=c["if"].call(a,a&&a.playing,{hash:{},inverse:G.program(38,A,b),fn:G.program(36,z,b),data:b}),(d||0===d)&&(g+=d),g+='\n
\n \n \n "}function x(){return'\n \n '}function y(a,b){var c,d="";return d+='\n
\n ',B=c["if"].call(b,b&&b.loading,{hash:{},inverse:G.noop,fn:G.program(1,f,e),data:e}),(B||0===B)&&(D+=B),D+='\n
\n \n ',B=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:G.noop,fn:G.programWithDepth(3,g,e,b),data:e}),(B||0===B)&&(D+=B),D+='\n
\n
\n
\n ',(e=c.title)?d=e.call(a,{hash:{},data:b}):(e=a&&a.title,d=typeof e===E?e.call(a,{hash:{},data:b}):e),g+=F(d)+'\n
\n
\n
\n
\n \n '+F((e=c.commanator||a&&a.commanator,f={hash:{},data:b},e?e.call(a,a&&a.playback_count,f):H.call(a,"commanator",a&&a.playback_count,f)))+'\n
\n
\n \n '+F((e=c.commanator||a&&a.commanator,f={hash:{},data:b},e?e.call(a,a&&a.favoritings_count,f):H.call(a,"commanator",a&&a.favoritings_count,f)))+"\n
\n \n
\n
\n ',B=c.each.call(b,b&&b.tracks,{hash:{},inverse:G.noop,fn:G.program(31,w,e),data:e}),(B||0===B)&&(D+=B),D+="\n \n \n \n\n"});return c}),ToneDen.define("hbs!templates/player-solo",["hbs","hbs/handlebars","templates/helpers/ifCond","templates/helpers/msToTimestamp","templates/helpers/commanator"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b,d){var e,f,g,m="";return m+='\n
\n
\n
\n ',e=c["if"].call(a,a&&a.artwork_url,{hash:{},inverse:B.program(6,i,b),fn:B.program(4,h,b)}),(e||0===e)&&(m+=e),m+='\n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n ',f=c.ifCond||a&&a.ifCond,g={hash:{},inverse:B.program(10,k,b),fn:B.program(8,j,b)},e=f?f.call(a,a&&a.purchase_url,a&&a.download_url,g):C.call(a,"ifCond",a&&a.purchase_url,a&&a.download_url,g),(e||0===e)&&(m+=e),m+="\n ",e=c["if"].call(a,a&&a.purchase_url,{hash:{},inverse:B.program(17,o,b),fn:B.program(12,l,b)}),(e||0===e)&&(m+=e),m+='\n
\n
\n
\n
\n
\n ',e=c["if"].call(a,d&&d.repeat,{hash:{},inverse:B.program(22,r,b),fn:B.program(20,q,b)}),(e||0===e)&&(m+=e),m+='\n
\n \n
\n \n \n
\n
\n ',e=c["if"].call(a,a&&a.error,{hash:{},inverse:B.program(26,t,b),fn:B.program(24,s,b)}),(e||0===e)&&(m+=e),m+='\n \n "}function h(a){var b,d,e="";return e+='\n \n '}function i(a){var b,c="";return c+='\n \n '}function j(a){var b,d,e="";return e+='\n \n '}function k(a){var b,d,e="";return e+='\n \n '}function l(a,b){var d,e,f="";return f+='\n \n "}function m(a){var b,d,e="";return e+="\n ",(d=c.purchase_title)?b=d.call(a,{hash:{}}):(d=a&&a.purchase_title,b=typeof d===z?d.call(a,{hash:{}}):d),e+=A(b)+"\n "}function n(){return"\n BUY\n "}function o(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.download_url,{hash:{},inverse:B.noop,fn:B.program(18,p,b)}),(d||0===d)&&(e+=d),e+="\n "}function p(a){var b,d,e="";return e+=' \n \n '}function q(){return'\n \n '}function r(){return'\n \n '}function s(a){var b,d,e="";return e+='\n
\n
\n
\n ',(d=c.errorMessage)?b=d.call(a,{hash:{}}):(d=a&&a.errorMessage,b=typeof d===z?d.call(a,{hash:{}}):d),e+=A(b)+" \n
\n
\n
\n "}function t(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:B.program(29,v,b),fn:B.program(27,u,b)}),(d||0===d)&&(e+=d),e+="\n "}function u(a){var b,d,e,f="";return f+='\n
\n
\n
0:00
\n
\n \n
\n
\n '+A((d=c.msToTimestamp||a&&a.msToTimestamp,e={hash:{}},d?d.call(a,(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e):C.call(a,"msToTimestamp",(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e)))+'\n \n
\n
\n
\n '}function v(){return'\n
\n
\n
\n This track is not streamable.\n
\n
\n
\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var w,x,y="",z="function",A=this.escapeExpression,B=this,C=c.helperMissing;return y+='
\n ',w=c.unless.call(b,b&&b.nowPlaying,{hash:{},inverse:B.noop,fn:B.program(1,f,e)}),(w||0===w)&&(y+=w),y+='\n
\n \n ',w=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:B.noop,fn:B.programWithDepth(3,g,e,b)}),(w||0===w)&&(y+=w),y+="\n
\n
\n
\n"});return c}),ToneDen.define("hbs!templates/player-mini",["hbs","hbs/handlebars","templates/helpers/msToTimestamp","templates/helpers/commanator","templates/helpers/ifCond"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b){var d,e,f,g="";return g+='\n
\n
\n \n \n \n
\n
\n ',d=c["if"].call(a,a&&a.error,{hash:{},inverse:w.program(6,i,b),fn:w.program(4,h,b)}),(d||0===d)&&(g+=d),g+='\n \n
    \n
  • \n \n '+u((e=c.commanator||a&&a.commanator,f={hash:{}},e?e.call(a,a&&a.playback_count,f):v.call(a,"commanator",a&&a.playback_count,f)))+'\n
  • \n
  • \n \n '+u((e=c.commanator||a&&a.commanator,f={hash:{}},e?e.call(a,a&&a.favoritings_count,f):v.call(a,"commanator",a&&a.favoritings_count,f)))+'\n
  • \n \n
\n
\n ',d=c["if"].call(a,a&&a.purchase_url,{hash:{},inverse:w.program(16,o,b),fn:w.program(11,l,b)}),(d||0===d)&&(g+=d),g+=" \n ",e=c.ifCond||a&&a.ifCond,f={hash:{},inverse:w.program(18,p,b),fn:w.program(18,p,b)},d=e?e.call(a,a&&a.purchase_url,a&&a.download_url,f):v.call(a,"ifCond",a&&a.purchase_url,a&&a.download_url,f),(d||0===d)&&(g+=d),g+="\n \n
\n \n "}function i(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:w.program(9,k,b),fn:w.program(7,j,b)}),(d||0===d)&&(e+=d),e+="\n "}function j(a){var b,d,e,f="";return f+='\n
\n
\n
0:00
\n
\n \n
\n
\n '+u((d=c.msToTimestamp||a&&a.msToTimestamp,e={hash:{}},d?d.call(a,(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e):v.call(a,"msToTimestamp",(b=a&&a.nowPlaying,null==b||b===!1?b:b.duration),e)))+'\n \n
\n
\n
\n '}function k(){return'\n
\n
\n This track is not streamable.\n
\n
\n '}function l(a,b){var d,e,f="";return f+='\n \n "}function m(a){var b,d,e="";return e+="\n ",(d=c.purchase_title)?b=d.call(a,{hash:{}}):(d=a&&a.purchase_title,b=typeof d===t?d.call(a,{hash:{}}):d),e+=u(b)+"\n "}function n(){return"\n BUY\n "}function o(a){var b,d,e="";return e+='\n \n '}function p(a){var b,d,e="";return e+='\n \n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var q,r,s="",t="function",u=this.escapeExpression,v=c.helperMissing,w=this;return s+='
\n ',q=c.unless.call(b,b&&b.nowPlaying,{hash:{},inverse:w.noop,fn:w.program(1,f,e)}),(q||0===q)&&(s+=q),s+="\n ",q=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:w.noop,fn:w.program(3,g,e)}),(q||0===q)&&(s+=q),s+="\n
\n"});return c}),ToneDen.define("hbs!templates/player-feed",["hbs","hbs/handlebars","templates/helpers/commanator","templates/helpers/ifCond"],function(a,b){var c=b.template(function(a,b,c,d,e){function f(){return'\n
\n
\n
\n
\n
\n
\n
\n '}function g(a,b){var d,e,f,g="";return g+='\n
\n
\n
\n ',d=c["if"].call(a,a&&a.artwork_url,{hash:{},inverse:x.program(6,i,b),fn:x.program(4,h,b)}),(d||0===d)&&(g+=d),g+='\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n ",d=c["if"].call(a,a&&a.error,{hash:{},inverse:x.program(10,k,b),fn:x.program(8,j,b)}),(d||0===d)&&(g+=d),g+='\n \n "}function h(a){var b,d,e="";return e+='\n \n '}function i(a){var b,c="";return c+='\n \n '}function j(a){var b,d,e="";return e+='\n
\n
\n
\n ',(d=c.errorMessage)?b=d.call(a,{hash:{}}):(d=a&&a.errorMessage,b=typeof d===v?d.call(a,{hash:{}}):d),e+=w(b)+" \n
\n
\n
\n "}function k(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.streamable,{hash:{},inverse:x.program(13,m,b),fn:x.program(11,l,b)}),(d||0===d)&&(e+=d),e+="\n "}function l(){return'\n
\n ' +}function m(){return'\n
\n
\n
\n This track is not streamable.\n
\n
\n
\n '}function n(a){var b,d,e="";return e+='\n \n '}function o(a){var b,d,e="";return e+='\n \n '}function p(a){var b,d,e="";return e+='\n
\n \n \n \n
\n '}function q(a,b){var d,e="";return e+="\n ",d=c["if"].call(a,a&&a.download_url,{hash:{},inverse:x.noop,fn:x.program(22,r,b)}),(d||0===d)&&(e+=d),e+="\n "}function r(a){var b,d,e="";return e+=' \n
\n \n \n \n
\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var s,t,u="",v="function",w=this.escapeExpression,x=this,y=c.helperMissing;return u+='
\n ',s=c.unless.call(b,b&&b.nowPlaying,{hash:{},inverse:x.noop,fn:x.program(1,f,e)}),(s||0===s)&&(u+=s),u+='\n
\n ',s=c["with"].call(b,b&&b.nowPlaying,{hash:{},inverse:x.noop,fn:x.program(3,g,e)}),(s||0===s)&&(u+=s),u+="\n
\n
\n
\n"});return c}),ToneDen.define("hbs!templates/player-empty",["hbs","hbs/handlebars"],function(a,b){var c=b.template(function(a,b,c){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers);var d,e,f="",g="function",h=this.escapeExpression;return f+='
\n
\n \n There are no tracks to play.\n
\n
\n'});return c}),ToneDen.define("player",["jquery","vendor/simple-slider","underscore","vendor/td-interface","vendor/handlebars","hbs!templates/player","hbs!templates/player-solo","hbs!templates/player-mini","hbs!templates/player-feed","hbs!templates/player-empty","templates/helpers/msToTimestamp","vendor/d3","analytics","constants"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){return{create:function(b,e,o){function p(a,b){window.console&&("error"===b?console.error(a):"warning"===b?console.warn(a):L.debug&&console.debug(a))}function q(a){a=JSON.parse(JSON.stringify(a)),a.repeat=X.config.loopTrack;var b=!L.urls||!c.any(L.urls)||!c.any(a.tracks)&&!a.loading;if(a.nowPlaying){a.nowPlaying.purchase_title&&(a.nowPlaying.useCustomPurchaseTitle=L.useCustomPurchaseTitle);for(var d=0;d1?(N.find(".prev").show(),N.find(".next").show()):(N.find(".prev").hide(),N.find(".next").hide()),N.width()<400&&(N.find(".header").addClass("header-small").css("width","100%"),N.find(".solo-container").addClass("solo-container-small").css("width","100%").prependTo(N.find(".solo-buttons")),N.find(".scrubber").hide())):a.mini===!0?N.html(h(a)):a.feed===!0?N.html(i(a)):(N.html(f(a)),s(),N.width()<500&&(N.find(".current-song-info").css("width","100%").prependTo(N.find(".social")),N.find(".buy").hide(),N.find(".follow").hide(),N.find(".track-info-stats").hide()),N.height()<500&&a.shrink===!0&&N.find(".player").addClass("shrink")),N.find(".scrubber-slider").simpleSlider({highlight:!0})}function r(a){function b(a,b){"waves"===L.visualizerType?(a.selectAll("path").data([b]).attr("d",n).attr("visibility","visible").transition().ease("linear").duration(100),e.selectAll("rect").attr("visibility","hidden")):"bars"==L.visualizerType&&(e.selectAll("rect").data(b).transition().duration(100).attr("y",function(a){return i-m(a)}).attr("height",function(a){return m(a)}).attr("visibility","visible"),a.selectAll("path").attr("visibility","hidden"))}if(!a)for(var a=[],c=0;128>c;c++)a.push(0);var d=l.select(N[0]),e=d.select(".waveform svg"),f=128,g={top:0,right:0,bottom:0,left:0},h=N.find(".cover").width(),i=N.find(".cover").height(),j=(h-f)/f,k=l.scale.linear().domain([0,f-1]).range([0,h]),m=l.scale.linear().domain([0,1.5]).range([0,i]),n=l.svg.line().x(function(a,b){return k(b)}).y(function(a){return i-m(a)}).interpolate("basis");e.node()||(e=d.select(".waveform").append("svg:svg").attr("width",h+g.left+g.right).attr("height",i+g.top+g.bottom).append("g"),e.selectAll("path").data([a]).enter().append("svg:path").attr("d",n).attr("stroke-width",3),e.selectAll("rect").data(a).enter().append("rect").attr("x",function(a,b){return k(b)}).attr("y",function(a){return i-m(a)}).attr("width",j).attr("height",function(a){return m(a)})),b(e,a)}function s(){100==J?(N.find(".volume-init").removeClass().addClass("tdicon-volume-up volume-init"),N.find(".volume-select i.volume-active").removeClass("volume-active"),N.find(".volume-select i.volume-max").addClass("volume-active")):0==J?(N.find(".volume-init").removeClass().addClass("tdicon-volume-off volume-init"),N.find(".volume-select i.volume-active").removeClass("volume-active"),N.find(".volume-select i.volume-off").addClass("volume-active")):(N.find(".volume-init").removeClass().addClass("tdicon-volume-down volume-init"),N.find(".volume-select i.volume-active").removeClass("volume-active"),N.find(".volume-select i.volume-med").addClass("volume-active"))}function t(a){var b="tdicon-play-circle-outline",c="tdicon-pause-circle-outline",d=N.find(".play");a?(d.removeClass(c),d.addClass(b)):(d.removeClass(b),d.addClass(c))}function u(a){return X.addTracks(a),L.urls=X.playlist(),L.urls}function v(){N.off(),N.html(""),X.destroy(),ToneDen.players.splice(ToneDen.players.indexOf(I),1),delete I}function w(){X.pause()}function x(){X.play()}function y(){X.volume(0),N.find(".volume-select i").removeClass("volume-active"),target.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(newClass+" volume-init"),N.find(".volume-select").hide(),J=0}function z(a){X.next(a)}function A(a,b){X.on(a,b)}function B(a){X.prev(a)}function C(a,b){if("number"!=typeof a)return p("Index argument is not a number.","error"),[];L.urls.splice(a,b);var c=X.removeTracks(a,b);return X.tracks(function(a){q({feed:L.feed,loading:!1,mini:L.mini,nowPlaying:X.track(),shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),X.pause(!0)}),c}function D(a,b){X.goto(a,b)}function E(){return X.track()}function F(){return X.playlist()}function G(){return X.sound()}function H(a){var b=!1;a.dom&&(p("Updating the DOM parameter is not allowed, ignoring.","error"),delete a.dom),a.urls&&!c.isEqual(a.urls,L.urls)?(X.setTracks(a.urls),X.goto(0,!1),c.extend(L,a)):(c.extend(L,a),X.tracks(function(a){q({feed:L.feed,loading:b,mini:L.mini,nowPlaying:X.track(),shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),X.sound().paused||t(!1)}))}ToneDen.players=ToneDen.players||[];var I,J=100,K=!0,L={debug:!1,feed:!1,keyboardEvents:!1,mini:!1,onTrackReady:null,onTrackFinished:null,onPlaylistFinished:null,shrink:!0,single:null,skin:"light",staticUrl:n.protocol+"//sd.toneden.io/",togglePause:!0,tracksPerArtist:10,useCustomPurchaseTitle:!0,visualizerType:"waves"};1===arguments.length&&"object"==typeof arguments[0]?c.extend(L,arguments[0]):(L.urls=b,L.dom=e,delete o.urls,delete o.dom,c.extend(L,o),"/"!==L.staticUrl.charAt(L.staticUrl.length-1)&&(L.staticUrl+="/")),-1===navigator.userAgent.toLowerCase().indexOf("chrome")&&(K=!1),"none"===L.visualizerType&&(K=!1);{var M={cache:!0,cachePrefix:(new Date).getTime(),consumerKey:"6f85bdf51b0a19b7ab2df7b969233901",debug:L.debug,preload:!0,togglePause:L.togglePause,tracksPerArtist:L.tracksPerArtist,visualizer:K,onTrackReady:L.onTrackReady,onTrackFinished:L.onTrackFinished,onPlaylistFinished:L.onPlaylistFinished},e=L.dom,b=L.urls,N=a(e),O=null,P=null,Q=5e3,R=1e4,S=null,T=null,U=null,V=!1,W=!1,X=new d(b,M);N.find(".title")}return N.length>0?(q({feed:L.feed,loading:!0,mini:L.mini,shrink:L.shrink,single:L.single,skin:L.skin,tracks:[],tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),N.on("click",".controls",function(b){b.preventDefault();var c=a(b.target);c.hasClass("play")?X.pause():c.hasClass("next")?X.next():c.hasClass("prev")&&(X.position()>4e3?X.seek(0):X.prev())}),N.on("click",".repeat-init",function(b){b.preventDefault();var c=a(b.target);c.hasClass("repeat-on")?(c.removeClass("repeat-on"),X.config.loopTrack=!1):(c.addClass("repeat-on"),X.config.loopTrack=!0)}),N.on("click",".volume-controls",function(b){b.preventDefault();var c=a(b.target),d=c.attr("data-class");c.hasClass("volume-init")?(N.find(".volume-init").hide(),N.find(".volume-select").fadeIn()):c.hasClass("volume-off")?(X.volume(0),N.find(".volume-select i").removeClass("volume-active"),c.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(d+" volume-init"),N.find(".volume-select").hide(),J=0):c.hasClass("volume-med")?(X.volume(50),N.find(".volume-select i").removeClass("volume-active"),c.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(d+" volume-init"),N.find(".volume-select").hide(),J=50):c.hasClass("volume-max")&&(X.volume(100),N.find(".volume-select i").removeClass("volume-active"),c.addClass("volume-active"),N.find(".volume-init").fadeIn().removeClass().addClass(d+" volume-init"),N.find(".volume-select").hide(),J=50)}),N.on("click",".track-info",function(){var b=a(this),c=b.attr("class"),d=Number(b.attr("data-index"));-1===c.indexOf("playing")&&X.goto(d)}),N.on("slider:changed",".scrubber-slider",function(a,b){X.play(),p("Slider Ratio: "+b.ratio),X.seek(b.ratio)}),L.keyboardEvents&&document.addEventListener("keydown",function(a){32==a.keyCode?(X&&X.pause(),a.preventDefault()):39==a.keyCode?(X&&X.next(),a.preventDefault()):37==a.keyCode&&(X&&X.prev(),a.preventDefault())},!1),X.on("tdplayer.play",function(){p("Playing."),t(!1)}),X.on("tdplayer.pause",function(){var a=X.sound(),b=a.paused,c=a.position/a.duration;t(b),0!==c||b||m("ToneDenTracker.send",{hitType:"event",eventCategory:"track",action:"started",label:a.url.replace(/stream\?.+$/,"")})}),X.on("tdplayer.stop",function(){p("Stopped."),N.find(".play").attr("src",L.staticUrl+"img/play.png")}),X.on("tdplayer.track.whileloading",function(a,b){S=b,T=b/100*X.sound().duration,N.find(".buffer").css("width",b+"%"),W&&T-X.position()>R&&(X.pause(),W=!1)}),X.on("tdplayer.track.whileplaying",function(b,c,d){1!=K||"number"!=typeof d[0]||isNaN(d[0])||r(d);var e=c/100,f=X.position(),g=k(f),h=k(X.track().duration-f);U=Math.round(c),e=e.toFixed(3),e!==O&&N.find(".scrubber-slider").simpleSlider("setRatio",e,!0),g!==P&&(N.find(".start-time").html(g),N.find(".stop-time").html(h)),O=e,P=g;var i=Q>T-f&&h>Q||!d||O>S/100;if(i){var j=a('');100!=U&&(X.pause(),W=!0,N.find(".stop-time").empty().append(j))}}),X.on("tdplayer.playlist.preloaded",function(){X.tracks(function(a){var b=X.track();p(a),1===a.length&&L.single!==!1&&0==L.mini&&0==L.feed&&(L.single=!0),N.find(".tdspinner").hide(),q({feed:L.feed,mini:L.mini,nowPlaying:b,shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType}),X.sound()&&!X.sound().paused&&t(!1)})}),X.on("tdplayer.track.ready",function(){V=!0}),X.on("tdplayer.changing_track",function(a,b){p("New track index: "+b),N.find(".played").css("width","0%"),N.find(".buffer").css("width","0%"),X.tracks(function(a){q({feed:L.feed,mini:L.mini,nowPlaying:X.track(),shrink:L.shrink,single:L.single,skin:L.skin,tracks:a,tracksPerArtist:L.tracksPerArtist,visualizerType:L.visualizerType})})}),I={addTracks:u,destroy:v,getAllTracks:F,getSound:G,getTrack:E,mute:y,next:z,on:A,parameters:L,pause:w,play:x,prev:B,removeTracks:C,skipTo:D,update:H},ToneDen.players.push(I),I):void p('ToneDen Player: the container specified by "'+L.dom+'" does not exist.',"error")},getInstanceByDom:function(b){if(ToneDen.players)for(var c,d=0;d