-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathforcedirected.js
1 lines (1 loc) · 115 KB
/
forcedirected.js
1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.forcedirected=e():t.forcedirected=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=61)}({38:function(t,e,n){var r={};!function(t){function e(t){for(var e="",n=t.length-1;n>=0;)e+=t.charAt(n--);return e}function n(t,e){for(var n="";n.length<e;)n+=t;return n}function r(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}function i(t,e){var r=""+t;return r.length>=e?r:n(" ",e-r.length)+r}function a(t,e){var r=""+t;return r.length>=e?r:r+n(" ",e-r.length)}t.version="0.11.2";var o=Math.pow(2,32);function u(t,e){return t>o||t<-o?function(t,e){var r=""+Math.round(t);return r.length>=e?r:n("0",e-r.length)+r}(t,e):function(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}(Math.round(t),e)}function s(t,e){return e=e||0,t.length>=7+e&&103==(32|t.charCodeAt(e))&&101==(32|t.charCodeAt(e+1))&&110==(32|t.charCodeAt(e+2))&&101==(32|t.charCodeAt(e+3))&&114==(32|t.charCodeAt(e+4))&&97==(32|t.charCodeAt(e+5))&&108==(32|t.charCodeAt(e+6))}var l=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],c=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function f(t){t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "'}var h={};f(h);var g=[],d=0;for(d=5;d<=8;++d)g[d]=32+d;for(d=23;d<=26;++d)g[d]=0;for(d=27;d<=31;++d)g[d]=14;for(d=50;d<=58;++d)g[d]=14;for(d=59;d<=62;++d)g[d]=d-58;for(d=67;d<=68;++d)g[d]=d-58;for(d=72;d<=75;++d)g[d]=d-58;for(d=67;d<=68;++d)g[d]=d-57;for(d=76;d<=78;++d)g[d]=d-56;for(d=79;d<=81;++d)g[d]=d-34;var p=[];function v(t,e,n){for(var r=t<0?-1:1,i=t*r,a=0,o=1,u=0,s=1,l=0,c=0,f=Math.floor(i);l<e&&(u=(f=Math.floor(i))*o+a,c=f*l+s,!(i-f<5e-8));)i=1/(i-f),a=o,o=u,s=l,l=c;if(c>e&&(l>e?(c=s,u=a):(c=l,u=o)),!n)return[0,r*u,c];var h=Math.floor(r*u/c);return[h,r*u-h*c,c]}function y(t,e,n){if(t>2958465||t<0)return null;var r=0|t,i=Math.floor(86400*(t-r)),a=0,o=[],u={D:r,T:i,u:86400*(t-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(u.u)<1e-6&&(u.u=0),e&&e.date1904&&(r+=1462),u.u>.9999&&(u.u=0,86400==++i&&(u.T=i=0,++r,++u.D)),60===r)o=n?[1317,10,29]:[1900,2,29],a=3;else if(0===r)o=n?[1317,8,29]:[1900,1,0],a=6;else{r>60&&--r;var s=new Date(1900,0,1);s.setDate(s.getDate()+r-1),o=[s.getFullYear(),s.getMonth()+1,s.getDate()],a=s.getDay(),r<60&&(a=(a+6)%7),n&&(a=function(t,e){e[0]-=581;var n=t.getDay();return t<60&&(n=(n+6)%7),n}(s,o))}return u.y=o[0],u.m=o[1],u.d=o[2],u.S=i%60,i=Math.floor(i/60),u.M=i%60,i=Math.floor(i/60),u.H=i,u.q=a,u}p[5]=p[63]='"$"#,##0_);\\("$"#,##0\\)',p[6]=p[64]='"$"#,##0_);[Red]\\("$"#,##0\\)',p[7]=p[65]='"$"#,##0.00_);\\("$"#,##0.00\\)',p[8]=p[66]='"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',p[41]='_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',p[42]='_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',p[43]='_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',p[44]='_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)',t.parse_date_code=y;var m=new Date(1899,11,31,0,0,0),_=m.getTime(),b=new Date(1900,2,1,0,0,0);function w(t,e){var n=t.getTime();return e?n-=1262304e5:t>=b&&(n+=864e5),(n-(_+6e4*(t.getTimezoneOffset()-m.getTimezoneOffset())))/864e5}t._general_int=function(t){return t.toString(10)};var x=function(){var t=/(?:\.0*|(\.\d*[1-9])0+)$/;function e(e){return-1==e.indexOf(".")?e:e.replace(t,"$1")}var n=/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,r=/(E[+-])(\d)$/;return function(t){var i=Math.floor(Math.log(Math.abs(t))*Math.LOG10E);return e(function(t){return-1==t.indexOf("E")?t:t.replace(n,"$1E").replace(r,"$10$2")}((i>=-4&&i<=-1?t.toPrecision(10+i):Math.abs(i)<=9?function(t){var n=t<0?12:11,r=e(t.toFixed(12));return r.length<=n||(r=t.toPrecision(10)).length<=n?r:t.toExponential(5)}(t):10===i?t.toFixed(10).substr(0,12):function(t){var n=e(t.toFixed(11));return n.length>(t<0?12:11)||"0"===n||"-0"===n?t.toPrecision(6):n}(t)).toUpperCase()))}}();function M(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(0|t)===t?t.toString(10):x(t);case"undefined":return"";case"object":if(null==t)return"";if(t instanceof Date)return D(14,w(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function A(t,e,n,i){var a,o="",u=0,s=0,f=n.y,h=0;switch(t){case 98:f=n.y+543;case 121:switch(e.length){case 1:case 2:a=f%100,h=2;break;default:a=f%1e4,h=4}break;case 109:switch(e.length){case 1:case 2:a=n.m,h=e.length;break;case 3:return c[n.m-1][1];case 5:return c[n.m-1][0];default:return c[n.m-1][2]}break;case 100:switch(e.length){case 1:case 2:a=n.d,h=e.length;break;case 3:return l[n.q][0];default:return l[n.q][1]}break;case 104:switch(e.length){case 1:case 2:a=1+(n.H+11)%12,h=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:a=n.H,h=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:a=n.M,h=e.length;break;default:throw"bad minute format: "+e}break;case 115:if("s"!=e&&"ss"!=e&&".0"!=e&&".00"!=e&&".000"!=e)throw"bad second format: "+e;return 0!==n.u||"s"!=e&&"ss"!=e?(s=i>=2?3===i?1e3:100:1===i?10:1,(u=Math.round(s*(n.S+n.u)))>=60*s&&(u=0),"s"===e?0===u?"0":""+u/s:(o=r(u,2+i),"ss"===e?o.substr(0,2):"."+o.substr(2,e.length-1))):r(n.S,e.length);case 90:switch(e){case"[h]":case"[hh]":a=24*n.D+n.H;break;case"[m]":case"[mm]":a=60*(24*n.D+n.H)+n.M;break;case"[s]":case"[ss]":a=60*(60*(24*n.D+n.H)+n.M)+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+e}h=3===e.length?1:2;break;case 101:a=f,h=1}return h>0?r(a,h):""}function k(t){if(t.length<=3)return t;for(var e=t.length%3,n=t.substr(0,e);e!=t.length;e+=3)n+=(n.length>0?",":"")+t.substr(e,3);return n}t._general_num=x,t._general=M,"๐๑๒๓๔๕๖๗๘๙".split("");var C=function(){var t=/%/g,o=/# (\?+)( ?)\/( ?)(\d+)/,s=/^#*0*\.([0#]+)/,l=/\).*[0#]/,c=/\(###\) ###\\?-####/;function f(t){for(var e,n="",r=0;r!=t.length;++r)switch(e=t.charCodeAt(r)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(e)}return n}function h(t,e){var n=Math.pow(10,e);return""+Math.round(t*n)/n}function g(t,e){var n=t-Math.floor(t),r=Math.pow(10,e);return e<(""+Math.round(n*r)).length?0:Math.round(n*r)}function d(p,y,m){if(40===p.charCodeAt(0)&&!y.match(l)){var _=y.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return m>=0?d("n",_,m):"("+d("n",_,-m)+")"}if(44===y.charCodeAt(y.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return C(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(p,y,m);if(-1!==y.indexOf("%"))return function(e,r,i){var a=r.replace(t,""),o=r.length-a.length;return C(e,a,i*Math.pow(10,2*o))+n("%",o)}(p,y,m);if(-1!==y.indexOf("E"))return function t(e,n){var r,i=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+t(e,-n);var a=e.indexOf(".");-1===a&&(a=e.indexOf("E"));var o=Math.floor(Math.log(n)*Math.LOG10E)%a;if(o<0&&(o+=a),-1===(r=(n/Math.pow(10,o)).toPrecision(i+1+(a+o)%a)).indexOf("e")){var u=Math.floor(Math.log(n)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(u-r.length+o):r+="E+"+(u-o);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,a)+"."+r.substr(2+a)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(a+o)%a)+"."+r.substr(o)+"E"}))}else r=n.toExponential(i);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(y,m);if(36===y.charCodeAt(0))return"$"+d(p,y.substr(" "==y.charAt(1)?2:1),m);var b,w,x,M,A=Math.abs(m),T=m<0?"-":"";if(y.match(/^00+$/))return T+u(A,y.length);if(y.match(/^[#?]+$/))return"0"===(b=u(m,0))&&(b=""),b.length>y.length?b:f(y.substr(0,y.length-b.length))+b;if(w=y.match(o))return function(t,e,a){var o=parseInt(t[4],10),u=Math.round(e*o),s=Math.floor(u/o),l=u-s*o,c=o;return a+(0===s?"":""+s)+" "+(0===l?n(" ",t[1].length+1+t[4].length):i(l,t[1].length)+t[2]+"/"+t[3]+r(c,t[4].length))}(w,A,T);if(y.match(/^#+0+$/))return T+u(A,y.length-y.indexOf("0"));if(w=y.match(s))return b=h(m,w[1].length).replace(/^([^\.]+)$/,"$1."+f(w[1])).replace(/\.$/,"."+f(w[1])).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(w[1]).length-e.length)})),-1!==y.indexOf("0.")?b:b.replace(/^0\./,".");if(y=y.replace(/^#+([0.])/,"$1"),w=y.match(/^(0*)\.(#*)$/))return T+h(A,w[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,w[1].length?"0.":".");if(w=y.match(/^#{1,3},##0(\.?)$/))return T+k(u(A,0));if(w=y.match(/^#,##0\.([#0]*0)$/))return m<0?"-"+d(p,y,-m):k(""+(Math.floor(m)+function(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}(m,w[1].length)))+"."+r(g(m,w[1].length),w[1].length);if(w=y.match(/^#,#*,#0/))return d(p,y.replace(/^#,#*,/,""),m);if(w=y.match(/^([0#]+)(\\?-([0#]+))+$/))return b=e(d(p,y.replace(/[\\-]/g,""),m)),x=0,e(e(y.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return x<b.length?b.charAt(x++):"0"===t?"0":""})));if(y.match(c))return"("+(b=d(p,"##########",m)).substr(0,3)+") "+b.substr(3,3)+"-"+b.substr(6);var N="";if(w=y.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return x=Math.min(w[4].length,7),M=v(A,Math.pow(10,x)-1,!1),b=""+T," "==(N=C("n",w[1],M[1])).charAt(N.length-1)&&(N=N.substr(0,N.length-1)+"0"),b+=N+w[2]+"/"+w[3],(N=a(M[2],x)).length<w[4].length&&(N=f(w[4].substr(w[4].length-N.length))+N),b+=N;if(w=y.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return x=Math.min(Math.max(w[1].length,w[4].length),7),T+((M=v(A,Math.pow(10,x)-1,!0))[0]||(M[1]?"":"0"))+" "+(M[1]?i(M[1],x)+w[2]+"/"+w[3]+a(M[2],x):n(" ",2*x+1+w[2].length+w[3].length));if(w=y.match(/^[#0?]+$/))return b=u(m,0),y.length<=b.length?b:f(y.substr(0,y.length-b.length))+b;if(w=y.match(/^([#0?]+)\.([#0]+)$/)){b=""+m.toFixed(Math.min(w[2].length,10)).replace(/([^0])0+$/,"$1"),x=b.indexOf(".");var E=y.indexOf(".")-x,S=y.length-b.length-E;return f(y.substr(0,E)+b+y.substr(y.length-S))}if(w=y.match(/^00,000\.([#0]*0)$/))return x=g(m,w[1].length),m<0?"-"+d(p,y,-m):k(function(t){return t<2147483647&&t>-2147483648?""+(t>=0?0|t:t-1|0):""+Math.floor(t)}(m)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(x,w[1].length);switch(y){case"###,##0.00":return d(p,"#,##0.00",m);case"###,###":case"##,###":case"#,###":var U=k(u(A,0));return"0"!==U?T+U:"";case"###,###.00":return d(p,"###,##0.00",m).replace(/^0\./,".");case"#,###.00":return d(p,"#,##0.00",m).replace(/^0\./,".")}throw new Error("unsupported format |"+y+"|")}function p(u,h,g){if(40===u.charCodeAt(0)&&!h.match(l)){var d=h.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return g>=0?p("n",d,g):"("+p("n",d,-g)+")"}if(44===h.charCodeAt(h.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return C(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(u,h,g);if(-1!==h.indexOf("%"))return function(e,r,i){var a=r.replace(t,""),o=r.length-a.length;return C(e,a,i*Math.pow(10,2*o))+n("%",o)}(u,h,g);if(-1!==h.indexOf("E"))return function t(e,n){var r,i=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==n)return"0.0E+0";if(n<0)return"-"+t(e,-n);var a=e.indexOf(".");-1===a&&(a=e.indexOf("E"));var o=Math.floor(Math.log(n)*Math.LOG10E)%a;if(o<0&&(o+=a),!(r=(n/Math.pow(10,o)).toPrecision(i+1+(a+o)%a)).match(/[Ee]/)){var u=Math.floor(Math.log(n)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(u-r.length+o):r+="E+"+(u-o),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(a+o)%a)+"."+r.substr(o)+"E"}))}else r=n.toExponential(i);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}(h,g);if(36===h.charCodeAt(0))return"$"+p(u,h.substr(" "==h.charAt(1)?2:1),g);var y,m,_,b,w=Math.abs(g),x=g<0?"-":"";if(h.match(/^00+$/))return x+r(w,h.length);if(h.match(/^[#?]+$/))return y=""+g,0===g&&(y=""),y.length>h.length?y:f(h.substr(0,h.length-y.length))+y;if(m=h.match(o))return function(t,e,r){return r+(0===e?"":""+e)+n(" ",t[1].length+2+t[4].length)}(m,w,x);if(h.match(/^#+0+$/))return x+r(w,h.length-h.indexOf("0"));if(m=h.match(s))return y=(y=(""+g).replace(/^([^\.]+)$/,"$1."+f(m[1])).replace(/\.$/,"."+f(m[1]))).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(m[1]).length-e.length)})),-1!==h.indexOf("0.")?y:y.replace(/^0\./,".");if(h=h.replace(/^#+([0.])/,"$1"),m=h.match(/^(0*)\.(#*)$/))return x+(""+w).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,m[1].length?"0.":".");if(m=h.match(/^#{1,3},##0(\.?)$/))return x+k(""+w);if(m=h.match(/^#,##0\.([#0]*0)$/))return g<0?"-"+p(u,h,-g):k(""+g)+"."+n("0",m[1].length);if(m=h.match(/^#,#*,#0/))return p(u,h.replace(/^#,#*,/,""),g);if(m=h.match(/^([0#]+)(\\?-([0#]+))+$/))return y=e(p(u,h.replace(/[\\-]/g,""),g)),_=0,e(e(h.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return _<y.length?y.charAt(_++):"0"===t?"0":""})));if(h.match(c))return"("+(y=p(u,"##########",g)).substr(0,3)+") "+y.substr(3,3)+"-"+y.substr(6);var M="";if(m=h.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return _=Math.min(m[4].length,7),b=v(w,Math.pow(10,_)-1,!1),y=""+x," "==(M=C("n",m[1],b[1])).charAt(M.length-1)&&(M=M.substr(0,M.length-1)+"0"),y+=M+m[2]+"/"+m[3],(M=a(b[2],_)).length<m[4].length&&(M=f(m[4].substr(m[4].length-M.length))+M),y+=M;if(m=h.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return _=Math.min(Math.max(m[1].length,m[4].length),7),x+((b=v(w,Math.pow(10,_)-1,!0))[0]||(b[1]?"":"0"))+" "+(b[1]?i(b[1],_)+m[2]+"/"+m[3]+a(b[2],_):n(" ",2*_+1+m[2].length+m[3].length));if(m=h.match(/^[#0?]+$/))return y=""+g,h.length<=y.length?y:f(h.substr(0,h.length-y.length))+y;if(m=h.match(/^([#0]+)\.([#0]+)$/)){y=""+g.toFixed(Math.min(m[2].length,10)).replace(/([^0])0+$/,"$1"),_=y.indexOf(".");var A=h.indexOf(".")-_,T=h.length-y.length-A;return f(h.substr(0,A)+y+h.substr(h.length-T))}if(m=h.match(/^00,000\.([#0]*0)$/))return g<0?"-"+p(u,h,-g):k(""+g).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(0,m[1].length);switch(h){case"###,###":case"##,###":case"#,###":var N=k(""+w);return"0"!==N?x+N:"";default:if(h.match(/\.[0#?]*$/))return p(u,h.slice(0,h.lastIndexOf(".")),g)+f(h.slice(h.lastIndexOf(".")))}throw new Error("unsupported format |"+h+"|")}return function(t,e,n){return(0|n)===n?p(t,e,n):d(t,e,n)}}();function T(t){for(var e=[],n=!1,r=0,i=0;r<t.length;++r)switch(t.charCodeAt(r)){case 34:n=!n;break;case 95:case 42:case 92:++r;break;case 59:e[e.length]=t.substr(i,r-i),i=r+1}if(e[e.length]=t.substr(i),!0===n)throw new Error("Format |"+t+"| unterminated string ");return e}t._split=T;var N=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function E(t){for(var e=0,n="",r="";e<t.length;)switch(n=t.charAt(e)){case"G":s(t,e)&&(e+=6),e++;break;case'"':for(;34!==t.charCodeAt(++e)&&e<t.length;);++e;break;case"\\":case"_":e+=2;break;case"@":++e;break;case"B":case"b":if("1"===t.charAt(e+1)||"2"===t.charAt(e+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===t.substr(e,3).toUpperCase())return!0;if("AM/PM"===t.substr(e,5).toUpperCase())return!0;if("上午/下午"===t.substr(e,5).toUpperCase())return!0;++e;break;case"[":for(r=n;"]"!==t.charAt(e++)&&e<t.length;)r+=t.charAt(e);if(r.match(N))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(n=t.charAt(++e))>-1||"\\"==n&&"-"==t.charAt(e+1)&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===n;);break;case"*":++e," "!=t.charAt(e)&&"*"!=t.charAt(e)||++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;case" ":default:++e}return!1}function S(t,e,n,r){for(var i,a,o,u=[],l="",c=0,f="",h="t",g="H";c<t.length;)switch(f=t.charAt(c)){case"G":if(!s(t,c))throw new Error("unrecognized character "+f+" in "+t);u[u.length]={t:"G",v:"General"},c+=7;break;case'"':for(l="";34!==(o=t.charCodeAt(++c))&&c<t.length;)l+=String.fromCharCode(o);u[u.length]={t:"t",v:l},++c;break;case"\\":var d=t.charAt(++c),p="("===d||")"===d?d:"t";u[u.length]={t:p,v:d},++c;break;case"_":u[u.length]={t:"t",v:" "},c+=2;break;case"@":u[u.length]={t:"T",v:e},++c;break;case"B":case"b":if("1"===t.charAt(c+1)||"2"===t.charAt(c+1)){if(null==i&&null==(i=y(e,n,"2"===t.charAt(c+1))))return"";u[u.length]={t:"X",v:t.substr(c,2)},h=f,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":f=f.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0)return"";if(null==i&&null==(i=y(e,n)))return"";for(l=f;++c<t.length&&t.charAt(c).toLowerCase()===f;)l+=f;"m"===f&&"h"===h.toLowerCase()&&(f="M"),"h"===f&&(f=g),u[u.length]={t:f,v:l},h=f;break;case"A":case"a":case"上":var v={t:f,v:f};if(null==i&&(i=y(e,n)),"A/P"===t.substr(c,3).toUpperCase()?(null!=i&&(v.v=i.H>=12?"P":"A"),v.t="T",g="h",c+=3):"AM/PM"===t.substr(c,5).toUpperCase()?(null!=i&&(v.v=i.H>=12?"PM":"AM"),v.t="T",c+=5,g="h"):"上午/下午"===t.substr(c,5).toUpperCase()?(null!=i&&(v.v=i.H>=12?"下午":"上午"),v.t="T",c+=5,g="h"):(v.t="t",++c),null==i&&"T"===v.t)return"";u[u.length]=v,h=f;break;case"[":for(l=f;"]"!==t.charAt(c++)&&c<t.length;)l+=t.charAt(c);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(N)){if(null==i&&null==(i=y(e,n)))return"";u[u.length]={t:"Z",v:l.toLowerCase()},h=l.charAt(1)}else l.indexOf("$")>-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",E(t)||(u[u.length]={t:"t",v:l}));break;case".":if(null!=i){for(l=f;++c<t.length&&"0"===(f=t.charAt(c));)l+=f;u[u.length]={t:"s",v:l};break}case"0":case"#":for(l=f;++c<t.length&&"0#?.,E+-%".indexOf(f=t.charAt(c))>-1;)l+=f;u[u.length]={t:"n",v:l};break;case"?":for(l=f;t.charAt(++c)===f;)l+=f;u[u.length]={t:f,v:l},h=f;break;case"*":++c," "!=t.charAt(c)&&"*"!=t.charAt(c)||++c;break;case"(":case")":u[u.length]={t:1===r?"t":f,v:f},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=f;c<t.length&&"0123456789".indexOf(t.charAt(++c))>-1;)l+=t.charAt(c);u[u.length]={t:"D",v:l};break;case" ":u[u.length]={t:f,v:f},++c;break;case"$":u[u.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(f))throw new Error("unrecognized character "+f+" in "+t);u[u.length]={t:"t",v:f},++c}var m,_=0,b=0;for(c=u.length-1,h="t";c>=0;--c)switch(u[c].t){case"h":case"H":u[c].t=g,h="h",_<1&&(_=1);break;case"s":(m=u[c].v.match(/\.0+$/))&&(b=Math.max(b,m[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":h=u[c].t;break;case"m":"s"===h&&(u[c].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&u[c].v.match(/[Hh]/)&&(_=1),_<2&&u[c].v.match(/[Mm]/)&&(_=2),_<3&&u[c].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M),i.M>=60&&(i.M=0,++i.H);break;case 2:i.u>=.5&&(i.u=0,++i.S),i.S>=60&&(i.S=0,++i.M)}var w,x="";for(c=0;c<u.length;++c)switch(u[c].t){case"t":case"T":case" ":case"D":break;case"X":u[c].v="",u[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":u[c].v=A(u[c].t.charCodeAt(0),u[c].v,i,b),u[c].t="t";break;case"n":case"?":for(w=c+1;null!=u[w]&&("?"===(f=u[w].t)||"D"===f||(" "===f||"t"===f)&&null!=u[w+1]&&("?"===u[w+1].t||"t"===u[w+1].t&&"/"===u[w+1].v)||"("===u[c].t&&(" "===f||"n"===f||")"===f)||"t"===f&&("/"===u[w].v||" "===u[w].v&&null!=u[w+1]&&"?"==u[w+1].t));)u[c].v+=u[w].v,u[w]={v:"",t:";"},++w;x+=u[c].v,c=w-1;break;case"G":u[c].t="t",u[c].v=M(e,n)}var k,T,S="";if(x.length>0){40==x.charCodeAt(0)?(k=e<0&&45===x.charCodeAt(0)?-e:e,T=C("n",x,k)):(T=C("n",x,k=e<0&&r>1?-e:e),k<0&&u[0]&&"t"==u[0].t&&(T=T.substr(1),u[0].v="-"+u[0].v)),w=T.length-1;var U=u.length;for(c=0;c<u.length;++c)if(null!=u[c]&&"t"!=u[c].t&&u[c].v.indexOf(".")>-1){U=c;break}var $=u.length;if(U===u.length&&-1===T.indexOf("E")){for(c=u.length-1;c>=0;--c)null!=u[c]&&-1!=="n?".indexOf(u[c].t)&&(w>=u[c].v.length-1?(w-=u[c].v.length,u[c].v=T.substr(w+1,u[c].v.length)):w<0?u[c].v="":(u[c].v=T.substr(0,w+1),w=-1),u[c].t="t",$=c);w>=0&&$<u.length&&(u[$].v=T.substr(0,w+1)+u[$].v)}else if(U!==u.length&&-1===T.indexOf("E")){for(w=T.indexOf(".")-1,c=U;c>=0;--c)if(null!=u[c]&&-1!=="n?".indexOf(u[c].t)){for(a=u[c].v.indexOf(".")>-1&&c===U?u[c].v.indexOf(".")-1:u[c].v.length-1,S=u[c].v.substr(a+1);a>=0;--a)w>=0&&("0"===u[c].v.charAt(a)||"#"===u[c].v.charAt(a))&&(S=T.charAt(w--)+S);u[c].v=S,u[c].t="t",$=c}for(w>=0&&$<u.length&&(u[$].v=T.substr(0,w+1)+u[$].v),w=T.indexOf(".")+1,c=U;c<u.length;++c)if(null!=u[c]&&(-1!=="n?(".indexOf(u[c].t)||c===U)){for(a=u[c].v.indexOf(".")>-1&&c===U?u[c].v.indexOf(".")+1:0,S=u[c].v.substr(0,a);a<u[c].v.length;++a)w<T.length&&(S+=T.charAt(w++));u[c].v=S,u[c].t="t",$=c}}}for(c=0;c<u.length;++c)null!=u[c]&&"n?".indexOf(u[c].t)>-1&&(k=r>1&&e<0&&c>0&&"-"===u[c-1].v?-e:e,u[c].v=C(u[c].t,u[c].v,k),u[c].t="t");var L="";for(c=0;c!==u.length;++c)null!=u[c]&&(L+=u[c].v);return L}t.is_date=E,t._eval=S;var U=/\[[=<>]/,$=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function L(t,e){if(null==e)return!1;var n=parseFloat(e[2]);switch(e[1]){case"=":if(t==n)return!0;break;case">":if(t>n)return!0;break;case"<":if(t<n)return!0;break;case"<>":if(t!=n)return!0;break;case">=":if(t>=n)return!0;break;case"<=":if(t<=n)return!0}return!1}function D(t,e,n){null==n&&(n={});var r="";switch(typeof t){case"string":r="m/d/yy"==t&&n.dateNF?n.dateNF:t;break;case"number":null==(r=14==t&&n.dateNF?n.dateNF:(null!=n.table?n.table:h)[t])&&(r=n.table&&n.table[g[t]]||h[g[t]]),null==r&&(r=p[t]||"General")}if(s(r,0))return M(e,n);e instanceof Date&&(e=w(e,n.date1904));var i=function(t,e){var n=T(t),r=n.length,i=n[r-1].indexOf("@");if(r<4&&i>-1&&--r,n.length>4)throw new Error("cannot find right format for |"+n.join("|")+"|");if("number"!=typeof e)return[4,4===n.length||i>-1?n[n.length-1]:"@"];switch(n.length){case 1:n=i>-1?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=i>-1?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=i>-1?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"]}var a=e>0?n[0]:e<0?n[1]:n[2];if(-1===n[0].indexOf("[")&&-1===n[1].indexOf("["))return[r,a];if(null!=n[0].match(U)||null!=n[1].match(U)){var o=n[0].match($),u=n[1].match($);return L(e,o)?[r,n[0]]:L(e,u)?[r,n[1]]:[r,n[null!=o&&null!=u?2:1]]}return[r,a]}(r,e);if(s(i[1]))return M(e,n);if(!0===e)e="TRUE";else if(!1===e)e="FALSE";else if(""===e||null==e)return"";return S(i[1],e,n,i[0])}function O(t,e){if("number"!=typeof e){e=+e||-1;for(var n=0;n<392;++n)if(null!=h[n]){if(h[n]==t){e=n;break}}else e<0&&(e=n);e<0&&(e=391)}return h[e]=t,e}t.load=O,t._table=h,t.get_table=function(){return h},t.load_table=function(t){for(var e=0;392!=e;++e)void 0!==t[e]&&O(t[e],e)},t.init_table=f,t.format=D}(r),"undefined"==typeof DO_NOT_EXPORT_SSF&&(t.exports=r)},61:function(t,e,n){"use strict";n.r(e);var r=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},i=function(t){return 1===t.length&&(t=function(t){return function(e,n){return r(t(e),n)}}(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}(r);i.right,i.left;var a=Array.prototype;a.slice,a.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2),Array.prototype.slice;var o={value:function(){}};function u(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new s(r)}function s(t){this._=t}function l(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function c(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=o,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}s.prototype=u.prototype={constructor:s,on:function(t,e){var n,r=this._,i=function(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(n=(t=i[a]).type)r[n]=c(r[n],t.name,e);else if(null==e)for(n in r)r[n]=c(r[n],t.name,null);return this}for(;++a<o;)if((n=(t=i[a]).type)&&(n=l(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new s(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var f=u;function h(){}var g=function(t){return null==t?h:function(){return this.querySelector(t)}};function d(){return[]}var p=function(t){return null==t?d:function(){return this.querySelectorAll(t)}},v=function(t){return function(){return this.matches(t)}},y=function(t){return new Array(t.length)};function m(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}m.prototype={constructor:m,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function _(t,e,n,r,i,a){for(var o,u=0,s=e.length,l=a.length;u<l;++u)(o=e[u])?(o.__data__=a[u],r[u]=o):n[u]=new m(t,a[u]);for(;u<s;++u)(o=e[u])&&(i[u]=o)}function b(t,e,n,r,i,a,o){var u,s,l,c={},f=e.length,h=a.length,g=new Array(f);for(u=0;u<f;++u)(s=e[u])&&(g[u]=l="$"+o.call(s,s.__data__,u,e),l in c?i[u]=s:c[l]=s);for(u=0;u<h;++u)(s=c[l="$"+o.call(t,a[u],u,a)])?(r[u]=s,s.__data__=a[u],c[l]=null):n[u]=new m(t,a[u]);for(u=0;u<f;++u)(s=e[u])&&c[g[u]]===s&&(i[u]=s)}function w(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var x="http://www.w3.org/1999/xhtml",M={svg:"http://www.w3.org/2000/svg",xhtml:x,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},A=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),M.hasOwnProperty(e)?{space:M[e],local:t}:t},k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function C(t,e){return t.style.getPropertyValue(e)||k(t).getComputedStyle(t,null).getPropertyValue(e)}function T(t){return t.trim().split(/^|\s+/)}function N(t){return t.classList||new E(t)}function E(t){this._node=t,this._names=T(t.getAttribute("class")||"")}function S(t,e){for(var n=N(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function U(t,e){for(var n=N(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function $(){this.textContent=""}function L(){this.innerHTML=""}function D(){this.nextSibling&&this.parentNode.appendChild(this)}function O(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}E.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var F=function(t){var e=A(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===x&&e.documentElement.namespaceURI===x?e.createElement(t):e.createElementNS(n,t)}})(e)};function P(){return null}function R(){var t=this.parentNode;t&&t.removeChild(this)}function H(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function q(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var Y={},z=null;function G(t,e,n){return t=j(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function j(t,e,n){return function(r){var i=z;z=r;try{t.call(this,this.__data__,e,n)}finally{z=i}}}function X(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function I(t,e,n){var r=Y.hasOwnProperty(t.type)?G:j;return function(i,a,o){var u,s=this.__on,l=r(e,a,o);if(s)for(var c=0,f=s.length;c<f;++c)if((u=s[c]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=l,u.capture=n),void(u.value=e);this.addEventListener(t.type,l,n),u={type:t.type,name:t.name,value:e,listener:l,capture:n},s?s.push(u):this.__on=[u]}}function V(t,e,n,r){var i=z;t.sourceEvent=z,z=t;try{return e.apply(n,r)}finally{z=i}}function Z(t,e,n){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Y={mouseenter:"mouseover",mouseleave:"mouseout"}));var B=[null];function J(t,e){this._groups=t,this._parents=e}function W(){return new J([[document.documentElement]],B)}J.prototype=W.prototype={constructor:J,select:function(t){"function"!=typeof t&&(t=g(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o,u=e[i],s=u.length,l=r[i]=new Array(s),c=0;c<s;++c)(a=u[c])&&(o=t.call(a,a.__data__,c,u))&&("__data__"in a&&(o.__data__=a.__data__),l[c]=o);return new J(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=p(t));for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o,u=e[a],s=u.length,l=0;l<s;++l)(o=u[l])&&(r.push(t.call(o,o.__data__,l,u)),i.push(o));return new J(r,i)},filter:function(t){"function"!=typeof t&&(t=v(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],u=o.length,s=r[i]=[],l=0;l<u;++l)(a=o[l])&&t.call(a,a.__data__,l,o)&&s.push(a);return new J(r,this._parents)},data:function(t,e){if(!t)return g=new Array(this.size()),l=-1,this.each((function(t){g[++l]=t})),g;var n=e?b:_,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var c=r[l],f=i[l],h=f.length,g=t.call(c,c&&c.__data__,l,r),d=g.length,p=u[l]=new Array(d),v=o[l]=new Array(d);n(c,f,p,v,s[l]=new Array(h),g,e);for(var y,m,w=0,x=0;w<d;++w)if(y=p[w]){for(w>=x&&(x=w+1);!(m=v[x])&&++x<d;);y._next=m||null}}return(o=new J(o,r))._enter=u,o._exit=s,o},enter:function(){return new J(this._enter||this._groups.map(y),this._parents)},exit:function(){return new J(this._exit||this._groups.map(y),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s,l=e[u],c=n[u],f=l.length,h=o[u]=new Array(f),g=0;g<f;++g)(s=l[g]||c[g])&&(h[g]=s);for(;u<r;++u)o[u]=e[u];return new J(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=w);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,u=n[a],s=u.length,l=i[a]=new Array(s),c=0;c<s;++c)(o=u[c])&&(l[c]=o);l.sort(e)}return new J(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],o=0,u=a.length;o<u;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=A(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):C(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=T(t+"");if(arguments.length<2){for(var r=N(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?S:U)(this,t)}}:e?function(t){return function(){S(this,t)}}:function(t){return function(){U(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?$:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?L:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(D)},lower:function(){return this.each(O)},append:function(t){var e="function"==typeof t?t:F(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:F(t),r=null==e?P:"function"==typeof e?e:g(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(R)},clone:function(t){return this.select(t?q:H)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(u=e?I:X,null==n&&(n=!1),r=0;r<o;++r)this.each(u(a[r],e,n));return this}var u=this.node().__on;if(u)for(var s,l=0,c=u.length;l<c;++l)for(r=0,s=u[l];r<o;++r)if((i=a[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return Z(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return Z(this,t,e)}})(t,e))}};var Q=W,K=function(t){return"string"==typeof t?new J([[document.querySelector(t)]],[document.documentElement]):new J([[t]],B)};function tt(){z.stopImmediatePropagation()}var et=function(){z.preventDefault(),z.stopImmediatePropagation()},nt=function(t){var e=t.document.documentElement,n=K(t).on("dragstart.drag",et,!0);"onselectstart"in e?n.on("selectstart.drag",et,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};var rt=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function it(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function at(){}var ot="\\s*([+-]?\\d+)\\s*",ut="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",st="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lt=/^#([0-9a-f]{3,8})$/,ct=new RegExp("^rgb\\("+[ot,ot,ot]+"\\)$"),ft=new RegExp("^rgb\\("+[st,st,st]+"\\)$"),ht=new RegExp("^rgba\\("+[ot,ot,ot,ut]+"\\)$"),gt=new RegExp("^rgba\\("+[st,st,st,ut]+"\\)$"),dt=new RegExp("^hsl\\("+[ut,st,st]+"\\)$"),pt=new RegExp("^hsla\\("+[ut,st,st,ut]+"\\)$"),vt={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,rebeccapurple:6697881,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};function yt(){return this.rgb().formatHex()}function mt(){return this.rgb().formatRgb()}function _t(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=lt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?bt(e):3===n?new Mt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?wt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?wt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ct.exec(t))?new Mt(e[1],e[2],e[3],1):(e=ft.exec(t))?new Mt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ht.exec(t))?wt(e[1],e[2],e[3],e[4]):(e=gt.exec(t))?wt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dt.exec(t))?Tt(e[1],e[2]/100,e[3]/100,1):(e=pt.exec(t))?Tt(e[1],e[2]/100,e[3]/100,e[4]):vt.hasOwnProperty(t)?bt(vt[t]):"transparent"===t?new Mt(NaN,NaN,NaN,0):null}function bt(t){return new Mt(t>>16&255,t>>8&255,255&t,1)}function wt(t,e,n,r){return r<=0&&(t=e=n=NaN),new Mt(t,e,n,r)}function xt(t,e,n,r){return 1===arguments.length?function(t){return t instanceof at||(t=_t(t)),t?new Mt((t=t.rgb()).r,t.g,t.b,t.opacity):new Mt}(t):new Mt(t,e,n,null==r?1:r)}function Mt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function At(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)}function kt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ct(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Tt(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Et(t,e,n,r)}function Nt(t){if(t instanceof Et)return new Et(t.h,t.s,t.l,t.opacity);if(t instanceof at||(t=_t(t)),!t)return new Et;if(t instanceof Et)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(o=e===a?(n-r)/u+6*(n<r):n===a?(r-e)/u+2:(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new Et(o,u,s,t.opacity)}function Et(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function St(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Ut(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}rt(at,_t,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:yt,formatHex:yt,formatHsl:function(){return Nt(this).formatHsl()},formatRgb:mt,toString:mt}),rt(Mt,xt,it(at,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:At,formatHex:At,formatRgb:kt,toString:kt})),rt(Et,(function(t,e,n,r){return 1===arguments.length?Nt(t):new Et(t,e,n,null==r?1:r)}),it(at,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Et(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Et(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Mt(St(t>=240?t-240:t+120,i,r),St(t,i,r),St(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var $t=function(t){return function(){return t}};function Lt(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):$t(isNaN(t)?e:t)}var Dt=function t(e){var n=function(t){return 1==(t=+t)?Lt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):$t(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=xt(t)).r,(e=xt(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Lt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Ot(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),u=new Array(i);for(n=0;n<i;++n)r=xt(e[n]),a[n]=r.r||0,o[n]=r.g||0,u[n]=r.b||0;return a=t(a),o=t(o),u=t(u),r.opacity=1,function(t){return r.r=a(t),r.g=o(t),r.b=u(t),r+""}}}Ot((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,u=r<e-1?t[r+2]:2*a-i;return Ut((n-r/e)*e,o,i,a,u)}})),Ot((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],o=t[(r+1)%e],u=t[(r+2)%e];return Ut((n-r/e)*e,i,a,o,u)}}));var Ft,Pt,Rt=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},Ht=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qt=new RegExp(Ht.source,"g"),Yt=function(t,e){var n,r,i,a=Ht.lastIndex=qt.lastIndex=0,o=-1,u=[],s=[];for(t+="",e+="";(n=Ht.exec(t))&&(r=qt.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,s.push({i:o,x:Rt(n,r)})),a=qt.lastIndex;return a<e.length&&(i=e.slice(a),u[o]?u[o]+=i:u[++o]=i),u.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})},zt=function(){for(var t,e=z;t=e.sourceEvent;)e=t;return e},Gt=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]},jt=function(t,e,n){arguments.length<3&&(n=e,e=zt().changedTouches);for(var r,i=0,a=e?e.length:0;i<a;++i)if((r=e[i]).identifier===n)return Gt(t,r);return null},Xt=function(t){var e=zt();return e.changedTouches&&(e=e.changedTouches[0]),Gt(t,e)},It=0,Vt=0,Zt=0,Bt=0,Jt=0,Wt=0,Qt="object"==typeof performance&&performance.now?performance:Date,Kt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function te(){return Jt||(Kt(ee),Jt=Qt.now()+Wt)}function ee(){Jt=0}function ne(){this._call=this._time=this._next=null}function re(t,e,n){var r=new ne;return r.restart(t,e,n),r}function ie(){Jt=(Bt=Qt.now())+Wt,It=Vt=0;try{!function(){te(),++It;for(var t,e=Ft;e;)(t=Jt-e._time)>=0&&e._call.call(null,t),e=e._next;--It}()}finally{It=0,function(){for(var t,e,n=Ft,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ft=e);Pt=t,oe(r)}(),Jt=0}}function ae(){var t=Qt.now(),e=t-Bt;e>1e3&&(Wt-=e,Bt=t)}function oe(t){It||(Vt&&(Vt=clearTimeout(Vt)),t-Jt>24?(t<1/0&&(Vt=setTimeout(ie,t-Qt.now()-Wt)),Zt&&(Zt=clearInterval(Zt))):(Zt||(Bt=Qt.now(),Zt=setInterval(ae,1e3)),It=1,Kt(ie)))}ne.prototype=re.prototype={constructor:ne,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?te():+n)+(null==e?0:+e),this._next||Pt===this||(Pt?Pt._next=this:Ft=this,Pt=this),this._call=t,this._time=n,oe()},stop:function(){this._call&&(this._call=null,this._time=1/0,oe())}};var ue=function(t,e,n){var r=new ne;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},se=f("start","end","cancel","interrupt"),le=[],ce=function(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(s){var l,c,f,h;if(1!==n.state)return u();for(l in i)if((h=i[l]).name===n.name){if(3===h.state)return ue(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[l])}if(ue((function(){3===n.state&&(n.state=4,n.timer.restart(o,n.delay,n.time),o(s))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(f=n.tween.length),l=0,c=-1;l<f;++l)(h=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=h);r.length=c+1}}function o(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),a=-1,o=r.length;++a<o;)r[a].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=re((function(t){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:se,tween:le,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})};function fe(t,e){var n=ge(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function he(t,e){var n=ge(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ge(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var de,pe,ve,ye,me=180/Math.PI,_e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},be=function(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*me,skewX:Math.atan(s)*me,scaleX:o,scaleY:u}};function we(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var u=[],s=[];return a=t(a),o=t(o),function(t,r,i,a,o,u){if(t!==i||r!==a){var s=o.push("translate(",null,e,null,n);u.push({i:s-4,x:Rt(t,i)},{i:s-2,x:Rt(r,a)})}else(i||a)&&o.push("translate("+i+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,u,s),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Rt(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,u,s),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Rt(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,u,s),function(t,e,n,r,a,o){if(t!==n||e!==r){var u=a.push(i(a)+"scale(",null,",",null,")");o.push({i:u-4,x:Rt(t,n)},{i:u-2,x:Rt(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,u,s),a=o=null,function(t){for(var e,n=-1,r=s.length;++n<r;)u[(e=s[n]).i]=e.x(t);return u.join("")}}}var xe=we((function(t){return"none"===t?_e:(de||(de=document.createElement("DIV"),pe=document.documentElement,ve=document.defaultView),de.style.transform=t,t=ve.getComputedStyle(pe.appendChild(de),null).getPropertyValue("transform"),pe.removeChild(de),t=t.slice(7,-1).split(","),be(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Me=we((function(t){return null==t?_e:(ye||(ye=document.createElementNS("http://www.w3.org/2000/svg","g")),ye.setAttribute("transform",t),(t=ye.transform.baseVal.consolidate())?(t=t.matrix,be(t.a,t.b,t.c,t.d,t.e,t.f)):_e)}),", ",")",")");function Ae(t,e,n){var r=t._id;return t.each((function(){var t=he(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ge(t,r).value[e]}}var ke=function(t,e){var n;return("number"==typeof e?Rt:e instanceof _t?Dt:(n=_t(e))?(e=n,Dt):Yt)(t,e)},Ce=Q.prototype.constructor;function Te(t){return function(){this.style.removeProperty(t)}}var Ne=0;function Ee(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Se(){return++Ne}var Ue=Q.prototype;Ee.prototype=function(t){return Q().transition(t)}.prototype={constructor:Ee,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=g(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u,s,l=r[o],c=l.length,f=a[o]=new Array(c),h=0;h<c;++h)(u=l[h])&&(s=t.call(u,u.__data__,h,l))&&("__data__"in u&&(s.__data__=u.__data__),f[h]=s,ce(f[h],e,n,h,f,ge(u,n)));return new Ee(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=p(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var s,l=r[u],c=l.length,f=0;f<c;++f)if(s=l[f]){for(var h,g=t.call(s,s.__data__,f,l),d=ge(s,n),v=0,y=g.length;v<y;++v)(h=g[v])&&ce(h,e,n,v,g,d);a.push(g),o.push(s)}return new Ee(a,o,e,n)},filter:function(t){"function"!=typeof t&&(t=v(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,o=e[i],u=o.length,s=r[i]=[],l=0;l<u;++l)(a=o[l])&&t.call(a,a.__data__,l,o)&&s.push(a);return new Ee(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s,l=e[u],c=n[u],f=l.length,h=o[u]=new Array(f),g=0;g<f;++g)(s=l[g]||c[g])&&(h[g]=s);for(;u<r;++u)o[u]=e[u];return new Ee(o,this._parents,this._name,this._id)},selection:function(){return new Ce(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Se(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o,u=r[a],s=u.length,l=0;l<s;++l)if(o=u[l]){var c=ge(o,e);ce(o,t,n,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ee(r,this._parents,t,n)},call:Ue.call,nodes:Ue.nodes,node:Ue.node,size:Ue.size,empty:Ue.empty,each:Ue.each,on:function(t,e){var n=this._id;return arguments.length<2?ge(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,a=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?fe:he;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}(n,t,e))},attr:function(t,e){var n=A(t),r="transform"===n?Me:ke;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,a;return function(){var o,u,s=n(this);if(null!=s)return(o=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:o===r&&u===i?a:(i=u,a=e(r=o,s));this.removeAttributeNS(t.space,t.local)}}:function(t,e,n){var r,i,a;return function(){var o,u,s=n(this);if(null!=s)return(o=this.getAttribute(t))===(u=s+"")?null:o===r&&u===i?a:(i=u,a=e(r=o,s));this.removeAttribute(t)}})(n,r,Ae(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=e(r=o,n)}}:function(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=e(r=o,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=A(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,i)),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,i)),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r="transform"==(t+="")?xe:ke;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=C(this,t),o=(this.style.removeProperty(t),C(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}(t,r)).on("end.style."+t,Te(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var o=C(this,t),u=n(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=C(this,t)),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}(t,r,Ae(this,"style."+t,e))).each(function(t,e){var n,r,i,a,o="style."+e,u="end."+o;return function(){var s=he(this,t),l=s.on,c=null==s.value[o]?a||(a=Te(e)):void 0;l===n&&i===c||(r=(n=l).copy()).on(u,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var o=C(this,t);return o===a?null:o===r?i:i=e(r=o,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,a,n)),r}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ae(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=ge(this.node(),n).tween,a=0,o=i.length;a<o;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?function(t,e){var n,r;return function(){var i=he(this,t),a=i.tween;if(a!==n)for(var o=0,u=(r=n=a).length;o<u;++o)if(r[o].name===e){(r=r.slice()).splice(o,1);break}i.tween=r}}:function(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=he(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}a.tween=i}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){fe(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){fe(this,t).delay=e}})(e,t)):ge(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){he(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){he(this,t).duration=e}})(e,t)):ge(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){he(this,t).ease=e}}(e,t)):ge(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(a,o){var u={value:o},s={value:function(){0==--i&&a()}};n.each((function(){var n=he(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),n.on=e}))}))}};var $e={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Le(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return $e.time=te(),$e;return n}function De(t){return{type:t}}Q.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}}(this,t)}))},Q.prototype.transition=function(t){var e,n;t instanceof Ee?(e=t._id,t=t._name):(e=Se(),(n=$e).time=te(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o,u=r[a],s=u.length,l=0;l<s;++l)(o=u[l])&&ce(o,t,e,l,u,n||Le(o,e));return new Ee(r,this._parents,t,e)},["w","e"].map(De),["n","s"].map(De),["n","w","e","s","nw","ne","sw","se"].map(De),Math.cos,Math.sin,Math.PI,Math.max,Array.prototype.slice;var Oe=Math.PI,Fe=2*Oe,Pe=Fe-1e-6;function Re(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function He(){}function qe(t,e){var n=new He;if(t instanceof He)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i<a;)n.set(i,t[i]);else for(;++i<a;)n.set(e(r=t[i],i,t),r)}else if(t)for(var o in t)n.set(o,t[o]);return n}Re.prototype=function(){return new Re}.prototype={constructor:Re,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,u=n-t,s=r-e,l=a-t,c=o-e,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(c*u-s*l)>1e-6&&i){var h=n-a,g=r-o,d=u*u+s*s,p=h*h+g*g,v=Math.sqrt(d),y=Math.sqrt(f),m=i*Math.tan((Oe-Math.acos((d+f-p)/(2*v*y)))/2),_=m/y,b=m/v;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*g)+","+(this._x1=t+b*u)+","+(this._y1=e+b*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(r),u=n*Math.sin(r),s=t+o,l=e+u,c=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+s+","+l),n&&(f<0&&(f=f%Fe+Fe),f>Pe?this._+="A"+n+","+n+",0,1,"+c+","+(t-o)+","+(e-u)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Oe)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},He.prototype=qe.prototype={constructor:He,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Ye=qe;function ze(){}var Ge=Ye.prototype;ze.prototype=function(t,e){var n=new ze;if(t instanceof ze)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}.prototype={constructor:ze,has:Ge.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Ge.remove,clear:Ge.clear,values:Ge.keys,size:Ge.size,empty:Ge.empty,each:Ge.each},Array.prototype.slice;var je=function(t){return function(){return t}};function Xe(t,e,n,r,i,a,o,u,s,l){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=u,this.dy=s,this._=l}function Ie(){return!z.ctrlKey&&!z.button}function Ve(){return this.parentNode}function Ze(t){return null==t?{x:z.x,y:z.y}:t}function Be(){return navigator.maxTouchPoints||"ontouchstart"in this}Xe.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Je=function(t){return function(){return t}},We=function(){return 1e-6*(Math.random()-.5)};function Qe(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,o,u,s,l,c,f,h,g=t._root,d={data:r},p=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!g)return t._root=d,t;for(;g.length;)if((l=e>=(a=(p+y)/2))?p=a:y=a,(c=n>=(o=(v+m)/2))?v=o:m=o,i=g,!(g=g[f=c<<1|l]))return i[f]=d,t;if(u=+t._x.call(null,g.data),s=+t._y.call(null,g.data),e===u&&n===s)return d.next=g,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(a=(p+y)/2))?p=a:y=a,(c=n>=(o=(v+m)/2))?v=o:m=o}while((f=c<<1|l)==(h=(s>=o)<<1|u>=a));return i[h]=g,i[f]=d,t}var Ke=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function tn(t){return t[0]}function en(t){return t[1]}function nn(t,e,n){var r=new rn(null==e?tn:e,null==n?en:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function rn(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function an(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var on=nn.prototype=rn.prototype;function un(t){return t.index}function sn(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function ln(t){return t.x}function cn(t){return t.y}on.copy=function(){var t,e,n=new rn(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=an(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=an(e));return n},on.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Qe(this.cover(e,n),e,n,t)},on.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),u=new Array(a),s=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,u[n]=i,r<s&&(s=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),n=0;n<a;++n)Qe(this,o[n],u[n],t[n]);return this},on.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,u,s=i-n,l=this._root;n>t||t>=i||r>e||e>=a;)switch(u=(e<r)<<1|t<n,(o=new Array(4))[u]=l,l=o,s*=2,u){case 0:i=n+s,a=r+s;break;case 1:n=i-s,a=r+s;break;case 2:i=n+s,r=a-s;break;case 3:n=i-s,r=a-s}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this},on.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},on.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},on.find=function(t,e,n){var r,i,a,o,u,s,l,c=this._x0,f=this._y0,h=this._x1,g=this._y1,d=[],p=this._root;for(p&&d.push(new Ke(p,c,f,h,g)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,g=e+n,n*=n);s=d.pop();)if(!(!(p=s.node)||(i=s.x0)>h||(a=s.y0)>g||(o=s.x1)<c||(u=s.y1)<f))if(p.length){var v=(i+o)/2,y=(a+u)/2;d.push(new Ke(p[3],v,y,o,u),new Ke(p[2],i,y,v,u),new Ke(p[1],v,a,o,y),new Ke(p[0],i,a,v,y)),(l=(e>=y)<<1|t>=v)&&(s=d[d.length-1],d[d.length-1]=d[d.length-1-l],d[d.length-1-l]=s)}else{var m=t-+this._x.call(null,p.data),_=e-+this._y.call(null,p.data),b=m*m+_*_;if(b<n){var w=Math.sqrt(n=b);c=t-w,f=e-w,h=t+w,g=e+w,r=p.data}}return r},on.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,r,i,a,o,u,s,l,c,f,h,g=this._root,d=this._x0,p=this._y0,v=this._x1,y=this._y1;if(!g)return this;if(g.length)for(;;){if((l=a>=(u=(d+v)/2))?d=u:v=u,(c=o>=(s=(p+y)/2))?p=s:y=s,e=g,!(g=g[f=c<<1|l]))return this;if(!g.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;g.data!==t;)if(r=g,!(g=g.next))return this;return(i=g.next)&&delete g.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(g=e[0]||e[1]||e[2]||e[3])&&g===(e[3]||e[2]||e[1]||e[0])&&!g.length&&(n?n[h]=g:this._root=g),this):(this._root=i,this)},on.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},on.root=function(){return this._root},on.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},on.visit=function(t){var e,n,r,i,a,o,u=[],s=this._root;for(s&&u.push(new Ke(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,a=e.x1,o=e.y1)&&s.length){var l=(r+a)/2,c=(i+o)/2;(n=s[3])&&u.push(new Ke(n,l,c,a,o)),(n=s[2])&&u.push(new Ke(n,r,c,l,o)),(n=s[1])&&u.push(new Ke(n,l,i,a,c)),(n=s[0])&&u.push(new Ke(n,r,i,l,c))}return this},on.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Ke(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,o=e.x0,u=e.y0,s=e.x1,l=e.y1,c=(o+s)/2,f=(u+l)/2;(a=i[0])&&n.push(new Ke(a,o,u,c,f)),(a=i[1])&&n.push(new Ke(a,c,u,s,f)),(a=i[2])&&n.push(new Ke(a,o,f,c,l)),(a=i[3])&&n.push(new Ke(a,c,f,s,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},on.x=function(t){return arguments.length?(this._x=t,this):this._x},on.y=function(t){return arguments.length?(this._y=t,this):this._y};var fn=Math.PI*(3-Math.sqrt(5));function hn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var gn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dn(t){if(!(e=gn.exec(t)))throw new Error("invalid format: "+t);var e;return new pn({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function pn(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}dn.prototype=pn.prototype,pn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var vn,yn,mn=function(t,e){var n=hn(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},_n={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return mn(100*t,e)},r:mn,s:function(t,e){var n=hn(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(vn=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+hn(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},bn=function(t){return t},wn=Array.prototype.map,xn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];(yn=function(t){var e=void 0===t.grouping||void 0===t.thousands?bn:function(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}(wn.call(t.grouping,Number),t.thousands+""),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?bn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(wn.call(t.numerals,String)),o=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"-":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var l=(t=dn(t)).fill,c=t.align,f=t.sign,h=t.symbol,g=t.zero,d=t.width,p=t.comma,v=t.precision,y=t.trim,m=t.type;"n"===m?(p=!0,m="g"):_n[m]||(void 0===v&&(v=12),y=!0,m="g"),(g||"0"===l&&"="===c)&&(g=!0,l="0",c="=");var _="$"===h?n:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",b="$"===h?r:/[%p]/.test(m)?o:"",w=_n[m],x=/[defgprs%]/.test(m);function M(t){var n,r,o,h=_,M=b;if("c"===m)M=w(t)+M,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:w(Math.abs(t),v),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==f&&(A=!1),h=(A?"("===f?f:u:"-"===f||"("===f?"":f)+h,M=("s"===m?xn[8+vn/3]:"")+M+(A&&"("===f?")":""),x)for(n=-1,r=t.length;++n<r;)if(48>(o=t.charCodeAt(n))||o>57){M=(46===o?i+t.slice(n+1):t.slice(n))+M,t=t.slice(0,n);break}}p&&!g&&(t=e(t,1/0));var k=h.length+t.length+M.length,C=k<d?new Array(d-k+1).join(l):"";switch(p&&g&&(t=e(C+t,C.length?d-M.length:1/0),C=""),c){case"<":t=h+t+M+C;break;case"=":t=h+C+t+M;break;case"^":t=C.slice(0,k=C.length>>1)+h+t+M+C.slice(k);break;default:t=C+h+t+M}return a(t)}return v=void 0===v?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,e){var n=l(((t=dn(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=hn(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),a=xn[8+r/3];return function(t){return n(i*t)+a}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"})).format,yn.formatPrefix;var Mn=function(){return Math.random()},An=(function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return e()*n+t}}return n.source=t,n}(Mn),function t(e){function n(t,n){var r,i;return t=null==t?0:+t,n=null==n?1:+n,function(){var a;if(null!=r)a=r,r=null;else do{r=2*e()-1,a=2*e()-1,i=r*r+a*a}while(!i||i>1);return t+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(Mn)),kn=(function t(e){function n(){var t=An.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(Mn),function t(e){function n(t){return function(){for(var n=0,r=0;r<t;++r)n+=e();return n}}return n.source=t,n}(Mn));function Cn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}(function t(e){function n(t){var n=kn.source(e)(t);return function(){return n()/t}}return n.source=t,n})(Mn),function t(e){function n(t){return function(){return-Math.log(1-e())/t}}return n.source=t,n}(Mn);var Tn=Array.prototype,Nn=(Tn.map,Tn.slice),En={name:"implicit"};var Sn=new Date,Un=new Date;function $n(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,a){var o,u=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return u;do{u.push(o=new Date(+n)),e(n,a),t(n)}while(o<n&&n<r);return u},i.filter=function(n){return $n((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Sn.setTime(+e),Un.setTime(+r),t(Sn),t(Un),Math.floor(n(Sn,Un))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Ln=$n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ln.every=function(t){return isFinite(t=Math.floor(t))&&t>0?$n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Dn=Ln,On=((Ln.range,$n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))).range,6e4),Fn=6048e5;function Pn(t){return $n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*On)/Fn}))}var Rn=Pn(0),Hn=Pn(1),qn=Pn(2),Yn=Pn(3),zn=Pn(4),Gn=Pn(5),jn=Pn(6),Xn=(Rn.range,Hn.range,qn.range,Yn.range,zn.range,Gn.range,jn.range,$n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*On)/864e5}),(function(t){return t.getDate()-1}))),In=Xn,Vn=((((Xn.range,$n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*On)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))).range,$n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+e*On)}),(function(t,e){return(e-t)/On}),(function(t){return t.getMinutes()}))).range,$n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))).range,$n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));function Zn(t){return $n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Fn}))}Vn.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?$n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Vn:null},Vn.range;var Bn=Zn(0),Jn=Zn(1),Wn=Zn(2),Qn=Zn(3),Kn=Zn(4),tr=Zn(5),er=Zn(6),nr=(Bn.range,Jn.range,Wn.range,Qn.range,Kn.range,tr.range,er.range,$n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),rr=nr,ir=(nr.range,$n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));ir.every=function(t){return isFinite(t=Math.floor(t))&&t>0?$n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var ar=ir;function or(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ur(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function sr(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}ir.range;var lr,cr={"-":"",_:" ",0:"0"},fr=/^\s*\d+/,hr=/^%/,gr=/[\\^$*+?|[\]().{}]/g;function dr(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function pr(t){return t.replace(gr,"\\$&")}function vr(t){return new RegExp("^(?:"+t.map(pr).join("|")+")","i")}function yr(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function mr(t,e,n){var r=fr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function _r(t,e,n){var r=fr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function br(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function wr(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function xr(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Mr(t,e,n){var r=fr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function kr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Cr(t,e,n){var r=fr.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Tr(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Nr(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Er(t,e,n){var r=fr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Sr(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Ur(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=fr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Lr(t,e,n){var r=fr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Dr(t,e,n){var r=fr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Or(t,e,n){var r=hr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Fr(t,e,n){var r=fr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Pr(t,e,n){var r=fr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Rr(t,e){return dr(t.getDate(),e,2)}function Hr(t,e){return dr(t.getHours(),e,2)}function qr(t,e){return dr(t.getHours()%12||12,e,2)}function Yr(t,e){return dr(1+In.count(Dn(t),t),e,3)}function zr(t,e){return dr(t.getMilliseconds(),e,3)}function Gr(t,e){return zr(t,e)+"000"}function jr(t,e){return dr(t.getMonth()+1,e,2)}function Xr(t,e){return dr(t.getMinutes(),e,2)}function Ir(t,e){return dr(t.getSeconds(),e,2)}function Vr(t){var e=t.getDay();return 0===e?7:e}function Zr(t,e){return dr(Rn.count(Dn(t)-1,t),e,2)}function Br(t){var e=t.getDay();return e>=4||0===e?zn(t):zn.ceil(t)}function Jr(t,e){return t=Br(t),dr(zn.count(Dn(t),t)+(4===Dn(t).getDay()),e,2)}function Wr(t){return t.getDay()}function Qr(t,e){return dr(Hn.count(Dn(t)-1,t),e,2)}function Kr(t,e){return dr(t.getFullYear()%100,e,2)}function ti(t,e){return dr((t=Br(t)).getFullYear()%100,e,2)}function ei(t,e){return dr(t.getFullYear()%1e4,e,4)}function ni(t,e){var n=t.getDay();return dr((t=n>=4||0===n?zn(t):zn.ceil(t)).getFullYear()%1e4,e,4)}function ri(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+dr(e/60|0,"0",2)+dr(e%60,"0",2)}function ii(t,e){return dr(t.getUTCDate(),e,2)}function ai(t,e){return dr(t.getUTCHours(),e,2)}function oi(t,e){return dr(t.getUTCHours()%12||12,e,2)}function ui(t,e){return dr(1+rr.count(ar(t),t),e,3)}function si(t,e){return dr(t.getUTCMilliseconds(),e,3)}function li(t,e){return si(t,e)+"000"}function ci(t,e){return dr(t.getUTCMonth()+1,e,2)}function fi(t,e){return dr(t.getUTCMinutes(),e,2)}function hi(t,e){return dr(t.getUTCSeconds(),e,2)}function gi(t){var e=t.getUTCDay();return 0===e?7:e}function di(t,e){return dr(Bn.count(ar(t)-1,t),e,2)}function pi(t){var e=t.getUTCDay();return e>=4||0===e?Kn(t):Kn.ceil(t)}function vi(t,e){return t=pi(t),dr(Kn.count(ar(t),t)+(4===ar(t).getUTCDay()),e,2)}function yi(t){return t.getUTCDay()}function mi(t,e){return dr(Jn.count(ar(t)-1,t),e,2)}function _i(t,e){return dr(t.getUTCFullYear()%100,e,2)}function bi(t,e){return dr((t=pi(t)).getUTCFullYear()%100,e,2)}function wi(t,e){return dr(t.getUTCFullYear()%1e4,e,4)}function xi(t,e){var n=t.getUTCDay();return dr((t=n>=4||0===n?Kn(t):Kn.ceil(t)).getUTCFullYear()%1e4,e,4)}function Mi(){return"+0000"}function Ai(){return"%"}function ki(t){return+t}function Ci(t){return Math.floor(+t/1e3)}(lr=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,u=t.months,s=t.shortMonths,l=vr(i),c=yr(i),f=vr(a),h=yr(a),g=vr(o),d=yr(o),p=vr(u),v=yr(u),y=vr(s),m=yr(s),_={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Rr,e:Rr,f:Gr,g:ti,G:ni,H:Hr,I:qr,j:Yr,L:zr,m:jr,M:Xr,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ki,s:Ci,S:Ir,u:Vr,U:Zr,V:Jr,w:Wr,W:Qr,x:null,X:null,y:Kr,Y:ei,Z:ri,"%":Ai},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:ii,e:ii,f:li,g:bi,G:xi,H:ai,I:oi,j:ui,L:si,m:ci,M:fi,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ki,s:Ci,S:hi,u:gi,U:di,V:vi,w:yi,W:mi,x:null,X:null,y:_i,Y:wi,Z:Mi,"%":Ai},w={a:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.w=d[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=m[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return A(t,e,n,r)},d:Nr,e:Nr,f:Dr,g:Ar,G:Mr,H:Sr,I:Sr,j:Er,L:Lr,m:Tr,M:Ur,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Cr,Q:Fr,s:Pr,S:$r,u:_r,U:br,V:wr,w:mr,W:xr,x:function(t,e,r){return A(t,n,e,r)},X:function(t,e,n){return A(t,r,e,n)},y:Ar,Y:Mr,Z:kr,"%":Or};function x(t,e){return function(n){var r,i,a,o=[],u=-1,s=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++u<l;)37===t.charCodeAt(u)&&(o.push(t.slice(s,u)),null!=(i=cr[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(a=e[r])&&(r=a(n,i)),o.push(r),s=u+1);return o.push(t.slice(s,u)),o.join("")}}function M(t,e){return function(n){var r,i,a=sr(1900,void 0,1);if(A(a,t,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!e||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(r=(i=(r=ur(sr(a.y,0,1))).getUTCDay())>4||0===i?Jn.ceil(r):Jn(r),r=rr.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(i=(r=or(sr(a.y,0,1))).getDay())>4||0===i?Hn.ceil(r):Hn(r),r=In.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?ur(sr(a.y,0,1)).getUTCDay():or(sr(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,ur(a)):or(a)}}function A(t,e,n,r){for(var i,a,o=0,u=e.length,s=n.length;o<u;){if(r>=s)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=w[i in cr?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return _.x=x(n,_),_.X=x(r,_),_.c=x(e,_),b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),{format:function(t){var e=x(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]})).format,lr.parse,lr.utcFormat,lr.utcParse,(($n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})).range,$n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))).range,$n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*On)}),(function(t,e){return(e-t)/On}),(function(t){return t.getUTCMinutes()}))).range;var Ti=function(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Ni=function(t){return"string"==typeof t?new J([document.querySelectorAll(t)],[document.documentElement]):new J([null==t?[]:t],B)};function Ei(){this._=null}function Si(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ui(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function $i(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Li(t){for(;t.L;)t=t.L;return t}Ei.prototype={constructor:Ei,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Li(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Ui(this,n),n=(t=n).U),n.C=!1,r.C=!0,$i(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&($i(this,n),n=(t=n).U),n.C=!1,r.C=!0,Ui(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,a=t.L,o=t.R;if(n=a?o?Li(o):a:o,i?i.L===t?i.L=n:i.R=n:this._=n,a&&o?(r=n.C,n.C=t.C,n.L=a,a.U=n,n!==o?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=o,o.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Ui(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,$i(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Ui(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,$i(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Ui(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,$i(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Di=Ei;function Oi(t,e,n,r){var i=[null,null],a=ra.push(i)-1;return i.left=t,i.right=e,n&&Pi(i,t,e,n),r&&Pi(i,e,t,r),ea[t.index].halfedges.push(a),ea[e.index].halfedges.push(a),i}function Fi(t,e,n){var r=[e,n];return r.left=t,r}function Pi(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Ri(t,e,n,r,i){var a,o=t[0],u=t[1],s=o[0],l=o[1],c=0,f=1,h=u[0]-s,g=u[1]-l;if(a=e-s,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<f&&(f=a)}else if(h>0){if(a>f)return;a>c&&(c=a)}if(a=r-s,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<f&&(f=a)}if(a=n-l,g||!(a>0)){if(a/=g,g<0){if(a<c)return;a<f&&(f=a)}else if(g>0){if(a>f)return;a>c&&(c=a)}if(a=i-l,g||!(a<0)){if(a/=g,g<0){if(a>f)return;a>c&&(c=a)}else if(g>0){if(a<c)return;a<f&&(f=a)}return!(c>0||f<1)||(c>0&&(t[0]=[s+c*h,l+c*g]),f<1&&(t[1]=[s+f*h,l+f*g]),!0)}}}}}function Hi(t,e,n,r,i){var a=t[1];if(a)return!0;var o,u,s=t[0],l=t.left,c=t.right,f=l[0],h=l[1],g=c[0],d=c[1],p=(f+g)/2,v=(h+d)/2;if(d===h){if(p<e||p>=r)return;if(f>g){if(s){if(s[1]>=i)return}else s=[p,n];a=[p,i]}else{if(s){if(s[1]<n)return}else s=[p,i];a=[p,n]}}else if(u=v-(o=(f-g)/(d-h))*p,o<-1||o>1)if(f>g){if(s){if(s[1]>=i)return}else s=[(n-u)/o,n];a=[(i-u)/o,i]}else{if(s){if(s[1]<n)return}else s=[(i-u)/o,i];a=[(n-u)/o,n]}else if(h<d){if(s){if(s[0]>=r)return}else s=[e,o*e+u];a=[r,o*r+u]}else{if(s){if(s[0]<e)return}else s=[r,o*r+u];a=[e,o*e+u]}return t[0]=s,t[1]=a,!0}function qi(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Yi(t,e){return e[+(e.left!==t.site)]}function zi(t,e){return e[+(e.left===t.site)]}var Gi,ji=[];function Xi(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,a=n.site;if(r!==a){var o=i[0],u=i[1],s=r[0]-o,l=r[1]-u,c=a[0]-o,f=a[1]-u,h=2*(s*f-l*c);if(!(h>=-aa)){var g=s*s+l*l,d=c*c+f*f,p=(f*g-l*d)/h,v=(s*d-c*g)/h,y=ji.pop()||new function(){Si(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=p+o,y.y=(y.cy=v+u)+Math.sqrt(p*p+v*v),t.circle=y;for(var m=null,_=na._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}na.insert(m,y),m||(Gi=y)}}}}function Ii(t){var e=t.circle;e&&(e.P||(Gi=e.N),na.remove(e),ji.push(e),Si(e),t.circle=null)}var Vi=[];function Zi(t){var e=Vi.pop()||new function(){Si(this),this.edge=this.site=this.circle=null};return e.site=t,e}function Bi(t){Ii(t),ta.remove(t),Vi.push(t),Si(t)}function Ji(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],a=t.P,o=t.N,u=[t];Bi(t);for(var s=a;s.circle&&Math.abs(n-s.circle.x)<ia&&Math.abs(r-s.circle.cy)<ia;)a=s.P,u.unshift(s),Bi(s),s=a;u.unshift(s),Ii(s);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<ia&&Math.abs(r-l.circle.cy)<ia;)o=l.N,u.push(l),Bi(l),l=o;u.push(l),Ii(l);var c,f=u.length;for(c=1;c<f;++c)l=u[c],s=u[c-1],Pi(l.edge,s.site,l.site,i);s=u[0],(l=u[f-1]).edge=Oi(s.site,l.site,null,i),Xi(s),Xi(l)}function Wi(t){for(var e,n,r,i,a=t[0],o=t[1],u=ta._;u;)if((r=Qi(u,o)-a)>ia)u=u.L;else{if(!((i=a-Ki(u,o))>ia)){r>-ia?(e=u.P,n=u):i>-ia?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}!function(t){ea[t.index]={site:t,halfedges:[]}}(t);var s=Zi(t);if(ta.insert(e,s),e||n){if(e===n)return Ii(e),n=Zi(e.site),ta.insert(s,n),s.edge=n.edge=Oi(e.site,s.site),Xi(e),void Xi(n);if(n){Ii(e),Ii(n);var l=e.site,c=l[0],f=l[1],h=t[0]-c,g=t[1]-f,d=n.site,p=d[0]-c,v=d[1]-f,y=2*(h*v-g*p),m=h*h+g*g,_=p*p+v*v,b=[(v*m-g*_)/y+c,(h*_-p*m)/y+f];Pi(n.edge,l,d,b),s.edge=Oi(l,t,null,b),n.edge=Oi(t,d,null,b),Xi(e),Xi(n)}else s.edge=Oi(e.site,s.site)}}function Qi(t,e){var n=t.site,r=n[0],i=n[1],a=i-e;if(!a)return r;var o=t.P;if(!o)return-1/0;var u=(n=o.site)[0],s=n[1],l=s-e;if(!l)return u;var c=u-r,f=1/a-1/l,h=c/l;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*l)-s+l/2+i-a/2)))/f+r:(r+u)/2}function Ki(t,e){var n=t.N;if(n)return Qi(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var ta,ea,na,ra,ia=1e-6,aa=1e-12;function oa(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function ua(t,e){return e[1]-t[1]||e[0]-t[0]}function sa(t,e){var n,r,i,a=t.sort(ua).pop();for(ra=[],ea=new Array(t.length),ta=new Di,na=new Di;;)if(i=Gi,a&&(!i||a[1]<i.y||a[1]===i.y&&a[0]<i.x))a[0]===n&&a[1]===r||(Wi(a),n=a[0],r=a[1]),a=t.pop();else{if(!i)break;Ji(i.arc)}if(function(){for(var t,e,n,r,i=0,a=ea.length;i<a;++i)if((t=ea[i])&&(r=(e=t.halfedges).length)){var o=new Array(r),u=new Array(r);for(n=0;n<r;++n)o[n]=n,u[n]=qi(t,ra[e[n]]);for(o.sort((function(t,e){return u[e]-u[t]})),n=0;n<r;++n)u[n]=e[o[n]];for(n=0;n<r;++n)e[n]=u[n]}}(),e){var o=+e[0][0],u=+e[0][1],s=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,a=ra.length;a--;)Hi(i=ra[a],t,e,n,r)&&Ri(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>ia||Math.abs(i[0][1]-i[1][1])>ia)||delete ra[a]}(o,u,s,l),function(t,e,n,r){var i,a,o,u,s,l,c,f,h,g,d,p,v=ea.length,y=!0;for(i=0;i<v;++i)if(a=ea[i]){for(o=a.site,u=(s=a.halfedges).length;u--;)ra[s[u]]||s.splice(u,1);for(u=0,l=s.length;u<l;)d=(g=zi(a,ra[s[u]]))[0],p=g[1],f=(c=Yi(a,ra[s[++u%l]]))[0],h=c[1],(Math.abs(d-f)>ia||Math.abs(p-h)>ia)&&(s.splice(u,0,ra.push(Fi(o,g,Math.abs(d-t)<ia&&r-p>ia?[t,Math.abs(f-t)<ia?h:r]:Math.abs(p-r)<ia&&n-d>ia?[Math.abs(h-r)<ia?f:n,r]:Math.abs(d-n)<ia&&p-e>ia?[n,Math.abs(f-n)<ia?h:e]:Math.abs(p-e)<ia&&d-t>ia?[Math.abs(h-e)<ia?f:t,e]:null))-1),++l);l&&(y=!1)}if(y){var m,_,b,w=1/0;for(i=0,y=null;i<v;++i)(a=ea[i])&&(b=(m=(o=a.site)[0]-t)*m+(_=o[1]-e)*_)<w&&(w=b,y=a);if(y){var x=[t,e],M=[t,r],A=[n,r],k=[n,e];y.halfedges.push(ra.push(Fi(o=y.site,x,M))-1,ra.push(Fi(o,M,A))-1,ra.push(Fi(o,A,k))-1,ra.push(Fi(o,k,x))-1)}}for(i=0;i<v;++i)(a=ea[i])&&(a.halfedges.length||delete ea[i])}(o,u,s,l)}this.edges=ra,this.cells=ea,ta=na=ra=ea=null}function la(t,e,n){this.k=t,this.x=e,this.y=n}sa.prototype={constructor:sa,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Yi(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(a=(i=n.halfedges).length)for(var i,a,o,u=n.site,s=-1,l=e[i[a-1]],c=l.left===u?l.right:l.left;++s<a;)o=c,c=(l=e[i[s]]).left===u?l.right:l.left,o&&c&&r<o.index&&r<c.index&&oa(u,o,c)<0&&t.push([u.data,o.data,c.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,a=this,o=a._found||0,u=a.cells.length;!(i=a.cells[o]);)if(++o>=u)return null;var s=t-i.site[0],l=e-i.site[1],c=s*s+l*l;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],u=r.left;if(u!==i.site&&u||(u=r.right)){var s=t-u[0],l=e-u[1],f=s*s+l*l;f<c&&(c=f,o=u.index)}}))}while(null!==o);return a._found=r,null==n||c<=n*n?i.site:null}},Math.SQRT2,la.prototype={constructor:la,scale:function(t){return 1===t?this:new la(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new la(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new la(1,0,0),la.prototype;var ca=n(38);function fa(t,e,n,r){if(!n){var i=e.pageX,a=e.pageY;K("#tooltip").style("left",i-5+"px").style("top",a-ga()+"px")}}function ha(){K("#tooltip").style("opacity",0).style("left",0)}function ga(){return parseInt(K("#tooltip").style("height"),10)+15}var da={id:"force-directed",label:"Force Directed Graph",options:{nodeDivider:{section:"Graph",type:"string",label:"Nodes -----------------------------------------",display:"divider",order:8},color_range:{type:"array",section:"Graph",label:"Node Color Range",display:"colors",display_size:"half",default:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],order:9},circle_radius:{section:"Graph",type:"number",display:"range",display_size:"half",label:"Circle Radius",min:1,max:40,step:1,default:5,order:10},linkDivider:{section:"Graph",type:"string",label:"Links -----------------------------------------",display:"divider",order:19},link_color:{section:"Graph",type:"string",display:"color",display_size:"half",label:"Link Color",default:"#000000",order:20},linkDistance:{section:"Graph",type:"number",display:"range",display_size:"half",label:"Link Distance",default:30,min:5,max:300,step:5,order:21},edge_weight:{type:"string",section:"Graph",display:"select",display_size:"half",label:"Link Weight Function",values:[{"Square Root":"sqrt"},{"Cube Root":"cbrt"},{log2:"log2"},{log10:"log10"}],default:"sqrt",order:22},labelDivider:{section:"Labels",type:"string",display:"divider",label:"Labels -----------------------------------------",order:90},font_color:{section:"Labels",type:"string",display:"color",display_size:"half",label:"Label Color",default:"#000000",order:91},labels:{section:"Labels",type:"string",label:"Labels",display:"select",values:[{None:"none"},{"Source Group":"source_group"},{"Target Group":"target_group"},{All:"all"},{"On Hover":"on_hover"}],display_size:"half",order:92,default:"all"},labelTypes:{section:"Labels",type:"string",label:"Filter Node Labels",placeholder:'List of values from "Source"/"Target" groups',default:"",order:93},font_weight:{section:"Labels",type:"string",label:"Label Font Weight",display:"select",display_size:"half",values:[{Normal:"normal"},{Bold:"bold"}],default:"normal",order:94},font_size:{section:"Labels",type:"string",label:"Label Font Size",display_size:"half",default:["10"],order:95},tooltipDivider:{section:"Labels",label:"Tooltip -----------------------------------------",type:"string",display:"divider",order:100},highlight_selection:{order:101,section:"Labels",type:"boolean",label:"Focus on Hover",default:!0},tooltip:{section:"Labels",type:"boolean",label:"Tooltip",default:!0,order:102},tooltipFont:{section:"Labels",type:"string",label:"Tooltip Font Size",default:"11",order:103},tooltipValFormat:{section:"Labels",type:"string",label:"Value Format (measure)",placeholder:"Spreadsheet-style value format",order:104}},create:function(t,e){t.style.fontFamily='"Open Sans", "Helvetica", sans-serif',this.svg=K(t).append("svg")},updateAsync:function(t,e,n,r,i,a){var o=this;if(this.clearErrors(),function(t,e,n){var r=function(e,n,r,i,a){return!(!t.addError||!t.clearErrors||(r<i?(t.addError({title:"Not Enough "+n+"s",message:"This visualization requires "+(i===a?"exactly":"at least")+" "+i+" "+n.toLowerCase()+(1===i?"":"s")+".",group:e}),1):r>a?(t.addError({title:"Too Many "+n+"s",message:"This visualization requires "+(i===a?"exactly":"no more than")+" "+a+" "+n.toLowerCase()+(1===i?"":"s")+".",group:e}),1):(t.clearErrors(e),0)))},i=e.fields,a=i.pivots,o=i.dimensions,u=i.measure_like;return r("pivot-req","Pivot",a.length,n.min_pivots,n.max_pivots)&&r("dim-req","Dimension",o.length,n.min_dimensions,n.max_dimensions)&&r("mes-req","Measure",u.length,n.min_measures,n.max_measures)}(this,r,{min_pivots:0,max_pivots:0,min_dimensions:4,max_dimensions:4,min_measures:0,max_measures:1})){void 0===n.color_range&&function(){for(var t in o.options)void 0===n[t]&&(n[t]=o.options[t].default)}(),this.svg.selectAll("*").remove(),n.tooltip&&function(t){Ni("#tooltip").remove(),K("#vis").insert("div",":first-child").attr("id","tooltip").style("opacity",0).style("position","absolute").style("background-color","rgba(0, 0, 0, 0.75)").style("border-color","rgba(0, 0, 0, 0.75)").style("border-radius","5px").style("width","auto").style("text-align","left").style("padding","5px").style("color","#FFFFFF").style("font-size",t+"px")}(n.tooltipFont);var u=["Node_1","Group_1","Node_2","Group_2"],s=["Source nodes","Source groups","Target nodes","Target groups"],l=function(t){var e=Object.assign({},o.options),n=t.map((function(t){var e;return(e={})[t.label_short||t.label]=t.name,e}));u.forEach((function(r,i){e[r]={section:"Graph",label:s[i],type:"string",display:"select",display_size:"half",values:n,order:10+i,default:t[i].name}})),o.trigger("registerOptions",e)},c=e.clientHeight+20,h=e.clientWidth,g=n.circle_radius,d=n.linkDistance,p=r.fields.dimension_like,v=r.fields.measure_like[0]||null,y=(null==v?void 0:v.value_format)||(null==n?void 0:n.tooltipValFormat)||"#,###";l(p),void 0!==n.NODE_1&&""!==n.NODE_1||l(p);var m=!1,_=function t(){var e=Ye(),n=[],r=[],i=En;function a(t){var a=t+"",o=e.get(a);if(!o){if(i!==En)return i;e.set(a,o=n.push(t))}return r[(o-1)%r.length]}return a.domain=function(t){if(!arguments.length)return n.slice();n=[],e=Ye();for(var r,i,o=-1,u=t.length;++o<u;)e.has(i=(r=t[o])+"")||e.set(i,n.push(r));return a},a.range=function(t){return arguments.length?(r=Nn.call(t),a):r.slice()},a.unknown=function(t){return arguments.length?(i=t,a):i},a.copy=function(){return t(n,r).unknown(i)},Cn.apply(a,arguments),a}(),b=_.range(Ti);null!=n.color_range&&(b=_.range(n.color_range));var w=[],x=[],M=[],A=[];t.forEach((function(t){var e,r;if(void 0!==t[n.Node_1]&&void 0!==t[n.Node_2]&&null!==(null===(e=t[n.Node_1])||void 0===e?void 0:e.value)&&null!==(null===(r=t[n.Node_2])||void 0===r?void 0:r.value)){if(-1==w.indexOf(t[n.Node_1].value)){w.push(t[n.Node_1].value),-1==x.indexOf(t[n.Group_1].value)&&x.push(t[n.Group_1].value);var i=p.find((function(t){return t.name===n.Node_1})),a=p.find((function(t){return t.name===n.Group_1})),o={id:t[n.Node_1].value,group:t[n.Group_1].value,groupType:"SOURCE",nodeField:i.label_short||i.short,groupField:a.label_short||a.short};M.push(o)}-1==w.indexOf(t[n.Node_2].value)&&(w.push(t[n.Node_2].value),-1==x.indexOf(t[n.Group_2].value)&&x.push(t[n.Group_2].value),i=p.find((function(t){return t.name===n.Node_2})),a=p.find((function(t){return t.name===n.Group_2})),o={id:t[n.Node_2].value,group:t[n.Group_2].value,groupType:"TARGET",nodeField:i.label_short||i.label,groupField:a.label_short||i.label},M.push(o));var u={source:t[n.Node_1].value,target:t[n.Node_2].value,value:v?t[v.name].value:1};A.push(u)}})),M.length<1&&(this.addError({title:"No nodes to plot.",message:"Check for null values in either the start or end nodes."}),a());var k=function(){var t,e,n,r,i=Je(-30),a=1,o=1/0,u=.81;function s(r){var i,a=t.length,o=nn(t,ln,cn).visitAfter(c);for(n=r,i=0;i<a;++i)e=t[i],o.visit(f)}function l(){if(t){var e,n,a=t.length;for(r=new Array(a),e=0;e<a;++e)n=t[e],r[n.index]=+i(n,e,t)}}function c(t){var e,n,i,a,o,u=0,s=0;if(t.length){for(i=a=o=0;o<4;++o)(e=t[o])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,i+=n*e.x,a+=n*e.y);t.x=i/s,t.y=a/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=r[e.data.index]}while(e=e.next)}t.value=u}function f(t,i,s,l){if(!t.value)return!0;var c=t.x-e.x,f=t.y-e.y,h=l-i,g=c*c+f*f;if(h*h/u<g)return g<o&&(0===c&&(g+=(c=We())*c),0===f&&(g+=(f=We())*f),g<a&&(g=Math.sqrt(a*g)),e.vx+=c*t.value*n/g,e.vy+=f*t.value*n/g),!0;if(!(t.length||g>=o)){(t.data!==e||t.next)&&(0===c&&(g+=(c=We())*c),0===f&&(g+=(f=We())*f),g<a&&(g=Math.sqrt(a*g)));do{t.data!==e&&(h=r[t.data.index]*n/g,e.vx+=c*h,e.vy+=f*h)}while(t=t.next)}}return s.initialize=function(e){t=e,l()},s.strength=function(t){return arguments.length?(i="function"==typeof t?t:Je(+t),l(),s):i},s.distanceMin=function(t){return arguments.length?(a=t*t,s):Math.sqrt(a)},s.distanceMax=function(t){return arguments.length?(o=t*t,s):Math.sqrt(o)},s.theta=function(t){return arguments.length?(u=t*t,s):Math.sqrt(u)},s}(),C=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,u=Ye(),s=re(c),l=f("tick","end");function c(){h(),l.call("tick",e),n<r&&(s.stop(),l.call("end",e))}function h(r){var s,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(a-n)*i,u.each((function(t){t(n)})),s=0;s<c;++s)null==(l=t[s]).fx?l.x+=l.vx*=o:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=o:(l.y=l.fy,l.vy=0);return e}function g(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(n),a=n*fn;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function d(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),g(),e={tick:h,restart:function(){return s.restart(c),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,g(),u.each(d),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},force:function(t,n){return arguments.length>1?(null==n?u.remove(t):u.set(t,d(n)),e):u.get(t)},find:function(e,n,r){var i,a,o,u,s,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(o=(i=e-(u=t[l]).x)*i+(a=n-u.y)*a)<r&&(s=u,r=o);return s},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}(M).force("link",function(t){var e,n,r,i,a,o=un,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},s=Je(30),l=1;function c(r){for(var i=0,o=t.length;i<l;++i)for(var u,s,c,f,h,g,d,p=0;p<o;++p)s=(u=t[p]).source,f=(c=u.target).x+c.vx-s.x-s.vx||We(),h=c.y+c.vy-s.y-s.vy||We(),f*=g=((g=Math.sqrt(f*f+h*h))-n[p])/g*r*e[p],h*=g,c.vx-=f*(d=a[p]),c.vy-=h*d,s.vx+=f*(d=1-d),s.vy+=h*d}function f(){if(r){var u,s,l=r.length,c=t.length,f=Ye(r,o);for(u=0,i=new Array(l);u<c;++u)(s=t[u]).index=u,"object"!=typeof s.source&&(s.source=sn(f,s.source)),"object"!=typeof s.target&&(s.target=sn(f,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(u=0,a=new Array(c);u<c;++u)s=t[u],a[u]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(c),h(),n=new Array(c),g()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function g(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+s(t[e],e,t)}return null==t&&(t=[]),c.initialize=function(t){r=t,f()},c.links=function(e){return arguments.length?(t=e,f(),c):t},c.id=function(t){return arguments.length?(o=t,c):o},c.iterations=function(t){return arguments.length?(l=+t,c):l},c.strength=function(t){return arguments.length?(u="function"==typeof t?t:Je(+t),h(),c):u},c.distance=function(t){return arguments.length?(s="function"==typeof t?t:Je(+t),g(),c):s},c}(A).distance(d).id((function(t){return t.id}))).force("charge",k).force("center",function(t,e){var n;function r(){var r,i,a=n.length,o=0,u=0;for(r=0;r<a;++r)o+=(i=n[r]).x,u+=i.y;for(o=o/a-t,u=u/a-e,r=0;r<a;++r)(i=n[r]).x-=o,i.y-=u}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r}(h/2,c/2)),T=this.svg.attr("width","100%").attr("height",c),N=T.append("g").attr("stroke",n.link_color).attr("stroke-opacity",.6).selectAll("line").data(A).enter().append("line").attr("value",(function(t){return t.value})).attr("target",(function(t){return t.target.id})).attr("source",(function(t){return t.source.id})).attr("stroke-width",(function(t){return v?{sqrt:function(t){return Math.sqrt(t)},cbrt:function(t){return Math.cbrt(t)},log2:function(t){return Math.log2(t)},log10:function(t){return Math.log10(t)}}[n.edge_weight](t.value):t.value})).on("mouseover",(function(t){K(this).attr("stroke","#FFA500"),n.tooltip&&function(t,e,n,r,i){if(!n){var a=e.pageX,o=e.pageY,u="Source: <b>"+t.source.id+"</b>";t.source.id!==t.target.id&&(u+="<br/ >Target: <b>"+t.target.id+"</b> "),r&&(u+="<br>"+(r.label_short||r.label)+": <b>"+Object(ca.format)(i,t.value)+"</b>"),K("#tooltip").style("left",a-20+"px").style("top",o-ga()+"px").style("opacity",1).html(u)}}(t,z,m,v,y)})).on("mousemove",(function(t){n.tooltip&&fa(0,z,m)})).on("mouseleave",(function(){K(this).attr("stroke",n.link_color),ha()})),E=T.append("g").attr("class","nodes").selectAll(".node").data(M).enter().append("g").attr("class","node").call(function(t){return function(){var t,e,n,r,i=Ie,a=Ve,o=Ze,u=Be,s={},l=f("start","drag","end"),c=0,h=0;function g(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=b("mouse",a.apply(this,arguments),Xt,this,arguments);o&&(K(z.view).on("mousemove.drag",p,!0).on("mouseup.drag",v,!0),nt(z.view),tt(),n=!1,t=z.clientX,e=z.clientY,o("start"))}}function p(){if(et(),!n){var r=z.clientX-t,i=z.clientY-e;n=r*r+i*i>h}s.mouse("drag")}function v(){K(z.view).on("mousemove.drag mouseup.drag",null),function(t,e){var n=t.document.documentElement,r=K(t).on("dragstart.drag",null);e&&(r.on("click.drag",et,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(z.view,n),et(),s.mouse("end")}function y(){if(i.apply(this,arguments)){var t,e,n=z.changedTouches,r=a.apply(this,arguments),o=n.length;for(t=0;t<o;++t)(e=b(n[t].identifier,r,jt,this,arguments))&&(tt(),e("start"))}}function m(){var t,e,n=z.changedTouches,r=n.length;for(t=0;t<r;++t)(e=s[n[t].identifier])&&(et(),e("drag"))}function _(){var t,e,n=z.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=s[n[t].identifier])&&(tt(),e("end"))}function b(t,e,n,r,i){var a,u,f,h=n(e,t),d=l.copy();if(V(new Xe(g,"beforestart",a,t,c,h[0],h[1],0,0,d),(function(){return null!=(z.subject=a=o.apply(r,i))&&(u=a.x-h[0]||0,f=a.y-h[1]||0,!0)})))return function o(l){var p,v=h;switch(l){case"start":s[t]=o,p=c++;break;case"end":delete s[t],--c;case"drag":h=n(e,t),p=c}V(new Xe(g,l,a,t,p,h[0]+u,h[1]+f,h[0]-v[0],h[1]-v[1],d),d.apply,d,[l,r,i])}}return g.filter=function(t){return arguments.length?(i="function"==typeof t?t:je(!!t),g):i},g.container=function(t){return arguments.length?(a="function"==typeof t?t:je(t),g):a},g.subject=function(t){return arguments.length?(o="function"==typeof t?t:je(t),g):o},g.touchable=function(t){return arguments.length?(u="function"==typeof t?t:je(!!t),g):u},g.on=function(){var t=l.on.apply(l,arguments);return t===l?g:t},g.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,g):Math.sqrt(h)},g}().on("start",(function(e){m=!0,z.active||t.alphaTarget(.3).restart(),e.fx=e.x,e.fy=e.y})).on("drag",(function(t){t.fx=z.x,t.fy=z.y})).on("end",(function(e){z.active||t.alphaTarget(0),e.fx=null,e.fy=null,m=!1}))}(C)),S=(E.append("circle").attr("stroke","#fff").attr("stroke-width",1).attr("id",(function(t){return t.id})).attr("r",g).attr("fill",(function(t){return b(t.group)})).on("mouseover",(function(t){K(this).attr("stroke-width",1.5).attr("stroke","#FFA500"),n.tooltip&&function(t,e,n){if(!n){var r=e.pageX,i=e.pageY,a=t.nodeField+": <b>"+t.id+"</b>";t.id!==t.group&&(a+="<br/>"+t.groupField+": <b>"+t.group+"</b>"),K("#tooltip").style("left",r-15+"px").style("top",i-ga()+"px").html(a).style("opacity",1)}}(t,z,m),(n.highlight_selection||"on_hover"===n.labels)&&function(t,e,n,r,i){if(!n){!function(t,e){e&&(Ni("line").attr("opacity",.1),Ni("circle").attr("opacity",.2),Ni("text").attr("opacity",t?0:.2))}(r,i);var a=Ni('line[target="'+t.id+'"]'),o=Ni('line[source="'+t.id+'"]');a.attr("opacity",1),o.attr("opacity",1),K('circle[id="'+t.id+'"]').attr("opacity",1),K('text[id="'+t.id+'"]').attr("opacity",1),a.each((function(t){K('circle[id="'+t.source.id+'"]').attr("opacity",1),K('text[id="'+t.source.id+'"]').attr("opacity",1)})),o.each((function(t){K('circle[id="'+t.target.id+'"]').attr("opacity",1),K('text[id="'+t.target.id+'"]').attr("opacity",1)}))}}(t,0,m,"on_hover"===n.labels,n.highlight_selection)})).on("mousemove",(function(t){n.tooltip&&fa(0,z,m)})).on("mouseleave mousedown",(function(){K(this).attr("stroke-width",1).attr("stroke","#fff"),ha(),(n.highlight_selection||"on_hover"===n.labels)&&function(t){Ni("line").attr("opacity",1),Ni("circle").attr("opacity",1),Ni("text").attr("opacity",t?0:1)}("on_hover"===n.labels)})),[]);n.labelTypes&&n.labelTypes.length&&(S=n.labelTypes.split(",").map((function(t){return t.trim()}))),n.labels&&n.labelTypes&&n.labelTypes.length?E.append("text").attr("id",(function(t){return t.id})).style("font-size",n.font_size).style("fill",n.font_color).attr("y",-1*n.circle_radius-3+"px").style("text-anchor","middle").style("font-weight",n.font_weight).text((function(t){return S.indexOf(t.group)>-1?t.id:null})):"none"!==n.labels&&E.append("text").attr("id",(function(t){return t.id})).style("font-size",n.font_size).style("fill",n.font_color).attr("y",-1*n.circle_radius-3+"px").style("text-anchor","middle").style("font-weight",n.font_weight).text((function(t){return"all"===n.labels||"on_hover"===n.labels?t.id:"source_group"===n.labels?"SOURCE"===t.groupType?t.id:"":"target_group"===n.labels?"TARGET"===t.groupType?t.id:"":void 0})),"on_hover"===n.labels&&Ni("text").attr("opacity",0),C.on("tick",(function(){N.attr("x1",(function(t){return isNaN(t.source.x)?0:t.source.x})).attr("y1",(function(t){return isNaN(t.source.y)?0:t.source.y})).attr("x2",(function(t){return isNaN(t.target.x)?0:t.target.x})).attr("y2",(function(t){return isNaN(t.target.y)?0:t.target.y})),E.attr("cx",(function(t){return t.x=Math.max(g,Math.min(h-g,t.x))})).attr("cy",(function(t){return t.y=Math.max(g,Math.min(c-g,t.y))})).attr("transform",(function(t){return isNaN(t.x)?"":"translate("+t.x+","+t.y+")"}))})),a()}}};looker.plugins.visualizations.add(da)}})}));