text: 
  
  /* web/extensions/timecode/wwvb.min.js */
  var wwvb={AMPL_NOISE_THRESHOLD:3,arm:0,PHASE_NOISE_THRESHOLD:15,prev_one_width:0,ph_sync:[0,0,0,1,1,1,0,1,1,0,1,0,0,0],inverted:0,sixmin_mode:0,cur:0,cnt:0,width:0,dcnt:0,tick:0,min:0,time0:0,time0_copy:0,line:0,end:null};function wwvb_sync(){var t=tc.raw.length,c=1;for(i=0;i<14;i++)if(tc.raw[t-(14-i)]!=wwvb.ph_sync[i]){c=0;break}if(!c)for(c=2,i=0;i<14;i++)if(tc.raw[t-(14-i)]!=(1^wwvb.ph_sync[i])){c=0;break}return 0!=c&&console.log("SYNC"+(2==c?"-I":"")+" dlen="+tc.raw.length),c}function wwvb_dmsg(t){w3_innerHTML("id-tc-wwvb",t)}function wwvb_legend(t){0==(3&wwvb.line++)&&(t?tc_dmsg("sync           ppppp m d mmmmmmmmm r mmmmmmmmm r mmmmmmm LL N LLL dddddd<br>"):tc_dmsg("M mmm0mmmm M00 hh0hhhh M00 dd0ddddMdddd 00 +-+ M DDDD 0 yyyyMyyyy 0 YSDD M<br>"))}function wwvb_ampl_decode(t){var c=(tc_gap_bcd(t,8,8,-1)+1)%60,d=tc_gap_bcd(t,18,7,-1),n=tc_gap_bcd(t,33,12,-1),e=tc_gap_bcd(t,53,9,-1);tc_dmsg("  day #"+n+" "+(e+2e3)+" "+d.leadingZeros(2)+":"+c.leadingZeros(2)+" UTC<br>"),tc_stat("lime","Time decoded: day #"+n+" "+(e+2e3)+" "+d.leadingZeros(2)+":"+c.leadingZeros(2)+" UTC")}function wwvb_clr(){var t=wwvb;t.arm=0,t.cnt=t.dcnt=0,t.prev_one_width=t.one_width=t.zero_width=0,t.line=0}function wwvb_ampl(t){var c=wwvb;if(tc.trig++,tc.trig>=100&&(tc.trig=0),(t=t>.95?1:0)==c.cur?c.cnt=0:(c.cnt++,c.cnt>c.AMPL_NOISE_THRESHOLD&&(c.cur=t,c.cnt=0,tc.data^=1,tc.data||(tc.state==tc.ACQ_SYNC&&c.prev_one_width>0&&c.prev_one_width<25&&c.one_width<25&&(tc_stat("cyan","Found sync"),tc.trig=-20,tc.sample_point=80,c.sec=0,c.msec=0,wwvb_legend(0),tc.raw=[],tc.state=tc.MIN_MARK),c.prev_one_width=c.one_width),tc.data?c.one_width=0:c.zero_width=0)),tc.data?c.one_width++:c.zero_width++,tc.state==tc.MIN_MARK||tc.state==tc.ACQ_DATA&&tc.sample_point==tc.trig){var d=tc.state==tc.MIN_MARK||c.one_width<=60?1:0;tc_dmsg(d),tc.raw[c.sec]=d,[0,8,11,18,21,33,35,38,39,43,44,53,54,58].includes(c.dcnt)&&tc_dmsg(" "),tc.state==tc.MIN_MARK&&(c.msec=990,tc.state=tc.ACQ_DATA),c.dcnt++,60==c.dcnt&&(wwvb_ampl_decode(tc.raw),wwvb_legend(0),tc.raw=[],c.sec=-1,c.dcnt=0)}c.msec+=10,1e3==c.msec&&(c.sec++,c.msec=0)}function wwvb_phase(t){var c=wwvb;if(tc.trig++,tc.trig>=100&&(tc.trig=0),t==c.cur?c.cnt=0:(c.cnt++,c.cnt>c.PHASE_NOISE_THRESHOLD&&(c.cur=t,c.cnt=0,tc.data^=1)),tc.data&&c.width++,-1==tc.sample_point&&tc.data_last!=tc.data&&(c.width>50&&c.width<110&&(tc.sample_point=tc.trig-1,tc.sample_point<0&&(tc.sample_point+=100),tc.start_point=1),c.width=0,tc.data_last=tc.data),tc.sample_point==tc.trig)if(tc.state==tc.ACQ_SYNC){if(tc.raw.push(tc.data),tc_dmsg(tc.data.toString()),tc.raw.length>=14){var d=wwvb_sync();c.inverted=0,2==d&&(c.inverted=1),d&&(tc_stat("cyan","Found sync"),tc_dmsg(" SYNC"+(c.inverted?"-inv<br>":"<br>")),wwvb_legend(1),tc_dmsg("00011101101000 "),c.dcnt=13,tc.state=tc.ACQ_DATA,tc.raw=[],c.min=0)}c.tick++,c.tick>60+c.ph_sync.length+5&&(tc_dmsg(" RESTART<br>"),tc.sample_point=-1,c.width=0,c.tick=0,tc.raw=[],c.min=0)}else if(tc.state==tc.ACQ_DATA){tc.raw.push(tc.data);var n=tc.data^c.inverted;if(tc_dmsg(n.toString()),[12,17,18,19,28,29,38,39,46,48,49,52].includes(c.dcnt)&&tc_dmsg(" "),(18==c.dcnt||c.dcnt>=20&&c.dcnt<=46&&29!=c.dcnt&&39!=c.dcnt)&&(c.min=(c.min<<1)+n),19==c.dcnt&&(c.time0_copy=n),46==c.dcnt&&(c.time0=n),tc.raw.length>=14&&12==c.dcnt)(d=wwvb_sync())?(1==d&&c.inverted||2==d&&!c.inverted)&&(tc_dmsg(" PHASE INVERSION<br>00011101101000 "),c.inverted^=1):(tc_dmsg(" RESYNC<br>"),tc.state=tc.ACQ_SYNC,tc.sample_point=-1,c.width=0,c.tick=0);if(58==c.dcnt){if(c.min&&c.time0_copy!=c.time0)tc_dmsg(" TIME BIT-0 MISMATCH");else if(c.min){var e=c.min-(tc.MpY+tc.MpD);e++;for(var i,a=2001;;){i=0==(3&a);var _=tc.MpY+(i?tc.MpD:0);if(!(e>_))break;e-=_,a++}for(var r=0;;){var m=tc.dim[r];1==r&&i&&m++;var w=tc.MpD*m;if(!(e>w))break;e-=w,r++}var s=Math.floor(e/tc.MpD);e-=s*tc.MpD;var o=Math.floor(e/60);e-=60*o,tc_dmsg(" "+(s+1)+" "+tc.mo[r]+" "+a+" "+o.leadingZeros(2)+":"+e.leadingZeros(2)+" UTC"),tc_stat("lime","Time decoded: "+(s+1)+" "+tc.mo[r]+" "+a+" "+o.leadingZeros(2)+":"+e.leadingZeros(2)+" UTC"),10!=e&&40!=e||(c.sixmin_mode=1)}tc_dmsg("<br>"),wwvb_legend(1),tc.raw=[],c.min=0}c.dcnt++,60==c.dcnt&&(c.dcnt=0),0==c.dcnt&&c.sixmin_mode&&(c.sixmin_mode=0,tc.state=tc.ACQ_DATA2)}else if(tc.state==tc.ACQ_DATA2){0==c.dcnt&&tc_dmsg("127b: "),127==c.dcnt&&tc_dmsg("<br>106b: "),233==c.dcnt&&tc_dmsg("<br>127b: ");n=tc.data^c.inverted;tc_dmsg(n.toString()),c.dcnt++,359==c.dcnt&&(tc_dmsg("<br>"),c.dcnt=0,tc.state=tc.ACQ_DATA,tc.raw=[],c.min=0)}return tc.data}function wwvb_focus(){}function wwvb_blur(){var t;(t=w3_el("id-tc-bits"))&&(t.innerHTML=""),(t=w3_el("id-tc-wwvb"))&&(t.innerHTML="")}function wwvb_init(){w3_el("id-tc-addon").innerHTML+=w3_div("id-tc-bits")+w3_div("id-tc-wwvb")}