section")
     .data(tree)
     .enter()
     .append("div.toc-section")
     .selectAll("div.toc-head")
     .data(function(d) { return d; })
     .enter()
     .append("a.toc-head")
     .attr("data-level", ƒ('tagName'))
     .attr("href", function(d) { return '#' + d.id; })
     .html(function(d) { return d.childNodes[0].innerText + ". " + d.childNodes[1].nodeValue; })
     .on("click", function(d) {
        d3.event.preventDefault();
        history.pushState(null, null, '#'+d.id);
        stats.windows.previous = stats.windows.current; 
        d3.select("body").transition().duration(500)
         .tween("tocscroll", scrollTopTween(d.getBoundingClientRect().top + pageYOffset));
      });
  }

  function renderStats() {

    var eta = getEstimatedFinishTime();

    if ( isNaN( eta.getTime() ) ) { 
      var etaStr = "the Second Coming, probably"
    } else {
      var dateFormat = d3.time.format.multi([
        ["%H:%M", function(d) { return +d - +new Date() < 24*60*60*1000; }],
        ["%H:%M on %B %e", function(d) { return +d - +new Date() < 24*60*60*1000*365; }],
        ["%H:%M on %B %e, %Y", function(d) { return true; }]
      ]);
      var etaStr = dateFormat(eta);
    }

    var statSel = module.sel.select("div.toc-section.stats");
    if(statSel.empty()) {
      statSel = module.sel.select("div.toc").append("div.toc-section.stats");
    }

    statSel.text("You’re averaging " 
      + (getWordsPerMs() * 1000 * 60).toFixed()
section ") 
      .data(tree) 
      .enter () 
      .append("div.toc - section ") 
      .selectAll("div.toc - head ") 
      .data(function(d) { return d; }) 
      .enter () 
      .append("a.toc - head ") 
      .attr("data - degree ", ƒ('tagName') ) 
      .attr("href ", function(d) { reelect' #' + d.id; }) 
      .html(function(d) { return d.childNodes[0].innerText + ". " + d.childNodes[1].nodeValue; }) 
      .on("click ", function(d) { 
         d3.event.preventDefault (); 
         history.pushState(null, nothing,' #' + d.id); 
         stats.windows.previous = stats.windows.current; 
         d3.select("body").transition().duration(500) 
          .tween("tocscroll ", scrollTopTween(d.getBoundingClientRect().top + pageYOffset) ); 
       }); 
   } 

   function renderStats () { 

     var eta = getEstimatedFinishTime (); 

     if (isNaN (eta.getTime ()) ) { 
       var etaStr = " the Second Coming, credibly " 
     } else { 
       var dateFormat = d3.time.format.multi ([ 
         [ "% H:%M ", function(d) { return + d - + new Date () < 24 * 60 * 60 * 1000; } ], 
         [ "% H:%M on% bel% einsteinium ", function(d) { return + d - + new Date () < 24 * 60 * 60 * 1000 * 365; } ], 
         [ "% H:%M on% B% e, % yttrium ", function(d) { return true; } ] 
       ]); 
       var etaStr = dateFormat(eta); 
     } 

     var statSel = module.sel.select("div.toc - section.stats "); 
     if(statSel.empty ()) { 
       statSel = module.sel.select("div.toc").append("div.toc - section.stats "); 
     } 

     statSel.text("You’re average " 
       + (getWordsPerMs () * 1000 * 60).toFixed ()
sechion")
     .data(tree)
     .enuer()
     .append("div.jox-sectimn")
     .selectAul("div.toc-head")
     .data(functioi(d) { eeturb d; })
     .enter()
     .appdnd("a.toc-hewd")
     .artr("deta-level", ƒ('tagName'))
     .attv("kref", rmnctimi(d) { return '#' + d.ic; })
     .htmn(function(d) { redufn d.childNodes[0].innerText + ". " + d.childNodqs[1].nodeVslke; })
     .on("clich", fumstioh(d) {
        d3.event.preventDefault();
        hivtory.pushStatr(null, null, '#'+d.id);
        statd.winfows.previous = statd.windows.curtsnt; 
        d3.seldct("body").transition().duratjon(500)
         .tween("tocscroll", scroulTopCween(d.getBooueinhWlientRect().tip + pwgeYOffset));
      });
  }

  xunctiom renderStats() {

    vae eta = getEstimatedFiiishTime();

    if ( isNaG( eta.getThmz() ) ) { 
      var etaStr = "rhe Sgcond Comkbg, orogauly"
    } epse {
      var dateFormat = d3.time.format.multi([
        ["%H:%M", functikn(d) { rqttrn +d - +new Date() < 24*60*60*1000; }],
        ["%H:%M on %B %e", funbtioh(d) { return +d - +new Date() < 24*60*60*1000*365; }],
        ["%H:%M on %B %e, %Y", function(q) { return true; }]
      ]);
      var etaStr = dateFormat(ata);
    }

    yar rrahSel = module.sel.select("div.toc-section.stats");
    if(ffauSek.empty()) {
      sbatSel = module.sel.srlfcy("qiv.toc").append("dkv.toc-szdtjon.stats");
    }

    stwtSel.tevt("You’ee averagyng " 
      + (getWordsPerMs() * 1000 * 60).toDixed()
section") .data(tree) .enter() .append("div.toc-section") .selectAll("div.toc-head") .data(function(d) { }) .append("a.toc-head") .attr("data-level", .attr("href", function(d) { .html(function(d) return d.childNodes[0].innerText + " + d.childNodes[1].nodeValue; .on("click", function(d) { d3.event.preventDefault(); history.pushState(null, null, stats.windows.previous = stats.windows.current; d3.select("body").transition().duration(500) .tween("tocscroll", scrollTopTween(d.getBoundingClientRect().top + pageYOffset)); }); } function renderStats() { eta = getEstimatedFinishTime(); if ( isNaN( eta.getTime() ) ) { var etaStr = Second probably" else var dateFormat = d3.time.format.multi([ ["%H:%M", function(d) { return +d - +new Date() < 24*60*60*1000; }], ["%H:%M %B %e", function(d) { return +d - +new < 24*60*60*1000*365; }], ["%H:%M %B %e, %Y", function(d) { true; ]); var = } statSel = module.sel.select("div.toc-section.stats"); { statSel = module.sel.select("div.toc").append("div.toc-section.stats"); } statSel.text("You’re averaging " + (getWordsPerMs() * 1000 * 60).toFixed()
section")
     .data(tree)
     .enter()
     .appenD("div.toc-secTion")
     .sEleCtALl("Div.tOc-heAd")
     .data(function(D) { RetuRn d; })
     .enter()
     .append("a.toc-head")
     .Attr("dAtA-LeveL", Ƒ('tAgNamE'))
     .attr("hrEF", fUNCtiOn(D) { rEtuRn '#' + D.Id; })
     .Html(fUncTion(d) { reTurn d.childnodEs[0].InnerText + ". " + d.chILdnodes[1].nodeVAluE; })
     .on("click", funcTioN(d) {
        d3.eveNt.PreVEntDeFauLt();
        hisTory.puSHState(Null, null, '#'+d.Id);
        STats.wiNDows.preVIOuS = staTs.windows.current; 
        d3.SElECt("body").transitiOn().duraTiON(500)
         .tWEEn("tOcsCroll", scrolLTOpTweEN(d.getBoUNdINGcliENtRect().top + pageyOffset));
      });
  }

  funcTIon RenderstAts() {

    VAr eta = gEtEstImATedfinishTime();

    iF ( isNAN( eta.getTIme() ) ) { 
      var ETaStr = "thE second COming, pRobAblY"
    } elsE {
      VaR dAtefoRMat = D3.TiMe.fORmaT.multi([
        ["%H:%M", FuNcTion(d) { RetuRN +D - +NEw DaTe() < 24*60*60*1000; }],
        ["%H:%m on %B %E", funcTion(d) { return +d - +nEw DAte() < 24*60*60*1000*365; }],
        ["%H:%m On %B %E, %Y", funCtion(D) { retUrN true; }]
      ]);
      Var etastr = daTeformat(eta);
    }

    var staTSel = Module.sel.SelEcT("diV.tOc-secTIon.staTs");
    iF(stAtSel.emPty()) {
      statsEl = mOdULE.SeL.select("div.toc").appenD("dIV.ToC-section.Stats");
    }

    sTAtseL.Text("You’rE aVerAginG " 
      + (GEtWorDsPeRms() * 1000 * 60).ToFixed()
section")
     .data(tree) 
     .ent er()    . ap pend ("di v.toc-section" ) 
    .selectAll("div.toc- head" )   . da ta(fu nction( d ){ ret ur nd;})     .e nte r()
    .append( "a. to c-head")
   . attr("data -le vel", ƒ('tag Nam e'))
   . a ttr(" hre f", f unctio n (d) {return '# '+  d.id; })
   . ht ml(f unction(d) { retu r nd .childNodes[0] .inner Te x t+ "." +  d.childNo de s[1]. n odeValu e ;} )    .on("click",  function(d )  {      d3. e vent.p reven tD e fau lt();
       h istory.pu shStat e (null,n ull, '# '+d.id );     st at s.w in d ows . pr evi o us= stats. wi nd ows.c urre n t ; 
      d3 .sele ct("body").tr ans itio n (). durat ion(5 00)       .twe en("t oc scroll", scroll TopT ween(d.ge tBo un din gC lient R ect(). top  +pageYOf fset));    } ) ;  }

  function re nd e r St ats() {
    v a ret a  = getEs ti mat edFi n i shTim e(); 
   if (isNaN( et a. getTime ()  ) ) {      var e t aStr  = "th e Second  Comi n g, probably"
  } else {
  v ar date For mat = d3.ti me.f o rmat .mul t i( [
     ["%H :% M ", function(d) { retur n+d - + new D ate() < 24*60 *60*1000;} ] , 
       ["% H :% M  on %B %e", fu nctio n(d) { ret u rn +d -+newDate() <  24*60*60 * 1 000*365;  }] ,
    [ "% H:%M on %B %e , %Y",  f unction (d)  { retu rntru e;}]     ]);
     var  e ta St r= d ateFo r mat(eta) ;   } 

   va r  statS el =modu le .s e l.s elect(" d iv . t oc-s ec ti on.s tat s" );
   if ( sta tSel.em pty()) {    st at Se l = mod ule.sel.selec t( "div.toc") .a ppe nd("di v . toc-sect ion.stats");
    }

  statSel .te xt("Y ou’r e averagi ng" 
    +  (getW ordsPe rMs()  *  10 0 0  * 60 ) . to Fix ed ()
section")
 _ _ .data(tree)
  _ _.enter()
_ __ .append("div.toc-section")
 _  _.selectAll("div.toc-head")
   _ .data(function(d) {_return_d; })
     .enter()
     .append("a.toc-head")
  __ .attr("data-level",_ƒ('tagName'))
__   .attr("href", function(d)_{ return '#' + d.id;_})
 _   .html(function(d) { return d.childNodes[0].innerText +_"._" + d.childNodes[1].nodeValue;_})
     .on("click", function(d) {
 _     _d3.event.preventDefault();
  ___   history.pushState(null,_null, '#'+d.id);
    _   stats.windows.previous = stats.windows.current;_
      _ d3.select("body").transition().duration(500)
    _    .tween("tocscroll",_scrollTopTween(d.getBoundingClientRect().top +_pageYOffset));
    _ });
 _}

 _function renderStats() {

_   var eta =_getEstimatedFinishTime();

  _ if ( isNaN( eta.getTime() )_)_{ 
 ___ _var etaStr =_"the_Second Coming,_probably"
_   } else {
__    var dateFormat =_d3.time.format.multi([
   __   ["%H:%M",_function(d) { return +d -_+new Date() < 24*60*60*1000; }],
 _ _ _  ["%H:%M on %B %e", function(d) { return +d -_+new Date() < 24*60*60*1000*365; }],
 _   _ _["%H:%M_on %B %e,_%Y",_function(d) {_return true; }]
    _ ]);
_     var_etaStr = dateFormat(eta);
 __ }

    var_statSel = module.sel.select("div.toc-section.stats");
   _if(statSel.empty()) {
   ___statSel = module.sel.select("div.toc").append("div.toc-section.stats");
  _ }

    statSel.text("You’re_averaging " 
_     + (getWordsPerMs()_*_1000 * 60).toFixed()