31 lines
595 KiB
JavaScript
31 lines
595 KiB
JavaScript
/*
|
||
d3plus v2.0.0-alpha.17
|
||
Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
|
||
Copyright (c) 2018 D3plus - https://d3plus.org
|
||
@license MIT
|
||
*/
|
||
if(typeof Object.assign!=="function"){Object.defineProperty(Object,"assign",{value:function t(e){"use strict";if(e===null){throw new TypeError("Cannot convert undefined or null to object")}var n=Object(e);for(var i=1;i<arguments.length;i++){var r=arguments[i];if(r!==null){for(var o in r){if(Object.prototype.hasOwnProperty.call(r,o)){n[o]=r[o]}}}}return n},writable:true,configurable:true})}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function t(e,n){var i=Object(this);var r=i.length>>>0;if(r===0)return false;var o=n|0;var a=Math.max(o>=0?o:r-Math.abs(o),0);function s(t,e){return t===e||typeof t==="number"&&typeof e==="number"&&isNaN(t)&&isNaN(e)}while(a<r){if(s(i[a],e)){return true}a++}return false}})}(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define("d3plus",["exports"],e):e(t.d3plus={})})(this,function(t){"use strict";var e="2.0.0-alpha.17";var s=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN};var E=function(o){if(o.length===1){o=n(o)}return{left:function(t,e,n,i){if(n==null){n=0}if(i==null){i=t.length}while(n<i){var r=n+i>>>1;if(o(t[r],e)<0){n=r+1}else{i=r}}return n},right:function(t,e,n,i){if(n==null){n=0}if(i==null){i=t.length}while(n<i){var r=n+i>>>1;if(o(t[r],e)>0){i=r}else{n=r+1}}return n}}};function n(n){return function(t,e){return s(n(t),e)}}var i=E(s);var u=i.right;var h=function(t){return t===null?NaN:+t};var Ht=function(t,e){var n=t.length,i=-1,r,o,a;if(e==null){while(++i<n){if((r=t[i])!=null&&r>=r){o=a=r;while(++i<n){if((r=t[i])!=null){if(o>r){o=r}if(a<r){a=r}}}}}}else{while(++i<n){if((r=e(t[i],i,t))!=null&&r>=r){o=a=r;while(++i<n){if((r=e(t[i],i,t))!=null){if(o>r){o=r}if(a<r){a=r}}}}}}return[o,a]};var Vt=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(r);while(++i<r){o[i]=t+i*n}return o};var a=Math.sqrt(50);var l=Math.sqrt(10);var f=Math.sqrt(2);var v=function(t,e,n){var i,r=-1,o,a,s;e=+e,t=+t,n=+n;if(t===e&&n>0){return[t]}if(i=e<t){o=t,t=e,e=o}if((s=c(t,e,n))===0||!isFinite(s)){return[]}if(s>0){t=Math.ceil(t/s);e=Math.floor(e/s);a=new Array(o=Math.ceil(e-t+1));while(++r<o){a[r]=(t+r)*s}}else{t=Math.floor(t*s);e=Math.ceil(e*s);a=new Array(o=Math.ceil(t-e+1));while(++r<o){a[r]=(t-r)/s}}if(i){a.reverse()}return a};function c(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=a?10:o>=l?5:o>=f?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=a?10:o>=l?5:o>=f?2:1)}function S(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;if(o>=a){r*=10}else if(o>=l){r*=5}else if(o>=f){r*=2}return e<t?-r:r}var A=function(t,e,n){if(n==null){n=h}if(!(i=t.length)){return}if((e=+e)<=0||i<2){return+n(t[0],0,t)}if(e>=1){return+n(t[i-1],i-1,t)}var i,r=(i-1)*e,o=Math.floor(r),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(r-o)};var Ut=function(t,e){var n=t.length,i=-1,r,o;if(e==null){while(++i<n){if((r=t[i])!=null&&r>=r){o=r;while(++i<n){if((r=t[i])!=null&&r>o){o=r}}}}}else{while(++i<n){if((r=e(t[i],i,t))!=null&&r>=r){o=r;while(++i<n){if((r=e(t[i],i,t))!=null&&r>o){o=r}}}}}return o};var r=function(t,e){var n=t.length,i=n,r=-1,o,a=0;if(e==null){while(++r<n){if(!isNaN(o=h(t[r]))){a+=o}else{--i}}}else{while(++r<n){if(!isNaN(o=h(e(t[r],r,t)))){a+=o}else{--i}}}if(i){return a/i}};var Wt=function(t){var e=t.length,n,i=-1,r=0,o,a;while(++i<e){r+=t[i].length}o=new Array(r);while(--e>=0){a=t[e];n=a.length;while(--n>=0){o[--r]=a[n]}}return o};var qt=function(t,e){var n=t.length,i=-1,r,o;if(e==null){while(++i<n){if((r=t[i])!=null&&r>=r){o=r;while(++i<n){if((r=t[i])!=null&&o>r){o=r}}}}}else{while(++i<n){if((r=e(t[i],i,t))!=null&&r>=r){o=r;while(++i<n){if((r=e(t[i],i,t))!=null&&o>r){o=r}}}}}return o};var Xt=function(t,e){var n=t.length,i=-1,r,o=0;if(e==null){while(++i<n){if(r=+t[i]){o+=r}}}else{while(++i<n){if(r=+e(t[i],i,t)){o+=r}}}return o};var o="$";function d(){}d.prototype=_.prototype={constructor:d,has:function(t){return o+t in this},get:function(t){return this[o+t]},set:function(t,e){this[o+t]=e;return this},remove:function(t){var e=o+t;return e in this&&delete this[e]},clear:function(){var t=this;for(var e in t){if(e[0]===o){delete t[e]}}},keys:function(){var t=this;var e=[];for(var n in t){if(n[0]===o){e.push(n.slice(1))}}return e},values:function(){var t=this;var e=[];for(var n in t){if(n[0]===o){e.push(t[n])}}return e},entries:function(){var t=this;var e=[];for(var n in t){if(n[0]===o){e.push({key:n.slice(1),value:t[n]})}}return e},size:function(){var t=this;var e=0;for(var n in t){if(n[0]===o){++e}}return e},empty:function(){var t=this;for(var e in t){if(e[0]===o){return false}}return true},each:function(t){var e=this;for(var n in e){if(n[0]===o){t(e[n],n.slice(1),e)}}}};function _(t,e){var n=new d;if(t instanceof d){t.each(function(t,e){n.set(e,t)})}else if(Array.isArray(t)){var i=-1,r=t.length,o;if(e==null){while(++i<r){n.set(i,t[i])}}else{while(++i<r){n.set(e(o=t[i],i,t),o)}}}else if(t){for(var a in t){n.set(a,t[a])}}return n}var Gt=function(){var c=[],e=[],d,p,n;function g(t,n,i,r){if(n>=c.length){if(d!=null){t.sort(d)}return p!=null?p(t):t}var e=-1,o=t.length,a=c[n++],s,u,h=_(),l,f=i();while(++e<o){if(l=h.get(s=a(u=t[e])+"")){l.push(u)}else{h.set(s,[u])}}h.each(function(t,e){r(f,e,g(t,n,i,r))});return f}function o(t,n){if(++n>c.length){return t}var i,r=e[n-1];if(p!=null&&n>=c.length){i=t.entries()}else{i=[],t.each(function(t,e){i.push({key:e,values:o(t,n)})})}return r!=null?i.sort(function(t,e){return r(t.key,e.key)}):i}return n={object:function(t){return g(t,0,y,m)},map:function(t){return g(t,0,b,x)},entries:function(t){return o(g(t,0,b,x),0)},key:function(t){c.push(t);return n},sortKeys:function(t){e[c.length-1]=t;return n},sortValues:function(t){d=t;return n},rollup:function(t){p=t;return n}}};function y(){return{}}function m(t,e,n){t[e]=n}function b(){return _()}function x(t,e,n){t.set(e,n)}var p=function(t){var e=[];for(var n in t){e.push(n)}return e};var g=Array.prototype;var k=g.map;var w=g.slice;var C={name:"implicit"};function M(i){var o=_(),a=[],r=C;i=i==null?[]:w.call(i);function s(t){var e=t+"",n=o.get(e);if(!n){if(r!==C){return r}o.set(e,n=a.push(t))}return i[(n-1)%i.length]}s.domain=function(t){if(!arguments.length){return a.slice()}a=[],o=_();var e=-1,n=t.length,i,r;while(++e<n){if(!o.has(r=(i=t[e])+"")){o.set(r,a.push(i))}}return s};s.range=function(t){return arguments.length?(i=w.call(t),s):i.slice()};s.unknown=function(t){return arguments.length?(r=t,s):r};s.copy=function(){return M().domain(a).range(i).unknown(r)};return s}function T(){var t=M().unknown(undefined),o=t.domain,a=t.range,s=[0,1],u,h,l=false,f=0,c=0,d=.5;delete t.unknown;function e(){var t=o().length,e=s[1]<s[0],n=s[e-0],i=s[1-e];u=(i-n)/Math.max(1,t-f+c*2);if(l){u=Math.floor(u)}n+=(i-n-u*(t-f))*d;h=u*(1-f);if(l){n=Math.round(n),h=Math.round(h)}var r=Vt(t).map(function(t){return n+u*t});return a(e?r.reverse():r)}t.domain=function(t){return arguments.length?(o(t),e()):o()};t.range=function(t){return arguments.length?(s=[+t[0],+t[1]],e()):s.slice()};t.rangeRound=function(t){return s=[+t[0],+t[1]],l=true,e()};t.bandwidth=function(){return h};t.step=function(){return u};t.round=function(t){return arguments.length?(l=!!t,e()):l};t.padding=function(t){return arguments.length?(f=c=Math.max(0,Math.min(1,t)),e()):f};t.paddingInner=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),e()):f};t.paddingOuter=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),e()):c};t.align=function(t){return arguments.length?(d=Math.max(0,Math.min(1,t)),e()):d};t.copy=function(){return T().domain(o()).range(s).round(l).paddingInner(f).paddingOuter(c).align(d)};return e()}function B(t){var e=t.copy;t.padding=t.paddingOuter;delete t.paddingInner;delete t.paddingOuter;t.copy=function(){return B(e())};return t}function D(){return B(T().paddingInner(1))}var N=function(t,e,n){t.prototype=e.prototype=n;n.constructor=t};function P(t,e){var n=Object.create(t.prototype);for(var i in e){n[i]=e[i]}return n}function z(){}var O=.7;var F=1/O;var R="\\s*([+-]?\\d+)\\s*";var I="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*";var L="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";var j=/^#([0-9a-f]{3})$/;var H=/^#([0-9a-f]{6})$/;var V=new RegExp("^rgb\\("+[R,R,R]+"\\)$");var U=new RegExp("^rgb\\("+[L,L,L]+"\\)$");var W=new RegExp("^rgba\\("+[R,R,R,I]+"\\)$");var q=new RegExp("^rgba\\("+[L,L,L,I]+"\\)$");var X=new RegExp("^hsl\\("+[I,L,L]+"\\)$");var G=new RegExp("^hsla\\("+[I,L,L,I]+"\\)$");var Y={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};N(z,Q,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}});function Q(t){var e;t=(t+"").trim().toLowerCase();return(e=j.exec(t))?(e=parseInt(e[1],16),new et(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1)):(e=H.exec(t))?Z(parseInt(e[1],16)):(e=V.exec(t))?new et(e[1],e[2],e[3],1):(e=U.exec(t))?new et(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=W.exec(t))?K(e[1],e[2],e[3],e[4]):(e=q.exec(t))?K(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=X.exec(t))?it(e[1],e[2]/100,e[3]/100,1):(e=G.exec(t))?it(e[1],e[2]/100,e[3]/100,e[4]):Y.hasOwnProperty(t)?Z(Y[t]):t==="transparent"?new et(NaN,NaN,NaN,0):null}function Z(t){return new et(t>>16&255,t>>8&255,t&255,1)}function K(t,e,n,i){if(i<=0){t=e=n=NaN}return new et(t,e,n,i)}function J(t){if(!(t instanceof z)){t=Q(t)}if(!t){return new et}t=t.rgb();return new et(t.r,t.g,t.b,t.opacity)}function tt(t,e,n,i){return arguments.length===1?J(t):new et(t,e,n,i==null?1:i)}function et(t,e,n,i){this.r=+t;this.g=+e;this.b=+n;this.opacity=+i}N(et,tt,P(z,{brighter:function(t){t=t==null?F:Math.pow(F,t);return new et(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){t=t==null?O:Math.pow(O,t);return new et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&(0<=this.g&&this.g<=255)&&(0<=this.b&&this.b<=255)&&(0<=this.opacity&&this.opacity<=1)},hex:function(){return"#"+nt(this.r)+nt(this.g)+nt(this.b)},toString:function(){var t=this.opacity;t=isNaN(t)?1:Math.max(0,Math.min(1,t));return(t===1?"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))+(t===1?")":", "+t+")")}}));function nt(t){t=Math.max(0,Math.min(255,Math.round(t)||0));return(t<16?"0":"")+t.toString(16)}function it(t,e,n,i){if(i<=0){t=e=n=NaN}else if(n<=0||n>=1){t=e=NaN}else if(e<=0){t=NaN}return new at(t,e,n,i)}function rt(t){if(t instanceof at){return new at(t.h,t.s,t.l,t.opacity)}if(!(t instanceof z)){t=Q(t)}if(!t){return new at}if(t instanceof at){return t}t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,u=(o+r)/2;if(s){if(e===o){a=(n-i)/s+(n<i)*6}else if(n===o){a=(i-e)/s+2}else{a=(e-n)/s+4}s/=u<.5?o+r:2-o-r;a*=60}else{s=u>0&&u<1?0:a}return new at(a,s,u,t.opacity)}function ot(t,e,n,i){return arguments.length===1?rt(t):new at(t,e,n,i==null?1:i)}function at(t,e,n,i){this.h=+t;this.s=+e;this.l=+n;this.opacity=+i}N(at,ot,P(z,{brighter:function(t){t=t==null?F:Math.pow(F,t);return new at(this.h,this.s,this.l*t,this.opacity)},darker:function(t){t=t==null?O:Math.pow(O,t);return new at(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new et(st(t>=240?t-240:t+120,r,i),st(t,r,i),st(t<120?t+240:t-120,r,i),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)}}));function st(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var ut=Math.PI/180;var ht=180/Math.PI;var lt=18;var ft=.96422;var ct=1;var dt=.82521;var pt=4/29;var gt=6/29;var vt=3*gt*gt;var _t=gt*gt*gt;function yt(t){if(t instanceof bt){return new bt(t.l,t.a,t.b,t.opacity)}if(t instanceof kt){if(isNaN(t.h)){return new bt(t.l,0,0,t.opacity)}var e=t.h*ut;return new bt(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}if(!(t instanceof et)){t=J(t)}var n=Et(t.r),i=Et(t.g),r=Et(t.b),o=xt((.2225045*n+.7168786*i+.0606169*r)/ct),a,s;if(n===i&&i===r){a=s=o}else{a=xt((.4360747*n+.3850649*i+.1430804*r)/ft);s=xt((.0139322*n+.0971045*i+.7141733*r)/dt)}return new bt(116*o-16,500*(a-o),200*(o-s),t.opacity)}function mt(t,e,n,i){return arguments.length===1?yt(t):new bt(t,e,n,i==null?1:i)}function bt(t,e,n,i){this.l=+t;this.a=+e;this.b=+n;this.opacity=+i}N(bt,mt,P(z,{brighter:function(t){return new bt(this.l+lt*(t==null?1:t),this.a,this.b,this.opacity)},darker:function(t){return new bt(this.l-lt*(t==null?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;e=ft*wt(e);t=ct*wt(t);n=dt*wt(n);return new et(Ct(3.1338561*e-1.6168667*t-.4906146*n),Ct(-.9787684*e+1.9161415*t+.033454*n),Ct(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function xt(t){return t>_t?Math.pow(t,1/3):t/vt+pt}function wt(t){return t>gt?t*t*t:vt*(t-pt)}function Ct(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Et(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function St(t){if(t instanceof kt){return new kt(t.h,t.c,t.l,t.opacity)}if(!(t instanceof bt)){t=yt(t)}if(t.a===0&&t.b===0){return new kt(NaN,0,t.l,t.opacity)}var e=Math.atan2(t.b,t.a)*ht;return new kt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function At(t,e,n,i){return arguments.length===1?St(t):new kt(t,e,n,i==null?1:i)}function kt(t,e,n,i){this.h=+t;this.c=+e;this.l=+n;this.opacity=+i}N(kt,At,P(z,{brighter:function(t){return new kt(this.h,this.c,this.l+lt*(t==null?1:t),this.opacity)},darker:function(t){return new kt(this.h,this.c,this.l-lt*(t==null?1:t),this.opacity)},rgb:function(){return yt(this).rgb()}}));var Mt=-.14861;var Tt=+1.78277;var Bt=-.29227;var Dt=-.90649;var Nt=+1.97294;var Pt=Nt*Dt;var zt=Nt*Tt;var Ot=Tt*Bt-Dt*Mt;function Ft(t){if(t instanceof It){return new It(t.h,t.s,t.l,t.opacity)}if(!(t instanceof et)){t=J(t)}var e=t.r/255,n=t.g/255,i=t.b/255,r=(Ot*i+Pt*e-zt*n)/(Ot+Pt-zt),o=i-r,a=(Nt*(n-r)-Bt*o)/Dt,s=Math.sqrt(a*a+o*o)/(Nt*r*(1-r)),u=s?Math.atan2(a,o)*ht-120:NaN;return new It(u<0?u+360:u,s,r,t.opacity)}function Rt(t,e,n,i){return arguments.length===1?Ft(t):new It(t,e,n,i==null?1:i)}function It(t,e,n,i){this.h=+t;this.s=+e;this.l=+n;this.opacity=+i}N(It,Rt,P(z,{brighter:function(t){t=t==null?F:Math.pow(F,t);return new It(this.h,this.s,this.l*t,this.opacity)},darker:function(t){t=t==null?O:Math.pow(O,t);return new It(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*ut,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new et(255*(e+n*(Mt*i+Tt*r)),255*(e+n*(Bt*i+Dt*r)),255*(e+n*(Nt*i)),this.opacity)}}));var Lt=function(t){return function(){return t}};function jt(e,n){return function(t){return e+t*n}}function Yt(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(t){return Math.pow(e+t*n,i)}}function $t(t,e){var n=e-t;return n?jt(t,n>180||n<-180?n-360*Math.round(n/360):n):Lt(isNaN(t)?e:t)}function Qt(n){return(n=+n)===1?Zt:function(t,e){return e-t?Yt(t,e,n):Lt(isNaN(t)?e:t)}}function Zt(t,e){var n=e-t;return n?jt(t,n):Lt(isNaN(t)?e:t)}var Kt=function t(e){var a=Qt(e);function n(e,t){var n=a((e=tt(e)).r,(t=tt(t)).r),i=a(e.g,t.g),r=a(e.b,t.b),o=Zt(e.opacity,t.opacity);return function(t){e.r=n(t);e.g=i(t);e.b=r(t);e.opacity=o(t);return e+""}}n.gamma=t;return n}(1);var Jt=function(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n),a;for(a=0;a<i;++a){r[a]=ue(t[a],e[a])}for(;a<n;++a){o[a]=e[a]}return function(t){for(a=0;a<i;++a){o[a]=r[a](t)}return o}};var te=function(e,n){var i=new Date;return e=+e,n-=e,function(t){return i.setTime(e+n*t),i}};var ee=function(e,n){return e=+e,n-=e,function(t){return e+n*t}};var ne=function(t,e){var n={},i={},r;if(t===null||typeof t!=="object"){t={}}if(e===null||typeof e!=="object"){e={}}for(r in e){if(r in t){n[r]=ue(t[r],e[r])}else{i[r]=e[r]}}return function(t){for(r in n){i[r]=n[r](t)}return i}};var ie=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;var re=new RegExp(ie.source,"g");function oe(t){return function(){return t}}function ae(e){return function(t){return e(t)+""}}var se=function(t,i){var e=ie.lastIndex=re.lastIndex=0,n,r,o,a=-1,s=[],u=[];t=t+"",i=i+"";while((n=ie.exec(t))&&(r=re.exec(i))){if((o=r.index)>e){o=i.slice(e,o);if(s[a]){s[a]+=o}else{s[++a]=o}}if((n=n[0])===(r=r[0])){if(s[a]){s[a]+=r}else{s[++a]=r}}else{s[++a]=null;u.push({i:a,x:ee(n,r)})}e=re.lastIndex}if(e<i.length){o=i.slice(e);if(s[a]){s[a]+=o}else{s[++a]=o}}return s.length<2?u[0]?ae(u[0].x):oe(i):(i=u.length,function(t){for(var e=0,n;e<i;++e){s[(n=u[e]).i]=n.x(t)}return s.join("")})};var ue=function(t,e){var n=typeof e,i;return e==null||n==="boolean"?Lt(e):(n==="number"?ee:n==="string"?(i=Q(e))?(e=i,Kt):se:e instanceof Q?Kt:e instanceof Date?te:Array.isArray(e)?Jt:typeof e.valueOf!=="function"&&typeof e.toString!=="function"||isNaN(e)?ne:ee)(t,e)};var he=function(e,n){return e=+e,n-=e,function(t){return Math.round(e+n*t)}};var le=180/Math.PI;var fe={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};var ce=function(t,e,n,i,r,o){var a,s,u;if(a=Math.sqrt(t*t+e*e)){t/=a,e/=a}if(u=t*n+e*i){n-=t*u,i-=e*u}if(s=Math.sqrt(n*n+i*i)){n/=s,i/=s,u/=s}if(t*i<e*n){t=-t,e=-e,u=-u,a=-a}return{translateX:r,translateY:o,rotate:Math.atan2(e,t)*le,skewX:Math.atan(u)*le,scaleX:a,scaleY:s}};var de;var pe;var ge;var ve;function _e(t){if(t==="none"){return fe}if(!de){de=document.createElement("DIV"),pe=document.documentElement,ge=document.defaultView}de.style.transform=t;t=ge.getComputedStyle(pe.appendChild(de),null).getPropertyValue("transform");pe.removeChild(de);t=t.slice(7,-1).split(",");return ce(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5])}function ye(t){if(t==null){return fe}if(!ve){ve=document.createElementNS("http://www.w3.org/2000/svg","g")}ve.setAttribute("transform",t);if(!(t=ve.transform.baseVal.consolidate())){return fe}t=t.matrix;return ce(t.a,t.b,t.c,t.d,t.e,t.f)}function me(n,s,u,r){function h(t){return t.length?t.pop()+" ":""}function i(t,e,n,i,r,o){if(t!==n||e!==i){var a=r.push("translate(",null,s,null,u);o.push({i:a-4,x:ee(t,n)},{i:a-2,x:ee(e,i)})}else if(n||i){r.push("translate("+n+s+i+u)}}function a(t,e,n,i){if(t!==e){if(t-e>180){e+=360}else if(e-t>180){t+=360}i.push({i:n.push(h(n)+"rotate(",null,r)-2,x:ee(t,e)})}else if(e){n.push(h(n)+"rotate("+e+r)}}function l(t,e,n,i){if(t!==e){i.push({i:n.push(h(n)+"skewX(",null,r)-2,x:ee(t,e)})}else if(e){n.push(h(n)+"skewX("+e+r)}}function f(t,e,n,i,r,o){if(t!==n||e!==i){var a=r.push(h(r)+"scale(",null,",",null,")");o.push({i:a-4,x:ee(t,n)},{i:a-2,x:ee(e,i)})}else if(n!==1||i!==1){r.push(h(r)+"scale("+n+","+i+")")}}return function(t,e){var r=[],o=[];t=n(t),e=n(e);i(t.translateX,t.translateY,e.translateX,e.translateY,r,o);a(t.rotate,e.rotate,r,o);l(t.skewX,e.skewX,r,o);f(t.scaleX,t.scaleY,e.scaleX,e.scaleY,r,o);t=e=null;return function(t){var e=-1,n=o.length,i;while(++e<n){r[(i=o[e]).i]=i.x(t)}return r.join("")}}}var be=me(_e,"px, ","px)","deg)");var xe=me(ye,", ",")",")");var we=Math.SQRT2;var Ce=2;var Ee=4;var Se=1e-12;function Ae(t){return((t=Math.exp(t))+1/t)/2}function ke(t){return((t=Math.exp(t))-1/t)/2}function Me(t){return((t=Math.exp(2*t))-1)/(t+1)}var Te=function(t,e){var r=t[0],o=t[1],a=t[2],n=e[0],i=e[1],s=e[2],u=n-r,h=i-o,l=u*u+h*h,f,c;if(l<Se){c=Math.log(s/a)/we;f=function(t){return[r+t*u,o+t*h,a*Math.exp(we*t*c)]}}else{var d=Math.sqrt(l),p=(s*s-a*a+Ee*l)/(2*a*Ce*d),g=(s*s-a*a-Ee*l)/(2*s*Ce*d),v=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(g*g+1)-g);c=(_-v)/we;f=function(t){var e=t*c,n=Ae(v),i=a/(Ce*d)*(n*Me(we*e+v)-ke(v));return[r+i*u,o+i*h,a*n/Ae(we*e+v)]}}f.duration=c*1e3;return f};function Be(a){return function(e,t){var n=a((e=ot(e)).h,(t=ot(t)).h),i=Zt(e.s,t.s),r=Zt(e.l,t.l),o=Zt(e.opacity,t.opacity);return function(t){e.h=n(t);e.s=i(t);e.l=r(t);e.opacity=o(t);return e+""}}}var De=Be($t);var Ne=Be(Zt);function Pe(s){return function t(a){a=+a;function e(e,t){var n=s((e=Rt(e)).h,(t=Rt(t)).h),i=Zt(e.s,t.s),r=Zt(e.l,t.l),o=Zt(e.opacity,t.opacity);return function(t){e.h=n(t);e.s=i(t);e.l=r(Math.pow(t,a));e.opacity=o(t);return e+""}}e.gamma=t;return e}(1)}Pe($t);var ze=Pe(Zt);var Oe=function(t){return function(){return t}};var Fe=function(t){return+t};var Re=[0,1];function Ie(e,n){return(n-=e=+e)?function(t){return(t-e)/n}:Oe(n)}function Le(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:i(t)}}}function je(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:i(t)}}}function He(t,e,n,i){var r=t[0],o=t[1],a=e[0],s=e[1];if(o<r){r=n(o,r),a=i(s,a)}else{r=n(r,o),a=i(a,s)}return function(t){return a(r(t))}}function Ve(n,t,e,i){var r=Math.min(n.length,t.length)-1,o=new Array(r),a=new Array(r),s=-1;if(n[r]<n[0]){n=n.slice().reverse();t=t.slice().reverse()}while(++s<r){o[s]=e(n[s],n[s+1]);a[s]=i(t[s],t[s+1])}return function(t){var e=u(n,t,1,r)-1;return a[e](o[e](t))}}function Ue(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function We(e,n){var i=Re,r=Re,o=ue,a=false,s,u,h;function l(){s=Math.min(i.length,r.length)>2?Ve:He;u=h=null;return t}function t(t){return(u||(u=s(i,r,a?Le(e):e,o)))(+t)}t.invert=function(t){return(h||(h=s(r,i,Ie,a?je(n):n)))(+t)};t.domain=function(t){return arguments.length?(i=k.call(t,Fe),l()):i.slice()};t.range=function(t){return arguments.length?(r=w.call(t),l()):r.slice()};t.rangeRound=function(t){return r=w.call(t),o=he,l()};t.clamp=function(t){return arguments.length?(a=!!t,l()):a};t.interpolate=function(t){return arguments.length?(o=t,l()):o};return l()}var qe=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0){return null}var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]};var Xe=function(t){return t=qe(Math.abs(t)),t?t[1]:NaN};var Ge=function(s,u){return function(t,e){var n=t.length,i=[],r=0,o=s[0],a=0;while(n>0&&o>0){if(a+o+1>e){o=Math.max(1,e-a)}i.push(t.substring(n-=o,n+o));if((a+=o+1)>e){break}o=s[r=(r+1)%s.length]}return i.reverse().join(u)}};var Ye=function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}};var $e=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qe(t){return new Ze(t)}Qe.prototype=Ze.prototype;function Ze(t){if(!(e=$e.exec(t))){throw new Error("invalid format: "+t)}var e;this.fill=e[1]||" ";this.align=e[2]||">";this.sign=e[3]||"-";this.symbol=e[4]||"";this.zero=!!e[5];this.width=e[6]&&+e[6];this.comma=!!e[7];this.precision=e[8]&&+e[8].slice(1);this.trim=!!e[9];this.type=e[10]||""}Ze.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width==null?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision==null?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};var Ke=function(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n){switch(t[n]){case".":i=r=n;break;case"0":if(i===0){i=n}r=n;break;default:if(i>0){if(!+t[n]){break t}i=0}break}}return i>0?t.slice(0,i)+t.slice(r+1):t};var Je;var tn=function(t,e){var n=qe(t,e);if(!n){return t+""}var i=n[0],r=n[1],o=r-(Je=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+qe(t,Math.max(0,e+o-1))[0]};var en=function(t,e){var n=qe(t,e);if(!n){return t+""}var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")};var nn={"%":function(t,e){return(t*100).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(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 en(t*100,e)},r:en,s:tn,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};var rn=function(t){return t};var on=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];var an=function(t){var w=t.grouping&&t.thousands?Ge(t.grouping,t.thousands):rn,i=t.currency,C=t.decimal,E=t.numerals?Ye(t.numerals):rn,r=t.percent||"%";function a(t){t=Qe(t);var h=t.fill,l=t.align,f=t.sign,e=t.symbol,c=t.zero,d=t.width,p=t.comma,g=t.precision,v=t.trim,_=t.type;if(_==="n"){p=true,_="g"}else if(!nn[_]){g==null&&(g=12),v=true,_="g"}if(c||h==="0"&&l==="="){c=true,h="0",l="="}var y=e==="$"?i[0]:e==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",m=e==="$"?i[1]:/[%p]/.test(_)?r:"";var b=nn[_],x=/[defgprs%]/.test(_);g=g==null?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function n(t){var e=y,n=m,i,r,o;if(_==="c"){n=b(t)+n;t=""}else{t=+t;var a=t<0;t=b(Math.abs(t),g);if(v){t=Ke(t)}if(a&&+t===0){a=false}e=(a?f==="("?f:"-":f==="-"||f==="("?"":f)+e;n=(_==="s"?on[8+Je/3]:"")+n+(a&&f==="("?")":"");if(x){i=-1,r=t.length;while(++i<r){if(o=t.charCodeAt(i),48>o||o>57){n=(o===46?C+t.slice(i+1):t.slice(i))+n;t=t.slice(0,i);break}}}}if(p&&!c){t=w(t,Infinity)}var s=e.length+t.length+n.length,u=s<d?new Array(d-s+1).join(h):"";if(p&&c){t=w(u+t,u.length?d-n.length:Infinity),u=""}switch(l){case"<":t=e+t+n+u;break;case"=":t=e+u+t+n;break;case"^":t=u.slice(0,s=u.length>>1)+e+t+n+u.slice(s);break;default:t=u+e+t+n;break}return E(t)}n.toString=function(){return t+""};return n}function e(t,e){var n=a((t=Qe(t),t.type="f",t)),i=Math.max(-8,Math.min(8,Math.floor(Xe(e)/3)))*3,r=Math.pow(10,-i),o=on[8+i/3];return function(t){return n(r*t)+o}}return{format:a,formatPrefix:e}};var sn;var un;var hn;ln({decimal:".",thousands:",",grouping:[3],currency:["$",""]});function ln(t){sn=an(t);un=sn.format;hn=sn.formatPrefix;return sn}var fn=function(t){return Math.max(0,-Xe(Math.abs(t)))};var cn=function(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xe(e)/3)))*3-Xe(Math.abs(t)))};var dn=function(t,e){t=Math.abs(t),e=Math.abs(e)-t;return Math.max(0,Xe(e)-Xe(t))+1};var pn=function(t,e,n){var i=t[0],r=t[t.length-1],o=S(i,r,e==null?10:e),a;n=Qe(n==null?",f":n);switch(n.type){case"s":{var s=Math.max(Math.abs(i),Math.abs(r));if(n.precision==null&&!isNaN(a=cn(o,s))){n.precision=a}return hn(n,s)}case"":case"e":case"g":case"p":case"r":{if(n.precision==null&&!isNaN(a=dn(o,Math.max(Math.abs(i),Math.abs(r))))){n.precision=a-(n.type==="e")}break}case"f":case"%":{if(n.precision==null&&!isNaN(a=fn(o))){n.precision=a-(n.type==="%")*2}break}}return un(n)};function gn(s){var u=s.domain;s.ticks=function(t){var e=u();return v(e[0],e[e.length-1],t==null?10:t)};s.tickFormat=function(t,e){return pn(u(),t,e)};s.nice=function(t){if(t==null){t=10}var e=u(),n=0,i=e.length-1,r=e[n],o=e[i],a;if(o<r){a=r,r=o,o=a;a=n,n=i,i=a}a=c(r,o,t);if(a>0){r=Math.floor(r/a)*a;o=Math.ceil(o/a)*a;a=c(r,o,t)}else if(a<0){r=Math.ceil(r*a)/a;o=Math.floor(o*a)/a;a=c(r,o,t)}if(a>0){e[n]=Math.floor(r/a)*a;e[i]=Math.ceil(o/a)*a;u(e)}else if(a<0){e[n]=Math.ceil(r*a)/a;e[i]=Math.floor(o*a)/a;u(e)}return s};return s}function vn(){var t=We(Ie,ee);t.copy=function(){return Ue(t,vn())};return gn(t)}function _n(){var e=[0,1];function n(t){return+t}n.invert=n;n.domain=n.range=function(t){return arguments.length?(e=k.call(t,Fe),n):e.slice()};n.copy=function(){return _n().domain(e)};return gn(n)}var yn=function(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],o=t[i],a;if(o<r){a=n,n=i,i=a;a=r,r=o,o=a}t[n]=e.floor(r);t[i]=e.ceil(o);return t};function mn(e,n){return(n=Math.log(n/e))?function(t){return Math.log(t/e)/n}:Oe(n)}function bn(e,n){return e<0?function(t){return-Math.pow(-n,t)*Math.pow(-e,1-t)}:function(t){return Math.pow(n,t)*Math.pow(e,1-t)}}function xn(t){return isFinite(t)?+("1e"+t):t<0?0:t}function wn(e){return e===10?xn:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}function Cn(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}function En(e){return function(t){return-e(-t)}}function Sn(){var e=We(mn,bn).domain([1,10]),c=e.domain,d=10,p=Cn(10),g=wn(10);function n(){p=Cn(d),g=wn(d);if(c()[0]<0){p=En(p),g=En(g)}return e}e.base=function(t){return arguments.length?(d=+t,n()):d};e.domain=function(t){return arguments.length?(c(t),n()):c()};e.ticks=function(t){var e=c(),n=e[0],i=e[e.length-1],r;if(r=i<n){o=n,n=i,i=o}var o=p(n),a=p(i),s,u,h,l=t==null?10:+t,f=[];if(!(d%1)&&a-o<l){o=Math.round(o)-1,a=Math.round(a)+1;if(n>0){for(;o<a;++o){for(u=1,s=g(o);u<d;++u){h=s*u;if(h<n){continue}if(h>i){break}f.push(h)}}}else{for(;o<a;++o){for(u=d-1,s=g(o);u>=1;--u){h=s*u;if(h<n){continue}if(h>i){break}f.push(h)}}}}else{f=v(o,a,Math.min(a-o,l)).map(g)}return r?f.reverse():f};e.tickFormat=function(t,n){if(n==null){n=d===10?".0e":","}if(typeof n!=="function"){n=un(n)}if(t===Infinity){return n}if(t==null){t=10}var i=Math.max(1,d*t/e.ticks().length);return function(t){var e=t/g(Math.round(p(t)));if(e*d<d-.5){e*=d}return e<=i?n(t):""}};e.nice=function(){return c(yn(c(),{floor:function(t){return g(Math.floor(p(t)))},ceil:function(t){return g(Math.ceil(p(t)))}}))};e.copy=function(){return Ue(e,Sn().base(d))};return e}function An(t,e){return t<0?-Math.pow(-t,e):Math.pow(t,e)}function kn(){var i=1,t=We(n,r),e=t.domain;function n(e,n){return(n=An(n,i)-(e=An(e,i)))?function(t){return(An(t,i)-e)/n}:Oe(n)}function r(e,n){n=An(n,i)-(e=An(e,i));return function(t){return An(e+n*t,1/i)}}t.exponent=function(t){return arguments.length?(i=+t,e(e())):i};t.copy=function(){return Ue(t,kn().exponent(i))};return gn(t)}function Mn(){return kn().exponent(.5)}function Tn(){var r=[],n=[],i=[];function o(){var t=0,e=Math.max(1,n.length);i=new Array(e-1);while(++t<e){i[t-1]=A(r,t/e)}return a}function a(t){if(!isNaN(t=+t)){return n[u(i,t)]}}a.invertExtent=function(t){var e=n.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:r[0],e<i.length?i[e]:r[r.length-1]]};a.domain=function(t){if(!arguments.length){return r.slice()}r=[];for(var e=0,n=t.length,i;e<n;++e){if(i=t[e],i!=null&&!isNaN(i=+i)){r.push(i)}}r.sort(s);return o()};a.range=function(t){return arguments.length?(n=w.call(t),o()):n.slice()};a.quantiles=function(){return i.slice()};a.copy=function(){return Tn().domain(r).range(n)};return a}function Bn(){var n=0,i=1,r=1,o=[.5],a=[0,1];function e(t){if(t<=t){return a[u(o,t,0,r)]}}function s(){var t=-1;o=new Array(r);while(++t<r){o[t]=((t+1)*i-(t-r)*n)/(r+1)}return e}e.domain=function(t){return arguments.length?(n=+t[0],i=+t[1],s()):[n,i]};e.range=function(t){return arguments.length?(r=(a=w.call(t)).length-1,s()):a.slice()};e.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=r?[o[r-1],i]:[o[e-1],o[e]]};e.copy=function(){return Bn().domain([n,i]).range(a)};return gn(e)}function Dn(){var n=[.5],i=[0,1],e=1;function r(t){if(t<=t){return i[u(n,t,0,e)]}}r.domain=function(t){return arguments.length?(n=w.call(t),e=Math.min(n.length,i.length-1),r):n.slice()};r.range=function(t){return arguments.length?(i=w.call(t),e=Math.min(n.length,i.length-1),r):i.slice()};r.invertExtent=function(t){var e=i.indexOf(t);return[n[e-1],n[e]]};r.copy=function(){return Dn().domain(n).range(i)};return r}var Nn=new Date;var Pn=new Date;function zn(o,a,n,i){function s(t){return o(t=new Date(+t)),t}s.floor=s;s.ceil=function(t){return o(t=new Date(t-1)),a(t,1),o(t),t};s.round=function(t){var e=s(t),n=s.ceil(t);return t-e<n-t?e:n};s.offset=function(t,e){return a(t=new Date(+t),e==null?1:Math.floor(e)),t};s.range=function(t,e,n){var i=[],r;t=s.ceil(t);n=n==null?1:Math.floor(n);if(!(t<e)||!(n>0)){return i}do{i.push(r=new Date(+t)),a(t,n),o(t)}while(r<t&&t<e);return i};s.filter=function(n){return zn(function(t){if(t>=t){while(o(t),!n(t)){t.setTime(t-1)}}},function(t,e){if(t>=t){if(e<0){while(++e<=0){while(a(t,-1),!n(t)){}}}else{while(--e>=0){while(a(t,+1),!n(t)){}}}}})};if(n){s.count=function(t,e){Nn.setTime(+t),Pn.setTime(+e);o(Nn),o(Pn);return Math.floor(n(Nn,Pn))};s.every=function(e){e=Math.floor(e);return!isFinite(e)||!(e>0)?null:!(e>1)?s:s.filter(i?function(t){return i(t)%e===0}:function(t){return s.count(0,t)%e===0})}}return s}var On=zn(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});On.every=function(n){n=Math.floor(n);if(!isFinite(n)||!(n>0)){return null}if(!(n>1)){return On}return zn(function(t){t.setTime(Math.floor(t/n)*n)},function(t,e){t.setTime(+t+e*n)},function(t,e){return(e-t)/n})};var Fn=1e3;var Rn=6e4;var In=36e5;var Ln=864e5;var jn=6048e5;var Hn=zn(function(t){t.setTime(Math.floor(t/Fn)*Fn)},function(t,e){t.setTime(+t+e*Fn)},function(t,e){return(e-t)/Fn},function(t){return t.getUTCSeconds()});var Vn=zn(function(t){t.setTime(Math.floor(t/Rn)*Rn)},function(t,e){t.setTime(+t+e*Rn)},function(t,e){return(e-t)/Rn},function(t){return t.getMinutes()});var Un=zn(function(t){var e=t.getTimezoneOffset()*Rn%In;if(e<0){e+=In}t.setTime(Math.floor((+t-e)/In)*In+e)},function(t,e){t.setTime(+t+e*In)},function(t,e){return(e-t)/In},function(t){return t.getHours()});var Wn=zn(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())*Rn)/Ln},function(t){return t.getDate()-1});function qn(e){return zn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7);t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e*7)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Rn)/jn})}var Xn=qn(0);var Gn=qn(1);var Yn=qn(2);var $n=qn(3);var Qn=qn(4);var Zn=qn(5);var Kn=qn(6);var Jn=zn(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()+(e.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()});var ti=zn(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()});ti.every=function(n){return!isFinite(n=Math.floor(n))||!(n>0)?null:zn(function(t){t.setFullYear(Math.floor(t.getFullYear()/n)*n);t.setMonth(0,1);t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e*n)})};var ei=zn(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*Rn)},function(t,e){return(e-t)/Rn},function(t){return t.getUTCMinutes()});var ni=zn(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*In)},function(t,e){return(e-t)/In},function(t){return t.getUTCHours()});var ii=zn(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/Ln},function(t){return t.getUTCDate()-1});function ri(e){return zn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7);t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e*7)},function(t,e){return(e-t)/jn})}var oi=ri(0);var ai=ri(1);var si=ri(2);var ui=ri(3);var hi=ri(4);var li=ri(5);var fi=ri(6);var ci=zn(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()+(e.getUTCFullYear()-t.getUTCFullYear())*12},function(t){return t.getUTCMonth()});var di=zn(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()});di.every=function(n){return!isFinite(n=Math.floor(n))||!(n>0)?null:zn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/n)*n);t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e*n)})};function pi(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);e.setFullYear(t.y);return e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function gi(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));e.setUTCFullYear(t.y);return e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function vi(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function _i(t){var i=t.dateTime,r=t.date,o=t.time,e=t.periods,n=t.days,a=t.shortDays,s=t.months,u=t.shortMonths;var h=Ei(e),l=Si(e),f=Ei(n),c=Si(n),d=Ei(a),p=Si(a),g=Ei(s),v=Si(s),_=Ei(u),y=Si(u);var m={a:P,A:z,b:O,B:F,c:null,d:qi,e:qi,f:Qi,H:Xi,I:Gi,j:Yi,L:$i,m:Zi,M:Ki,p:R,Q:Ar,s:kr,S:Ji,u:tr,U:er,V:nr,w:ir,W:rr,x:null,X:null,y:or,Y:ar,Z:sr,"%":Sr};var b={a:I,A:L,b:j,B:H,c:null,d:ur,e:ur,f:dr,H:hr,I:lr,j:fr,L:cr,m:pr,M:gr,p:V,Q:Ar,s:kr,S:vr,u:_r,U:yr,V:mr,w:br,W:xr,x:null,X:null,y:wr,Y:Cr,Z:Er,"%":Sr};var x={a:A,A:k,b:M,B:T,c:B,d:Oi,e:Oi,f:Hi,H:Ri,I:Ri,j:Fi,L:ji,m:zi,M:Ii,p:S,Q:Ui,s:Wi,S:Li,u:ki,U:Mi,V:Ti,w:Ai,W:Bi,x:D,X:N,y:Ni,Y:Di,Z:Pi,"%":Vi};m.x=w(r,m);m.X=w(o,m);m.c=w(i,m);b.x=w(r,b);b.X=w(o,b);b.c=w(i,b);function w(u,h){return function(t){var e=[],n=-1,i=0,r=u.length,o,a,s;if(!(t instanceof Date)){t=new Date(+t)}while(++n<r){if(u.charCodeAt(n)===37){e.push(u.slice(i,n));if((a=yi[o=u.charAt(++n)])!=null){o=u.charAt(++n)}else{a=o==="e"?" ":"0"}if(s=h[o]){o=s(t,a)}e.push(o);i=n+1}}e.push(u.slice(i,n));return e.join("")}}function C(o,a){return function(t){var e=vi(1900),n=E(e,o,t+="",0),i,r;if(n!=t.length){return null}if("Q"in e){return new Date(e.Q)}if("p"in e){e.H=e.H%12+e.p*12}if("V"in e){if(e.V<1||e.V>53){return null}if(!("w"in e)){e.w=1}if("Z"in e){i=gi(vi(e.y)),r=i.getUTCDay();i=r>4||r===0?ai.ceil(i):ai(i);i=ii.offset(i,(e.V-1)*7);e.y=i.getUTCFullYear();e.m=i.getUTCMonth();e.d=i.getUTCDate()+(e.w+6)%7}else{i=a(vi(e.y)),r=i.getDay();i=r>4||r===0?Gn.ceil(i):Gn(i);i=Wn.offset(i,(e.V-1)*7);e.y=i.getFullYear();e.m=i.getMonth();e.d=i.getDate()+(e.w+6)%7}}else if("W"in e||"U"in e){if(!("w"in e)){e.w="u"in e?e.u%7:"W"in e?1:0}r="Z"in e?gi(vi(e.y)).getUTCDay():a(vi(e.y)).getDay();e.m=0;e.d="W"in e?(e.w+6)%7+e.W*7-(r+5)%7:e.w+e.U*7-(r+6)%7}if("Z"in e){e.H+=e.Z/100|0;e.M+=e.Z%100;return gi(e)}return a(e)}}function E(t,e,n,i){var r=0,o=e.length,a=n.length,s,u;while(r<o){if(i>=a){return-1}s=e.charCodeAt(r++);if(s===37){s=e.charAt(r++);u=x[s in yi?e.charAt(r++):s];if(!u||(i=u(t,n,i))<0){return-1}}else if(s!=n.charCodeAt(i++)){return-1}}return i}function S(t,e,n){var i=h.exec(e.slice(n));return i?(t.p=l[i[0].toLowerCase()],n+i[0].length):-1}function A(t,e,n){var i=d.exec(e.slice(n));return i?(t.w=p[i[0].toLowerCase()],n+i[0].length):-1}function k(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=c[i[0].toLowerCase()],n+i[0].length):-1}function M(t,e,n){var i=_.exec(e.slice(n));return i?(t.m=y[i[0].toLowerCase()],n+i[0].length):-1}function T(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=v[i[0].toLowerCase()],n+i[0].length):-1}function B(t,e,n){return E(t,i,e,n)}function D(t,e,n){return E(t,r,e,n)}function N(t,e,n){return E(t,o,e,n)}function P(t){return a[t.getDay()]}function z(t){return n[t.getDay()]}function O(t){return u[t.getMonth()]}function F(t){return s[t.getMonth()]}function R(t){return e[+(t.getHours()>=12)]}function I(t){return a[t.getUTCDay()]}function L(t){return n[t.getUTCDay()]}function j(t){return u[t.getUTCMonth()]}function H(t){return s[t.getUTCMonth()]}function V(t){return e[+(t.getUTCHours()>=12)]}return{format:function(t){var e=w(t+="",m);e.toString=function(){return t};return e},parse:function(t){var e=C(t+="",pi);e.toString=function(){return t};return e},utcFormat:function(t){var e=w(t+="",b);e.toString=function(){return t};return e},utcParse:function(t){var e=C(t,gi);e.toString=function(){return t};return e}}}var yi={"-":"",_:" ",0:"0"};var mi=/^\s*\d+/;var bi=/^%/;var xi=/[\\^$*+?|[\]().{}]/g;function wi(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function Ci(t){return t.replace(xi,"\\$&")}function Ei(t){return new RegExp("^(?:"+t.map(Ci).join("|")+")","i")}function Si(t){var e={},n=-1,i=t.length;while(++n<i){e[t[n].toLowerCase()]=n}return e}function Ai(t,e,n){var i=mi.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function ki(t,e,n){var i=mi.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Mi(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Ti(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Bi(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Di(t,e,n){var i=mi.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Ni(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Pi(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function zi(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Oi(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Fi(t,e,n){var i=mi.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Ri(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Ii(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Li(t,e,n){var i=mi.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function ji(t,e,n){var i=mi.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Hi(t,e,n){var i=mi.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Vi(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Ui(t,e,n){var i=mi.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Wi(t,e,n){var i=mi.exec(e.slice(n));return i?(t.Q=+i[0]*1e3,n+i[0].length):-1}function qi(t,e){return wi(t.getDate(),e,2)}function Xi(t,e){return wi(t.getHours(),e,2)}function Gi(t,e){return wi(t.getHours()%12||12,e,2)}function Yi(t,e){return wi(1+Wn.count(ti(t),t),e,3)}function $i(t,e){return wi(t.getMilliseconds(),e,3)}function Qi(t,e){return $i(t,e)+"000"}function Zi(t,e){return wi(t.getMonth()+1,e,2)}function Ki(t,e){return wi(t.getMinutes(),e,2)}function Ji(t,e){return wi(t.getSeconds(),e,2)}function tr(t){var e=t.getDay();return e===0?7:e}function er(t,e){return wi(Xn.count(ti(t),t),e,2)}function nr(t,e){var n=t.getDay();t=n>=4||n===0?Qn(t):Qn.ceil(t);return wi(Qn.count(ti(t),t)+(ti(t).getDay()===4),e,2)}function ir(t){return t.getDay()}function rr(t,e){return wi(Gn.count(ti(t),t),e,2)}function or(t,e){return wi(t.getFullYear()%100,e,2)}function ar(t,e){return wi(t.getFullYear()%1e4,e,4)}function sr(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+wi(e/60|0,"0",2)+wi(e%60,"0",2)}function ur(t,e){return wi(t.getUTCDate(),e,2)}function hr(t,e){return wi(t.getUTCHours(),e,2)}function lr(t,e){return wi(t.getUTCHours()%12||12,e,2)}function fr(t,e){return wi(1+ii.count(di(t),t),e,3)}function cr(t,e){return wi(t.getUTCMilliseconds(),e,3)}function dr(t,e){return cr(t,e)+"000"}function pr(t,e){return wi(t.getUTCMonth()+1,e,2)}function gr(t,e){return wi(t.getUTCMinutes(),e,2)}function vr(t,e){return wi(t.getUTCSeconds(),e,2)}function _r(t){var e=t.getUTCDay();return e===0?7:e}function yr(t,e){return wi(oi.count(di(t),t),e,2)}function mr(t,e){var n=t.getUTCDay();t=n>=4||n===0?hi(t):hi.ceil(t);return wi(hi.count(di(t),t)+(di(t).getUTCDay()===4),e,2)}function br(t){return t.getUTCDay()}function xr(t,e){return wi(ai.count(di(t),t),e,2)}function wr(t,e){return wi(t.getUTCFullYear()%100,e,2)}function Cr(t,e){return wi(t.getUTCFullYear()%1e4,e,4)}function Er(){return"+0000"}function Sr(){return"%"}function Ar(t){return+t}function kr(t){return Math.floor(+t/1e3)}var Mr;var Tr;var Br;var Dr;Nr({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"]});function Nr(t){Mr=_i(t);Tr=Mr.format;Br=Mr.utcFormat;Dr=Mr.utcParse;return Mr}var Pr="%Y-%m-%dT%H:%M:%S.%LZ";function zr(t){return t.toISOString()}var Or=Date.prototype.toISOString?zr:Br(Pr);function Fr(t){var e=new Date(t);return isNaN(e)?null:e}var Rr=+new Date("2000-01-01T00:00:00.000Z")?Fr:Dr(Pr);var Ir=1e3;var Lr=Ir*60;var jr=Lr*60;var Hr=jr*24;var Vr=Hr*7;var Ur=Hr*30;var Wr=Hr*365;function qr(t){return new Date(t)}function Xr(t){return t instanceof Date?+t:+new Date(+t)}function Gr(a,e,n,i,r,o,s,u,h){var l=We(Ie,ee),f=l.invert,c=l.domain;var d=h(".%L"),p=h(":%S"),g=h("%I:%M"),v=h("%I %p"),_=h("%a %d"),y=h("%b %d"),m=h("%B"),b=h("%Y");var x=[[s,1,Ir],[s,5,5*Ir],[s,15,15*Ir],[s,30,30*Ir],[o,1,Lr],[o,5,5*Lr],[o,15,15*Lr],[o,30,30*Lr],[r,1,jr],[r,3,3*jr],[r,6,6*jr],[r,12,12*jr],[i,1,Hr],[i,2,2*Hr],[n,1,Vr],[e,1,Ur],[e,3,3*Ur],[a,1,Wr]];function w(t){return(s(t)<t?d:o(t)<t?p:r(t)<t?g:i(t)<t?v:e(t)<t?n(t)<t?_:y:a(t)<t?m:b)(t)}function C(t,e,n,i){if(t==null){t=10}if(typeof t==="number"){var r=Math.abs(n-e)/t,o=E(function(t){return t[2]}).right(x,r);if(o===x.length){i=S(e/Wr,n/Wr,t);t=a}else if(o){o=x[r/x[o-1][2]<x[o][2]/r?o-1:o];i=o[1];t=o[0]}else{i=Math.max(S(e,n,t),1);t=u}}return i==null?t:t.every(i)}l.invert=function(t){return new Date(f(t))};l.domain=function(t){return arguments.length?c(k.call(t,Xr)):c().map(qr)};l.ticks=function(t,e){var n=c(),i=n[0],r=n[n.length-1],o=r<i,a;if(o){a=i,i=r,r=a}a=C(t,i,r,e);a=a?a.range(i,r+1):[];return o?a.reverse():a};l.tickFormat=function(t,e){return e==null?w:h(e)};l.nice=function(t,e){var n=c();return(t=C(t,n[0],n[n.length-1],e))?c(yn(n,t)):l};l.copy=function(){return Ue(l,Gr(a,e,n,i,r,o,s,u,h))};return l}var Yr=function(){return Gr(ti,Jn,Xn,Wn,Un,Vn,Hn,On,Tr).domain([new Date(2e3,0,1),new Date(2e3,0,2)])};var $r=function(){return Gr(di,ci,oi,ii,ni,ei,Hn,On,Br).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])};function Qr(n){var i=0,r=1,o=false;function e(t){var e=(t-i)/(r-i);return n(o?Math.max(0,Math.min(1,e)):e)}e.domain=function(t){return arguments.length?(i=+t[0],r=+t[1],e):[i,r]};e.clamp=function(t){return arguments.length?(o=!!t,e):o};e.interpolator=function(t){return arguments.length?(n=t,e):n};e.copy=function(){return Qr(n).domain([i,r]).clamp(o)};return gn(e)}var Zr=Object.freeze({scaleBand:T,scalePoint:D,scaleIdentity:_n,scaleLinear:vn,scaleLog:Sn,scaleOrdinal:M,scaleImplicit:C,scalePow:kn,scaleSqrt:Mn,scaleQuantile:Tn,scaleQuantize:Bn,scaleThreshold:Dn,scaleTime:Yr,scaleUtc:$r,scaleSequential:Qr});var Kr="http://www.w3.org/1999/xhtml";var Jr={svg:"http://www.w3.org/2000/svg",xhtml:Kr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var to=function(t){var e=t+="",n=e.indexOf(":");if(n>=0&&(e=t.slice(0,n))!=="xmlns"){t=t.slice(n+1)}return Jr.hasOwnProperty(e)?{space:Jr[e],local:t}:t};function eo(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===Kr&&t.documentElement.namespaceURI===Kr?t.createElement(n):t.createElementNS(e,n)}}function no(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var io=function(t){var e=to(t);return(e.local?no:eo)(e)};function ro(){}var oo=function(t){return t==null?ro:function(){return this.querySelector(t)}};var ao=function(t){if(typeof t!=="function"){t=oo(t)}for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r){for(var o=e[r],a=o.length,s=i[r]=new Array(a),u,h,l=0;l<a;++l){if((u=o[l])&&(h=t.call(u,u.__data__,l,o))){if("__data__"in u){h.__data__=u.__data__}s[l]=h}}}return new Ua(i,this._parents)};function so(){return[]}var uo=function(t){return t==null?so:function(){return this.querySelectorAll(t)}};var ho=function(t){if(typeof t!=="function"){t=uo(t)}for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o){for(var a=e[o],s=a.length,u,h=0;h<s;++h){if(u=a[h]){i.push(t.call(u,u.__data__,h,a));r.push(u)}}}return new Ua(i,r)};var lo=function(t){return function(){return this.matches(t)}};if(typeof document!=="undefined"){var fo=document.documentElement;if(!fo.matches){var co=fo.webkitMatchesSelector||fo.msMatchesSelector||fo.mozMatchesSelector||fo.oMatchesSelector;lo=function(t){return function(){return co.call(this,t)}}}}var po=lo;var go=function(t){if(typeof t!=="function"){t=po(t)}for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r){for(var o=e[r],a=o.length,s=i[r]=[],u,h=0;h<a;++h){if((u=o[h])&&t.call(u,u.__data__,h,o)){s.push(u)}}}return new Ua(i,this._parents)};var vo=function(t){return new Array(t.length)};var _o=function(){return new Ua(this._enter||this._groups.map(vo),this._parents)};function yo(t,e){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=e}yo.prototype={constructor:yo,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)}};var mo=function(t){return function(){return t}};var bo="$";function xo(t,e,n,i,r,o){var a=0,s,u=e.length,h=o.length;for(;a<h;++a){if(s=e[a]){s.__data__=o[a];i[a]=s}else{n[a]=new yo(t,o[a])}}for(;a<u;++a){if(s=e[a]){r[a]=s}}}function wo(t,e,n,i,r,o,a){var s,u,h={},l=e.length,f=o.length,c=new Array(l),d;for(s=0;s<l;++s){if(u=e[s]){c[s]=d=bo+a.call(u,u.__data__,s,e);if(d in h){r[s]=u}else{h[d]=u}}}for(s=0;s<f;++s){d=bo+a.call(t,o[s],s,o);if(u=h[d]){i[s]=u;u.__data__=o[s];h[d]=null}else{n[s]=new yo(t,o[s])}}for(s=0;s<l;++s){if((u=e[s])&&h[c[s]]===u){r[s]=u}}}var Co=function(t,e){if(!t){d=new Array(this.size()),h=-1;this.each(function(t){d[++h]=t});return d}var n=e?wo:xo,i=this._parents,r=this._groups;if(typeof t!=="function"){t=mo(t)}for(var o=r.length,a=new Array(o),s=new Array(o),u=new Array(o),h=0;h<o;++h){var l=i[h],f=r[h],c=f.length,d=t.call(l,l&&l.__data__,h,i),p=d.length,g=s[h]=new Array(p),v=a[h]=new Array(p),_=u[h]=new Array(c);n(l,f,g,v,_,d,e);for(var y=0,m=0,b,x;y<p;++y){if(b=g[y]){if(y>=m){m=y+1}while(!(x=v[m])&&++m<p){}b._next=x||null}}}a=new Ua(a,i);a._enter=s;a._exit=u;return a};var Eo=function(){return new Ua(this._exit||this._groups.map(vo),this._parents)};var So=function(t){for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),a=new Array(i),s=0;s<o;++s){for(var u=e[s],h=n[s],l=u.length,f=a[s]=new Array(l),c,d=0;d<l;++d){if(c=u[d]||h[d]){f[d]=c}}}for(;s<i;++s){a[s]=e[s]}return new Ua(a,this._parents)};var Ao=function(){for(var t=this._groups,e=-1,n=t.length;++e<n;){for(var i=t[e],r=i.length-1,o=i[r],a;--r>=0;){if(a=i[r]){if(o&&o!==a.nextSibling){o.parentNode.insertBefore(a,o)}o=a}}}return this};var ko=function(n){if(!n){n=Mo}function t(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}for(var e=this._groups,i=e.length,r=new Array(i),o=0;o<i;++o){for(var a=e[o],s=a.length,u=r[o]=new Array(s),h,l=0;l<s;++l){if(h=a[l]){u[l]=h}}u.sort(t)}return new Ua(r,this._parents).order()};function Mo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var To=function(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this};var Bo=function(){var t=new Array(this.size()),e=-1;this.each(function(){t[++e]=this});return t};var Do=function(){for(var t=this._groups,e=0,n=t.length;e<n;++e){for(var i=t[e],r=0,o=i.length;r<o;++r){var a=i[r];if(a){return a}}}return null};var No=function(){var t=0;this.each(function(){++t});return t};var Po=function(){return!this.node()};var zo=function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n){for(var r=e[n],o=0,a=r.length,s;o<a;++o){if(s=r[o]){t.call(s,s.__data__,o,r)}}}return this};function Oo(t){return function(){this.removeAttribute(t)}}function Fo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ro(t,e){return function(){this.setAttribute(t,e)}}function Io(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Lo(e,n){return function(){var t=n.apply(this,arguments);if(t==null){this.removeAttribute(e)}else{this.setAttribute(e,t)}}}function jo(e,n){return function(){var t=n.apply(this,arguments);if(t==null){this.removeAttributeNS(e.space,e.local)}else{this.setAttributeNS(e.space,e.local,t)}}}var Ho=function(t,e){var n=to(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?Fo:Oo:typeof e==="function"?n.local?jo:Lo:n.local?Io:Ro)(n,e))};var Vo=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Uo(t){return function(){this.style.removeProperty(t)}}function Wo(t,e,n){return function(){this.style.setProperty(t,e,n)}}function qo(e,n,i){return function(){var t=n.apply(this,arguments);if(t==null){this.style.removeProperty(e)}else{this.style.setProperty(e,t,i)}}}var Xo=function(t,e,n){return arguments.length>1?this.each((e==null?Uo:typeof e==="function"?qo:Wo)(t,e,n==null?"":n)):Go(this.node(),t)};function Go(t,e){return t.style.getPropertyValue(e)||Vo(t).getComputedStyle(t,null).getPropertyValue(e)}function Yo(t){return function(){delete this[t]}}function $o(t,e){return function(){this[t]=e}}function Qo(e,n){return function(){var t=n.apply(this,arguments);if(t==null){delete this[e]}else{this[e]=t}}}var Zo=function(t,e){return arguments.length>1?this.each((e==null?Yo:typeof e==="function"?Qo:$o)(t,e)):this.node()[t]};function Ko(t){return t.trim().split(/^|\s+/)}function Jo(t){return t.classList||new ta(t)}function ta(t){this._node=t;this._names=Ko(t.getAttribute("class")||"")}ta.prototype={add:function(t){var e=this._names.indexOf(t);if(e<0){this._names.push(t);this._node.setAttribute("class",this._names.join(" "))}},remove:function(t){var e=this._names.indexOf(t);if(e>=0){this._names.splice(e,1);this._node.setAttribute("class",this._names.join(" "))}},contains:function(t){return this._names.indexOf(t)>=0}};function ea(t,e){var n=Jo(t),i=-1,r=e.length;while(++i<r){n.add(e[i])}}function na(t,e){var n=Jo(t),i=-1,r=e.length;while(++i<r){n.remove(e[i])}}function ia(t){return function(){ea(this,t)}}function ra(t){return function(){na(this,t)}}function oa(t,e){return function(){(e.apply(this,arguments)?ea:na)(this,t)}}var aa=function(t,e){var n=Ko(t+"");if(arguments.length<2){var i=Jo(this.node()),r=-1,o=n.length;while(++r<o){if(!i.contains(n[r])){return false}}return true}return this.each((typeof e==="function"?oa:e?ia:ra)(n,e))};function sa(){this.textContent=""}function ua(t){return function(){this.textContent=t}}function ha(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}var la=function(t){return arguments.length?this.each(t==null?sa:(typeof t==="function"?ha:ua)(t)):this.node().textContent};function fa(){this.innerHTML=""}function ca(t){return function(){this.innerHTML=t}}function da(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}var pa=function(t){return arguments.length?this.each(t==null?fa:(typeof t==="function"?da:ca)(t)):this.node().innerHTML};function ga(){if(this.nextSibling){this.parentNode.appendChild(this)}}var va=function(){return this.each(ga)};function _a(){if(this.previousSibling){this.parentNode.insertBefore(this,this.parentNode.firstChild)}}var ya=function(){return this.each(_a)};var ma=function(t){var e=typeof t==="function"?t:io(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})};function ba(){return null}var xa=function(t,e){var n=typeof t==="function"?t:io(t),i=e==null?ba:typeof e==="function"?e:oo(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})};function wa(){var t=this.parentNode;if(t){t.removeChild(this)}}var Ca=function(){return this.each(wa)};function Ea(){return this.parentNode.insertBefore(this.cloneNode(false),this.nextSibling)}function Sa(){return this.parentNode.insertBefore(this.cloneNode(true),this.nextSibling)}var Aa=function(t){return this.select(t?Sa:Ea)};var ka=function(t){return arguments.length?this.property("__data__",t):this.node().__data__};var Ma={};var Ta=null;if(typeof document!=="undefined"){var Ba=document.documentElement;if(!("onmouseenter"in Ba)){Ma={mouseenter:"mouseover",mouseleave:"mouseout"}}}function Da(n,t,e){n=Na(n,t,e);return function(t){var e=t.relatedTarget;if(!e||e!==this&&!(e.compareDocumentPosition(this)&8)){n.call(this,t)}}}function Na(n,i,r){return function(t){var e=Ta;Ta=t;try{n.call(this,this.__data__,i,r)}finally{Ta=e}}}function Pa(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0){e=t.slice(n+1),t=t.slice(0,n)}return{type:t,name:e}})}function za(a){return function(){var t=this;var e=this.__on;if(!e){return}for(var n=0,i=-1,r=e.length,o;n<r;++n){if(o=e[n],(!a.type||o.type===a.type)&&o.name===a.name){t.removeEventListener(o.type,o.listener,o.capture)}else{e[++i]=o}}if(++i){e.length=i}else{delete this.__on}}}function Oa(h,l,f){var c=Ma.hasOwnProperty(h.type)?Da:Na;return function(t,e,n){var i=this;var r=this.__on,o,a=c(l,e,n);if(r){for(var s=0,u=r.length;s<u;++s){if((o=r[s]).type===h.type&&o.name===h.name){i.removeEventListener(o.type,o.listener,o.capture);i.addEventListener(o.type,o.listener=a,o.capture=f);o.value=l;return}}}this.addEventListener(h.type,a,f);o={type:h.type,name:h.name,value:l,listener:a,capture:f};if(!r){this.__on=[o]}else{r.push(o)}}}var Fa=function(t,e,n){var i=this;var r=Pa(t+""),o,a=r.length,s;if(arguments.length<2){var u=this.node().__on;if(u){for(var h=0,l=u.length,f;h<l;++h){for(o=0,f=u[h];o<a;++o){if((s=r[o]).type===f.type&&s.name===f.name){return f.value}}}}return}u=e?Oa:za;if(n==null){n=false}for(o=0;o<a;++o){i.each(u(r[o],e,n))}return this};function Ra(t,e,n,i){var r=Ta;t.sourceEvent=Ta;Ta=t;try{return e.apply(n,i)}finally{Ta=r}}function Ia(t,e,n){var i=Vo(t),r=i.CustomEvent;if(typeof r==="function"){r=new r(e,n)}else{r=i.document.createEvent("Event");if(n){r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail}else{r.initEvent(e,false,false)}}t.dispatchEvent(r)}function La(t,e){return function(){return Ia(this,t,e)}}function ja(t,e){return function(){return Ia(this,t,e.apply(this,arguments))}}var Ha=function(t,e){return this.each((typeof e==="function"?ja:La)(t,e))};var Va=[null];function Ua(t,e){this._groups=t;this._parents=e}function Wa(){return new Ua([[document.documentElement]],Va)}Ua.prototype=Wa.prototype={constructor:Ua,select:ao,selectAll:ho,filter:go,data:Co,enter:_o,exit:Eo,merge:So,order:Ao,sort:ko,call:To,nodes:Bo,node:Do,size:No,empty:Po,each:zo,attr:Ho,style:Xo,property:Zo,classed:aa,text:la,html:pa,raise:va,lower:ya,append:ma,insert:xa,remove:Ca,clone:Aa,datum:ka,on:Fa,dispatch:Ha};var qa=function(t){return typeof t==="string"?new Ua([[document.querySelector(t)]],[document.documentElement]):new Ua([[t]],Va)};var Xa=function(){var t=Ta,e;while(e=t.sourceEvent){t=e}return t};var Ga=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();i.x=e.clientX,i.y=e.clientY;i=i.matrixTransform(t.getScreenCTM().inverse());return[i.x,i.y]}var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]};var Ya=function(t){var e=Xa();if(e.changedTouches){e=e.changedTouches[0]}return Ga(t,e)};var $a=function(t){return typeof t==="string"?new Ua([document.querySelectorAll(t)],[document.documentElement]):new Ua([t==null?[]:t],Va)};var Qa=function(t,e,n){if(arguments.length<3){n=e,e=Xa().changedTouches}for(var i=0,r=e?e.length:0,o;i<r;++i){if((o=e[i]).identifier===n){return Ga(t,o)}}return null};var Za={value:function(){}};function Ka(){var t=arguments;for(var e=0,n=arguments.length,i={},r;e<n;++e){if(!(r=t[e]+"")||r in i){throw new Error("illegal type: "+r)}i[r]=[]}return new Ja(i)}function Ja(t){this._=t}function ts(t,i){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0){e=t.slice(n+1),t=t.slice(0,n)}if(t&&!i.hasOwnProperty(t)){throw new Error("unknown type: "+t)}return{type:t,name:e}})}Ja.prototype=Ka.prototype={constructor:Ja,on:function(t,e){var n=this._,i=ts(t+"",n),r,o=-1,a=i.length;if(arguments.length<2){while(++o<a){if((r=(t=i[o]).type)&&(r=es(n[r],t.name))){return r}}return}if(e!=null&&typeof e!=="function"){throw new Error("invalid callback: "+e)}while(++o<a){if(r=(t=i[o]).type){n[r]=ns(n[r],t.name,e)}else if(e==null){for(r in n){n[r]=ns(n[r],t.name,null)}}}return this},copy:function(){var t={},e=this._;for(var n in e){t[n]=e[n].slice()}return new Ja(t)},call:function(t,e){var n=arguments;if((o=arguments.length-2)>0){for(var i=new Array(o),r=0,o,a;r<o;++r){i[r]=n[r+2]}}if(!this._.hasOwnProperty(t)){throw new Error("unknown type: "+t)}for(a=this._[t],r=0,o=a.length;r<o;++r){a[r].value.apply(e,i)}},apply:function(t,e,n){if(!this._.hasOwnProperty(t)){throw new Error("unknown type: "+t)}for(var i=this._[t],r=0,o=i.length;r<o;++r){i[r].value.apply(e,n)}}};function es(t,e){for(var n=0,i=t.length,r;n<i;++n){if((r=t[n]).name===e){return r.value}}}function ns(t,e,n){for(var i=0,r=t.length;i<r;++i){if(t[i].name===e){t[i]=Za,t=t.slice(0,i).concat(t.slice(i+1));break}}if(n!=null){t.push({name:e,value:n})}return t}var is=0;var rs=0;var os=0;var as=1e3;var ss;var us;var hs=0;var ls=0;var fs=0;var cs=typeof performance==="object"&&performance.now?performance:Date;var ds=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ps(){return ls||(ds(gs),ls=cs.now()+fs)}function gs(){ls=0}function vs(){this._call=this._time=this._next=null}vs.prototype=_s.prototype={constructor:vs,restart:function(t,e,n){if(typeof t!=="function"){throw new TypeError("callback is not a function")}n=(n==null?ps():+n)+(e==null?0:+e);if(!this._next&&us!==this){if(us){us._next=this}else{ss=this}us=this}this._call=t;this._time=n;ws()},stop:function(){if(this._call){this._call=null;this._time=Infinity;ws()}}};function _s(t,e,n){var i=new vs;i.restart(t,e,n);return i}function ys(){ps();++is;var t=ss,e;while(t){if((e=ls-t._time)>=0){t._call.call(null,e)}t=t._next}--is}function ms(){ls=(hs=cs.now())+fs;is=rs=0;try{ys()}finally{is=0;xs();ls=0}}function bs(){var t=cs.now(),e=t-hs;if(e>as){fs-=e,hs=t}}function xs(){var t,e=ss,n,i=Infinity;while(e){if(e._call){if(i>e._time){i=e._time}t=e,e=e._next}else{n=e._next,e._next=null;e=t?t._next=n:ss=n}}us=t;ws(i)}function ws(t){if(is){return}if(rs){rs=clearTimeout(rs)}var e=t-ls;if(e>24){if(t<Infinity){rs=setTimeout(ms,t-cs.now()-fs)}if(os){os=clearInterval(os)}}else{if(!os){hs=cs.now(),os=setInterval(bs,as)}is=1,ds(ms)}}var Cs=function(e,n,t){var i=new vs;n=n==null?0:+n;i.restart(function(t){i.stop();e(t+n)},n,t);return i};var Es=Ka("start","end","interrupt");var Ss=[];var As=0;var ks=1;var Ms=2;var Ts=3;var Bs=4;var Ds=5;var Ns=6;var Ps=function(t,e,n,i,r,o){var a=t.__transition;if(!a){t.__transition={}}else if(n in a){return}Rs(t,n,{name:e,index:i,group:r,on:Es,tween:Ss,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:As})};function zs(t,e){var n=Fs(t,e);if(n.state>As){throw new Error("too late; already scheduled")}return n}function Os(t,e){var n=Fs(t,e);if(n.state>Ms){throw new Error("too late; already started")}return n}function Fs(t,e){var n=t.__transition;if(!n||!(n=n[e])){throw new Error("transition not found")}return n}function Rs(o,a,s){var u=o.__transition,h;u[a]=s;s.timer=_s(t,0,s.time);function t(t){s.state=ks;s.timer.restart(l,s.delay,s.time);if(s.delay<=t){l(t-s.delay)}}function l(t){var e,n,i,r;if(s.state!==ks){return c()}for(e in u){r=u[e];if(r.name!==s.name){continue}if(r.state===Ts){return Cs(l)}if(r.state===Bs){r.state=Ns;r.timer.stop();r.on.call("interrupt",o,o.__data__,r.index,r.group);delete u[e]}else if(+e<a){r.state=Ns;r.timer.stop();delete u[e]}}Cs(function(){if(s.state===Ts){s.state=Bs;s.timer.restart(f,s.delay,s.time);f(t)}});s.state=Ms;s.on.call("start",o,o.__data__,s.index,s.group);if(s.state!==Ms){return}s.state=Ts;h=new Array(i=s.tween.length);for(e=0,n=-1;e<i;++e){if(r=s.tween[e].value.call(o,o.__data__,s.index,s.group)){h[++n]=r}}h.length=n+1}function f(t){var e=t<s.duration?s.ease.call(null,t/s.duration):(s.timer.restart(c),s.state=Ds,1),n=-1,i=h.length;while(++n<i){h[n].call(null,e)}if(s.state===Ds){s.on.call("end",o,o.__data__,s.index,s.group);c()}}function c(){s.state=Ns;s.timer.stop();delete u[a];for(var t in u){return}delete o.__transition}}var Is=function(t,e){var n=t.__transition,i,r,o=true,a;if(!n){return}e=e==null?null:e+"";for(a in n){if((i=n[a]).name!==e){o=false;continue}r=i.state>Ms&&i.state<Ds;i.state=Ns;i.timer.stop();if(r){i.on.call("interrupt",t,t.__data__,i.index,i.group)}delete n[a]}if(o){delete t.__transition}};var Ls=function(t){return this.each(function(){Is(this,t)})};function js(r,o){var a,s;return function(){var t=Os(this,r),e=t.tween;if(e!==a){s=a=e;for(var n=0,i=s.length;n<i;++n){if(s[n].name===o){s=s.slice();s.splice(n,1);break}}}t.tween=s}}function Hs(o,a,s){var u,h;if(typeof s!=="function"){throw new Error}return function(){var t=Os(this,o),e=t.tween;if(e!==u){h=(u=e).slice();for(var n={name:a,value:s},i=0,r=h.length;i<r;++i){if(h[i].name===a){h[i]=n;break}}if(i===r){h.push(n)}}t.tween=h}}var Vs=function(t,e){var n=this._id;t+="";if(arguments.length<2){var i=Fs(this.node(),n).tween;for(var r=0,o=i.length,a;r<o;++r){if((a=i[r]).name===t){return a.value}}return null}return this.each((e==null?js:Hs)(n,t,e))};function Us(t,e,n){var i=t._id;t.each(function(){var t=Os(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)});return function(t){return Fs(t,i).value[e]}}var Ws=function(t,e){var n;return(typeof e==="number"?ee:e instanceof Q?Kt:(n=Q(e))?(e=n,Kt):se)(t,e)};function qs(t){return function(){this.removeAttribute(t)}}function Xs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gs(e,n,i){var r,o;return function(){var t=this.getAttribute(e);return t===i?null:t===r?o:o=n(r=t,i)}}function Ys(e,n,i){var r,o;return function(){var t=this.getAttributeNS(e.space,e.local);return t===i?null:t===r?o:o=n(r=t,i)}}function $s(n,i,r){var o,a,s;return function(){var t,e=r(this);if(e==null){return void this.removeAttribute(n)}t=this.getAttribute(n);return t===e?null:t===o&&e===a?s:s=i(o=t,a=e)}}function Qs(n,i,r){var o,a,s;return function(){var t,e=r(this);if(e==null){return void this.removeAttributeNS(n.space,n.local)}t=this.getAttributeNS(n.space,n.local);return t===e?null:t===o&&e===a?s:s=i(o=t,a=e)}}var Zs=function(t,e){var n=to(t),i=n==="transform"?xe:Ws;return this.attrTween(t,typeof e==="function"?(n.local?Qs:$s)(n,i,Us(this,"attr."+t,e)):e==null?(n.local?Xs:qs)(n):(n.local?Ys:Gs)(n,i,e+""))};function Ks(i,t){function e(){var e=this,n=t.apply(e,arguments);return n&&function(t){e.setAttributeNS(i.space,i.local,n(t))}}e._value=t;return e}function Js(i,t){function e(){var e=this,n=t.apply(e,arguments);return n&&function(t){e.setAttribute(i,n(t))}}e._value=t;return e}var tu=function(t,e){var n="attr."+t;if(arguments.length<2){return(n=this.tween(n))&&n._value}if(e==null){return this.tween(n,null)}if(typeof e!=="function"){throw new Error}var i=to(t);return this.tween(n,(i.local?Ks:Js)(i,e))};function eu(t,e){return function(){zs(this,t).delay=+e.apply(this,arguments)}}function nu(t,e){return e=+e,function(){zs(this,t).delay=e}}var iu=function(t){var e=this._id;return arguments.length?this.each((typeof t==="function"?eu:nu)(e,t)):Fs(this.node(),e).delay};function ru(t,e){return function(){Os(this,t).duration=+e.apply(this,arguments)}}function ou(t,e){return e=+e,function(){Os(this,t).duration=e}}var au=function(t){var e=this._id;return arguments.length?this.each((typeof t==="function"?ru:ou)(e,t)):Fs(this.node(),e).duration};function su(t,e){if(typeof e!=="function"){throw new Error}return function(){Os(this,t).ease=e}}var uu=function(t){var e=this._id;return arguments.length?this.each(su(e,t)):Fs(this.node(),e).ease};var hu=function(t){if(typeof t!=="function"){t=po(t)}for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r){for(var o=e[r],a=o.length,s=i[r]=[],u,h=0;h<a;++h){if((u=o[h])&&t.call(u,u.__data__,h,o)){s.push(u)}}}return new Nu(i,this._parents,this._name,this._id)};var lu=function(t){if(t._id!==this._id){throw new Error}for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),a=new Array(i),s=0;s<o;++s){for(var u=e[s],h=n[s],l=u.length,f=a[s]=new Array(l),c,d=0;d<l;++d){if(c=u[d]||h[d]){f[d]=c}}}for(;s<i;++s){a[s]=e[s]}return new Nu(a,this._parents,this._name,this._id)};function fu(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");if(e>=0){t=t.slice(0,e)}return!t||t==="start"})}function cu(n,i,r){var o,a,s=fu(i)?zs:Os;return function(){var t=s(this,n),e=t.on;if(e!==o){(a=(o=e).copy()).on(i,r)}t.on=a}}var du=function(t,e){var n=this._id;return arguments.length<2?Fs(this.node(),n).on.on(t):this.each(cu(n,t,e))};function pu(i){return function(){var t=this;var e=this.parentNode;for(var n in t.__transition){if(+n!==i){return}}if(e){e.removeChild(this)}}}var gu=function(){return this.on("end.remove",pu(this._id))};var vu=function(t){var e=this._name,n=this._id;if(typeof t!=="function"){t=oo(t)}for(var i=this._groups,r=i.length,o=new Array(r),a=0;a<r;++a){for(var s=i[a],u=s.length,h=o[a]=new Array(u),l,f,c=0;c<u;++c){if((l=s[c])&&(f=t.call(l,l.__data__,c,s))){if("__data__"in l){f.__data__=l.__data__}h[c]=f;Ps(h[c],e,n,c,h,Fs(l,n))}}}return new Nu(o,this._parents,e,n)};var _u=function(t){var e=this._name,n=this._id;if(typeof t!=="function"){t=uo(t)}for(var i=this._groups,r=i.length,o=[],a=[],s=0;s<r;++s){for(var u=i[s],h=u.length,l,f=0;f<h;++f){if(l=u[f]){for(var c=t.call(l,l.__data__,f,u),d,p=Fs(l,n),g=0,v=c.length;g<v;++g){if(d=c[g]){Ps(d,e,n,g,c,p)}}o.push(c);a.push(l)}}}return new Nu(o,a,e,n)};var yu=Wa.prototype.constructor;var mu=function(){return new yu(this._groups,this._parents)};function bu(n,i){var r,o,a;return function(){var t=Go(this,n),e=(this.style.removeProperty(n),Go(this,n));return t===e?null:t===r&&e===o?a:a=i(r=t,o=e)}}function xu(t){return function(){this.style.removeProperty(t)}}function wu(e,n,i){var r,o;return function(){var t=Go(this,e);return t===i?null:t===r?o:o=n(r=t,i)}}function Cu(n,i,r){var o,a,s;return function(){var t=Go(this,n),e=r(this);if(e==null){e=(this.style.removeProperty(n),Go(this,n))}return t===e?null:t===o&&e===a?s:s=i(o=t,a=e)}}var Eu=function(t,e,n){var i=(t+="")==="transform"?be:Ws;return e==null?this.styleTween(t,bu(t,i)).on("end.style."+t,xu(t)):this.styleTween(t,typeof e==="function"?Cu(t,i,Us(this,"style."+t,e)):wu(t,i,e+""),n)};function Su(i,t,r){function e(){var e=this,n=t.apply(e,arguments);return n&&function(t){e.style.setProperty(i,n(t),r)}}e._value=t;return e}var Au=function(t,e,n){var i="style."+(t+="");if(arguments.length<2){return(i=this.tween(i))&&i._value}if(e==null){return this.tween(i,null)}if(typeof e!=="function"){throw new Error}return this.tween(i,Su(t,e,n==null?"":n))};function ku(t){return function(){this.textContent=t}}function Mu(e){return function(){var t=e(this);this.textContent=t==null?"":t}}var Tu=function(t){return this.tween("text",typeof t==="function"?Mu(Us(this,"text",t)):ku(t==null?"":t+""))};var Bu=function(){var t=this._name,e=this._id,n=zu();for(var i=this._groups,r=i.length,o=0;o<r;++o){for(var a=i[o],s=a.length,u,h=0;h<s;++h){if(u=a[h]){var l=Fs(u,e);Ps(u,t,n,h,a,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}}}return new Nu(i,this._parents,t,n)};var Du=0;function Nu(t,e,n,i){this._groups=t;this._parents=e;this._name=n;this._id=i}function Pu(t){return Wa().transition(t)}function zu(){return++Du}var Ou=Wa.prototype;Nu.prototype=Pu.prototype={constructor:Nu,select:vu,selectAll:_u,filter:hu,merge:lu,selection:mu,transition:Bu,call:Ou.call,nodes:Ou.nodes,node:Ou.node,size:Ou.size,empty:Ou.empty,each:Ou.each,on:du,attr:Zs,attrTween:tu,style:Eu,styleTween:Au,text:Tu,remove:gu,tween:Vs,delay:iu,duration:au,ease:uu};function Fu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ru={time:null,delay:0,duration:250,ease:Fu};function Iu(t,e){var n;while(!(n=t.__transition)||!(n=n[e])){if(!(t=t.parentNode)){return Ru.time=ps(),Ru}}return n}var Lu=function(t){var e,n;if(t instanceof Nu){e=t._id,t=t._name}else{e=zu(),(n=Ru).time=ps(),t=t==null?null:t+""}for(var i=this._groups,r=i.length,o=0;o<r;++o){for(var a=i[o],s=a.length,u,h=0;h<s;++h){if(u=a[h]){Ps(u,t,e,h,a,n||Iu(u,e))}}}return new Nu(i,this._parents,t,e)};Wa.prototype.interrupt=Ls;Wa.prototype.transition=Lu;var ju=function(e,n){if(n===void 0){return function(t){return t[e]}}return function(t){return t[e]===void 0?n:t[e]}};var Hu=function(t){return t&&typeof t==="object"&&!Array.isArray(t)&&t!==void 0?true:false};function Vu(){var t=arguments;var e=[],n=arguments.length;while(n--){e[n]=t[n]}var r=e[0];var i=function(t){var n=e[t];Object.keys(n).forEach(function(t){var e=n[t];if(Hu(e)){if(r.hasOwnProperty(t)&&Hu(r[t])){r[t]=Vu({},r[t],e)}else{r[t]=e}}else if(Array.isArray(e)){if(r.hasOwnProperty(t)&&Array.isArray(r[t])){var i=r[t];e.forEach(function(t,e){if(e<i.length){var n=i[e];if(Object.is(n,t)){return}if(Hu(n)&&Hu(t)||Array.isArray(n)&&Array.isArray(t)){i[e]=Vu({},n,t)}else{i[e]=t}}else{i.push(t)}})}else{r[t]=e}}else{r[t]=e}})};for(var o=1;o<e.length;o++){i(o)}return r}var Uu=function(t,e){if(e===void 0){e={}}for(var n in e){if({}.hasOwnProperty.call(e,n)){t.attr(n,e[n])}}};function Wu(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}var qu=function(){return""+Wu()+Wu()+"-"+Wu()+"-"+Wu()+"-"+Wu()+"-"+Wu()+Wu()+Wu()};var Xu="D3PLUS-COMMON-RESET";function Gu(t,e){if(Hu(t)){for(var n in t){if({}.hasOwnProperty.call(t,n)&&!n.startsWith("_")){var i=e&&Hu(e)?e[n]:undefined;if(t[n]===Xu){t[n]=i}else if(Hu(t[n])){Gu(t[n],i)}}}}}var Yu=function t(){this._on={};this._uuid=qu()};Yu.prototype.config=function t(e){var n=this;if(!this._configDefault){var t={};for(var i in n.__proto__){if(i.indexOf("_")!==0&&!["config","constructor","render"].includes(i)){var r=n[i]();t[i]=Hu(r)?Vu({},r):r}}this._configDefault=t}if(arguments.length){for(var o in e){if({}.hasOwnProperty.call(e,o)&&o in n){var a=e[o];if(a===Xu){if(o==="on"){n._on=n._configDefault[o]}else{n[o](n._configDefault[o])}}else{Gu(a,n._configDefault[o]);n[o](a)}}}return this}else{var s={};for(var u in n.__proto__){if(u.indexOf("_")!==0&&!["config","constructor","render"].includes(u)){s[u]=n[u]()}}return s}};Yu.prototype.on=function t(e,n){return arguments.length===2?(this._on[e]=n,this):arguments.length?typeof e==="string"?this._on[e]:(this._on=Object.assign({},this._on,e),this):this._on};var $u=function(n,t){if(t===void 0){t=[]}if(!t||!(t instanceof Array)||!t.length){return undefined}return t.reduce(function(t,e){return Math.abs(e-n)<Math.abs(t-n)?e:t})};function Qu(t,i,e){var r=this;if(t===void 0){t=this._shapeConfig}if(i===void 0){i="shape"}if(e===void 0){e=false}var n={duration:this._duration,on:{}};var o=function(i){return function(t,e,n){while(t.__d3plus__){e=t.i;t=t.data||t.feature}return i.bind(r)(t,e,n)}};var a=function(t,e){for(var n in e){if({}.hasOwnProperty.call(e,n)&&!n.includes(".")||n.includes("."+i)){t.on[n]=o(e[n])}}};var s=function(t,e){for(var n in e){if({}.hasOwnProperty.call(e,n)){if(n==="on"){a(t,e[n])}else if(typeof e[n]==="function"){t[n]=o(e[n])}else if(typeof e[n]==="object"&&!(e instanceof Array)){t[n]={on:{}};s(t[n],e[n])}else{t[n]=e[n]}}}};s(n,t);if(this._on){a(n,this._on)}if(e&&t[e]){s(n,t[e]);if(t[e].on){a(n,t[e].on)}}return n}var Zu=function(e){return function t(){return e}};var Ku=function(t,e){e=Object.assign({},{condition:true,enter:{},exit:{},parent:qa("body"),transition:Pu().duration(0),update:{}},e);var n=/\.([^#]+)/g.exec(t),i=/#([^\.]+)/g.exec(t),r=/^([^.^#]+)/g.exec(t)[1];var o=e.parent.selectAll(t.includes(":")?t.split(":")[1]:t).data(e.condition?[null]:[]);var a=o.enter().append(r).call(Uu,e.enter);if(i){a.attr("id",i[1])}if(n){a.attr("class",n[1])}o.exit().transition(e.transition).call(Uu,e.exit).remove();var s=a.merge(o);s.transition(e.transition).call(Uu,e.update);return s};function Ju(r,o){if(o===void 0){o={}}var t=new Set(Wt(r.map(function(t){return p(t)}))),a={};t.forEach(function(e){var t=r.map(function(t){return t[e]});var n;if(o[e]){n=o[e](t)}else{var i=t.map(function(t){return t||t===false?t.constructor:t}).filter(function(t){return t!==void 0});if(!i.length){n=undefined}else if(i.indexOf(Array)>=0){n=Wt(t.map(function(t){return t instanceof Array?t:[t]}));n=Array.from(new Set(n));if(n.length===1){n=n[0]}}else if(i.indexOf(String)>=0){n=Array.from(new Set(t));if(n.length===1){n=n[0]}}else if(i.indexOf(Number)>=0){n=Xt(t)}else if(i.indexOf(Object)>=0){n=Ju(t.filter(function(t){return t}))}else{n=Array.from(new Set(t.filter(function(t){return t!==void 0})));if(n.length===1){n=n[0]}}}a[e]=n});return a}var th=function(t){var r;if(typeof t==="number"){r=[t]}else{r=t.split(/\s+/)}if(r.length===1){r=[r[0],r[0],r[0],r[0]]}else if(r.length===2){r=r.concat(r)}else if(r.length===3){r.push(r[1])}return["top","right","bottom","left"].reduce(function(t,e,n){var i=parseFloat(r[n]);t[e]=i||0;return t},{})};var eh=function(){if("-webkit-transform"in document.body.style){return"-webkit-"}else if("-moz-transform"in document.body.style){return"-moz-"}else if("-ms-transform"in document.body.style){return"-ms-"}else if("-o-transform"in document.body.style){return"-o-"}else{return""}};var nh=function(t,e){if(e===void 0){e={}}for(var n in e){if({}.hasOwnProperty.call(e,n)){t.style(n,e[n])}}};var ih=function t(){this._duration=600;this._height=ju("height");this._id=ju("id");this._pointerEvents=Zu("auto");this._select;this._url=ju("url");this._width=ju("width");this._x=ju("x",0);this._y=ju("y",0)};ih.prototype.render=function t(e){var n=this;if(this._select===void 0){this.select(qa("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").style("display","block").node())}var i=this._select.selectAll(".d3plus-Image").data(this._data,this._id);var r=i.enter().append("image").attr("class","d3plus-Image").attr("opacity",0).attr("width",0).attr("height",0).attr("x",function(t,e){return n._x(t,e)+n._width(t,e)/2}).attr("y",function(t,e){return n._y(t,e)+n._height(t,e)/2});var o=Pu().duration(this._duration),a=this,s=r.merge(i);s.attr("xlink:href",this._url).style("pointer-events",this._pointerEvents).transition(o).attr("opacity",1).attr("width",function(t,e){return n._width(t,e)}).attr("height",function(t,e){return n._height(t,e)}).attr("x",function(t,e){return n._x(t,e)}).attr("y",function(t,e){return n._y(t,e)}).each(function(t,e){var n=qa(this),i=a._url(t,e);var r=i.indexOf("http://")===0||i.indexOf("https://")===0;if(!r||i.indexOf(window.location.hostname)===0){var o=new ih;o.src=i;o.crossOrigin="Anonymous";o.onload=function(){var t=document.createElement("canvas");t.width=this.width;t.height=this.height;var e=t.getContext("2d");e.drawImage(this,0,0);n.attr("xlink:href",t.toDataURL("image/png"))}}});i.exit().transition(o).attr("width",function(t,e){return n._width(t,e)}).attr("height",function(t,e){return n._height(t,e)}).attr("x",function(t,e){return n._x(t,e)}).attr("y",function(t,e){return n._y(t,e)}).attr("opacity",0).remove();if(e){setTimeout(e,this._duration+100)}return this};ih.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};ih.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};ih.prototype.height=function t(e){return arguments.length?(this._height=typeof e==="function"?e:Zu(e),this):this._height};ih.prototype.id=function t(e){return arguments.length?(this._id=e,this):this._id};ih.prototype.pointerEvents=function t(e){return arguments.length?(this._pointerEvents=typeof e==="function"?e:Zu(e),this):this._pointerEvents};ih.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};ih.prototype.url=function t(e){return arguments.length?(this._url=e,this):this._url};ih.prototype.width=function t(e){return arguments.length?(this._width=typeof e==="function"?e:Zu(e),this):this._width};ih.prototype.x=function t(e){return arguments.length?(this._x=typeof e==="function"?e:Zu(e),this):this._x};ih.prototype.y=function t(e){return arguments.length?(this._y=typeof e==="function"?e:Zu(e),this):this._y};var rh=function(t,e,n,i){if(n===void 0){n=1}if(i===void 0){i=1}t=ot(t);e=ot(e);var r=Math.abs(e.h*i-t.h*n);if(r>180){r-=360}var o=(Math.min(t.h,e.h)+r/2)%360;var a=t.l+(e.l*i-t.l*n)/2,s=t.s+(e.s*i-t.s*n)/2;if(o<0){o+=360}return ot("hsl("+o+","+s*100+"%,"+a*100+"%)").toString()};var oh=Array.prototype;var ah=oh.slice;var sh={name:"implicit"};function uh(i){var o=_(),a=[],r=sh;i=i==null?[]:ah.call(i);function s(t){var e=t+"",n=o.get(e);if(!n){if(r!==sh){return r}o.set(e,n=a.push(t))}return i[(n-1)%i.length]}s.domain=function(t){if(!arguments.length){return a.slice()}a=[],o=_();var e=-1,n=t.length,i,r;while(++e<n){if(!o.has(r=(i=t[e])+"")){o.set(r,a.push(i))}}return s};s.range=function(t){return arguments.length?(i=ah.call(t),s):i.slice()};s.unknown=function(t){return arguments.length?(r=t,s):r};s.copy=function(){return uh().domain(a).range(i).unknown(r)};return s}var hh=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})};hh("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");hh("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6");hh("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9");hh("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");ze(Rt(300,.5,0),Rt(-240,.5,1));var lh=ze(Rt(-100,.75,.35),Rt(80,1.5,.8));var fh=ze(Rt(260,.75,.35),Rt(80,1.5,.8));var ch=Rt();function dh(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}dh(hh("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var ph=dh(hh("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));var gh=dh(hh("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));var vh=dh(hh("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));var _h={dark:"#444444",light:"#f7f7f7",missing:"#cccccc",off:"#b22200",on:"#224f20",scale:uh().range(["#b22200","#282f6b","#eace3f","#b35c1e","#224f20","#5f487c","#759143","#419391","#993c88","#e89c89","#ffee8d","#afd5e8","#f7ba77","#a5c697","#c5b5e5","#d1d392","#bbefd0","#e099cf"])};function yh(t,e){if(e===void 0){e={}}return t in e?e[t]:t in _h?_h[t]:_h.missing}var mh=function(t,e){if(e===void 0){e={}}if([null,void 0].indexOf(t)>=0){return yh("missing",e)}else if(t===true){return yh("on",e)}else if(t===false){return yh("off",e)}var n=Q(t);if(!n){return yh("scale",e)(t)}return t.toString()};var bh=function(t,e){if(e===void 0){e={}}t=tt(t);var n=(t.r*299+t.g*587+t.b*114)/1e3;return n>=128?yh("dark",e):yh("light",e)};var xh=function(t){t=ot(t);if(t.l>.45){if(t.s>.8){t.s=.8}t.l=.45}return t.toString()};var wh=function(t,e){if(e===void 0){e=.5}t=ot(t);e*=1-t.l;t.l+=e;t.s-=e;return t.toString()};var Ch=function(t,e,n,i){if(n===void 0){n=1}if(i===void 0){i=1}t=ot(t);e=ot(e);var r=e.h*i-t.h*n;if(Math.abs(r)>180){r-=360}var o=(t.h-r)%360;var a=t.l-(e.l*i-t.l*n)/2,s=t.s-(e.s*i-t.s*n)/2;if(o<0){o+=360}return ot("hsl("+o+","+s*100+"%,"+a*100+"%)").toString()};var Eh=Math.PI;var Sh=2*Eh;var Ah=1e-6;var kh=Sh-Ah;function Mh(){this._x0=this._y0=this._x1=this._y1=null;this._=""}function Th(){return new Mh}Mh.prototype=Th.prototype={constructor:Mh,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){if(this._x1!==null){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,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-t,u=i-e,h=o-t,l=a-e,f=h*h+l*l;if(r<0){throw new Error("negative radius: "+r)}if(this._x1===null){this._+="M"+(this._x1=t)+","+(this._y1=e)}else if(!(f>Ah)){}else if(!(Math.abs(l*s-u*h)>Ah)||!r){this._+="L"+(this._x1=t)+","+(this._y1=e)}else{var c=n-o,d=i-a,p=s*s+u*u,g=c*c+d*d,v=Math.sqrt(p),_=Math.sqrt(f),y=r*Math.tan((Eh-Math.acos((p+f-g)/(2*v*_)))/2),m=y/_,b=y/v;if(Math.abs(m-1)>Ah){this._+="L"+(t+m*h)+","+(e+m*l)}this._+="A"+r+","+r+",0,0,"+ +(l*c>h*d)+","+(this._x1=t+b*s)+","+(this._y1=e+b*u)}},arc:function(t,e,n,i,r,o){t=+t,e=+e,n=+n;var a=n*Math.cos(i),s=n*Math.sin(i),u=t+a,h=e+s,l=1^o,f=o?i-r:r-i;if(n<0){throw new Error("negative radius: "+n)}if(this._x1===null){this._+="M"+u+","+h}else if(Math.abs(this._x1-u)>Ah||Math.abs(this._y1-h)>Ah){this._+="L"+u+","+h}if(!n){return}if(f<0){f=f%Sh+Sh}if(f>kh){this._+="A"+n+","+n+",0,1,"+l+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=h)}else if(f>Ah){this._+="A"+n+","+n+",0,"+ +(f>=Eh)+","+l+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))}},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var Bh=function(e){return function t(){return e}};var Dh=Math.abs;var Nh=Math.atan2;var Ph=Math.cos;var zh=Math.max;var Oh=Math.min;var Fh=Math.sin;var Rh=Math.sqrt;var Ih=1e-12;var Lh=Math.PI;var jh=Lh/2;var Hh=2*Lh;function Vh(t){return t>1?0:t<-1?Lh:Math.acos(t)}function Uh(t){return t>=1?jh:t<=-1?-jh:Math.asin(t)}function Wh(t){return t.innerRadius}function qh(t){return t.outerRadius}function Xh(t){return t.startAngle}function Gh(t){return t.endAngle}function Yh(t){return t&&t.padAngle}function $h(t,e,n,i,r,o,a,s){var u=n-t,h=i-e,l=a-r,f=s-o,c=(l*(e-o)-f*(t-r))/(f*u-l*h);return[t+c*u,e+c*h]}function Qh(t,e,n,i,r,o,a){var s=t-n,u=e-i,h=(a?o:-o)/Rh(s*s+u*u),l=h*u,f=-h*s,c=t+l,d=e+f,p=n+l,g=i+f,v=(c+p)/2,_=(d+g)/2,y=p-c,m=g-d,b=y*y+m*m,x=r-o,w=c*g-p*d,C=(m<0?-1:1)*Rh(zh(0,x*x*b-w*w)),E=(w*m-y*C)/b,S=(-w*y-m*C)/b,A=(w*m+y*C)/b,k=(-w*y+m*C)/b,M=E-v,T=S-_,B=A-v,D=k-_;if(M*M+T*T>B*B+D*D){E=A,S=k}return{cx:E,cy:S,x01:-l,y01:-f,x11:E*(r/x-1),y11:S*(r/x-1)}}var Zh=function(){var I=Wh,L=qh,j=Bh(0),H=null,V=Xh,U=Gh,W=Yh,q=null;function e(){var t,e,n=+I.apply(this,arguments),i=+L.apply(this,arguments),r=V.apply(this,arguments)-jh,o=U.apply(this,arguments)-jh,a=Dh(o-r),s=o>r;if(!q){q=t=Th()}if(i<n){e=i,i=n,n=e}if(!(i>Ih)){q.moveTo(0,0)}else if(a>Hh-Ih){q.moveTo(i*Ph(r),i*Fh(r));q.arc(0,0,i,r,o,!s);if(n>Ih){q.moveTo(n*Ph(o),n*Fh(o));q.arc(0,0,n,o,r,s)}}else{var u=r,h=o,l=r,f=o,c=a,d=a,p=W.apply(this,arguments)/2,g=p>Ih&&(H?+H.apply(this,arguments):Rh(n*n+i*i)),v=Oh(Dh(i-n)/2,+j.apply(this,arguments)),_=v,y=v,m,b;if(g>Ih){var x=Uh(g/n*Fh(p)),w=Uh(g/i*Fh(p));if((c-=x*2)>Ih){x*=s?1:-1,l+=x,f-=x}else{c=0,l=f=(r+o)/2}if((d-=w*2)>Ih){w*=s?1:-1,u+=w,h-=w}else{d=0,u=h=(r+o)/2}}var C=i*Ph(u),E=i*Fh(u),S=n*Ph(f),A=n*Fh(f);if(v>Ih){var k=i*Ph(h),M=i*Fh(h),T=n*Ph(l),B=n*Fh(l);if(a<Lh){var D=c>Ih?$h(C,E,T,B,k,M,S,A):[S,A],N=C-D[0],P=E-D[1],z=k-D[0],O=M-D[1],F=1/Fh(Vh((N*z+P*O)/(Rh(N*N+P*P)*Rh(z*z+O*O)))/2),R=Rh(D[0]*D[0]+D[1]*D[1]);_=Oh(v,(n-R)/(F-1));y=Oh(v,(i-R)/(F+1))}}if(!(d>Ih)){q.moveTo(C,E)}else if(y>Ih){m=Qh(T,B,C,E,i,y,s);b=Qh(k,M,S,A,i,y,s);q.moveTo(m.cx+m.x01,m.cy+m.y01);if(y<v){q.arc(m.cx,m.cy,y,Nh(m.y01,m.x01),Nh(b.y01,b.x01),!s)}else{q.arc(m.cx,m.cy,y,Nh(m.y01,m.x01),Nh(m.y11,m.x11),!s);q.arc(0,0,i,Nh(m.cy+m.y11,m.cx+m.x11),Nh(b.cy+b.y11,b.cx+b.x11),!s);q.arc(b.cx,b.cy,y,Nh(b.y11,b.x11),Nh(b.y01,b.x01),!s)}}else{q.moveTo(C,E),q.arc(0,0,i,u,h,!s)}if(!(n>Ih)||!(c>Ih)){q.lineTo(S,A)}else if(_>Ih){m=Qh(S,A,k,M,n,-_,s);b=Qh(C,E,T,B,n,-_,s);q.lineTo(m.cx+m.x01,m.cy+m.y01);if(_<v){q.arc(m.cx,m.cy,_,Nh(m.y01,m.x01),Nh(b.y01,b.x01),!s)}else{q.arc(m.cx,m.cy,_,Nh(m.y01,m.x01),Nh(m.y11,m.x11),!s);q.arc(0,0,n,Nh(m.cy+m.y11,m.cx+m.x11),Nh(b.cy+b.y11,b.cx+b.x11),s);q.arc(b.cx,b.cy,_,Nh(b.y11,b.x11),Nh(b.y01,b.x01),!s)}}else{q.arc(0,0,n,f,l,s)}}q.closePath();if(t){return q=null,t+""||null}}e.centroid=function(){var t=(+I.apply(this,arguments)+ +L.apply(this,arguments))/2,e=(+V.apply(this,arguments)+ +U.apply(this,arguments))/2-Lh/2;return[Ph(e)*t,Fh(e)*t]};e.innerRadius=function(t){return arguments.length?(I=typeof t==="function"?t:Bh(+t),e):I};e.outerRadius=function(t){return arguments.length?(L=typeof t==="function"?t:Bh(+t),e):L};e.cornerRadius=function(t){return arguments.length?(j=typeof t==="function"?t:Bh(+t),e):j};e.padRadius=function(t){return arguments.length?(H=t==null?null:typeof t==="function"?t:Bh(+t),e):H};e.startAngle=function(t){return arguments.length?(V=typeof t==="function"?t:Bh(+t),e):V};e.endAngle=function(t){return arguments.length?(U=typeof t==="function"?t:Bh(+t),e):U};e.padAngle=function(t){return arguments.length?(W=typeof t==="function"?t:Bh(+t),e):W};e.context=function(t){return arguments.length?(q=t==null?null:t,e):q};return e};function Kh(t){this._context=t}Kh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===1){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};var Jh=function(t){return new Kh(t)};function tl(t){return t[0]}function el(t){return t[1]}var nl=function(){var a=tl,s=el,u=Bh(true),h=null,l=Jh,f=null;function e(t){var e,n=t.length,i,r=false,o;if(h==null){f=l(o=Th())}for(e=0;e<=n;++e){if(!(e<n&&u(i=t[e],e,t))===r){if(r=!r){f.lineStart()}else{f.lineEnd()}}if(r){f.point(+a(i,e,t),+s(i,e,t))}}if(o){return f=null,o+""||null}}e.x=function(t){return arguments.length?(a=typeof t==="function"?t:Bh(+t),e):a};e.y=function(t){return arguments.length?(s=typeof t==="function"?t:Bh(+t),e):s};e.defined=function(t){return arguments.length?(u=typeof t==="function"?t:Bh(!!t),e):u};e.curve=function(t){return arguments.length?(l=t,h!=null&&(f=l(h)),e):l};e.context=function(t){return arguments.length?(t==null?h=f=null:f=l(h=t),e):h};return e};var il=function(){var l=tl,f=null,c=Bh(0),d=el,p=Bh(true),g=null,v=Jh,_=null;function e(t){var e,n,i,r=t.length,o,a=false,s,u=new Array(r),h=new Array(r);if(g==null){_=v(s=Th())}for(e=0;e<=r;++e){if(!(e<r&&p(o=t[e],e,t))===a){if(a=!a){n=e;_.areaStart();_.lineStart()}else{_.lineEnd();_.lineStart();for(i=e-1;i>=n;--i){_.point(u[i],h[i])}_.lineEnd();_.areaEnd()}}if(a){u[e]=+l(o,e,t),h[e]=+c(o,e,t);_.point(f?+f(o,e,t):u[e],d?+d(o,e,t):h[e])}}if(s){return _=null,s+""||null}}function t(){return nl().defined(p).curve(v).context(g)}e.x=function(t){return arguments.length?(l=typeof t==="function"?t:Bh(+t),f=null,e):l};e.x0=function(t){return arguments.length?(l=typeof t==="function"?t:Bh(+t),e):l};e.x1=function(t){return arguments.length?(f=t==null?null:typeof t==="function"?t:Bh(+t),e):f};e.y=function(t){return arguments.length?(c=typeof t==="function"?t:Bh(+t),d=null,e):c};e.y0=function(t){return arguments.length?(c=typeof t==="function"?t:Bh(+t),e):c};e.y1=function(t){return arguments.length?(d=t==null?null:typeof t==="function"?t:Bh(+t),e):d};e.lineX0=e.lineY0=function(){return t().x(l).y(c)};e.lineY1=function(){return t().x(l).y(d)};e.lineX1=function(){return t().x(f).y(c)};e.defined=function(t){return arguments.length?(p=typeof t==="function"?t:Bh(!!t),e):p};e.curve=function(t){return arguments.length?(v=t,g!=null&&(_=v(g)),e):v};e.context=function(t){return arguments.length?(t==null?g=_=null:_=v(g=t),e):g};return e};var rl=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN};var ol=function(t){return t};var al=function(){var p=ol,g=rl,v=null,_=Bh(0),y=Bh(Hh),m=Bh(0);function e(n){var t,e=n.length,i,r,o=0,a=new Array(e),s=new Array(e),u=+_.apply(this,arguments),h=Math.min(Hh,Math.max(-Hh,y.apply(this,arguments)-u)),l,f=Math.min(Math.abs(h)/e,m.apply(this,arguments)),c=f*(h<0?-1:1),d;for(t=0;t<e;++t){if((d=s[a[t]=t]=+p(n[t],t,n))>0){o+=d}}if(g!=null){a.sort(function(t,e){return g(s[t],s[e])})}else if(v!=null){a.sort(function(t,e){return v(n[t],n[e])})}for(t=0,r=o?(h-e*c)/o:0;t<e;++t,u=l){i=a[t],d=s[i],l=u+(d>0?d*r:0)+c,s[i]={data:n[i],index:t,value:d,startAngle:u,endAngle:l,padAngle:f}}return s}e.value=function(t){return arguments.length?(p=typeof t==="function"?t:Bh(+t),e):p};e.sortValues=function(t){return arguments.length?(g=t,v=null,e):g};e.sort=function(t){return arguments.length?(v=t,g=null,e):v};e.startAngle=function(t){return arguments.length?(_=typeof t==="function"?t:Bh(+t),e):_};e.endAngle=function(t){return arguments.length?(y=typeof t==="function"?t:Bh(+t),e):y};e.padAngle=function(t){return arguments.length?(m=typeof t==="function"?t:Bh(+t),e):m};return e};var sl=hl(Jh);function ul(t){this._curve=t}ul.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function hl(e){function t(t){return new ul(e(t))}t._curve=e;return t}function ll(t){var e=t.curve;t.angle=t.x,delete t.x;t.radius=t.y,delete t.y;t.curve=function(t){return arguments.length?e(hl(t)):e()._curve};return t}var fl=function(){return ll(nl().curve(sl))};var cl=function(){var t=il().curve(sl),e=t.curve,n=t.lineX0,i=t.lineX1,r=t.lineY0,o=t.lineY1;t.angle=t.x,delete t.x;t.startAngle=t.x0,delete t.x0;t.endAngle=t.x1,delete t.x1;t.radius=t.y,delete t.y;t.innerRadius=t.y0,delete t.y0;t.outerRadius=t.y1,delete t.y1;t.lineStartAngle=function(){return ll(n())},delete t.lineX0;t.lineEndAngle=function(){return ll(i())},delete t.lineX1;t.lineInnerRadius=function(){return ll(r())},delete t.lineY0;t.lineOuterRadius=function(){return ll(o())},delete t.lineY1;t.curve=function(t){return arguments.length?e(hl(t)):e()._curve};return t};var dl=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]};var pl=Array.prototype.slice;function gl(t){return t.source}function vl(t){return t.target}function _l(r){var o=gl,a=vl,s=tl,u=el,h=null;function e(){var t,e=pl.call(arguments),n=o.apply(this,e),i=a.apply(this,e);if(!h){h=t=Th()}r(h,+s.apply(this,(e[0]=n,e)),+u.apply(this,e),+s.apply(this,(e[0]=i,e)),+u.apply(this,e));if(t){return h=null,t+""||null}}e.source=function(t){return arguments.length?(o=t,e):o};e.target=function(t){return arguments.length?(a=t,e):a};e.x=function(t){return arguments.length?(s=typeof t==="function"?t:Bh(+t),e):s};e.y=function(t){return arguments.length?(u=typeof t==="function"?t:Bh(+t),e):u};e.context=function(t){return arguments.length?(h=t==null?null:t,e):h};return e}function yl(t,e,n,i,r){t.moveTo(e,n);t.bezierCurveTo(e=(e+i)/2,n,e,r,i,r)}function ml(t,e,n,i,r){t.moveTo(e,n);t.bezierCurveTo(e,n=(n+r)/2,i,n,i,r)}function bl(t,e,n,i,r){var o=dl(e,n),a=dl(e,n=(n+r)/2),s=dl(i,n),u=dl(i,r);t.moveTo(o[0],o[1]);t.bezierCurveTo(a[0],a[1],s[0],s[1],u[0],u[1])}function xl(){return _l(yl)}function wl(){return _l(ml)}function Cl(){var t=_l(bl);t.angle=t.x,delete t.x;t.radius=t.y,delete t.y;return t}var El={draw:function(t,e){var n=Math.sqrt(e/Lh);t.moveTo(n,0);t.arc(0,0,n,0,Hh)}};var Sl={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n);t.lineTo(-n,-n);t.lineTo(-n,-3*n);t.lineTo(n,-3*n);t.lineTo(n,-n);t.lineTo(3*n,-n);t.lineTo(3*n,n);t.lineTo(n,n);t.lineTo(n,3*n);t.lineTo(-n,3*n);t.lineTo(-n,n);t.lineTo(-3*n,n);t.closePath()}};var Al=Math.sqrt(1/3);var kl=Al*2;var Ml={draw:function(t,e){var n=Math.sqrt(e/kl),i=n*Al;t.moveTo(0,-n);t.lineTo(i,0);t.lineTo(0,n);t.lineTo(-i,0);t.closePath()}};var Tl=.8908130915292852;var Bl=Math.sin(Lh/10)/Math.sin(7*Lh/10);var Dl=Math.sin(Hh/10)*Bl;var Nl=-Math.cos(Hh/10)*Bl;var Pl={draw:function(t,e){var n=Math.sqrt(e*Tl),i=Dl*n,r=Nl*n;t.moveTo(0,-n);t.lineTo(i,r);for(var o=1;o<5;++o){var a=Hh*o/5,s=Math.cos(a),u=Math.sin(a);t.lineTo(u*n,-s*n);t.lineTo(s*i-u*r,u*i+s*r)}t.closePath()}};var zl={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}};var Ol=Math.sqrt(3);var Fl={draw:function(t,e){var n=-Math.sqrt(e/(Ol*3));t.moveTo(0,n*2);t.lineTo(-Ol*n,-n);t.lineTo(Ol*n,-n);t.closePath()}};var Rl=-.5;var Il=Math.sqrt(3)/2;var Ll=1/Math.sqrt(12);var jl=(Ll/2+1)*3;var Hl={draw:function(t,e){var n=Math.sqrt(e/jl),i=n/2,r=n*Ll,o=i,a=n*Ll+n,s=-o,u=a;t.moveTo(i,r);t.lineTo(o,a);t.lineTo(s,u);t.lineTo(Rl*i-Il*r,Il*i+Rl*r);t.lineTo(Rl*o-Il*a,Il*o+Rl*a);t.lineTo(Rl*s-Il*u,Il*s+Rl*u);t.lineTo(Rl*i+Il*r,Rl*r-Il*i);t.lineTo(Rl*o+Il*a,Rl*a-Il*o);t.lineTo(Rl*s+Il*u,Rl*u-Il*s);t.closePath()}};var Vl=[El,Sl,Ml,zl,Pl,Fl,Hl];var Ul=function(){var e=Bh(El),n=Bh(64),i=null;function r(){var t;if(!i){i=t=Th()}e.apply(this,arguments).draw(i,+n.apply(this,arguments));if(t){return i=null,t+""||null}}r.type=function(t){return arguments.length?(e=typeof t==="function"?t:Bh(t),r):e};r.size=function(t){return arguments.length?(n=typeof t==="function"?t:Bh(+t),r):n};r.context=function(t){return arguments.length?(i=t==null?null:t,r):i};return r};var Wl=function(){};function ql(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Xl(t){this._context=t}Xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){switch(this._point){case 3:ql(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ql(this,t,e);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e}};var Gl=function(t){return new Xl(t)};function Yl(t){this._context=t}Yl.prototype={areaStart:Wl,areaEnd:Wl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2);this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3);this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3);this._context.closePath();break}case 3:{this.point(this._x2,this._y2);this.point(this._x3,this._y3);this.point(this._x4,this._y4);break}}},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._x2=t,this._y2=e;break;case 1:this._point=2;this._x3=t,this._y3=e;break;case 2:this._point=3;this._x4=t,this._y4=e;this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ql(this,t,e);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e}};var $l=function(t){return new Yl(t)};function Ql(t){this._context=t}Ql.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:ql(this,t,e);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e}};var Zl=function(t){return new Ql(t)};function Kl(t,e){this._basis=new Xl(t);this._beta=e}Kl.prototype={lineStart:function(){this._x=[];this._y=[];this._basis.lineStart()},lineEnd:function(){var t=this;var e=this._x,n=this._y,i=e.length-1;if(i>0){var r=e[0],o=n[0],a=e[i]-r,s=n[i]-o,u=-1,h;while(++u<=i){h=u/i;t._basis.point(t._beta*e[u]+(1-t._beta)*(r+h*a),t._beta*n[u]+(1-t._beta)*(o+h*s))}}this._x=this._y=null;this._basis.lineEnd()},point:function(t,e){this._x.push(+t);this._y.push(+e)}};var Jl=function e(n){function t(t){return n===1?new Xl(t):new Kl(t,n)}t.beta=function(t){return e(+t)};return t}(.85);function tf(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function ef(t,e){this._context=t;this._k=(1-e)/6}ef.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:tf(this,this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;this._x1=t,this._y1=e;break;case 2:this._point=3;default:tf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};var nf=function e(n){function t(t){return new ef(t,n)}t.tension=function(t){return e(+t)};return t}(0);function rf(t,e){this._context=t;this._k=(1-e)/6}rf.prototype={areaStart:Wl,areaEnd:Wl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._x3=t,this._y3=e;break;case 1:this._point=2;this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3;this._x5=t,this._y5=e;break;default:tf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};var of=function e(n){function t(t){return new rf(t,n)}t.tension=function(t){return e(+t)};return t}(0);function af(t,e){this._context=t;this._k=(1-e)/6}af.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:tf(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};var sf=function e(n){function t(t){return new af(t,n)}t.tension=function(t){return e(+t)};return t}(0);function uf(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Ih){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u;r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Ih){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*h+t._x1*t._l23_2a-e*t._l12_2a)/l;a=(a*h+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}function hf(t,e){this._context=t;this._alpha=e}hf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}if(this._line||this._line!==0&&this._point===1){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;if(this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:uf(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};var lf=function e(n){function t(t){return n?new hf(t,n):new ef(t,0)}t.alpha=function(t){return e(+t)};return t}(.5);function ff(t,e){this._context=t;this._alpha=e}ff.prototype={areaStart:Wl,areaEnd:Wl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(t,e){t=+t,e=+e;if(this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._x3=t,this._y3=e;break;case 1:this._point=2;this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3;this._x5=t,this._y5=e;break;default:uf(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};var cf=function e(n){function t(t){return n?new ff(t,n):new rf(t,0)}t.alpha=function(t){return e(+t)};return t}(.5);function df(t,e){this._context=t;this._alpha=e}df.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3){this._context.closePath()}this._line=1-this._line},point:function(t,e){t=+t,e=+e;if(this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:uf(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=e}};var pf=function e(n){function t(t){return n?new df(t,n):new af(t,0)}t.alpha=function(t){return e(+t)};return t}(.5);function gf(t){this._context=t}gf.prototype={areaStart:Wl,areaEnd:Wl,lineStart:function(){this._point=0},lineEnd:function(){if(this._point){this._context.closePath()}},point:function(t,e){t=+t,e=+e;if(this._point){this._context.lineTo(t,e)}else{this._point=1,this._context.moveTo(t,e)}}};var vf=function(t){return new gf(t)};function _f(t){return t<0?-1:1}function yf(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(_f(o)+_f(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function mf(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function bf(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function xf(t){this._context=t}xf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:bf(this,this._t0,mf(this,this._t0));break}if(this._line||this._line!==0&&this._point===1){this._context.closePath()}this._line=1-this._line},point:function(t,e){var n=NaN;t=+t,e=+e;if(t===this._x1&&e===this._y1){return}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;bf(this,mf(this,n=yf(this,t,e)),n);break;default:bf(this,this._t0,n=yf(this,t,e));break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=e;this._t0=n}};function wf(t){this._context=new Cf(t)}(wf.prototype=Object.create(xf.prototype)).point=function(t,e){xf.prototype.point.call(this,e,t)};function Cf(t){this._context=t}Cf.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}};function Ef(t){return new xf(t)}function Sf(t){return new wf(t)}function Af(t){this._context=t}Af.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[];this._y=[]},lineEnd:function(){var t=this;var e=this._x,n=this._y,i=e.length;if(i){this._line?this._context.lineTo(e[0],n[0]):this._context.moveTo(e[0],n[0]);if(i===2){this._context.lineTo(e[1],n[1])}else{var r=kf(e),o=kf(n);for(var a=0,s=1;s<i;++a,++s){t._context.bezierCurveTo(r[0][a],o[0][a],r[1][a],o[1][a],e[s],n[s])}}}if(this._line||this._line!==0&&i===1){this._context.closePath()}this._line=1-this._line;this._x=this._y=null},point:function(t,e){this._x.push(+t);this._y.push(+e)}};function kf(t){var e,n=t.length-1,i,r=new Array(n),o=new Array(n),a=new Array(n);r[0]=0,o[0]=2,a[0]=t[0]+2*t[1];for(e=1;e<n-1;++e){r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1]}r[n-1]=2,o[n-1]=7,a[n-1]=8*t[n-1]+t[n];for(e=1;e<n;++e){i=r[e]/o[e-1],o[e]-=i,a[e]-=i*a[e-1]}r[n-1]=a[n-1]/o[n-1];for(e=n-2;e>=0;--e){r[e]=(a[e]-r[e+1])/o[e]}o[n-1]=(t[n]+r[n-1])/2;for(e=0;e<n-1;++e){o[e]=2*t[e+1]-r[e+1]}return[r,o]}var Mf=function(t){return new Af(t)};function Tf(t,e){this._context=t;this._t=e}Tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN;this._point=0},lineEnd:function(){if(0<this._t&&this._t<1&&this._point===2){this._context.lineTo(this._x,this._y)}if(this._line||this._line!==0&&this._point===1){this._context.closePath()}if(this._line>=0){this._t=1-this._t,this._line=1-this._line}},point:function(t,e){t=+t,e=+e;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0){this._context.lineTo(this._x,e);this._context.lineTo(t,e)}else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y);this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};var Bf=function(t){return new Tf(t,.5)};function Df(t){return new Tf(t,0)}function Nf(t){return new Tf(t,1)}var Pf=function(t,e){if(!((a=t.length)>1)){return}for(var n=1,i,r,o=t[e[0]],a,s=o.length;n<a;++n){r=o,o=t[e[n]];for(i=0;i<s;++i){o[i][1]+=o[i][0]=isNaN(r[i][1])?r[i][0]:r[i][1]}}};var zf=function(t){var e=t.length,n=new Array(e);while(--e>=0){n[e]=e}return n};function Of(t,e){return t[e]}var Ff=function(){var f=Bh([]),c=zf,d=Pf,p=Of;function e(t){var e=f.apply(this,arguments),n,i=t.length,r=e.length,o=new Array(r),a;for(n=0;n<r;++n){for(var s=e[n],u=o[n]=new Array(i),h=0,l;h<i;++h){u[h]=l=[0,+p(t[h],s,h,t)];l.data=t[h]}u.key=s}for(n=0,a=c(o);n<r;++n){o[a[n]].index=n}d(o,a);return o}e.keys=function(t){return arguments.length?(f=typeof t==="function"?t:Bh(pl.call(t)),e):f};e.value=function(t){return arguments.length?(p=typeof t==="function"?t:Bh(+t),e):p};e.order=function(t){return arguments.length?(c=t==null?zf:typeof t==="function"?t:Bh(pl.call(t)),e):c};e.offset=function(t){return arguments.length?(d=t==null?Pf:t,e):d};return e};var Rf=function(t,e){if(!((i=t.length)>0)){return}for(var n,i,r=0,o=t[0].length,a;r<o;++r){for(a=n=0;n<i;++n){a+=t[n][r][1]||0}if(a){for(n=0;n<i;++n){t[n][r][1]/=a}}}Pf(t,e)};var If=function(t,e){if(!((u=t.length)>1)){return}for(var n,i=0,r,o,a,s,u,h=t[e[0]].length;i<h;++i){for(a=s=0,n=0;n<u;++n){if((o=(r=t[e[n]][i])[1]-r[0])>=0){r[0]=a,r[1]=a+=o}else if(o<0){r[1]=s,r[0]=s+=o}else{r[0]=a}}}};var Lf=function(t,e){if(!((r=t.length)>0)){return}for(var n=0,i=t[e[0]],r,o=i.length;n<o;++n){for(var a=0,s=0;a<r;++a){s+=t[a][n][1]||0}i[n][1]+=i[n][0]=-s/2}Pf(t,e)};var jf=function(t,e){if(!((a=t.length)>0)||!((o=(r=t[e[0]]).length)>0)){return}for(var n=0,i=1,r,o,a;i<o;++i){for(var s=0,u=0,h=0;s<a;++s){var l=t[e[s]],f=l[i][1]||0,c=l[i-1][1]||0,d=(f-c)/2;for(var p=0;p<s;++p){var g=t[e[p]],v=g[i][1]||0,_=g[i-1][1]||0;d+=v-_}u+=f,h+=d*f}r[i-1][1]+=r[i-1][0]=n;if(u){n-=h/u}}r[i-1][1]+=r[i-1][0]=n;Pf(t,e)};var Hf=function(t){var n=t.map(Vf);return zf(t).sort(function(t,e){return n[t]-n[e]})};function Vf(t){var e=0,n=-1,i=t.length,r;while(++n<i){if(r=+t[n][1]){e+=r}}return e}var Uf=function(t){return Hf(t).reverse()};var Wf=function(t){var e=t.length,n,i,r=t.map(Vf),o=zf(t).sort(function(t,e){return r[e]-r[t]}),a=0,s=0,u=[],h=[];for(n=0;n<e;++n){i=o[n];if(a<s){a+=r[i];u.push(i)}else{s+=r[i];h.push(i)}}return h.reverse().concat(u)};var qf=function(t){return zf(t).reverse()};var Xf=Object.freeze({arc:Zh,area:il,line:nl,pie:al,areaRadial:cl,radialArea:cl,lineRadial:fl,radialLine:fl,pointRadial:dl,linkHorizontal:xl,linkVertical:wl,linkRadial:Cl,symbol:Ul,symbols:Vl,symbolCircle:El,symbolCross:Sl,symbolDiamond:Ml,symbolSquare:zl,symbolStar:Pl,symbolTriangle:Fl,symbolWye:Hl,curveBasisClosed:$l,curveBasisOpen:Zl,curveBasis:Gl,curveBundle:Jl,curveCardinalClosed:of,curveCardinalOpen:sf,curveCardinal:nf,curveCatmullRomClosed:cf,curveCatmullRomOpen:pf,curveCatmullRom:lf,curveLinearClosed:vf,curveLinear:Jh,curveMonotoneX:Ef,curveMonotoneY:Sf,curveNatural:Mf,curveStep:Bf,curveStepAfter:Nf,curveStepBefore:Df,stack:Ff,stackOffsetExpand:Rf,stackOffsetDiverging:If,stackOffsetNone:Pf,stackOffsetSilhouette:Lf,stackOffsetWiggle:jf,stackOrderAscending:Hf,stackOrderDescending:Uf,stackOrderInsideOut:Wf,stackOrderNone:zf,stackOrderReverse:qf});var Gf=function(t,e){e=Object.assign({"font-size":10,"font-family":"sans-serif","font-style":"normal","font-weight":400,"font-variant":"normal"},e);var n=document.createElement("canvas").getContext("2d");var i=[];i.push(e["font-style"]);i.push(e["font-variant"]);i.push(e["font-weight"]);i.push(typeof e["font-size"]==="string"?e["font-size"]:e["font-size"]+"px");i.push(e["font-family"]);n.font=i.join(" ");if(t instanceof Array){return t.map(function(t){return n.measureText(t).width})}return n.measureText(t).width};function Yf(t){return t.replace(/^\s+|\s+$/g,"")}function $f(t){return t.replace(/^\s+/,"")}function Qf(t){return t.replace(/\s+$/,"")}var Zf="abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890";var Kf={};var Jf=32;var tc;var ec;var nc;var ic;var rc=function(t){if(!tc){tc=Gf(Zf,{"font-family":"DejaVuSans","font-size":Jf});ec=Gf(Zf,{"font-family":"-apple-system","font-size":Jf});nc=Gf(Zf,{"font-family":"monospace","font-size":Jf});ic=Gf(Zf,{"font-family":"sans-serif","font-size":Jf})}if(!(t instanceof Array)){t=t.split(",")}t=t.map(function(t){return Yf(t)});for(var e=0;e<t.length;e++){var n=t[e];if(Kf[n]||["-apple-system","monospace","sans-serif","DejaVuSans"].includes(n)){return n}else if(Kf[n]===false){continue}var i=Gf(Zf,{"font-family":n,"font-size":Jf});Kf[n]=i!==nc;if(Kf[n]){Kf[n]=i!==ic}if(ec&&Kf[n]){Kf[n]=i!==ec}if(tc&&Kf[n]){Kf[n]=i!==tc}if(Kf[n]){return n}}return false};var oc=function(){return qa("html").attr("dir")==="rtl"||qa("body").attr("dir")==="rtl"||qa("html").style("direction")==="rtl"||qa("body").style("direction")==="rtl"};var ac=function(t){if(t===void 0){t="undefined"}else if(!(typeof t==="string"||t instanceof String)){t=JSON.stringify(t)}return t};var sc=[[/[\300-\305]/g,"A"],[/[\340-\345]/g,"a"],[/[\306]/g,"AE"],[/[\346]/g,"ae"],[/[\337]/g,"B"],[/[\307]/g,"C"],[/[\347]/g,"c"],[/[\320\336\376]/g,"D"],[/[\360]/g,"d"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\322-\326\330]/g,"O"],[/[\362-\366\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\327]/g,"x"],[/[\335]/g,"Y"],[/[\375\377]/g,"y"]];var uc=function(t){return(""+t).replace(/[^A-Za-z0-9\-_]/g,function(t){if(t===" "){return"-"}var e=false;for(var n=0;n<sc.length;n++){if(new RegExp(sc[n][0]).test(t)){e=sc[n][1];break}}return e||""})};var hc=["u0903","u093B","u093E","u093F","u0940","u0949","u094A","u094B","u094C","u094E","u094F","u0982","u0983","u09BE","u09BF","u09C0","u09C7","u09C8","u09CB","u09CC","u09D7","u0A03","u0A3E","u0A3F","u0A40","u0A83","u0ABE","u0ABF","u0AC0","u0AC9","u0ACB","u0ACC","u0B02","u0B03","u0B3E","u0B40","u0B47","u0B48","u0B4B","u0B4C","u0B57","u0BBE","u0BBF","u0BC1","u0BC2","u0BC6","u0BC7","u0BC8","u0BCA","u0BCB","u0BCC","u0BD7","u0C01","u0C02","u0C03","u0C41","u0C42","u0C43","u0C44","u0C82","u0C83","u0CBE","u0CC0","u0CC1","u0CC2","u0CC3","u0CC4","u0CC7","u0CC8","u0CCA","u0CCB","u0CD5","u0CD6","u0D02","u0D03","u0D3E","u0D3F","u0D40","u0D46","u0D47","u0D48","u0D4A","u0D4B","u0D4C","u0D57","u0D82","u0D83","u0DCF","u0DD0","u0DD1","u0DD8","u0DD9","u0DDA","u0DDB","u0DDC","u0DDD","u0DDE","u0DDF","u0DF2","u0DF3","u0F3E","u0F3F","u0F7F","u102B","u102C","u1031","u1038","u103B","u103C","u1056","u1057","u1062","u1063","u1064","u1067","u1068","u1069","u106A","u106B","u106C","u106D","u1083","u1084","u1087","u1088","u1089","u108A","u108B","u108C","u108F","u109A","u109B","u109C","u17B6","u17BE","u17BF","u17C0","u17C1","u17C2","u17C3","u17C4","u17C5","u17C7","u17C8","u1923","u1924","u1925","u1926","u1929","u192A","u192B","u1930","u1931","u1933","u1934","u1935","u1936","u1937","u1938","u1A19","u1A1A","u1A55","u1A57","u1A61","u1A63","u1A64","u1A6D","u1A6E","u1A6F","u1A70","u1A71","u1A72","u1B04","u1B35","u1B3B","u1B3D","u1B3E","u1B3F","u1B40","u1B41","u1B43","u1B44","u1B82","u1BA1","u1BA6","u1BA7","u1BAA","u1BE7","u1BEA","u1BEB","u1BEC","u1BEE","u1BF2","u1BF3","u1C24","u1C25","u1C26","u1C27","u1C28","u1C29","u1C2A","u1C2B","u1C34","u1C35","u1CE1","u1CF2","u1CF3","u302E","u302F","uA823","uA824","uA827","uA880","uA881","uA8B4","uA8B5","uA8B6","uA8B7","uA8B8","uA8B9","uA8BA","uA8BB","uA8BC","uA8BD","uA8BE","uA8BF","uA8C0","uA8C1","uA8C2","uA8C3","uA952","uA953","uA983","uA9B4","uA9B5","uA9BA","uA9BB","uA9BD","uA9BE","uA9BF","uA9C0","uAA2F","uAA30","uAA33","uAA34","uAA4D","uAA7B","uAA7D","uAAEB","uAAEE","uAAEF","uAAF5","uABE3","uABE4","uABE6","uABE7","uABE9","uABEA","uABEC"];var lc=["u0300","u0301","u0302","u0303","u0304","u0305","u0306","u0307","u0308","u0309","u030A","u030B","u030C","u030D","u030E","u030F","u0310","u0311","u0312","u0313","u0314","u0315","u0316","u0317","u0318","u0319","u031A","u031B","u031C","u031D","u031E","u031F","u0320","u0321","u0322","u0323","u0324","u0325","u0326","u0327","u0328","u0329","u032A","u032B","u032C","u032D","u032E","u032F","u0330","u0331","u0332","u0333","u0334","u0335","u0336","u0337","u0338","u0339","u033A","u033B","u033C","u033D","u033E","u033F","u0340","u0341","u0342","u0343","u0344","u0345","u0346","u0347","u0348","u0349","u034A","u034B","u034C","u034D","u034E","u034F","u0350","u0351","u0352","u0353","u0354","u0355","u0356","u0357","u0358","u0359","u035A","u035B","u035C","u035D","u035E","u035F","u0360","u0361","u0362","u0363","u0364","u0365","u0366","u0367","u0368","u0369","u036A","u036B","u036C","u036D","u036E","u036F","u0483","u0484","u0485","u0486","u0487","u0591","u0592","u0593","u0594","u0595","u0596","u0597","u0598","u0599","u059A","u059B","u059C","u059D","u059E","u059F","u05A0","u05A1","u05A2","u05A3","u05A4","u05A5","u05A6","u05A7","u05A8","u05A9","u05AA","u05AB","u05AC","u05AD","u05AE","u05AF","u05B0","u05B1","u05B2","u05B3","u05B4","u05B5","u05B6","u05B7","u05B8","u05B9","u05BA","u05BB","u05BC","u05BD","u05BF","u05C1","u05C2","u05C4","u05C5","u05C7","u0610","u0611","u0612","u0613","u0614","u0615","u0616","u0617","u0618","u0619","u061A","u064B","u064C","u064D","u064E","u064F","u0650","u0651","u0652","u0653","u0654","u0655","u0656","u0657","u0658","u0659","u065A","u065B","u065C","u065D","u065E","u065F","u0670","u06D6","u06D7","u06D8","u06D9","u06DA","u06DB","u06DC","u06DF","u06E0","u06E1","u06E2","u06E3","u06E4","u06E7","u06E8","u06EA","u06EB","u06EC","u06ED","u0711","u0730","u0731","u0732","u0733","u0734","u0735","u0736","u0737","u0738","u0739","u073A","u073B","u073C","u073D","u073E","u073F","u0740","u0741","u0742","u0743","u0744","u0745","u0746","u0747","u0748","u0749","u074A","u07A6","u07A7","u07A8","u07A9","u07AA","u07AB","u07AC","u07AD","u07AE","u07AF","u07B0","u07EB","u07EC","u07ED","u07EE","u07EF","u07F0","u07F1","u07F2","u07F3","u0816","u0817","u0818","u0819","u081B","u081C","u081D","u081E","u081F","u0820","u0821","u0822","u0823","u0825","u0826","u0827","u0829","u082A","u082B","u082C","u082D","u0859","u085A","u085B","u08E3","u08E4","u08E5","u08E6","u08E7","u08E8","u08E9","u08EA","u08EB","u08EC","u08ED","u08EE","u08EF","u08F0","u08F1","u08F2","u08F3","u08F4","u08F5","u08F6","u08F7","u08F8","u08F9","u08FA","u08FB","u08FC","u08FD","u08FE","u08FF","u0900","u0901","u0902","u093A","u093C","u0941","u0942","u0943","u0944","u0945","u0946","u0947","u0948","u094D","u0951","u0952","u0953","u0954","u0955","u0956","u0957","u0962","u0963","u0981","u09BC","u09C1","u09C2","u09C3","u09C4","u09CD","u09E2","u09E3","u0A01","u0A02","u0A3C","u0A41","u0A42","u0A47","u0A48","u0A4B","u0A4C","u0A4D","u0A51","u0A70","u0A71","u0A75","u0A81","u0A82","u0ABC","u0AC1","u0AC2","u0AC3","u0AC4","u0AC5","u0AC7","u0AC8","u0ACD","u0AE2","u0AE3","u0B01","u0B3C","u0B3F","u0B41","u0B42","u0B43","u0B44","u0B4D","u0B56","u0B62","u0B63","u0B82","u0BC0","u0BCD","u0C00","u0C3E","u0C3F","u0C40","u0C46","u0C47","u0C48","u0C4A","u0C4B","u0C4C","u0C4D","u0C55","u0C56","u0C62","u0C63","u0C81","u0CBC","u0CBF","u0CC6","u0CCC","u0CCD","u0CE2","u0CE3","u0D01","u0D41","u0D42","u0D43","u0D44","u0D4D","u0D62","u0D63","u0DCA","u0DD2","u0DD3","u0DD4","u0DD6","u0E31","u0E34","u0E35","u0E36","u0E37","u0E38","u0E39","u0E3A","u0E47","u0E48","u0E49","u0E4A","u0E4B","u0E4C","u0E4D","u0E4E","u0EB1","u0EB4","u0EB5","u0EB6","u0EB7","u0EB8","u0EB9","u0EBB","u0EBC","u0EC8","u0EC9","u0ECA","u0ECB","u0ECC","u0ECD","u0F18","u0F19","u0F35","u0F37","u0F39","u0F71","u0F72","u0F73","u0F74","u0F75","u0F76","u0F77","u0F78","u0F79","u0F7A","u0F7B","u0F7C","u0F7D","u0F7E","u0F80","u0F81","u0F82","u0F83","u0F84","u0F86","u0F87","u0F8D","u0F8E","u0F8F","u0F90","u0F91","u0F92","u0F93","u0F94","u0F95","u0F96","u0F97","u0F99","u0F9A","u0F9B","u0F9C","u0F9D","u0F9E","u0F9F","u0FA0","u0FA1","u0FA2","u0FA3","u0FA4","u0FA5","u0FA6","u0FA7","u0FA8","u0FA9","u0FAA","u0FAB","u0FAC","u0FAD","u0FAE","u0FAF","u0FB0","u0FB1","u0FB2","u0FB3","u0FB4","u0FB5","u0FB6","u0FB7","u0FB8","u0FB9","u0FBA","u0FBB","u0FBC","u0FC6","u102D","u102E","u102F","u1030","u1032","u1033","u1034","u1035","u1036","u1037","u1039","u103A","u103D","u103E","u1058","u1059","u105E","u105F","u1060","u1071","u1072","u1073","u1074","u1082","u1085","u1086","u108D","u109D","u135D","u135E","u135F","u1712","u1713","u1714","u1732","u1733","u1734","u1752","u1753","u1772","u1773","u17B4","u17B5","u17B7","u17B8","u17B9","u17BA","u17BB","u17BC","u17BD","u17C6","u17C9","u17CA","u17CB","u17CC","u17CD","u17CE","u17CF","u17D0","u17D1","u17D2","u17D3","u17DD","u180B","u180C","u180D","u18A9","u1920","u1921","u1922","u1927","u1928","u1932","u1939","u193A","u193B","u1A17","u1A18","u1A1B","u1A56","u1A58","u1A59","u1A5A","u1A5B","u1A5C","u1A5D","u1A5E","u1A60","u1A62","u1A65","u1A66","u1A67","u1A68","u1A69","u1A6A","u1A6B","u1A6C","u1A73","u1A74","u1A75","u1A76","u1A77","u1A78","u1A79","u1A7A","u1A7B","u1A7C","u1A7F","u1AB0","u1AB1","u1AB2","u1AB3","u1AB4","u1AB5","u1AB6","u1AB7","u1AB8","u1AB9","u1ABA","u1ABB","u1ABC","u1ABD","u1B00","u1B01","u1B02","u1B03","u1B34","u1B36","u1B37","u1B38","u1B39","u1B3A","u1B3C","u1B42","u1B6B","u1B6C","u1B6D","u1B6E","u1B6F","u1B70","u1B71","u1B72","u1B73","u1B80","u1B81","u1BA2","u1BA3","u1BA4","u1BA5","u1BA8","u1BA9","u1BAB","u1BAC","u1BAD","u1BE6","u1BE8","u1BE9","u1BED","u1BEF","u1BF0","u1BF1","u1C2C","u1C2D","u1C2E","u1C2F","u1C30","u1C31","u1C32","u1C33","u1C36","u1C37","u1CD0","u1CD1","u1CD2","u1CD4","u1CD5","u1CD6","u1CD7","u1CD8","u1CD9","u1CDA","u1CDB","u1CDC","u1CDD","u1CDE","u1CDF","u1CE0","u1CE2","u1CE3","u1CE4","u1CE5","u1CE6","u1CE7","u1CE8","u1CED","u1CF4","u1CF8","u1CF9","u1DC0","u1DC1","u1DC2","u1DC3","u1DC4","u1DC5","u1DC6","u1DC7","u1DC8","u1DC9","u1DCA","u1DCB","u1DCC","u1DCD","u1DCE","u1DCF","u1DD0","u1DD1","u1DD2","u1DD3","u1DD4","u1DD5","u1DD6","u1DD7","u1DD8","u1DD9","u1DDA","u1DDB","u1DDC","u1DDD","u1DDE","u1DDF","u1DE0","u1DE1","u1DE2","u1DE3","u1DE4","u1DE5","u1DE6","u1DE7","u1DE8","u1DE9","u1DEA","u1DEB","u1DEC","u1DED","u1DEE","u1DEF","u1DF0","u1DF1","u1DF2","u1DF3","u1DF4","u1DF5","u1DFC","u1DFD","u1DFE","u1DFF","u20D0","u20D1","u20D2","u20D3","u20D4","u20D5","u20D6","u20D7","u20D8","u20D9","u20DA","u20DB","u20DC","u20E1","u20E5","u20E6","u20E7","u20E8","u20E9","u20EA","u20EB","u20EC","u20ED","u20EE","u20EF","u20F0","u2CEF","u2CF0","u2CF1","u2D7F","u2DE0","u2DE1","u2DE2","u2DE3","u2DE4","u2DE5","u2DE6","u2DE7","u2DE8","u2DE9","u2DEA","u2DEB","u2DEC","u2DED","u2DEE","u2DEF","u2DF0","u2DF1","u2DF2","u2DF3","u2DF4","u2DF5","u2DF6","u2DF7","u2DF8","u2DF9","u2DFA","u2DFB","u2DFC","u2DFD","u2DFE","u2DFF","u302A","u302B","u302C","u302D","u3099","u309A","uA66F","uA674","uA675","uA676","uA677","uA678","uA679","uA67A","uA67B","uA67C","uA67D","uA69E","uA69F","uA6F0","uA6F1","uA802","uA806","uA80B","uA825","uA826","uA8C4","uA8E0","uA8E1","uA8E2","uA8E3","uA8E4","uA8E5","uA8E6","uA8E7","uA8E8","uA8E9","uA8EA","uA8EB","uA8EC","uA8ED","uA8EE","uA8EF","uA8F0","uA8F1","uA926","uA927","uA928","uA929","uA92A","uA92B","uA92C","uA92D","uA947","uA948","uA949","uA94A","uA94B","uA94C","uA94D","uA94E","uA94F","uA950","uA951","uA980","uA981","uA982","uA9B3","uA9B6","uA9B7","uA9B8","uA9B9","uA9BC","uA9E5","uAA29","uAA2A","uAA2B","uAA2C","uAA2D","uAA2E","uAA31","uAA32","uAA35","uAA36","uAA43","uAA4C","uAA7C","uAAB0","uAAB2","uAAB3","uAAB4","uAAB7","uAAB8","uAABE","uAABF","uAAC1","uAAEC","uAAED","uAAF6","uABE5","uABE8","uABED","uFB1E","uFE00","uFE01","uFE02","uFE03","uFE04","uFE05","uFE06","uFE07","uFE08","uFE09","uFE0A","uFE0B","uFE0C","uFE0D","uFE0E","uFE0F","uFE20","uFE21","uFE22","uFE23","uFE24","uFE25","uFE26","uFE27","uFE28","uFE29","uFE2A","uFE2B","uFE2C","uFE2D","uFE2E","uFE2F"];var fc=hc.concat(lc);var cc=["-","/",";",":","&","u0E2F","u0EAF","u0EC6","u0ECC","u104A","u104B","u104C","u104D","u104E","u104F","u2013","u2014","u2027","u3000","u3001","u3002","uFF0C","uFF5E"];var dc=["'","<","(","{","[","u00AB","u300A","u3008"];var pc=["'",">",")","}","]",".","!","?","u00BB","u300B","u3009"].concat(cc);var gc="က-ဪဿ-၉ၐ-ၕ";var vc="-ゟ゠-ヿ-+--}⦅-゚㐀-䶿";var _c="㐀-龿";var yc="ກ-ຮະ-ໄ່-໋ໍ-ໝ";var mc=gc+_c+yc;var bc=new RegExp("(\\"+cc.join("|\\")+")*[^\\s|\\"+cc.join("|\\")+"]*(\\"+cc.join("|\\")+")*","g");var xc=new RegExp("["+vc+"]");var wc=new RegExp("["+mc+"]");var Cc=new RegExp("(\\"+dc.join("|\\")+")*["+mc+"](\\"+pc.join("|\\")+"|\\"+fc.join("|\\")+")*|[a-z0-9]+","gi");var Ec=function(t){if(!wc.test(t)){return ac(t).match(bc).filter(function(t){return t.length})}return Wt(ac(t).match(bc).map(function(t){if(!xc.test(t)&&wc.test(t)){return t.match(Cc)}return[t]}))};var Sc=function(){var d="sans-serif",p=10,g=400,v=200,_,y=false,m=Ec,b=200;function e(t){t=ac(t);if(_===void 0){_=Math.ceil(p*1.4)}var e=m(t);var n={"font-family":d,"font-size":p,"font-weight":g,"line-height":_};var i=1,r="",o=false,a=0;var s=[],u=Gf(e,n),h=Gf(" ",n);for(var l=0;l<e.length;l++){var f=e[l];var c=u[e.indexOf(f)];f+=t.slice(r.length+f.length).match("^( |\n)*","g")[0];if(r.slice(-1)==="\n"||a+c>b){if(!l&&!y){o=true;break}s[i-1]=Qf(s[i-1]);i++;if(_*i>v||c>b&&!y){o=true;break}a=0;s.push(f)}else if(!l){s[0]=f}else{s[i-1]+=f}r+=f;a+=c;a+=f.match(/[\s]*$/g)[0].length*h}return{lines:s,sentence:t,truncated:o,widths:Gf(s,n),words:e}}e.fontFamily=function(t){return arguments.length?(d=t,e):d};e.fontSize=function(t){return arguments.length?(p=t,e):p};e.fontWeight=function(t){return arguments.length?(g=t,e):g};e.height=function(t){return arguments.length?(v=t,e):v};e.lineHeight=function(t){return arguments.length?(_=t,e):_};e.overflow=function(t){return arguments.length?(y=t,e):y};e.split=function(t){return arguments.length?(m=t,e):m};e.width=function(t){return arguments.length?(b=t,e):b};return e};var Ac=function(t){function e(){var n=this;t.call(this);this._delay=0;this._duration=0;this._ellipsis=function(t,e){return e?t.replace(/\.|,$/g,"")+"...":""};this._fontColor=Zu("black");this._fontFamily=Zu(["Roboto","Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"]);this._fontMax=Zu(50);this._fontMin=Zu(8);this._fontOpacity=Zu(1);this._fontResize=Zu(false);this._fontSize=Zu(10);this._fontWeight=Zu(400);this._height=ju("height",200);this._id=function(t,e){return t.id||""+e};this._lineHeight=function(t,e){return n._fontSize(t,e)*1.2};this._on={};this._overflow=Zu(false);this._padding=Zu(0);this._pointerEvents=Zu("auto");this._rotate=Zu(0);this._rotateAnchor=function(t){return[t.w/2,t.h/2]};this._split=Ec;this._text=ju("text");this._textAnchor=Zu("start");this._verticalAlign=Zu("top");this._width=ju("width",200);this._x=ju("x",0);this._y=ju("y",0)}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.render=function t(e){var N=this;if(this._select===void 0){this.select(qa("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node())}var P=this;var n=this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function(t,e,n){var i=N._text(e,n);if(i===void 0){return t}var r=N._fontResize(e,n);var o=N._lineHeight(e,n)/N._fontSize(e,n);var a=r?N._fontMax(e,n):N._fontSize(e,n),s=r?a*o:N._lineHeight(e,n),u=1,h=[],l,f;var c={"font-family":rc(N._fontFamily(e,n)),"font-size":a,"font-weight":N._fontWeight(e,n),"line-height":s};var d=th(N._padding(e,n));var p=N._height(e,n)-(d.top+d.bottom),g=N._width(e,n)-(d.left+d.right);var v=Sc().fontFamily(c["font-family"]).fontSize(a).fontWeight(c["font-weight"]).lineHeight(s).height(p).overflow(N._overflow(e,n)).width(g);var _=N._fontMax(e,n),y=N._fontMin(e,n),m=N._verticalAlign(e,n),b=N._split(i,n);function x(){if(a<y){h=[];return}else if(a>_){a=_}if(r){s=a*o;v.fontSize(a).lineHeight(s);c["font-size"]=a;c["line-height"]=s}f=v(i);h=f.lines.filter(function(t){return t!==""});u=h.length;if(f.truncated){if(r){a--;if(a<y){h=[]}else{x()}}else if(u<1){h=[P._ellipsis("",u)]}else{h[u-1]=P._ellipsis(h[u-1],u)}}}if(g>y&&(p>s||r&&p>y*o)){if(r){l=Gf(b,c);var w=1.165+g/p*.1,C=g*p,E=Ut(l),S=Xt(l,function(t){return t*s})*w;if(E>g||S>C){var A=Math.sqrt(C/S),k=g/E;var M=qt([A,k]);a=Math.floor(a*M)}var T=Math.floor(p*.8);if(a>T){a=T}}x()}if(h.length){var B=u*s;var D=m==="top"?0:m==="middle"?p/2-B/2:p-B;D-=s*.1;t.push({data:e,i:n,lines:h,fC:N._fontColor(e,n),fF:c["font-family"],fO:N._fontOpacity(e,n),fW:c["font-weight"],id:N._id(e,n),tA:N._textAnchor(e,n),widths:f.widths,fS:a,lH:s,w:g,h:p,x:N._x(e,n)+d.left,y:N._y(e,n)+D+d.top})}return t},[]),this._id);var i=Pu().duration(this._duration);if(this._duration===0){n.exit().remove()}else{n.exit().transition().delay(this._duration).remove();n.exit().selectAll("text").transition(i).attr("opacity",0)}function r(t){t.attr("transform",function(t,e){var n=P._rotateAnchor(t,e);return"translate("+t.x+", "+t.y+") rotate("+P._rotate(t,e)+", "+n[0]+", "+n[1]+")"})}var o=n.enter().append("g").attr("class","d3plus-textBox").attr("id",function(t){return"d3plus-textBox-"+uc(t.id)}).call(r).merge(n);var a=oc();o.style("pointer-events",function(t){return N._pointerEvents(t.data,t.i)}).each(function(n){function t(t){t.text(function(t){return Qf(t)}).attr("dir",a?"rtl":"ltr").attr("fill",n.fC).attr("text-anchor",n.tA).attr("font-family",n.fF).style("font-family",n.fF).attr("font-size",n.fS+"px").style("font-size",n.fS+"px").attr("font-weight",n.fW).style("font-weight",n.fW).attr("opacity",n.fO).style("opacity",n.fO).attr("x",(n.tA==="middle"?n.w/2:a?n.tA==="start"?n.w:0:n.tA==="end"?n.w:0)+"px").attr("y",function(t,e){return(e+1)*n.lH-(n.lH-n.fS)+"px"})}var e=qa(this).selectAll("text").data(n.lines);if(P._duration===0){e.call(t);e.exit().remove();e.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("unicode-bidi","bidi-override").call(t)}else{e.transition(i).call(t);e.exit().transition(i).attr("opacity",0).remove();e.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(t).merge(e).transition(i).delay(P._delay).call(t).attr("opacity",1)}}).transition(i).call(r);var s=Object.keys(this._on),u=s.reduce(function(t,n){t[n]=function(t,e){return N._on[n](t.data,e)};return t},{});for(var h=0;h<s.length;h++){o.on(s[h],u[s[h]])}if(e){setTimeout(e,this._duration+100)}return this};e.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};e.prototype.delay=function t(e){return arguments.length?(this._delay=e,this):this._delay};e.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};e.prototype.ellipsis=function t(e){return arguments.length?(this._ellipsis=typeof e==="function"?e:Zu(e),this):this._ellipsis};e.prototype.fontColor=function t(e){return arguments.length?(this._fontColor=typeof e==="function"?e:Zu(e),this):this._fontColor};e.prototype.fontFamily=function t(e){return arguments.length?(this._fontFamily=typeof e==="function"?e:Zu(e),this):this._fontFamily};e.prototype.fontMax=function t(e){return arguments.length?(this._fontMax=typeof e==="function"?e:Zu(e),this):this._fontMax};e.prototype.fontMin=function t(e){return arguments.length?(this._fontMin=typeof e==="function"?e:Zu(e),this):this._fontMin};e.prototype.fontOpacity=function t(e){return arguments.length?(this._fontOpacity=typeof e==="function"?e:Zu(e),this):this._fontOpacity};e.prototype.fontResize=function t(e){return arguments.length?(this._fontResize=typeof e==="function"?e:Zu(e),this):this._fontResize};e.prototype.fontSize=function t(e){return arguments.length?(this._fontSize=typeof e==="function"?e:Zu(e),this):this._fontSize};e.prototype.fontWeight=function t(e){return arguments.length?(this._fontWeight=typeof e==="function"?e:Zu(e),this):this._fontWeight};e.prototype.height=function t(e){return arguments.length?(this._height=typeof e==="function"?e:Zu(e),this):this._height};e.prototype.id=function t(e){return arguments.length?(this._id=typeof e==="function"?e:Zu(e),this):this._id};e.prototype.lineHeight=function t(e){return arguments.length?(this._lineHeight=typeof e==="function"?e:Zu(e),this):this._lineHeight};e.prototype.overflow=function t(e){return arguments.length?(this._overflow=typeof e==="function"?e:Zu(e),this):this._overflow};e.prototype.padding=function t(e){return arguments.length?(this._padding=typeof e==="function"?e:Zu(e),this):this._padding};e.prototype.pointerEvents=function t(e){return arguments.length?(this._pointerEvents=typeof e==="function"?e:Zu(e),this):this._pointerEvents};e.prototype.rotate=function t(e){return arguments.length?(this._rotate=typeof e==="function"?e:Zu(e),this):this._rotate};e.prototype.rotateAnchor=function t(e){return arguments.length?(this._rotateAnchor=typeof e==="function"?e:Zu(e),this):this._rotateAnchor};e.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};e.prototype.split=function t(e){return arguments.length?(this._split=e,this):this._split};e.prototype.text=function t(e){return arguments.length?(this._text=typeof e==="function"?e:Zu(e),this):this._text};e.prototype.textAnchor=function t(e){return arguments.length?(this._textAnchor=typeof e==="function"?e:Zu(e),this):this._textAnchor};e.prototype.verticalAlign=function t(e){return arguments.length?(this._verticalAlign=typeof e==="function"?e:Zu(e),this):this._verticalAlign};e.prototype.width=function t(e){return arguments.length?(this._width=typeof e==="function"?e:Zu(e),this):this._width};e.prototype.x=function t(e){return arguments.length?(this._x=typeof e==="function"?e:Zu(e),this):this._x};e.prototype.y=function t(e){return arguments.length?(this._y=typeof e==="function"?e:Zu(e),this):this._y};return e}(Yu);var kc=["a","an","and","as","at","but","by","for","from","if","in","into","near","nor","of","on","onto","or","per","that","the","to","with","via","vs","vs."];var Mc=["CEO","CFO","CNC","COO","CPU","GDP","HVAC","ID","IT","R&D","TV","UI"];var Tc=function(i){if(i===void 0){return""}var o=kc.map(function(t){return t.toLowerCase()});var a=Mc.slice();a=a.concat(a.map(function(t){return t+"s"}));var s=a.map(function(t){return t.toLowerCase()});var u=Ec(i);return u.map(function(t,e){if(t){var n=t.toLowerCase();var i=pc.includes(n.charAt(n.length-1))?n.slice(0,-1):n;var r=s.indexOf(i);if(r>=0){return a[r]}else if(o.includes(i)&&e!==0&&e!==u.length-1){return n}else{return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}}else{return""}}).reduce(function(t,e,n){if(n&&i.charAt(t.length)===" "){t+=" "}t+=e;return t},"")};var Bc=function(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i};var Dc=function(t,e){return Math.sqrt(Bc(t,e))};var Nc=function(e){function t(t){var i=this;if(t===void 0){t="g"}e.call(this);this._activeOpacity=.25;this._activeStyle={stroke:function(t,e){var n=i._fill(t,e);if(["transparent","none"].includes(n)){n=i._stroke(t,e)}return Q(n).darker(1)},"stroke-width":function(t,e){var n=i._strokeWidth(t,e)||1;return n*3}};this._backgroundImage=Zu(false);this._backgroundImageClass=new ih;this._data=[];this._duration=600;this._fill=Zu("black");this._fillOpacity=Zu(1);this._hoverOpacity=.5;this._hoverStyle={stroke:function(t,e){var n=i._fill(t,e);if(["transparent","none"].includes(n)){n=i._stroke(t,e)}return Q(n).darker(.5)},"stroke-width":function(t,e){var n=i._strokeWidth(t,e)||1;return n*2}};this._id=function(t,e){return t.id!==void 0?t.id:e};this._label=Zu(false);this._labelClass=new Ac;this._labelConfig={fontColor:function(t,e){return bh(i._fill(t,e))},fontSize:12,padding:5};this._name="Shape";this._opacity=Zu(1);this._pointerEvents=Zu("visiblePainted");this._rotate=Zu(0);this._rx=Zu(0);this._ry=Zu(0);this._scale=Zu(1);this._shapeRendering=Zu("geometricPrecision");this._stroke=function(t,e){return Q(i._fill(t,e)).darker(1)};this._strokeDasharray=Zu("0");this._strokeLinecap=Zu("butt");this._strokeOpacity=Zu(1);this._strokeWidth=Zu(0);this._tagName=t;this._textAnchor=Zu("start");this._vectorEffect=Zu("non-scaling-stroke");this._verticalAlign=Zu("top");this._x=ju("x",0);this._y=ju("y",0)}if(e){t.__proto__=e}t.prototype=Object.create(e&&e.prototype);t.prototype.constructor=t;t.prototype._aes=function t(){return{}};t.prototype._applyEvents=function t(e){var o=this;var a=Object.keys(this._on);var n=function(r){e.on(a[r],function(t,e){if(!o._on[a[r]]){return}if(t.i!==void 0){e=t.i}if(t.nested&&t.values){var n=Ya(o._select.node()),i=t.values.map(function(t){return Dc(n,[o._x(t,e),o._y(t,e)])});t=t.values[i.indexOf(qt(i))]}o._on[a[r]].bind(o)(t,e)})};for(var i=0;i<a.length;i++){n(i)}};t.prototype._updateStyle=function t(e,n){var i=this;if(e.size()&&e.node().tagName==="g"){e=e.selectAll("*")}function r(t,e){return typeof this!=="function"?this:t.nested&&t.key&&t.values?this(t.values[0],i._data.indexOf(t.values[0])):this(t,e)}var o={};for(var a in n){if({}.hasOwnProperty.call(n,a)){o[a]=r.bind(n[a])}}e.transition().duration(0).call(Uu,o)};t.prototype._applyStyle=function t(e){var n=this;if(e.size()&&e.node().tagName==="g"){e=e.selectAll("*")}function i(t,e){return typeof this!=="function"?this:t.nested&&t.key&&t.values?this(t.values[0],n._data.indexOf(t.values[0])):this(t,e)}e.attr("fill",i.bind(this._fill)).attr("fill-opacity",i.bind(this._fillOpacity)).attr("rx",i.bind(this._rx)).attr("ry",i.bind(this._ry)).attr("stroke",i.bind(this._stroke)).attr("stroke-dasharray",i.bind(this._strokeDasharray)).attr("stroke-linecap",i.bind(this._strokeLinecap)).attr("stroke-opacity",i.bind(this._strokeOpacity)).attr("stroke-width",i.bind(this._strokeWidth)).attr("vector-effect",i.bind(this._vectorEffect))};t.prototype._applyTransform=function t(e){var n=this;e.attr("transform",function(t,e){return"\n translate("+(t.__d3plusShape__?t.translate?t.translate:n._x(t.data,t.i)+","+n._y(t.data,t.i):n._x(t,e)+","+n._y(t,e))+")\n scale("+(t.__d3plusShape__?t.scale||n._scale(t.data,t.i):n._scale(t,e))+")\n rotate("+(t.__d3plusShape__?t.rotate?t.rotate:n._rotate(t.data||t,t.i):n._rotate(t.data||t,t.i))+")"})};t.prototype._nestWrapper=function t(n){return function(t,e){return n(t.__d3plusShape__?t.data:t,t.__d3plusShape__?t.i:e)}};t.prototype._renderActive=function t(){var r=this;this._group.selectAll(".d3plus-Shape, .d3plus-Image, .d3plus-textBox").each(function(t,e){if(!t){t={}}if(!t.parentNode){t.parentNode=this.parentNode}var n=t.parentNode;if(qa(this).classed("d3plus-textBox")){t=t.data}if(t.__d3plusShape__||t.__d3plus__){while(t&&(t.__d3plusShape__||t.__d3plus__)){e=t.i;t=t.data}}else{e=r._data.indexOf(t)}var i=!r._active||typeof r._active!=="function"||!r._active(t,e)?n:r._activeGroup.node();if(i!==this.parentNode){i.appendChild(this);if(this.className.baseVal.includes("d3plus-Shape")){if(n===i){qa(this).call(r._applyStyle.bind(r))}else{qa(this).call(r._updateStyle.bind(r,qa(this),r._activeStyle))}}}});this._group.selectAll("g.d3plus-"+this._name+"-shape, g.d3plus-"+this._name+"-image, g.d3plus-"+this._name+"-text").attr("opacity",this._hover?this._hoverOpacity:this._active?this._activeOpacity:1)};t.prototype._renderHover=function t(){var r=this;this._group.selectAll("g.d3plus-"+this._name+"-shape, g.d3plus-"+this._name+"-image, g.d3plus-"+this._name+"-text, g.d3plus-"+this._name+"-hover").selectAll(".d3plus-Shape, .d3plus-Image, .d3plus-textBox").each(function(t,e){if(!t){t={}}if(!t.parentNode){t.parentNode=this.parentNode}var n=t.parentNode;if(qa(this).classed("d3plus-textBox")){t=t.data}if(t.__d3plusShape__||t.__d3plus__){while(t&&(t.__d3plusShape__||t.__d3plus__)){e=t.i;t=t.data}}else{e=r._data.indexOf(t)}var i=!r._hover||typeof r._hover!=="function"||!r._hover(t,e)?n:r._hoverGroup.node();if(i!==this.parentNode){i.appendChild(this)}if(this.className.baseVal.includes("d3plus-Shape")){if(n===i){qa(this).call(r._applyStyle.bind(r))}else{qa(this).call(r._updateStyle.bind(r,qa(this),r._hoverStyle))}}});this._group.selectAll("g.d3plus-"+this._name+"-shape, g.d3plus-"+this._name+"-image, g.d3plus-"+this._name+"-text").attr("opacity",this._hover?this._hoverOpacity:this._active?this._activeOpacity:1)};t.prototype._renderImage=function t(){var h=this;var l=[];this._update.merge(this._enter).data().forEach(function(t,e){var n=h._aes(t,e);if(n.r||n.width&&n.height){var i=t;if(t.nested&&t.key&&t.values){i=t.values[0];e=h._data.indexOf(i)}var r=n.r?n.r*2:n.height,o=h._backgroundImage(i,e),a=n.r?n.r*2:n.width;if(o){var s=i.__d3plusShape__?i.translate?i.translate[0]:h._x(i.data,i.i):h._x(i,e),u=i.__d3plusShape__?i.translate?i.translate[1]:h._y(i.data,i.i):h._y(i,e);if(n.x){s+=n.x}if(n.y){u+=n.y}if(i.__d3plusShape__){i=i.data;e=i.i}l.push({__d3plus__:true,data:i,height:r,i:e,id:h._id(i,e),url:o,width:a,x:s+-a/2,y:u+-r/2})}}});this._backgroundImageClass.data(l).duration(this._duration).pointerEvents("none").select(Ku("g.d3plus-"+this._name+"-image",{parent:this._group,update:{opacity:this._active?this._activeOpacity:1}}).node()).render()};t.prototype._renderLabels=function t(){var c=this;var d=[];this._update.merge(this._enter).data().forEach(function(t,e){var n=t;if(t.nested&&t.key&&t.values){n=t.values[0];e=c._data.indexOf(n)}var i=c._label(n,e);if(c._labelBounds&&i!==false&&i!==undefined&&i!==null){var r=c._labelBounds(n,e,c._aes(t,e));if(r){if(i.constructor!==Array){i=[i]}var o=n.__d3plusShape__?n.translate?n.translate[0]:c._x(n.data,n.i):c._x(n,e),a=n.__d3plusShape__?n.translate?n.translate[1]:c._y(n.data,n.i):c._y(n,e);if(n.__d3plusShape__){n=n.data;e=n.i}for(var s=0;s<i.length;s++){var u=r.constructor===Array?r[s]:Object.assign({},r);var h=c._rotate(n,e);var l=n.labelConfig&&n.labelConfig.rotate?n.labelConfig.rotate:r.angle!==undefined?r.angle:0;l+=h;var f=h!==0?[u.x*-1||0,u.y*-1||0]:[u.width/2,u.height/2];d.push({__d3plus__:true,data:n,height:u.height,l:s,id:c._id(n,e)+"_"+s,r:l,rotateAnchor:f,text:i[s],width:u.width,x:o+u.x,y:a+u.y})}}}});this._labelClass.data(d).duration(this._duration).pointerEvents("none").rotate(function(t){return t.data.r}).rotateAnchor(function(t){return t.data.rotateAnchor}).select(Ku("g.d3plus-"+this._name+"-text",{parent:this._group,update:{opacity:this._active?this._activeOpacity:1}}).node()).config(this._labelConfig).render()};t.prototype.render=function t(e){var n=this;if(this._select===void 0){this.select(qa("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").style("display","block").node())}this._transition=Pu().duration(this._duration);var i=this._data,r=this._id;if(this._dataFilter){i=this._dataFilter(i);if(i.key){r=i.key}}if(this._sort){i=i.sort(function(t,e){return n._sort(t.__d3plusShape__?t.data:t,e.__d3plusShape__?e.data:e)})}$a("g.d3plus-"+this._name+"-hover > *, g.d3plus-"+this._name+"-active > *").each(function(t){if(t&&t.parentNode){t.parentNode.appendChild(this)}else{this.parentNode.removeChild(this)}});this._group=Ku("g.d3plus-"+this._name+"-group",{parent:this._select});var o=this._update=Ku("g.d3plus-"+this._name+"-shape",{parent:this._group,update:{opacity:this._active?this._activeOpacity:1}}).selectAll(".d3plus-"+this._name).data(i,r);o.order().transition(this._transition).call(this._applyTransform.bind(this));var a=this._enter=o.enter().append(this._tagName).attr("class",function(t,e){return"d3plus-Shape d3plus-"+n._name+" d3plus-id-"+uc(n._nestWrapper(n._id)(t,e))}).call(this._applyTransform.bind(this)).attr("opacity",this._nestWrapper(this._opacity));var s=a.merge(o);s.attr("shape-rendering",this._nestWrapper(this._shapeRendering)).attr("pointer-events","none").transition(this._transition).attr("opacity",this._nestWrapper(this._opacity)).transition().attr("pointer-events",this._pointerEvents);var u=this._exit=o.exit();u.transition().delay(this._duration).remove();this._renderImage();this._renderLabels();this._hoverGroup=Ku("g.d3plus-"+this._name+"-hover",{parent:this._group});this._activeGroup=Ku("g.d3plus-"+this._name+"-active",{parent:this._group});var h=this._group.selectAll(".d3plus-HitArea").data(this._hitArea?i:[],r);h.order().call(this._applyTransform.bind(this));var l=this._name==="Line";l&&this._path.curve(Xf["curve"+this._curve.charAt(0).toUpperCase()+this._curve.slice(1)]).defined(this._defined).x(this._x).y(this._y);var f=h.enter().append(l?"path":"rect").attr("class",function(t,e){return"d3plus-HitArea d3plus-id-"+uc(n._nestWrapper(n._id)(t,e))}).attr("fill","black").attr("stroke","black").attr("pointer-events","painted").attr("opacity",0).call(this._applyTransform.bind(this));var c=this;var d=h.merge(f).each(function(t){var e=c._data.indexOf(t);var n=c._hitArea(t,e,c._aes(t,e));return n&&!(c._name==="Line"&&parseFloat(c._strokeWidth(t,e))>10)?qa(this).call(Uu,n):qa(this).remove()});h.exit().remove();this._applyEvents(this._hitArea?d:s);setTimeout(function(){if(n._active){n._renderActive()}else if(n._hover){n._renderHover()}if(e){e()}},this._duration+100);return this};t.prototype.active=function t(e){if(!arguments.length||e===undefined){return this._active}this._active=e;if(this._group){this._renderActive()}return this};t.prototype.activeOpacity=function t(e){return arguments.length?(this._activeOpacity=e,this):this._activeOpacity};t.prototype.activeStyle=function t(e){return arguments.length?(this._activeStyle=Vu({},this._activeStyle,e),this):this._activeStyle};t.prototype.backgroundImage=function t(e){return arguments.length?(this._backgroundImage=typeof e==="function"?e:Zu(e),this):this._backgroundImage};t.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};t.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};t.prototype.fill=function t(e){return arguments.length?(this._fill=typeof e==="function"?e:Zu(e),this):this._fill};t.prototype.fillOpacity=function t(e){return arguments.length?(this._fillOpacity=typeof e==="function"?e:Zu(e),this):this._fillOpacity};t.prototype.hover=function t(e){if(!arguments.length||e===void 0){return this._hover}this._hover=e;if(this._group){this._renderHover()}return this};t.prototype.hoverStyle=function t(e){return arguments.length?(this._hoverStyle=Vu({},this._hoverStyle,e),this):this._hoverStyle};t.prototype.hoverOpacity=function t(e){return arguments.length?(this._hoverOpacity=e,this):this._hoverOpacity};t.prototype.hitArea=function t(e){return arguments.length?(this._hitArea=typeof e==="function"?e:Zu(e),this):this._hitArea};t.prototype.id=function t(e){return arguments.length?(this._id=e,this):this._id};t.prototype.label=function t(e){return arguments.length?(this._label=typeof e==="function"?e:Zu(e),this):this._label};t.prototype.labelBounds=function t(e){return arguments.length?(this._labelBounds=typeof e==="function"?e:Zu(e),this):this._labelBounds};t.prototype.labelConfig=function t(e){return arguments.length?(this._labelConfig=Vu(this._labelConfig,e),this):this._labelConfig};t.prototype.opacity=function t(e){return arguments.length?(this._opacity=typeof e==="function"?e:Zu(e),this):this._opacity};t.prototype.pointerEvents=function t(e){return arguments.length?(this._pointerEvents=typeof e==="function"?e:Zu(e),this):this._pointerEvents};t.prototype.rotate=function t(e){return arguments.length?(this._rotate=typeof e==="function"?e:Zu(e),this):this._rotate};t.prototype.rx=function t(e){return arguments.length?(this._rx=typeof e==="function"?e:Zu(e),this):this._rx};t.prototype.ry=function t(e){return arguments.length?(this._ry=typeof e==="function"?e:Zu(e),this):this._ry};t.prototype.scale=function t(e){return arguments.length?(this._scale=typeof e==="function"?e:Zu(e),this):this._scale};t.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};t.prototype.shapeRendering=function t(e){return arguments.length?(this._shapeRendering=typeof e==="function"?e:Zu(e),this):this._shapeRendering};t.prototype.sort=function t(e){return arguments.length?(this._sort=e,this):this._sort};t.prototype.stroke=function t(e){return arguments.length?(this._stroke=typeof e==="function"?e:Zu(e),this):this._stroke};t.prototype.strokeDasharray=function t(e){return arguments.length?(this._strokeDasharray=typeof e==="function"?e:Zu(e),this):this._strokeDasharray};t.prototype.strokeLinecap=function t(e){return arguments.length?(this._strokeLinecap=typeof e==="function"?e:Zu(e),this):this._strokeLinecap};t.prototype.strokeOpacity=function t(e){return arguments.length?(this._strokeOpacity=typeof e==="function"?e:Zu(e),this):this._strokeOpacity};t.prototype.strokeWidth=function t(e){return arguments.length?(this._strokeWidth=typeof e==="function"?e:Zu(e),this):this._strokeWidth};t.prototype.textAnchor=function t(e){return arguments.length?(this._textAnchor=typeof e==="function"?e:Zu(e),this):this._textAnchor};t.prototype.vectorEffect=function t(e){return arguments.length?(this._vectorEffect=typeof e==="function"?e:Zu(e),this):this._vectorEffect};t.prototype.verticalAlign=function t(e){return arguments.length?(this._verticalAlign=typeof e==="function"?e:Zu(e),this):this._verticalAlign};t.prototype.x=function t(e){return arguments.length?(this._x=typeof e==="function"?e:Zu(e),this):this._x};t.prototype.y=function t(e){return arguments.length?(this._y=typeof e==="function"?e:Zu(e),this):this._y};return t}(Yu);function Pc(t,e){var r=[];var o=[];function a(t,e){if(t.length===1){r.push(t[0]);o.push(t[0])}else{var n=Array(t.length-1);for(var i=0;i<n.length;i++){if(i===0){r.push(t[0])}if(i===n.length-1){o.push(t[i+1])}n[i]=[(1-e)*t[i][0]+e*t[i+1][0],(1-e)*t[i][1]+e*t[i+1][1]]}a(n,e)}}if(t.length){a(t,e)}return{left:r,right:o.reverse()}}function zc(t){var e={};if(t.length===4){e.x2=t[2][0];e.y2=t[2][1]}if(t.length>=3){e.x1=t[1][0];e.y1=t[1][1]}e.x=t[t.length-1][0];e.y=t[t.length-1][1];if(t.length===4){e.type="C"}else if(t.length===3){e.type="Q"}else{e.type="L"}return e}function Oc(t,e){e=e||2;var n=[];var i=t;var r=1/e;for(var o=0;o<e-1;o++){var a=r/(1-r*o);var s=Pc(i,a);n.push(s.left);i=s.right}n.push(i);return n}function Fc(t,e,n){var i=[[t.x,t.y]];if(e.x1!=null){i.push([e.x1,e.y1])}if(e.x2!=null){i.push([e.x2,e.y2])}i.push([e.x,e.y]);return Oc(i,n).map(zc)}var Rc={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"]};function Ic(t,e){var n=Array(t);for(var i=0;i<t;i++){n[i]=e}return n}function Lc(t){t=t.trim().replace(/ /g,",");var e=t[0];var i=t.substring(1).split(",");return Rc[e.toUpperCase()].reduce(function(t,e,n){t[e]=+i[n];return t},{type:e})}function jc(e){var t=e.type;var n=Rc[t.toUpperCase()];return""+t+n.map(function(t){return e[t]}).join(",")}function Hc(i,r){var o={x1:"x",y1:"y",x2:"x",y2:"y"};var a=["xAxisRotation","largeArcFlag","sweepFlag"];if(i.type!==r.type&&r.type.toUpperCase()!=="M"){var s={};Object.keys(r).forEach(function(t){var e=r[t];var n=i[t];if(n===undefined){if(a.includes(t)){n=e}else{if(n===undefined&&o[t]){n=i[o[t]]}if(n===undefined){n=0}}}s[t]=n});s.type=r.type;i=s}return i}function Vc(t,e,n){var i=[];if(e.type==="L"||e.type==="Q"||e.type==="C"){i=i.concat(Fc(t,e,n))}else{var r=Object.assign({},t);if(r.type==="M"){r.type="L"}i=i.concat(Ic(n-1).map(function(){return r}));i.push(e)}return i}function Uc(o,t,a){var e=o.length-1;var n=t.length-1;var s=e/n;var i=Ic(n).reduce(function(t,e,n){var i=Math.floor(s*n);if(a&&i<o.length-1&&a(o[i],o[i+1])){var r=s*n%1<.5;if(t[i]){if(r){if(i>0){i-=1}else if(i<o.length-1){i+=1}}else if(i<o.length-1){i+=1}else if(i>0){i-=1}}}t[i]=(t[i]||0)+1;return t},[]);var r=i.reduce(function(t,e,n){if(n===o.length-1){var i=Ic(e,Object.assign({},o[o.length-1]));if(i[0].type==="M"){i.forEach(function(t){t.type="L"})}return t.concat(i)}return t.concat(Vc(o[n],o[n+1],e))},[]);r.unshift(o[0]);return r}function Wc(t){if(t==null){return""}return t.trim().replace(/[Z]/gi,"").replace(/\s+/," ").replace(/([MLCSTQAHV])\s*/gi,"$1")}function qc(t,n,e){var i=Wc(t);var r=Wc(n);var o=i===""?[]:i.split(/(?=[MLCSTQAHV])/gi);var a=r===""?[]:r.split(/(?=[MLCSTQAHV])/gi);if(!o.length&&!a.length){return function t(){return""}}if(!o.length){o.push(a[0])}else if(!a.length){a.push(o[0])}var s=o.map(Lc);var u=a.map(Lc);var h=Math.abs(a.length-o.length);if(h!==0){if(u.length>s.length){s=Uc(s,u,e)}else if(u.length<s.length){u=Uc(u,s,e)}}s=s.map(function(t,e){return Hc(t,u[e])});var l=s.map(jc).join("");var f=u.map(jc).join("");if((t==null||t[t.length-1]==="Z")&&(n==null||n[n.length-1]==="Z")){l+="Z";f+="Z"}var c=se(l,f);return function t(e){if(e===1){return n==null?"":n}return c(e)}}var Xc=function(t){var e=-1,n=t.length,i,r=t[n-1],o=0;while(++e<n){i=r;r=t[e];o+=i[1]*r[0]-i[0]*r[1]}return o/2};var Gc=function(t){var e=-1,n=t.length,i=0,r=0,o,a=t[n-1],s,u=0;while(++e<n){o=a;a=t[e];u+=s=o[0]*a[1]-a[0]*o[1];i+=(o[0]+a[0])*s;r+=(o[1]+a[1])*s}return u*=3,[i/u,r/u]};var Yc=function(t,e){var n=t.length,i=t[n-1],r=e[0],o=e[1],a=i[0],s=i[1],u,h,l=false;for(var f=0;f<n;++f){i=t[f],u=i[0],h=i[1];if(h>o!==s>o&&r<(a-u)*(o-h)/(s-h)+u){l=!l}a=u,s=h}return l};var $c=function(t,e,n,i){var r=1e-9;var o=t[0]-e[0],a=n[0]-i[0],s=t[1]-e[1],u=n[1]-i[1];var h=o*u-s*a;if(Math.abs(h)<r){return null}var l=t[0]*e[1]-t[1]*e[0],f=n[0]*i[1]-n[1]*i[0];var c=(l*a-f*o)/h,d=(l*u-f*s)/h;return[c,d]};var Qc=function(t,e,n){var i=1e-9;var r=n[0];var o=n[1];return!(r<Math.min(t[0],e[0])-i||r>Math.max(t[0],e[0])+i||o<Math.min(t[1],e[1])-i||o>Math.max(t[1],e[1])+i)};var Zc=function(t,e,n,i){var r=$c(t,e,n,i);if(!r){return false}return Qc(t,e,r)&&Qc(n,i,r)};var Kc=function(t,e){var n=-1;var i=t.length;var r=e.length;var o=t[i-1];while(++n<i){var a=o;o=t[n];var s=-1;var u=e[r-1];while(++s<r){var h=u;u=e[s];if(Zc(a,o,h,u)){return false}}}return Yc(e,t[0])};var Jc=function(t,e,n){if(n===void 0){n=0}var i=1e-9;e=[e[0]+i*Math.cos(n),e[1]+i*Math.sin(n)];var r=e[0];var o=e[1];var a=[r+Math.cos(n),o+Math.sin(n)];var s=0;if(Math.abs(a[0]-r)<i){s=1}var u=-1;var h=t.length;var l=t[h-1];var f=Number.MAX_VALUE;var c=Number.MAX_VALUE;var d=null;var p=null;while(++u<h){var g=l;l=t[u];var v=$c(e,a,g,l);if(v&&Qc(g,l,v)){var _=Bc(e,v);if(v[s]<e[s]){if(_<f){f=_;d=v}}else if(v[s]>e[s]){if(_<c){c=_;p=v}}}}return[d,p]};var td=function(t,e,n){if(n===void 0){n=[0,0]}var i=Math.cos(e),r=Math.sin(e),o=t[0]-n[0],a=t[1]-n[1];return[i*o-r*a+n[0],r*o+i*a+n[1]]};var ed=function(t,e,n){if(n===void 0){n=[0,0]}return t.map(function(t){return td(t,e,n)})};function nd(t,e,n){var i=e[0],r=e[1];var o=n[0]-i,a=n[1]-r;if(o!==0||a!==0){var s=((t[0]-i)*o+(t[1]-r)*a)/(o*o+a*a);if(s>1){i=n[0];r=n[1]}else if(s>0){i+=o*s;r+=a*s}}o=t[0]-i;a=t[1]-r;return o*o+a*a}function id(t,e){var n,i=t[0];var r=[i];for(var o=1,a=t.length;o<a;o++){n=t[o];if(Bc(n,i)>e){r.push(n);i=n}}if(i!==n){r.push(n)}return r}function rd(t,e,n,i,r){var o,a=i;for(var s=e+1;s<n;s++){var u=nd(t[s],t[e],t[n]);if(u>a){o=s;a=u}}if(a>i){if(o-e>1){rd(t,e,o,i,r)}r.push(t[o]);if(n-o>1){rd(t,o,n,i,r)}}}function od(t,e){var n=t.length-1;var i=[t[0]];rd(t,0,n,e,i);i.push(t[n]);return i}var ad=function(t,e,n){if(e===void 0){e=1}if(n===void 0){n=false}if(t.length<=2){return t}var i=e*e;t=n?t:id(t,i);t=od(t,i);return t};var sd=.5;var ud=5;var hd={};var ld=function(t,e){var n,i;if(e===void 0){e={}}if(t.length<3){if(e.verbose){console.error("polygon has to have at least 3 points",t)}return null}var r=[];e=Object.assign({angle:Vt(-90,90+ud,ud),cache:true,maxAspectRatio:15,minAspectRatio:1,minHeight:0,minWidth:0,nTries:20,tolerance:.02,verbose:false},e);var o=e.angle instanceof Array?e.angle:typeof e.angle==="number"?[e.angle]:typeof e.angle==="string"&&!isNaN(e.angle)?[Number(e.angle)]:[];var a=e.aspectRatio instanceof Array?e.aspectRatio:typeof e.aspectRatio==="number"?[e.aspectRatio]:typeof e.aspectRatio==="string"&&!isNaN(e.aspectRatio)?[Number(e.aspectRatio)]:[];var s=e.origin&&e.origin instanceof Array?e.origin[0]instanceof Array?e.origin:[e.origin]:[];var u;if(e.cache){u=Wt(t).join(",");u+="-"+e.minAspectRatio;u+="-"+e.maxAspectRatio;u+="-"+e.minHeight;u+="-"+e.minWidth;u+="-"+o.join(",");u+="-"+s.join(",");if(hd[u]){return hd[u]}}var h=Math.abs(Xc(t));if(h===0){if(e.verbose){console.error("polygon has 0 area",t)}return null}var l=Ht(t,function(t){return t[0]});var f=l[0];var c=l[1];var d=Ht(t,function(t){return t[1]});var p=d[0];var g=d[1];var v=Math.min(c-f,g-p)*e.tolerance;if(v>0){t=ad(t,v)}if(e.events){r.push({type:"simplify",poly:t})}n=Ht(t,function(t){return t[0]}),f=n[0],c=n[1];i=Ht(t,function(t){return t[1]}),p=i[0],g=i[1];var _=[c-f,g-p];var y=_[0];var m=_[1];var b=Math.min(y,m)/50;if(!s.length){var x=Gc(t);if(isNaN(x[0])){if(e.verbose){console.error("cannot find centroid",t)}return null}if(Yc(t,x)){s.push(x)}while(s.length<e.nTries){var w=Math.random()*y+f;var C=Math.random()*m+p;var E=[w,C];if(Yc(t,E)){s.push(E)}}}if(e.events){r.push({type:"origins",points:s})}var S=0;var A=null;for(var k=0;k<o.length;k++){var M=o[k];var T=-M*Math.PI/180;if(e.events){r.push({type:"angle",angle:M})}for(var B=0;B<s.length;B++){var D=s[B];var N=Jc(t,D,T);var P=N[0];var z=N[1];var O=Jc(t,D,T+Math.PI/2);var F=O[0];var R=O[1];var I=[];if(P&&z){I.push([(P[0]+z[0])/2,(P[1]+z[1])/2])}if(F&&R){I.push([(F[0]+R[0])/2,(F[1]+R[1])/2])}if(e.events){r.push({type:"modifOrigin",idx:B,p1W:P,p2W:z,p1H:F,p2H:R,modifOrigins:I})}for(var L=0;L<I.length;L++){var j=I[L];if(e.events){r.push({type:"origin",cx:j[0],cy:j[1]})}var H=Jc(t,j,T);var V=H[0];var U=H[1];if(V===null||U===null){continue}var W=Math.min(Bc(j,V),Bc(j,U));var q=2*Math.sqrt(W);var X=Jc(t,j,T+Math.PI/2);var G=X[0];var Y=X[1];if(G===null||Y===null){continue}var $=Math.min(Bc(j,G),Bc(j,Y));var Q=2*Math.sqrt($);if(q*Q<S){continue}var Z=a;if(!Z.length){var K=Math.max(e.minAspectRatio,e.minWidth/Q,S/(Q*Q));var J=Math.min(e.maxAspectRatio,q/e.minHeight,q*q/S);Z=Vt(K,J+sd,sd)}for(var tt=0;tt<Z.length;tt++){var et=Z[tt];var nt=Math.max(e.minWidth,Math.sqrt(S*et));var it=Math.min(q,Q*et);if(it*Q<S){continue}if(e.events&&it-nt>=b){r.push({type:"aRatio",aRatio:et})}while(it-nt>=b){var rt=(nt+it)/2;var ot=rt/et;var at=j[0];var st=j[1];var ut=[[at-rt/2,st-ot/2],[at+rt/2,st-ot/2],[at+rt/2,st+ot/2],[at-rt/2,st+ot/2]];ut=ed(ut,T,j);var ht=Kc(ut,t);if(ht){S=rt*ot;ut.push(ut[0]);A={area:S,cx:at,cy:st,width:rt,height:ot,angle:-M,points:ut};nt=rt}else{it=rt}if(e.events){r.push({type:"rectangle",areaFraction:rt*ot/h,cx:at,cy:st,width:rt,height:ot,angle:M,insidePoly:ht})}}}}}}if(e.cache){hd[u]=A}return e.events?Object.assign(A||{},{events:r}):A};var fd=function(o){function t(){var r=this;o.call(this);this._curve="linear";this._defined=function(){return true};this._labelBounds=function(t,e,n){var i=ld(n.points);if(!i){return null}return{angle:i.angle,width:i.width,height:i.height,x:i.cx-i.width/2-r._x(t,e),y:i.cy-i.height/2-r._y(t,e)}};this._labelConfig=Object.assign(this._labelConfig,{textAnchor:"middle",verticalAlign:"middle"});this._name="Area";this._x=ju("x");this._x0=ju("x");this._x1=null;this._y=Zu(0);this._y0=Zu(0);this._y1=ju("y")}if(o){t.__proto__=o}t.prototype=Object.create(o&&o.prototype);t.prototype.constructor=t;t.prototype._aes=function t(e){var n=this;var i=e.values.slice().sort(function(t,e){return n._y1?n._x(t)-n._x(e):n._y(t)-n._y(e)});var r=i.map(function(t,e){return[n._x0(t,e),n._y0(t,e)]});var o=i.reverse().map(function(t,e){return n._y1?[n._x(t,e),n._y1(t,e)]:[n._x1(t,e),n._y(t,e)]});var a=r.concat(o);if(r[0][1]>o[0][1]){a=a.reverse()}a.push(a[0]);return{points:a}};t.prototype._dataFilter=function t(i){var r=this;var e=Gt().key(this._id).entries(i).map(function(t){t.data=Ju(t.values);t.i=i.indexOf(t.values[0]);var e=Ht(t.values.map(r._x).concat(t.values.map(r._x0)).concat(r._x1?t.values.map(r._x1):[]));t.xR=e;t.width=e[1]-e[0];t.x=e[0]+t.width/2;var n=Ht(t.values.map(r._y).concat(t.values.map(r._y0)).concat(r._y1?t.values.map(r._y1):[]));t.yR=n;t.height=n[1]-n[0];t.y=n[0]+t.height/2;t.nested=true;t.translate=[t.x,t.y];t.__d3plusShape__=true;return t});e.key=function(t){return t.key};return e};t.prototype.render=function t(e){o.prototype.render.call(this,e);var n=this._path=il().defined(this._defined).curve(Xf["curve"+this._curve.charAt(0).toUpperCase()+this._curve.slice(1)]).x(this._x).x0(this._x0).x1(this._x1).y(this._y).y0(this._y0).y1(this._y1);var i=il().defined(function(t){return t}).curve(Xf["curve"+this._curve.charAt(0).toUpperCase()+this._curve.slice(1)]).x(this._x).x0(this._x0).x1(this._x1).y(this._y).y0(this._y0).y1(this._y1);this._enter.append("path").attr("transform",function(t){return"translate("+(-t.xR[0]-t.width/2)+", "+(-t.yR[0]-t.height/2)+")"}).attr("d",function(t){return n(t.values)}).call(this._applyStyle.bind(this));this._update.select("path").transition(this._transition).attr("transform",function(t){return"translate("+(-t.xR[0]-t.width/2)+", "+(-t.yR[0]-t.height/2)+")"}).attrTween("d",function(t){return qc(qa(this).attr("d"),n(t.values))}).call(this._applyStyle.bind(this));this._exit.select("path").transition(this._transition).attrTween("d",function(t){return qc(qa(this).attr("d"),i(t.values))});return this};t.prototype.curve=function t(e){return arguments.length?(this._curve=e,this):this._curve};t.prototype.defined=function t(e){return arguments.length?(this._defined=e,this):this._defined};t.prototype.x=function t(e){if(!arguments.length){return this._x}this._x=typeof e==="function"?e:Zu(e);this._x0=this._x;return this};t.prototype.x0=function t(e){if(!arguments.length){return this._x0}this._x0=typeof e==="function"?e:Zu(e);this._x=this._x0;return this};t.prototype.x1=function t(e){return arguments.length?(this._x1=typeof e==="function"||e===null?e:Zu(e),this):this._x1};t.prototype.y=function t(e){if(!arguments.length){return this._y}this._y=typeof e==="function"?e:Zu(e);this._y0=this._y;return this};t.prototype.y0=function t(e){if(!arguments.length){return this._y0}this._y0=typeof e==="function"?e:Zu(e);this._y=this._y0;return this};t.prototype.y1=function t(e){return arguments.length?(this._y1=typeof e==="function"||e===null?e:Zu(e),this):this._y1};return t}(Nc);var cd=function(r){function t(){var i=this;r.call(this,"rect");this._name="Bar";this._height=Zu(10);this._labelBounds=function(t,e,n){return{width:n.width,height:n.height,x:i._x1!==null?i._getX(t,e):-n.width/2,y:i._x1===null?i._getY(t,e):-n.height/2}};this._width=Zu(10);this._x=ju("x");this._x0=ju("x");this._x1=null;this._y=Zu(0);this._y0=Zu(0);this._y1=ju("y")}if(r){t.__proto__=r}t.prototype=Object.create(r&&r.prototype);t.prototype.constructor=t;t.prototype.render=function t(e){var n=this;r.prototype.render.call(this,e);this._enter.attr("width",function(t,e){return n._x1===null?n._getWidth(t,e):0}).attr("height",function(t,e){return n._x1!==null?n._getHeight(t,e):0}).attr("x",function(t,e){return n._x1===null?-n._getWidth(t,e)/2:0}).attr("y",function(t,e){return n._x1!==null?-n._getHeight(t,e)/2:0}).call(this._applyStyle.bind(this)).transition(this._transition).call(this._applyPosition.bind(this));this._update.transition(this._transition).call(this._applyStyle.bind(this)).call(this._applyPosition.bind(this));this._exit.transition(this._transition).attr("width",function(t,e){return n._x1===null?n._getWidth(t,e):0}).attr("height",function(t,e){return n._x1!==null?n._getHeight(t,e):0}).attr("x",function(t,e){return n._x1===null?-n._getWidth(t,e)/2:0}).attr("y",function(t,e){return n._x1!==null?-n._getHeight(t,e)/2:0});return this};t.prototype._aes=function t(e,n){return{height:this._getHeight(e,n),width:this._getWidth(e,n)}};t.prototype._applyPosition=function t(e){var n=this;e.attr("width",function(t,e){return n._getWidth(t,e)}).attr("height",function(t,e){return n._getHeight(t,e)}).attr("x",function(t,e){return n._x1!==null?n._getX(t,e):-n._getWidth(t,e)/2}).attr("y",function(t,e){return n._x1===null?n._getY(t,e):-n._getHeight(t,e)/2})};t.prototype._getHeight=function t(e,n){if(this._x1!==null){return this._height(e,n)}return Math.abs(this._y1(e,n)-this._y(e,n))};t.prototype._getWidth=function t(e,n){if(this._x1===null){return this._width(e,n)}return Math.abs(this._x1(e,n)-this._x(e,n))};t.prototype._getX=function t(e,n){var i=this._x1===null?this._x(e,n):this._x1(e,n)-this._x(e,n);if(i<0){return i}else{return 0}};t.prototype._getY=function t(e,n){var i=this._x1!==null?this._y(e,n):this._y1(e,n)-this._y(e,n);if(i<0){return i}else{return 0}};t.prototype.height=function t(e){return arguments.length?(this._height=typeof e==="function"?e:Zu(e),this):this._height};t.prototype.width=function t(e){return arguments.length?(this._width=typeof e==="function"?e:Zu(e),this):this._width};t.prototype.x0=function t(e){if(!arguments.length){return this._x0}this._x0=typeof e==="function"?e:Zu(e);this._x=this._x0;return this};t.prototype.x1=function t(e){return arguments.length?(this._x1=typeof e==="function"||e===null?e:Zu(e),this):this._x1};t.prototype.y0=function t(e){if(!arguments.length){return this._y0}this._y0=typeof e==="function"?e:Zu(e);this._y=this._y0;return this};t.prototype.y1=function t(e){return arguments.length?(this._y1=typeof e==="function"||e===null?e:Zu(e),this):this._y1};return t}(Nc);var dd=function(n){function t(){n.call(this,"circle");this._labelBounds=function(t,e,n){return{width:n.r*1.5,height:n.r*1.5,x:-n.r*.75,y:-n.r*.75}};this._labelConfig=Vu(this._labelConfig,{textAnchor:"middle",verticalAlign:"middle"});this._name="Circle";this._r=ju("r")}if(n){t.__proto__=n}t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;t.prototype._applyPosition=function t(e){var n=this;e.attr("r",function(t,e){return n._r(t,e)}).attr("x",function(t,e){return-n._r(t,e)/2}).attr("y",function(t,e){return-n._r(t,e)/2})};t.prototype.render=function t(e){n.prototype.render.call(this,e);this._enter.attr("r",0).attr("x",0).attr("y",0).call(this._applyStyle.bind(this)).transition(this._transition).call(this._applyPosition.bind(this));this._update.transition(this._transition).call(this._applyStyle.bind(this)).call(this._applyPosition.bind(this));this._exit.transition(this._transition).attr("r",0).attr("x",0).attr("y",0);return this};t.prototype._aes=function t(e,n){return{r:this._r(e,n)}};t.prototype.r=function t(e){return arguments.length?(this._r=typeof e==="function"?e:Zu(e),this):this._r};return t}(Nc);var pd=function(r){function t(){var e=this;r.call(this);this._curve="linear";this._defined=function(t){return t};this._fill=Zu("none");this._hitArea=Zu({d:function(t){return e._path(t.values)},fill:"none","stroke-width":10,transform:null});this._name="Line";this._path=nl();this._stroke=Zu("black");this._strokeWidth=Zu(1)}if(r){t.__proto__=r}t.prototype=Object.create(r&&r.prototype);t.prototype.constructor=t;t.prototype._dataFilter=function t(i){var r=this;var e=Gt().key(this._id).entries(i).map(function(t){t.data=Ju(t.values);t.i=i.indexOf(t.values[0]);var e=Ht(t.values,r._x);t.xR=e;t.width=e[1]-e[0];t.x=e[0]+t.width/2;var n=Ht(t.values,r._y);t.yR=n;t.height=n[1]-n[0];t.y=n[0]+t.height/2;t.nested=true;t.translate=[t.x,t.y];t.__d3plusShape__=true;return t});e.key=function(t){return t.key};return e};t.prototype.render=function t(e){var n=this;r.prototype.render.call(this,e);var i=this;this._path.curve(Xf["curve"+this._curve.charAt(0).toUpperCase()+this._curve.slice(1)]).defined(this._defined).x(this._x).y(this._y);this._enter.append("path").attr("transform",function(t){return"translate("+(-t.xR[0]-t.width/2)+", "+(-t.yR[0]-t.height/2)+")"}).attr("d",function(t){return n._path(t.values)}).call(this._applyStyle.bind(this));this._update.select("path").transition(this._transition).attr("transform",function(t){return"translate("+(-t.xR[0]-t.width/2)+", "+(-t.yR[0]-t.height/2)+")"}).attrTween("d",function(t){return qc(qa(this).attr("d"),i._path(t.values))}).call(this._applyStyle.bind(this));return this};t.prototype._aes=function t(e,n){var i=this;return{points:e.values.map(function(t){return[i._x(t,n),i._y(t,n)]})}};t.prototype.curve=function t(e){return arguments.length?(this._curve=e,this):this._curve};t.prototype.defined=function t(e){return arguments.length?(this._defined=e,this):this._defined};return t}(Nc);var gd=Math.PI;var vd=function(t,e,n){if(n===void 0){n="circle"}if(t<0){t=gd*2+t}if(n==="square"){var i=45*(gd/180);var r=0,o=0;if(t<gd/2){var a=Math.tan(t);r+=t<i?e:e/a;o+=t<i?a*e:e}else if(t<=gd){var s=Math.tan(gd-t);r-=t<gd-i?e/s:e;o+=t<gd-i?e:s*e}else if(t<i+gd){r-=e;o-=Math.tan(t-gd)*e}else if(t<3*gd/2){r-=e/Math.tan(t-gd);o-=e}else if(t<2*gd-i){r+=e/Math.tan(2*gd-t);o-=e}else{r+=e;o-=Math.tan(2*gd-t)*e}return[r,o]}else if(n==="circle"){return[e*Math.cos(t),e*Math.sin(t)]}else{return null}};var _d=Math.PI;var yd=function(t,e){if(e===void 0){e=20}var n=[],i=/([MLA])([^MLAZ]+)/gi;var r=i.exec(t);while(r!==null){if(["M","L"].includes(r[1])){n.push(r[2].split(",").map(Number))}else if(r[1]==="A"){var o=r[2].split(",").map(Number);var a=o.slice(o.length-2,o.length),s=n[n.length-1],u=o[0],h=Dc(s,a);var l=Math.acos((u*u+u*u-h*h)/(2*u*u));if(o[2]){l=_d*2-l}var f=l/(l/(_d*2)*(u*_d*2)/e);var c=Math.atan2(-s[1],-s[0])-_d;var d=f;while(d<l){n.push(vd(o[4]?c+d:c-d,u));d+=f}n.push(a)}r=i.exec(t)}return n};var md=function(n){function t(){var r=this;n.call(this,"path");this._d=ju("path");this._labelBounds=function(t,e,n){var i=ld(n.points,{angle:r._labelConfig.rotate?r._labelConfig.rotate(t,e):0});return{angle:i.angle,width:i.width,height:i.height,x:i.cx-i.width/2,y:i.cy-i.height/2}};this._name="Path";this._labelConfig=Object.assign(this._labelConfig,{textAnchor:"middle",verticalAlign:"middle"})}if(n){t.__proto__=n}t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;t.prototype._aes=function t(e,n){return{points:yd(this._d(e,n))}};t.prototype.render=function t(e){n.prototype.render.call(this,e);this._enter.attr("opacity",0).attr("d",this._d).call(this._applyStyle.bind(this)).transition(this._transition).attr("opacity",1);this._update.transition(this._transition).call(this._applyStyle.bind(this)).attr("opacity",1).attr("d",this._d);this._exit.transition(this._transition).attr("opacity",0);return this};t.prototype.d=function t(e){return arguments.length?(this._d=typeof e==="function"?e:Zu(e),this):this._d};return t}(Nc);var bd=function(n){function t(){n.call(this,"rect");this._height=ju("height");this._labelBounds=function(t,e,n){return{width:n.width,height:n.height,x:-n.width/2,y:-n.height/2}};this._name="Rect";this._width=ju("width")}if(n){t.__proto__=n}t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;t.prototype.render=function t(e){n.prototype.render.call(this,e);this._enter.attr("width",0).attr("height",0).attr("x",0).attr("y",0).call(this._applyStyle.bind(this)).transition(this._transition).call(this._applyPosition.bind(this));this._update.transition(this._transition).call(this._applyStyle.bind(this)).call(this._applyPosition.bind(this));this._exit.transition(this._transition).attr("width",0).attr("height",0).attr("x",0).attr("y",0);return this};t.prototype._aes=function t(e,n){return{width:this._width(e,n),height:this._height(e,n)}};t.prototype._applyPosition=function t(e){var n=this;e.attr("width",function(t,e){return n._width(t,e)}).attr("height",function(t,e){return n._height(t,e)}).attr("x",function(t,e){return-n._width(t,e)/2}).attr("y",function(t,e){return-n._height(t,e)/2})};t.prototype.height=function t(e){return arguments.length?(this._height=typeof e==="function"?e:Zu(e),this):this._height};t.prototype.width=function t(e){return arguments.length?(this._width=typeof e==="function"?e:Zu(e),this):this._width};return t}(Nc);var xd=Object.freeze({Image:ih,Shape:Nc,Area:fd,Bar:cd,Circle:dd,Line:pd,Path:md,Rect:bd,largestRect:ld,lineIntersection:$c,path2polygon:yd,pointDistance:Dc,pointDistanceSquared:Bc,pointRotate:td,polygonInside:Kc,polygonRayCast:Jc,polygonRotate:ed,segmentBoxContains:Qc,segmentsIntersect:Zc,shapeEdgePoint:vd,simplify:ad});var wd=function(t){if(t.constructor===Date){return t}else if(t.constructor===Number&&(""+t).length>5&&t%1===0){return new Date(t)}var e=""+t;var n=new RegExp(/^\d{1,2}[./-]\d{1,2}[./-](-*\d{1,4})$/g).exec(e),i=new RegExp(/^[A-z]{1,3} [A-z]{1,3} \d{1,2} (-*\d{1,4}) \d{1,2}:\d{1,2}:\d{1,2} [A-z]{1,3}-*\d{1,4} \([A-z]{1,3}\)/g).exec(e);if(n){var r=n[1];if(r.indexOf("-")===0){e=e.replace(r,r.substr(1))}var o=new Date(e);o.setFullYear(r);return o}else if(i){var a=i[1];if(a.indexOf("-")===0){e=e.replace(a,a.substr(1))}var s=new Date(e);s.setFullYear(a);return s}else if(!e.includes("/")&&!e.includes(" ")&&(!e.includes("-")||!e.indexOf("-"))){var u=new Date(e+"/01/01");u.setFullYear(t);return u}else{return new Date(e)}};var Cd=function(t){function e(){var e=this;t.call(this);this._align="middle";this._barConfig={stroke:"#000","stroke-width":1};this._domain=[0,10];this._duration=600;this._gridConfig={stroke:"#ccc","stroke-width":1};this._height=400;this._labelOffset=false;this.orient("bottom");this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._paddingInner=.1;this._paddingOuter=.1;this._rotateLabels=false;this._scale="linear";this._shape="Line";this._shapeConfig={fill:"#000",height:function(t){return t.tick?8:0},label:function(t){return t.text},labelBounds:function(t){return t.labelBounds},labelConfig:{fontColor:"#000",fontFamily:(new Ac).fontFamily(),fontResize:false,fontSize:Zu(10),padding:0,textAnchor:function(){var t=oc();return e._orient==="left"?t?"start":"end":e._orient==="right"?t?"end":"start":e._rotateLabels?e._orient==="bottom"?"end":"start":"middle"},verticalAlign:function(){return e._orient==="bottom"?"top":e._orient==="top"?"bottom":"middle"}},r:function(t){return t.tick?4:0},stroke:"#000",strokeWidth:1,width:function(t){return t.tick?8:0}};this._tickSize=5;this._titleClass=new Ac;this._titleConfig={fontSize:12,textAnchor:"middle"};this._width=400}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype._barPosition=function t(e){var n=this._position;var i=n.height;var r=n.x;var o=n.y;var a=n.opposite;var s=this._getDomain(),u=this._margin[a],h=["top","left"].includes(this._orient)?this._outerBounds[o]+this._outerBounds[i]-u:this._outerBounds[o]+u;e.call(Uu,this._barConfig).attr(r+"1",this._getPosition(s[0])-(this._scale==="band"?this._d3Scale.step()-this._d3Scale.bandwidth():0)).attr(r+"2",this._getPosition(s[s.length-1])+(this._scale==="band"?this._d3Scale.step():0)).attr(o+"1",h).attr(o+"2",h)};e.prototype._getDomain=function t(){var e=[];if(this._d3ScaleNegative){e=this._d3ScaleNegative.domain()}if(this._d3Scale){e=e.concat(this._d3Scale.domain())}var n=this._scale==="ordinal"?e:Ht(e);return e[0]>e[1]?n.reverse():n};e.prototype._getPosition=function t(e){return e<0&&this._d3ScaleNegative?this._d3ScaleNegative(e):this._d3Scale(e)};e.prototype._getRange=function t(){var e=[];if(this._d3ScaleNegative){e=this._d3ScaleNegative.range()}if(this._d3Scale){e=e.concat(this._d3Scale.range())}return e[0]>e[1]?Ht(e).reverse():Ht(e)};e.prototype._getTicks=function t(){var e=Mn().domain([10,400]).range([10,50]);var n=[];if(this._d3ScaleNegative){var i=this._d3ScaleNegative.range();var r=i[1]-i[0];n=this._d3ScaleNegative.ticks(Math.floor(r/e(r)))}if(this._d3Scale){var o=this._d3Scale.range();var a=o[1]-o[0];n=n.concat(this._d3Scale.ticks(Math.floor(a/e(a))))}return n};e.prototype._gridPosition=function t(e,n){if(n===void 0){n=false}var i=this._position;var r=i.height;var o=i.x;var a=i.y;var s=i.opposite;var u=this._margin[s],h=["top","left"].includes(this._orient)?this._outerBounds[a]+this._outerBounds[r]-u:this._outerBounds[a]+u,l=n?this._lastScale||this._getPosition.bind(this):this._getPosition.bind(this),f=["top","left"].includes(this._orient)?u:-u,c=this._scale==="band"?this._d3Scale.bandwidth()/2:0,d=function(t){return l(t.id)+c};e.call(Uu,this._gridConfig).attr(o+"1",d).attr(o+"2",d).attr(a+"1",h).attr(a+"2",n?h:h+f)};e.prototype.render=function t(e){var y=this;var n;if(this._select===void 0){this.select(qa("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}var i=this._position;var r=i.width;var m=i.height;var b=i.x;var x=i.y;var w=i.horizontal;var C=i.opposite;var o="d3plus-Axis-clip-"+this._uuid,E=["top","left"].includes(this._orient),S=this._padding,a=this._select,s=Pu().duration(this._duration);var u=this._range?this._range.slice():[undefined,undefined];if(u[0]===void 0){u[0]=S}if(u[1]===void 0){u[1]=this["_"+r]-S}this._size=u[1]-u[0];if(this._scale==="ordinal"&&this._domain.length>u.length){u=Vt(this._domain.length).map(function(t){return y._size*(t/(y._domain.length-1))+u[0]})}var A=this._margin={top:0,right:0,bottom:0,left:0};if(this._title){var h=this._titleConfig;var l=h.fontFamily;var f=h.fontSize;var c=h.lineHeight;var d=Sc().fontFamily(typeof l==="function"?l():l).fontSize(typeof f==="function"?f():f).lineHeight(typeof c==="function"?c():c).width(this._size).height(this["_"+m]-this._tickSize-S);var p=d(this._title).lines.length;A[this._orient]=p*d.lineHeight()+S}this._d3Scale=Zr["scale"+this._scale.charAt(0).toUpperCase()+this._scale.slice(1)]().domain(this._scale==="time"?this._domain.map(wd):this._domain);if(this._d3Scale.rangeRound){this._d3Scale.rangeRound(u)}else{this._d3Scale.range(u)}if(this._d3Scale.round){this._d3Scale.round(true)}if(this._d3Scale.paddingInner){this._d3Scale.paddingInner(this._paddingInner)}if(this._d3Scale.paddingOuter){this._d3Scale.paddingOuter(this._paddingOuter)}this._d3ScaleNegative=null;if(this._scale==="log"){var g=this._d3Scale.domain();if(g[0]===0){g[0]=1}if(g[g.length-1]===0){g[g.length-1]=-1}var v=this._d3Scale.range();if(g[0]<0&&g[g.length-1]<0){this._d3ScaleNegative=this._d3Scale.copy().domain(g).range(v);this._d3Scale=null}else if(g[0]>0&&g[g.length-1]>0){this._d3Scale.domain(g).range(v)}else{var _=Sn().domain([1,g[g[1]>0?1:0]]).range([0,1]);var k=_(Math.abs(g[g[1]<0?1:0]));var M=k/(k+1)*(v[1]-v[0]);if(g[0]>0){M=v[1]-v[0]-M}this._d3ScaleNegative=this._d3Scale.copy();(g[0]<0?this._d3Scale:this._d3ScaleNegative).domain([Math.sign(g[1]),g[1]]).range([v[0]+M,v[1]]);(g[0]<0?this._d3ScaleNegative:this._d3Scale).domain([g[0],Math.sign(g[0])]).range([v[0],v[0]+M])}}var T=this._ticks?this._scale==="time"?this._ticks.map(wd):this._ticks:(this._d3Scale?this._d3Scale.ticks:this._d3ScaleNegative.ticks)?this._getTicks():this._domain;var B=this._labels?this._scale==="time"?this._labels.map(wd):this._labels:(this._d3Scale?this._d3Scale.ticks:this._d3ScaleNegative.ticks)?this._getTicks():T;T=T.slice();B=B.slice();if(this._scale==="log"){B=B.filter(function(t){return Math.abs(t).toString().charAt(0)==="1"&&(y._d3Scale?t!==-1:t!==1)})}var D="⁰¹²³⁴⁵⁶⁷⁸⁹";var N=this._tickFormat?this._tickFormat:function(t){if(y._scale==="log"){var e=Math.round(Math.log(Math.abs(t))/Math.LN10);var n=Math.abs(t).toString().charAt(0);var i="10 "+(""+e).split("").map(function(t){return D[t]}).join("");if(n!=="1"){i=n+" x "+i}return t<0?"-"+i:i}return y._d3Scale.tickFormat?y._d3Scale.tickFormat(B.length-1)(t):t};if(this._scale==="time"){T=T.map(Number);B=B.map(Number)}else if(this._scale==="ordinal"){B=B.filter(function(t){return T.includes(t)})}T=T.sort(function(t,e){return y._getPosition(t)-y._getPosition(e)});B=B.sort(function(t,e){return y._getPosition(t)-y._getPosition(e)});var P=this._shape==="Circle"?this._shapeConfig.r:this._shape==="Rect"?this._shapeConfig[r]:this._shapeConfig.strokeWidth;var z=typeof P!=="function"?function(){return P}:P;var O=[];this._availableTicks=T;T.forEach(function(t,e){var n=z({id:t,tick:true},e);if(y._shape==="Circle"){n*=2}var i=y._getPosition(t);if(!O.length||Math.abs($u(i,O)-i)>n*2){O.push(i)}else{O.push(false)}});T=T.filter(function(t,e){return O[e]!==false});this._visibleTicks=T;var F=this._shape==="Circle"?typeof this._shapeConfig.r==="function"?this._shapeConfig.r({tick:true}):this._shapeConfig.r:this._shape==="Rect"?typeof this._shapeConfig[m]==="function"?this._shapeConfig[m]({tick:true}):this._shapeConfig[m]:this._tickSize,R=z({tick:true});if(typeof F==="function"){F=Ut(T.map(F))}if(this._shape==="Rect"){F/=2}if(typeof R==="function"){R=Ut(T.map(R))}if(this._shape!=="Circle"){R/=2}if(this._scale==="band"){this._space=this._d3Scale.bandwidth()}else if(B.length>1){this._space=0;for(var I=0;I<B.length-1;I++){var L=y._getPosition(B[I+1])-y._getPosition(B[I]);if(L>y._space){y._space=L}}}else{this._space=this._size}var j=B.map(function(t,e){var n=y._shapeConfig.labelConfig.fontFamily(t,e),i=y._shapeConfig.labelConfig.fontSize(t,e);var r=Sc().fontFamily(n).fontSize(i).lineHeight(y._shapeConfig.lineHeight?y._shapeConfig.lineHeight(t,e):undefined).width(w?y._space*2:y._maxSize?y._maxSize-F-S-y._margin.left-y._margin.right-y._tickSize:y._width-F-S).height(w?y._height-F-S:y._space*2);var o=r(N(t));o.lines=o.lines.filter(function(t){return t!==""});o.d=t;o.fS=i;o.width=o.lines.length?Math.ceil(Ut(o.lines.map(function(t){return Gf(t,{"font-family":n,"font-size":i})})))+i/4:0;o.height=o.lines.length?Math.ceil(o.lines.length*(r.lineHeight()+1)):0;o.offset=0;o.hidden=false;if(o.width%2){o.width++}return o});var H=Ut(j,function(t){return t.height})||0;if(w&&typeof this._labelRotation==="undefined"){for(var V=0;V<B.length;V++){var U=B[V];var W=y._shapeConfig.labelConfig.fontFamily(U,V),q=y._shapeConfig.labelConfig.fontSize(U,V);var X=Sc().fontFamily(W).fontSize(q).lineHeight(y._shapeConfig.lineHeight?y._shapeConfig.lineHeight(U,V):undefined).width(y._space).height(H);var G=X(N(U));var Y=G.truncated;var $=y._getPosition(U);var Q=B[V-1]||false;var Z=B[V+1]||false;var K=Math.max(G.widths);var J=Q?$-K<y._getPosition(Q)+K:Z?$+K>y._getPosition(Z)-K:false;var tt=Y||J;if(tt){y._rotateLabels=true;break}}}else if(w){this._rotateLabels=this._labelRotation}if(this._rotateLabels){j=B.map(function(t,e){var n=j[e];var i=y._shapeConfig.labelConfig.fontFamily(t,e),r=y._shapeConfig.labelConfig.fontSize(t,e);var o=y._shapeConfig.lineHeight?y._shapeConfig.lineHeight(t,e):r*1.4;var a=Sc().fontFamily(i).fontSize(r).lineHeight(y._shapeConfig.lineHeight?y._shapeConfig.lineHeight(t,e):undefined).height(o*2+1).width(y._maxSize?y._maxSize-y._margin.top-y._margin.bottom-y._tickSize:y._height);var s=y._getPosition(t);var u=B[e-1]||false;var h=B[e+1]||false;var l=u?s-o*2>y._getPosition(u)+o*2:h?s+o*2<y._getPosition(h)-o*2:true;var f=a(N(t));var c=f.words.length>1&&f.widths[0]>80;var d=l&&c?f.widths[0]/1.6:f.widths[0];var p=l&&c?o*2:o;return Object.assign(n,{height:d||0,lineHeight:o,numLines:l&&c?2:1,width:p||0})})}j.forEach(function(t,e){if(e){var n=j[e-1];if(!n.offset&&y._getPosition(t.d)-t[r]/2<y._getPosition(n.d)+n[r]/2){t.offset=n[m]+y._padding}}});if(this._labelOffset){j.forEach(function(t,e){if(e){var n=j[e-1];if(!n.offset&&y._getPosition(t.d)-t[r]/2<y._getPosition(n.d)+n[r]/2){t.offset=n[m]+y._padding}}});var et=Ut(j,function(t){return t.offset});if(et){j.forEach(function(t){if(t.offset){t.offset=et;t[m]+=et}})}}var nt=u.slice();var it=u.length-1;if(this._scale!=="band"&&j.length){var rt=j[0],ot=j[j.length-1];var at=qt([this._getPosition(rt.d)-rt[r]/2,u[0]-R]);if(at<u[0]){var st=u[0]-at;if(this._range===void 0||this._range[0]===void 0){this._size-=st;u[0]+=st}else if(this._range){nt[0]-=st}}var ut=Ut([this._getPosition(ot.d)+ot[r]/2,u[it]+R]);if(ut>u[it]){var ht=ut-u[it];if(this._range===void 0||this._range[it]===void 0){this._size-=ht;u[it]-=ht}else if(this._range){nt[it]+=ht}}if(u.length>2){u=Vt(this._domain.length).map(function(t){return y._size*(t/(u.length-1))+u[0]})}u=u.map(Math.round);if(this._d3ScaleNegative){var lt=this._d3ScaleNegative.range();this._d3ScaleNegative[this._d3ScaleNegative.rangeRound?"rangeRound":"range"](this._d3Scale&&this._d3Scale.range()[0]<lt[0]?[lt[0],u[1]]:[u[0],this._d3Scale?lt[1]:u[1]]);if(this._d3Scale){var ft=this._d3Scale.range();this._d3Scale[this._d3Scale.rangeRound?"rangeRound":"range"](u[0]<lt[0]?[u[0],ft[1]]:[ft[0],u[1]])}}else{this._d3Scale[this._d3Scale.rangeRound?"rangeRound":"range"](u)}}if(this._scale==="band"){this._space=this._d3Scale.bandwidth()}else if(B.length>1){this._space=0;for(var ct=0;ct<B.length-1;ct++){var dt=y._getPosition(B[ct+1])-y._getPosition(B[ct]);if(dt>y._space){y._space=dt}}}else{this._space=this._size}var pt=this._shape==="Line"?0:F;var gt=this._outerBounds=(n={},n[m]=(Ut(j,function(t){return Math.ceil(t[m])})||0)+(j.length?S:0),n[r]=nt[it]-nt[0],n[b]=nt[0],n);A[this._orient]+=F;A[C]=this._gridSize!==void 0?Ut([this._gridSize,pt]):this["_"+m]-A[this._orient]-gt[m]-S;gt[m]+=A[C]+A[this._orient];gt[x]=this._align==="start"?this._padding:this._align==="end"?this["_"+m]-gt[m]-this._padding:this["_"+m]/2-gt[m]/2;var vt=Ku("g#d3plus-Axis-"+this._uuid,{parent:a});this._group=vt;var _t=Ku("g.grid",{parent:vt}).selectAll("line").data((this._gridSize!==0?this._grid||T:[]).map(function(t){return{id:t}}),function(t){return t.id});_t.exit().transition(s).attr("opacity",0).call(this._gridPosition.bind(this)).remove();_t.enter().append("line").attr("opacity",0).attr("clip-path","url(#"+o+")").call(this._gridPosition.bind(this),true).merge(_t).transition(s).attr("opacity",1).call(this._gridPosition.bind(this));var yt=B.filter(function(t,e){return j[e].lines.length&&!T.includes(t)});var mt=T.concat(yt).map(function(e){var t=j.filter(function(t){return t.d===e});var n=t.length?j.indexOf(t[0]):undefined;var i=y._getPosition(e);var r=t.length&&y._labelOffset?t[0].offset:0;var o=w?y._space:gt.width-A[y._position.opposite]-F-A[y._orient]+S;var a=t.length&&n>0?j.filter(function(t,e){return!t.hidden&&t.offset>=r&&e<n}):false;a=a.length?a[a.length-1]:false;var s=t.length&&n<j.length-1?j.filter(function(t,e){return!t.hidden&&t.offset>=r&&e>n}):false;s=s.length?s[0]:false;var u=Math.min(a?i-y._getPosition(a.d):o,s?y._getPosition(s.d)-i:o);if(t.length&&t[0].width>o){t[0].hidden=true;t[0].offset=r=0}var h=A[C],l=(F+r)*(E?-1:1),f=E?gt[x]+gt[m]-h:gt[x]+h;var c={id:e,labelBounds:{x:w?-u/2:y._orient==="left"?-o-S+l:l+S,y:w?y._orient==="bottom"?l+S:l-S-H:-u/2,width:w?u:o,height:w?H:u},size:T.includes(e)?l:0,text:B.includes(e)?N(e):false,tick:T.includes(e)};c[b]=i+(y._scale==="band"?y._d3Scale.bandwidth()/2:0);c[x]=f;var d=y._rotateLabels&&j.find(function(t){return t.d===e});if(d){var p=d.lineHeight;var g=d.numLines;var v=d.height;var _=d.width;c=Object.assign(c,{labelBounds:{x:-v/2,y:y._orient==="bottom"?l+S+(v-p*g)/2:l-S*2-(v+p*g)/2,width:v,height:_+1}})}return c});if(this._shape==="Line"){mt=mt.concat(mt.map(function(t){var e=Object.assign({},t);e[x]+=t.size;return e}))}(new xd[this._shape]).data(mt).duration(this._duration).labelConfig({ellipsis:function(t){return t&&t.length?t+"...":""},rotate:this._rotateLabels?-90:0}).select(Ku("g.ticks",{parent:vt}).node()).config(this._shapeConfig).render();var bt=vt.selectAll("line.bar").data([null]);bt.enter().append("line").attr("class","bar").attr("opacity",0).call(this._barPosition.bind(this)).merge(bt).transition(s).attr("opacity",1).call(this._barPosition.bind(this));this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).height(A[this._orient]).rotate(this._orient==="left"?-90:this._orient==="right"?90:0).select(Ku("g.d3plus-Axis-title",{parent:vt}).node()).text(function(t){return t.text}).verticalAlign("middle").width(gt[r]).x(w?gt.x:this._orient==="left"?gt.x+A[this._orient]/2-gt[r]/2:gt.x+gt.width-A[this._orient]/2-gt[r]/2).y(w?this._orient==="bottom"?gt.y+gt.height-A.bottom+S:gt.y:gt.y-A[this._orient]/2+gt[r]/2).config(this._titleConfig).render();this._lastScale=this._getPosition.bind(this);if(e){setTimeout(e,this._duration+100)}return this};e.prototype.align=function t(e){return arguments.length?(this._align=e,this):this._align};e.prototype.barConfig=function t(e){return arguments.length?(this._barConfig=Object.assign(this._barConfig,e),this):this._barConfig};e.prototype.domain=function t(e){return arguments.length?(this._domain=e,this):this._domain};e.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};e.prototype.grid=function t(e){return arguments.length?(this._grid=e,this):this._grid};e.prototype.gridConfig=function t(e){return arguments.length?(this._gridConfig=Object.assign(this._gridConfig,e),this):this._gridConfig};e.prototype.gridSize=function t(e){return arguments.length?(this._gridSize=e,this):this._gridSize};e.prototype.height=function t(e){return arguments.length?(this._height=e,this):this._height};e.prototype.labels=function t(e){return arguments.length?(this._labels=e,this):this._labels};e.prototype.labelOffset=function t(e){return arguments.length?(this._labelOffset=e,this):this._labelOffset};e.prototype.labelRotation=function t(e){return arguments.length?(this._labelRotation=e,this):this._labelRotation};e.prototype.maxSize=function t(e){return arguments.length?(this._maxSize=e,this):this._maxSize};e.prototype.orient=function t(e){if(arguments.length){var n=["top","bottom"].includes(e),i={top:"bottom",right:"left",bottom:"top",left:"right"};this._position={horizontal:n,width:n?"width":"height",height:n?"height":"width",x:n?"x":"y",y:n?"y":"x",opposite:i[e]};return this._orient=e,this}return this._orient};e.prototype.outerBounds=function t(){return this._outerBounds};e.prototype.padding=function t(e){return arguments.length?(this._padding=e,this):this._padding};e.prototype.paddingInner=function t(e){return arguments.length?(this._paddingInner=e,this):this._paddingInner};e.prototype.paddingOuter=function t(e){return arguments.length?(this._paddingOuter=e,this):this._paddingOuter};e.prototype.range=function t(e){return arguments.length?(this._range=e,this):this._range};e.prototype.scale=function t(e){return arguments.length?(this._scale=e,this):this._scale};e.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};e.prototype.shape=function t(e){return arguments.length?(this._shape=e,this):this._shape};e.prototype.shapeConfig=function t(e){return arguments.length?(this._shapeConfig=Vu(this._shapeConfig,e),this):this._shapeConfig};e.prototype.tickFormat=function t(e){return arguments.length?(this._tickFormat=e,this):this._tickFormat};e.prototype.ticks=function t(e){return arguments.length?(this._ticks=e,this):this._ticks};e.prototype.tickSize=function t(e){return arguments.length?(this._tickSize=e,this):this._tickSize};e.prototype.title=function t(e){return arguments.length?(this._title=e,this):this._title};e.prototype.titleConfig=function t(e){return arguments.length?(this._titleConfig=Object.assign(this._titleConfig,e),this):this._titleConfig};e.prototype.width=function t(e){return arguments.length?(this._width=e,this):this._width};return e}(Yu);var Ed=function(t){function e(){t.call(this);this.orient("bottom")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(Cd);var Sd=function(t){function e(){t.call(this);this.orient("left")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(Cd);var Ad=function(t){function e(){t.call(this);this.orient("right")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(Cd);var kd=function(t){function e(){t.call(this);this.orient("top")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(Cd);var Md=function(){return new Td};function Td(){this.reset()}Td.prototype={constructor:Td,reset:function(){this.s=this.t=0},add:function(t){Dd(Bd,t,this.t);Dd(this,Bd.s,this.s);if(this.s){this.t+=Bd.t}else{this.s=Bd.t}},valueOf:function(){return this.s}};var Bd=new Td;function Dd(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}var Nd=1e-6;var Pd=1e-12;var zd=Math.PI;var Od=zd/2;var Fd=zd/4;var Rd=zd*2;var Id=180/zd;var Ld=zd/180;var jd=Math.abs;var Hd=Math.atan;var Vd=Math.atan2;var Ud=Math.cos;var Wd=Math.ceil;var qd=Math.exp;var Xd=Math.log;var Gd=Math.pow;var Yd=Math.sin;var $d=Math.sign||function(t){return t>0?1:t<0?-1:0};var Qd=Math.sqrt;var Zd=Math.tan;function Kd(t){return t>1?0:t<-1?zd:Math.acos(t)}function Jd(t){return t>1?Od:t<-1?-Od:Math.asin(t)}function tp(t){return(t=Yd(t/2))*t}function ep(){}function np(t,e){if(t&&rp.hasOwnProperty(t.type)){rp[t.type](t,e)}}var ip={Feature:function(t,e){np(t.geometry,e)},FeatureCollection:function(t,e){var n=t.features,i=-1,r=n.length;while(++i<r){np(n[i].geometry,e)}}};var rp={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates;e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r){t=n[i],e.point(t[0],t[1],t[2])}},LineString:function(t,e){op(t.coordinates,e,0)},MultiLineString:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r){op(n[i],e,0)}},Polygon:function(t,e){ap(t.coordinates,e)},MultiPolygon:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r){ap(n[i],e)}},GeometryCollection:function(t,e){var n=t.geometries,i=-1,r=n.length;while(++i<r){np(n[i],e)}}};function op(t,e,n){var i=-1,r=t.length-n,o;e.lineStart();while(++i<r){o=t[i],e.point(o[0],o[1],o[2])}e.lineEnd()}function ap(t,e){var n=-1,i=t.length;e.polygonStart();while(++n<i){op(t[n],e,1)}e.polygonEnd()}var sp=function(t,e){if(t&&ip.hasOwnProperty(t.type)){ip[t.type](t,e)}else{np(t,e)}};var up=Md();var hp=Md();var lp;var fp;var cp;var dp;var pp;var gp={point:ep,lineStart:ep,lineEnd:ep,polygonStart:function(){up.reset();gp.lineStart=vp;gp.lineEnd=_p},polygonEnd:function(){var t=+up;hp.add(t<0?Rd+t:t);this.lineStart=this.lineEnd=this.point=ep},sphere:function(){hp.add(Rd)}};function vp(){gp.point=yp}function _p(){mp(lp,fp)}function yp(t,e){gp.point=mp;lp=t,fp=e;t*=Ld,e*=Ld;cp=t,dp=Ud(e=e/2+Fd),pp=Yd(e)}function mp(t,e){t*=Ld,e*=Ld;e=e/2+Fd;var n=t-cp,i=n>=0?1:-1,r=i*n,o=Ud(e),a=Yd(e),s=pp*a,u=dp*o+s*Ud(r),h=s*i*Yd(r);up.add(Vd(h,u));cp=t,dp=o,pp=a}var bp=function(t){hp.reset();sp(t,gp);return hp*2};function xp(t){return[Vd(t[1],t[0]),Jd(t[2])]}function wp(t){var e=t[0],n=t[1],i=Ud(n);return[i*Ud(e),i*Yd(e),Yd(n)]}function Cp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ep(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Sp(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ap(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kp(t){var e=Qd(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Mp;var Tp;var Bp;var Dp;var Np;var Pp;var zp;var Op;var Fp=Md();var Rp;var Ip;var Lp={point:jp,lineStart:Vp,lineEnd:Up,polygonStart:function(){Lp.point=Wp;Lp.lineStart=qp;Lp.lineEnd=Xp;Fp.reset();gp.polygonStart()},polygonEnd:function(){gp.polygonEnd();Lp.point=jp;Lp.lineStart=Vp;Lp.lineEnd=Up;if(up<0){Mp=-(Bp=180),Tp=-(Dp=90)}else if(Fp>Nd){Dp=90}else if(Fp<-Nd){Tp=-90}Ip[0]=Mp,Ip[1]=Bp}};function jp(t,e){Rp.push(Ip=[Mp=t,Bp=t]);if(e<Tp){Tp=e}if(e>Dp){Dp=e}}function Hp(t,e){var n=wp([t*Ld,e*Ld]);if(Op){var i=Ep(Op,n),r=[i[1],-i[0],0],o=Ep(r,i);kp(o);o=xp(o);var a=t-Np,s=a>0?1:-1,u=o[0]*Id*s,h,l=jd(a)>180;if(l^(s*Np<u&&u<s*t)){h=o[1]*Id;if(h>Dp){Dp=h}}else if(u=(u+360)%360-180,l^(s*Np<u&&u<s*t)){h=-o[1]*Id;if(h<Tp){Tp=h}}else{if(e<Tp){Tp=e}if(e>Dp){Dp=e}}if(l){if(t<Np){if(Gp(Mp,t)>Gp(Mp,Bp)){Bp=t}}else{if(Gp(t,Bp)>Gp(Mp,Bp)){Mp=t}}}else{if(Bp>=Mp){if(t<Mp){Mp=t}if(t>Bp){Bp=t}}else{if(t>Np){if(Gp(Mp,t)>Gp(Mp,Bp)){Bp=t}}else{if(Gp(t,Bp)>Gp(Mp,Bp)){Mp=t}}}}}else{Rp.push(Ip=[Mp=t,Bp=t])}if(e<Tp){Tp=e}if(e>Dp){Dp=e}Op=n,Np=t}function Vp(){Lp.point=Hp}function Up(){Ip[0]=Mp,Ip[1]=Bp;Lp.point=jp;Op=null}function Wp(t,e){if(Op){var n=t-Np;Fp.add(jd(n)>180?n+(n>0?360:-360):n)}else{Pp=t,zp=e}gp.point(t,e);Hp(t,e)}function qp(){gp.lineStart()}function Xp(){Wp(Pp,zp);gp.lineEnd();if(jd(Fp)>Nd){Mp=-(Bp=180)}Ip[0]=Mp,Ip[1]=Bp;Op=null}function Gp(t,e){return(e-=t)<0?e+360:e}function Yp(t,e){return t[0]-e[0]}function $p(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var Qp=function(t){var e,n,i,r,o,a,s;Dp=Bp=-(Mp=Tp=Infinity);Rp=[];sp(t,Lp);if(n=Rp.length){Rp.sort(Yp);for(e=1,i=Rp[0],o=[i];e<n;++e){r=Rp[e];if($p(i,r[0])||$p(i,r[1])){if(Gp(i[0],r[1])>Gp(i[0],i[1])){i[1]=r[1]}if(Gp(r[0],i[1])>Gp(i[0],i[1])){i[0]=r[0]}}else{o.push(i=r)}}for(a=-Infinity,n=o.length-1,e=0,i=o[n];e<=n;i=r,++e){r=o[e];if((s=Gp(i[1],r[0]))>a){a=s,Mp=r[0],Bp=i[1]}}}Rp=Ip=null;return Mp===Infinity||Tp===Infinity?[[NaN,NaN],[NaN,NaN]]:[[Mp,Tp],[Bp,Dp]]};var Zp;var Kp;var Jp;var tg;var eg;var ng;var ig;var rg;var og;var ag;var sg;var ug;var hg;var lg;var fg;var cg;var dg={sphere:ep,point:pg,lineStart:vg,lineEnd:mg,polygonStart:function(){dg.lineStart=bg;dg.lineEnd=xg},polygonEnd:function(){dg.lineStart=vg;dg.lineEnd=mg}};function pg(t,e){t*=Ld,e*=Ld;var n=Ud(e);gg(n*Ud(t),n*Yd(t),Yd(e))}function gg(t,e,n){++Zp;Jp+=(t-Jp)/Zp;tg+=(e-tg)/Zp;eg+=(n-eg)/Zp}function vg(){dg.point=_g}function _g(t,e){t*=Ld,e*=Ld;var n=Ud(e);lg=n*Ud(t);fg=n*Yd(t);cg=Yd(e);dg.point=yg;gg(lg,fg,cg)}function yg(t,e){t*=Ld,e*=Ld;var n=Ud(e),i=n*Ud(t),r=n*Yd(t),o=Yd(e),a=Vd(Qd((a=fg*o-cg*r)*a+(a=cg*i-lg*o)*a+(a=lg*r-fg*i)*a),lg*i+fg*r+cg*o);Kp+=a;ng+=a*(lg+(lg=i));ig+=a*(fg+(fg=r));rg+=a*(cg+(cg=o));gg(lg,fg,cg)}function mg(){dg.point=pg}function bg(){dg.point=wg}function xg(){Cg(ug,hg);dg.point=pg}function wg(t,e){ug=t,hg=e;t*=Ld,e*=Ld;dg.point=Cg;var n=Ud(e);lg=n*Ud(t);fg=n*Yd(t);cg=Yd(e);gg(lg,fg,cg)}function Cg(t,e){t*=Ld,e*=Ld;var n=Ud(e),i=n*Ud(t),r=n*Yd(t),o=Yd(e),a=fg*o-cg*r,s=cg*i-lg*o,u=lg*r-fg*i,h=Qd(a*a+s*s+u*u),l=Jd(h),f=h&&-l/h;og+=f*a;ag+=f*s;sg+=f*u;Kp+=l;ng+=l*(lg+(lg=i));ig+=l*(fg+(fg=r));rg+=l*(cg+(cg=o));gg(lg,fg,cg)}var Eg=function(t){Zp=Kp=Jp=tg=eg=ng=ig=rg=og=ag=sg=0;sp(t,dg);var e=og,n=ag,i=sg,r=e*e+n*n+i*i;if(r<Pd){e=ng,n=ig,i=rg;if(Kp<Nd){e=Jp,n=tg,i=eg}r=e*e+n*n+i*i;if(r<Pd){return[NaN,NaN]}}return[Vd(n,e)*Id,Jd(i/Qd(r))*Id]};var Sg=function(t){return function(){return t}};var Ag=function(n,i){function t(t,e){return t=n(t,e),i(t[0],t[1])}if(n.invert&&i.invert){t.invert=function(t,e){return t=i.invert(t,e),t&&n.invert(t[0],t[1])}}return t};function kg(t,e){return[t>zd?t-Rd:t<-zd?t+Rd:t,e]}kg.invert=kg;function Mg(t,e,n){return(t%=Rd)?e||n?Ag(Bg(t),Dg(e,n)):Bg(t):e||n?Dg(e,n):kg}function Tg(n){return function(t,e){return t+=n,[t>zd?t-Rd:t<-zd?t+Rd:t,e]}}function Bg(t){var e=Tg(t);e.invert=Tg(-t);return e}function Dg(t,e){var s=Ud(t),u=Yd(t),h=Ud(e),l=Yd(e);function n(t,e){var n=Ud(e),i=Ud(t)*n,r=Yd(t)*n,o=Yd(e),a=o*s+i*u;return[Vd(r*h-a*l,i*s-o*u),Jd(a*h+r*l)]}n.invert=function(t,e){var n=Ud(e),i=Ud(t)*n,r=Yd(t)*n,o=Yd(e),a=o*h-r*l;return[Vd(r*h+o*l,i*s+a*u),Jd(a*s-i*u)]};return n}var Ng=function(e){e=Mg(e[0]*Ld,e[1]*Ld,e.length>2?e[2]*Ld:0);function t(t){t=e(t[0]*Ld,t[1]*Ld);return t[0]*=Id,t[1]*=Id,t}t.invert=function(t){t=e.invert(t[0]*Ld,t[1]*Ld);return t[0]*=Id,t[1]*=Id,t};return t};function Pg(t,e,n,i,r,o){if(!n){return}var a=Ud(e),s=Yd(e),u=i*n;if(r==null){r=e+i*Rd;o=e-u/2}else{r=zg(a,r);o=zg(a,o);if(i>0?r<o:r>o){r+=i*Rd}}for(var h,l=r;i>0?l>o:l<o;l-=u){h=xp([a,-s*Ud(l),-s*Yd(l)]);t.point(h[0],h[1])}}function zg(t,e){e=wp(e),e[0]-=t;kp(e);var n=Kd(-e[1]);return((-e[2]<0?-n:n)+Rd-Nd)%Rd}var Og=function(){var i=Sg([0,0]),r=Sg(90),o=Sg(6),a,s,u={point:t};function t(t,e){a.push(t=s(t,e));t[0]*=Id,t[1]*=Id}function e(){var t=i.apply(this,arguments),e=r.apply(this,arguments)*Ld,n=o.apply(this,arguments)*Ld;a=[];s=Mg(-t[0]*Ld,-t[1]*Ld,0).invert;Pg(u,e,n,1);t={type:"Polygon",coordinates:[a]};a=s=null;return t}e.center=function(t){return arguments.length?(i=typeof t==="function"?t:Sg([+t[0],+t[1]]),e):i};e.radius=function(t){return arguments.length?(r=typeof t==="function"?t:Sg(+t),e):r};e.precision=function(t){return arguments.length?(o=typeof t==="function"?t:Sg(+t),e):o};return e};var Fg=function(){var e=[],n;return{point:function(t,e){n.push([t,e])},lineStart:function(){e.push(n=[])},lineEnd:ep,rejoin:function(){if(e.length>1){e.push(e.pop().concat(e.shift()))}},result:function(){var t=e;e=[];n=null;return t}}};var Rg=function(t,e){return jd(t[0]-e[0])<Nd&&jd(t[1]-e[1])<Nd};function Ig(t,e,n,i){this.x=t;this.z=e;this.o=n;this.e=i;this.v=false;this.n=this.p=null}var Lg=function(t,e,n,i,o){var a=[],s=[],u,r;t.forEach(function(t){if((e=t.length-1)<=0){return}var e,n=t[0],i=t[e],r;if(Rg(n,i)){o.lineStart();for(u=0;u<e;++u){o.point((n=t[u])[0],n[1])}o.lineEnd();return}a.push(r=new Ig(n,t,null,true));s.push(r.o=new Ig(n,null,r,false));a.push(r=new Ig(i,t,null,false));s.push(r.o=new Ig(i,null,r,true))});if(!a.length){return}s.sort(e);jg(a);jg(s);for(u=0,r=s.length;u<r;++u){s[u].e=n=!n}var h=a[0],l,f;while(1){var c=h,d=true;while(c.v){if((c=c.n)===h){return}}l=c.z;o.lineStart();do{c.v=c.o.v=true;if(c.e){if(d){for(u=0,r=l.length;u<r;++u){o.point((f=l[u])[0],f[1])}}else{i(c.x,c.n.x,1,o)}c=c.n}else{if(d){l=c.p.z;for(u=l.length-1;u>=0;--u){o.point((f=l[u])[0],f[1])}}else{i(c.x,c.p.x,-1,o)}c=c.p}c=c.o;l=c.z;d=!d}while(!c.v);o.lineEnd()}};function jg(t){if(!(e=t.length)){return}var e,n=0,i=t[0],r;while(++n<e){i.n=r=t[n];r.p=i;i=r}i.n=r=t[0];r.p=i}var Hg=Md();var Vg=function(t,e){var n=e[0],i=e[1],r=Yd(i),o=[Yd(n),-Ud(n),0],a=0,s=0;Hg.reset();if(r===1){i=Od+Nd}else if(r===-1){i=-Od-Nd}for(var u=0,h=t.length;u<h;++u){if(!(f=(l=t[u]).length)){continue}var l,f,c=l[f-1],d=c[0],p=c[1]/2+Fd,g=Yd(p),v=Ud(p);for(var _=0;_<f;++_,d=m,g=x,v=w,c=y){var y=l[_],m=y[0],b=y[1]/2+Fd,x=Yd(b),w=Ud(b),C=m-d,E=C>=0?1:-1,S=E*C,A=S>zd,k=g*x;Hg.add(Vd(k*E*Yd(S),v*w+k*Ud(S)));a+=A?C+E*Rd:C;if(A^d>=n^m>=n){var M=Ep(wp(c),wp(y));kp(M);var T=Ep(o,M);kp(T);var B=(A^C>=0?-1:1)*Jd(T[2]);if(i>B||i===B&&(M[0]||M[1])){s+=A^C>=0?1:-1}}}}return(a<-Nd||a<Nd&&Hg<-Nd)^s&1};var Ug=function(v,_,y,m){return function(s){var n=_(s),u=Fg(),h=_(u),l=false,f,c,d;var e={point:i,lineStart:r,lineEnd:o,polygonStart:function(){e.point=p;e.lineStart=a;e.lineEnd=g;c=[];f=[]},polygonEnd:function(){e.point=i;e.lineStart=r;e.lineEnd=o;c=Wt(c);var t=Vg(f,m);if(c.length){if(!l){s.polygonStart(),l=true}Lg(c,qg,t,y,s)}else if(t){if(!l){s.polygonStart(),l=true}s.lineStart();y(null,null,1,s);s.lineEnd()}if(l){s.polygonEnd(),l=false}c=f=null},sphere:function(){s.polygonStart();s.lineStart();y(null,null,1,s);s.lineEnd();s.polygonEnd()}};function i(t,e){if(v(t,e)){s.point(t,e)}}function t(t,e){n.point(t,e)}function r(){e.point=t;n.lineStart()}function o(){e.point=i;n.lineEnd()}function p(t,e){d.push([t,e]);h.point(t,e)}function a(){h.lineStart();d=[]}function g(){p(d[0][0],d[0][1]);h.lineEnd();var t=h.clean(),e=u.result(),n,i=e.length,r,o,a;d.pop();f.push(d);d=null;if(!i){return}if(t&1){o=e[0];if((r=o.length-1)>0){if(!l){s.polygonStart(),l=true}s.lineStart();for(n=0;n<r;++n){s.point((a=o[n])[0],a[1])}s.lineEnd()}return}if(i>1&&t&2){e.push(e.pop().concat(e.shift()))}c.push(e.filter(Wg))}return e}};function Wg(t){return t.length>1}function qg(t,e){return((t=t.x)[0]<0?t[1]-Od-Nd:Od-t[1])-((e=e.x)[0]<0?e[1]-Od-Nd:Od-e[1])}var Xg=Ug(function(){return true},Gg,$g,[-zd,-Od]);function Gg(r){var o=NaN,a=NaN,s=NaN,u;return{lineStart:function(){r.lineStart();u=1},point:function(t,e){var n=t>0?zd:-zd,i=jd(t-o);if(jd(i-zd)<Nd){r.point(o,a=(a+e)/2>0?Od:-Od);r.point(s,a);r.lineEnd();r.lineStart();r.point(n,a);r.point(t,a);u=0}else if(s!==n&&i>=zd){if(jd(o-s)<Nd){o-=s*Nd}if(jd(t-n)<Nd){t-=n*Nd}a=Yg(o,a,t,e);r.point(s,a);r.lineEnd();r.lineStart();r.point(n,a);u=0}r.point(o=t,a=e);s=n},lineEnd:function(){r.lineEnd();o=a=NaN},clean:function(){return 2-u}}}function Yg(t,e,n,i){var r,o,a=Yd(t-n);return jd(a)>Nd?Hd((Yd(e)*(o=Ud(i))*Yd(n)-Yd(i)*(r=Ud(e))*Yd(t))/(r*o*a)):(e+i)/2}function $g(t,e,n,i){var r;if(t==null){r=n*Od;i.point(-zd,r);i.point(0,r);i.point(zd,r);i.point(zd,0);i.point(zd,-r);i.point(0,-r);i.point(-zd,-r);i.point(-zd,0);i.point(-zd,r)}else if(jd(t[0]-e[0])>Nd){var o=t[0]<e[0]?zd:-zd;r=n*o/2;i.point(-o,r);i.point(0,r);i.point(o,r)}else{i.point(e[0],e[1])}}var Qg=function(r){var B=Ud(r),o=6*Ld,d=B>0,p=jd(B)>Nd;function t(t,e,n,i){Pg(i,r,o,n,t,e)}function g(t,e){return Ud(t)*Ud(e)>B}function e(s){var u,h,l,f,c;return{lineStart:function(){f=l=false;c=1},point:function(t,e){var n=[t,e],i,r=g(t,e),o=d?r?0:_(t,e):r?_(t+(t<0?zd:-zd),e):0;if(!u&&(f=l=r)){s.lineStart()}if(r!==l){i=v(u,n);if(!i||Rg(u,i)||Rg(n,i)){n[0]+=Nd;n[1]+=Nd;r=g(n[0],n[1])}}if(r!==l){c=0;if(r){s.lineStart();i=v(n,u);s.point(i[0],i[1])}else{i=v(u,n);s.point(i[0],i[1]);s.lineEnd()}u=i}else if(p&&u&&d^r){var a;if(!(o&h)&&(a=v(n,u,true))){c=0;if(d){s.lineStart();s.point(a[0][0],a[0][1]);s.point(a[1][0],a[1][1]);s.lineEnd()}else{s.point(a[1][0],a[1][1]);s.lineEnd();s.lineStart();s.point(a[0][0],a[0][1])}}}if(r&&(!u||!Rg(u,n))){s.point(n[0],n[1])}u=n,l=r,h=o},lineEnd:function(){if(l){s.lineEnd()}u=null},clean:function(){return c|(f&&l)<<1}}}function v(t,e,n){var i=wp(t),r=wp(e);var o=[1,0,0],a=Ep(i,r),s=Cp(a,a),u=a[0],h=s-u*u;if(!h){return!n&&t}var l=B*s/h,f=-B*u/h,c=Ep(o,a),d=Ap(o,l),p=Ap(a,f);Sp(d,p);var g=c,v=Cp(d,g),_=Cp(g,g),y=v*v-_*(Cp(d,d)-1);if(y<0){return}var m=Qd(y),b=Ap(g,(-v-m)/_);Sp(b,d);b=xp(b);if(!n){return b}var x=t[0],w=e[0],C=t[1],E=e[1],S;if(w<x){S=x,x=w,w=S}var A=w-x,k=jd(A-zd)<Nd,M=k||A<Nd;if(!k&&E<C){S=C,C=E,E=S}if(M?k?C+E>0^b[1]<(jd(b[0]-x)<Nd?C:E):C<=b[1]&&b[1]<=E:A>zd^(x<=b[0]&&b[0]<=w)){var T=Ap(g,(-v+m)/_);Sp(T,d);return[b,xp(T)]}}function _(t,e){var n=d?r:zd-r,i=0;if(t<-n){i|=1}else if(t>n){i|=2}if(e<-n){i|=4}else if(e>n){i|=8}return i}return Ug(g,e,t,d?[0,-r]:[-zd,r-zd])};var Zg=function(t,e,n,i,r,o){var a=t[0],s=t[1],u=e[0],h=e[1],l=0,f=1,c=u-a,d=h-s,p;p=n-a;if(!c&&p>0){return}p/=c;if(c<0){if(p<l){return}if(p<f){f=p}}else if(c>0){if(p>f){return}if(p>l){l=p}}p=r-a;if(!c&&p<0){return}p/=c;if(c<0){if(p>f){return}if(p>l){l=p}}else if(c>0){if(p<l){return}if(p<f){f=p}}p=i-s;if(!d&&p>0){return}p/=d;if(d<0){if(p<l){return}if(p<f){f=p}}else if(d>0){if(p>f){return}if(p>l){l=p}}p=o-s;if(!d&&p<0){return}p/=d;if(d<0){if(p>f){return}if(p>l){l=p}}else if(d>0){if(p<l){return}if(p<f){f=p}}if(l>0){t[0]=a+l*c,t[1]=s+l*d}if(f<1){e[0]=a+f*c,e[1]=s+f*d}return true};var Kg=1e9;var Jg=-Kg;function tv(w,C,E,S){function A(t,e){return w<=t&&t<=E&&C<=e&&e<=S}function k(t,e,n,i){var r=0,o=0;if(t==null||(r=a(t,n))!==(o=a(e,n))||s(t,e)<0^n>0){do{i.point(r===0||r===3?w:E,r>1?S:C)}while((r=(r+n+4)%4)!==o)}else{i.point(e[0],e[1])}}function a(t,e){return jd(t[0]-w)<Nd?e>0?0:3:jd(t[0]-E)<Nd?e>0?2:1:jd(t[1]-C)<Nd?e>0?1:0:e>0?3:2}function M(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:n===0?e[1]-t[1]:n===1?t[0]-e[0]:n===2?t[1]-e[1]:e[0]-t[0]}return function(i){var o=i,t=Fg(),r,f,a,s,u,h,l,c,d,p,g;var e={point:n,lineStart:m,lineEnd:b,polygonStart:_,polygonEnd:y};function n(t,e){if(A(t,e)){o.point(t,e)}}function v(){var t=0;for(var e=0,n=f.length;e<n;++e){for(var i=f[e],r=1,o=i.length,a=i[0],s,u,h=a[0],l=a[1];r<o;++r){s=h,u=l,a=i[r],h=a[0],l=a[1];if(u<=S){if(l>S&&(h-s)*(S-u)>(l-u)*(w-s)){++t}}else{if(l<=S&&(h-s)*(S-u)<(l-u)*(w-s)){--t}}}}return t}function _(){o=t,r=[],f=[],g=true}function y(){var t=v(),e=g&&t,n=(r=Wt(r)).length;if(e||n){i.polygonStart();if(e){i.lineStart();k(null,null,1,i);i.lineEnd()}if(n){Lg(r,M,t,k,i)}i.polygonEnd()}o=i,r=f=a=null}function m(){e.point=x;if(f){f.push(a=[])}p=true;d=false;l=c=NaN}function b(){if(r){x(s,u);if(h&&d){t.rejoin()}r.push(t.result())}e.point=n;if(d){o.lineEnd()}}function x(t,e){var n=A(t,e);if(f){a.push([t,e])}if(p){s=t,u=e,h=n;p=false;if(n){o.lineStart();o.point(t,e)}}else{if(n&&d){o.point(t,e)}else{var i=[l=Math.max(Jg,Math.min(Kg,l)),c=Math.max(Jg,Math.min(Kg,c))],r=[t=Math.max(Jg,Math.min(Kg,t)),e=Math.max(Jg,Math.min(Kg,e))];if(Zg(i,r,w,C,E,S)){if(!d){o.lineStart();o.point(i[0],i[1])}o.point(r[0],r[1]);if(!n){o.lineEnd()}g=false}else if(n){o.lineStart();o.point(t,e);g=false}}}l=t,c=e,d=n}return e}}var ev=function(){var e=0,n=0,i=960,r=500,o,a,s;return s={stream:function(t){return o&&a===t?o:o=tv(e,n,i,r)(a=t)},extent:function(t){return arguments.length?(e=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1],o=a=null,s):[[e,n],[i,r]]}}};var nv=Md();var iv;var rv;var ov;var av={sphere:ep,point:ep,lineStart:sv,lineEnd:ep,polygonStart:ep,polygonEnd:ep};function sv(){av.point=hv;av.lineEnd=uv}function uv(){av.point=av.lineEnd=ep}function hv(t,e){t*=Ld,e*=Ld;iv=t,rv=Yd(e),ov=Ud(e);av.point=lv}function lv(t,e){t*=Ld,e*=Ld;var n=Yd(e),i=Ud(e),r=jd(t-iv),o=Ud(r),a=Yd(r),s=i*a,u=ov*n-rv*i*o,h=rv*n+ov*i*o;nv.add(Vd(Qd(s*s+u*u),h));iv=t,rv=n,ov=i}var fv=function(t){nv.reset();sp(t,av);return+nv};var cv=[null,null];var dv={type:"LineString",coordinates:cv};var pv=function(t,e){cv[0]=t;cv[1]=e;return fv(dv)};var gv={Feature:function(t,e){return _v(t.geometry,e)},FeatureCollection:function(t,e){var n=t.features,i=-1,r=n.length;while(++i<r){if(_v(n[i].geometry,e)){return true}}return false}};var vv={Sphere:function(){return true},Point:function(t,e){return yv(t.coordinates,e)},MultiPoint:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r){if(yv(n[i],e)){return true}}return false},LineString:function(t,e){return mv(t.coordinates,e)},MultiLineString:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r){if(mv(n[i],e)){return true}}return false},Polygon:function(t,e){return bv(t.coordinates,e)},MultiPolygon:function(t,e){var n=t.coordinates,i=-1,r=n.length;while(++i<r){if(bv(n[i],e)){return true}}return false},GeometryCollection:function(t,e){var n=t.geometries,i=-1,r=n.length;while(++i<r){if(_v(n[i],e)){return true}}return false}};function _v(t,e){return t&&vv.hasOwnProperty(t.type)?vv[t.type](t,e):false}function yv(t,e){return pv(t,e)===0}function mv(t,e){var n=pv(t[0],t[1]),i=pv(t[0],e),r=pv(e,t[1]);return i+r<=n+Nd}function bv(t,e){return!!Vg(t.map(xv),wv(e))}function xv(t){return t=t.map(wv),t.pop(),t}function wv(t){return[t[0]*Ld,t[1]*Ld]}var Cv=function(t,e){return(t&&gv.hasOwnProperty(t.type)?gv[t.type]:_v)(t,e)};function Ev(t,e,n){var i=Vt(t,e-Nd,n).concat(e);return function(e){return i.map(function(t){return[e,t]})}}function Sv(t,e,n){var i=Vt(t,e-Nd,n).concat(e);return function(e){return i.map(function(t){return[t,e]})}}function Av(){var e,n,i,r,o,a,s,u,h=10,l=h,f=90,c=360,d,p,g,v,_=2.5;function y(){return{type:"MultiLineString",coordinates:t()}}function t(){return Vt(Wd(r/f)*f,i,f).map(g).concat(Vt(Wd(u/c)*c,s,c).map(v)).concat(Vt(Wd(n/h)*h,e,h).filter(function(t){return jd(t%f)>Nd}).map(d)).concat(Vt(Wd(a/l)*l,o,l).filter(function(t){return jd(t%c)>Nd}).map(p))}y.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})};y.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(v(s).slice(1),g(i).reverse().slice(1),v(u).reverse().slice(1))]}};y.extent=function(t){if(!arguments.length){return y.extentMinor()}return y.extentMajor(t).extentMinor(t)};y.extentMajor=function(t){if(!arguments.length){return[[r,u],[i,s]]}r=+t[0][0],i=+t[1][0];u=+t[0][1],s=+t[1][1];if(r>i){t=r,r=i,i=t}if(u>s){t=u,u=s,s=t}return y.precision(_)};y.extentMinor=function(t){if(!arguments.length){return[[n,a],[e,o]]}n=+t[0][0],e=+t[1][0];a=+t[0][1],o=+t[1][1];if(n>e){t=n,n=e,e=t}if(a>o){t=a,a=o,o=t}return y.precision(_)};y.step=function(t){if(!arguments.length){return y.stepMinor()}return y.stepMajor(t).stepMinor(t)};y.stepMajor=function(t){if(!arguments.length){return[f,c]}f=+t[0],c=+t[1];return y};y.stepMinor=function(t){if(!arguments.length){return[h,l]}h=+t[0],l=+t[1];return y};y.precision=function(t){if(!arguments.length){return _}_=+t;d=Ev(a,o,90);p=Sv(n,e,_);g=Ev(u,s,90);v=Sv(r,i,_);return y};return y.extentMajor([[-180,-90+Nd],[180,90-Nd]]).extentMinor([[-180,-80-Nd],[180,80+Nd]])}function kv(){return Av()()}var Mv=function(t,e){var n=t[0]*Ld,i=t[1]*Ld,r=e[0]*Ld,o=e[1]*Ld,a=Ud(i),s=Yd(i),u=Ud(o),h=Yd(o),l=a*Ud(n),f=a*Yd(n),c=u*Ud(r),d=u*Yd(r),p=2*Jd(Qd(tp(o-i)+a*u*tp(r-n))),g=Yd(p);var v=p?function(t){var e=Yd(t*=p)/g,n=Yd(p-t)/g,i=n*l+e*c,r=n*f+e*d,o=n*s+e*h;return[Vd(r,i)*Id,Vd(o,Qd(i*i+r*r))*Id]}:function(){return[n*Id,i*Id]};v.distance=p;return v};var Tv=function(t){return t};var Bv=Md();var Dv=Md();var Nv;var Pv;var zv;var Ov;var Fv={point:ep,lineStart:ep,lineEnd:ep,polygonStart:function(){Fv.lineStart=Rv;Fv.lineEnd=jv},polygonEnd:function(){Fv.lineStart=Fv.lineEnd=Fv.point=ep;Bv.add(jd(Dv));Dv.reset()},result:function(){var t=Bv/2;Bv.reset();return t}};function Rv(){Fv.point=Iv}function Iv(t,e){Fv.point=Lv;Nv=zv=t,Pv=Ov=e}function Lv(t,e){Dv.add(Ov*t-zv*e);zv=t,Ov=e}function jv(){Lv(Nv,Pv)}var Hv=Infinity;var Vv=Hv;var Uv=-Hv;var Wv=Uv;var qv={point:Xv,lineStart:ep,lineEnd:ep,polygonStart:ep,polygonEnd:ep,result:function(){var t=[[Hv,Vv],[Uv,Wv]];Uv=Wv=-(Vv=Hv=Infinity);return t}};function Xv(t,e){if(t<Hv){Hv=t}if(t>Uv){Uv=t}if(e<Vv){Vv=e}if(e>Wv){Wv=e}}var Gv=0;var Yv=0;var $v=0;var Qv=0;var Zv=0;var Kv=0;var Jv=0;var t_=0;var e_=0;var n_;var i_;var r_;var o_;var a_={point:s_,lineStart:u_,lineEnd:f_,polygonStart:function(){a_.lineStart=c_;a_.lineEnd=d_},polygonEnd:function(){a_.point=s_;a_.lineStart=u_;a_.lineEnd=f_},result:function(){var t=e_?[Jv/e_,t_/e_]:Kv?[Qv/Kv,Zv/Kv]:$v?[Gv/$v,Yv/$v]:[NaN,NaN];Gv=Yv=$v=Qv=Zv=Kv=Jv=t_=e_=0;return t}};function s_(t,e){Gv+=t;Yv+=e;++$v}function u_(){a_.point=h_}function h_(t,e){a_.point=l_;s_(r_=t,o_=e)}function l_(t,e){var n=t-r_,i=e-o_,r=Qd(n*n+i*i);Qv+=r*(r_+t)/2;Zv+=r*(o_+e)/2;Kv+=r;s_(r_=t,o_=e)}function f_(){a_.point=s_}function c_(){a_.point=p_}function d_(){g_(n_,i_)}function p_(t,e){a_.point=g_;s_(n_=r_=t,i_=o_=e)}function g_(t,e){var n=t-r_,i=e-o_,r=Qd(n*n+i*i);Qv+=r*(r_+t)/2;Zv+=r*(o_+e)/2;Kv+=r;r=o_*t-r_*e;Jv+=r*(r_+t);t_+=r*(o_+e);e_+=r*3;s_(r_=t,o_=e)}function v_(t){this._context=t}v_.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0){this._context.closePath()}this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e);this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e);this._context.arc(t,e,this._radius,0,Rd);break}}},result:ep};var __=Md();var y_;var m_;var b_;var x_;var w_;var C_={point:ep,lineStart:function(){C_.point=E_},lineEnd:function(){if(y_){S_(m_,b_)}C_.point=ep},polygonStart:function(){y_=true},polygonEnd:function(){y_=null},result:function(){var t=+__;__.reset();return t}};function E_(t,e){C_.point=S_;m_=x_=t,b_=w_=e}function S_(t,e){x_-=t,w_-=e;__.add(Qd(x_*x_+w_*w_));x_=t,w_=e}function A_(){this._string=[]}A_.prototype={_radius:4.5,_circle:k_(4.5),pointRadius:function(t){if((t=+t)!==this._radius){this._radius=t,this._circle=null}return this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0){this._string.push("Z")}this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._string.push("M",t,",",e);this._point=1;break}case 1:{this._string.push("L",t,",",e);break}default:{if(this._circle==null){this._circle=k_(this._radius)}this._string.push("M",t,",",e,this._circle);break}}},result:function(){if(this._string.length){var t=this._string.join("");this._string=[];return t}else{return null}}};function k_(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var M_=function(e,n){var i=4.5,r,o;function a(t){if(t){if(typeof i==="function"){o.pointRadius(+i.apply(this,arguments))}sp(t,r(o))}return o.result()}a.area=function(t){sp(t,r(Fv));return Fv.result()};a.measure=function(t){sp(t,r(C_));return C_.result()};a.bounds=function(t){sp(t,r(qv));return qv.result()};a.centroid=function(t){sp(t,r(a_));return a_.result()};a.projection=function(t){return arguments.length?(r=t==null?(e=null,Tv):(e=t).stream,a):e};a.context=function(t){if(!arguments.length){return n}o=t==null?(n=null,new A_):new v_(n=t);if(typeof i!=="function"){o.pointRadius(i)}return a};a.pointRadius=function(t){if(!arguments.length){return i}i=typeof t==="function"?t:(o.pointRadius(+t),+t);return a};return a.projection(e).context(n)};var T_=function(t){return{stream:B_(t)}};function B_(i){return function(t){var e=new D_;for(var n in i){e[n]=i[n]}e.stream=t;return e}}function D_(){}D_.prototype={constructor:D_,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function N_(t,e,n){var i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]);if(i!=null){t.clipExtent(null)}sp(n,t.stream(qv));e(qv.result());if(i!=null){t.clipExtent(i)}return t}function P_(a,s,t){return N_(a,function(t){var e=s[1][0]-s[0][0],n=s[1][1]-s[0][1],i=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),r=+s[0][0]+(e-i*(t[1][0]+t[0][0]))/2,o=+s[0][1]+(n-i*(t[1][1]+t[0][1]))/2;a.scale(150*i).translate([r,o])},t)}function z_(t,e,n){return P_(t,[[0,0],e],n)}function O_(o,a,t){return N_(o,function(t){var e=+a,n=e/(t[1][0]-t[0][0]),i=(e-n*(t[1][0]+t[0][0]))/2,r=-n*t[0][1];o.scale(150*n).translate([i,r])},t)}function F_(o,a,t){return N_(o,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),i=-n*t[0][0],r=(e-n*(t[1][1]+t[0][1]))/2;o.scale(150*n).translate([i,r])},t)}var R_=16;var I_=Ud(30*Ld);var L_=function(t,e){return+e?H_(t,e):j_(t)};function j_(n){return B_({point:function(t,e){t=n(t,e);this.stream.point(t[0],t[1])}})}function H_(T,B){function D(t,e,n,i,r,o,a,s,u,h,l,f,c,d){var p=a-t,g=s-e,v=p*p+g*g;if(v>4*B&&c--){var _=i+h,y=r+l,m=o+f,b=Qd(_*_+y*y+m*m),x=Jd(m/=b),w=jd(jd(m)-1)<Nd||jd(n-u)<Nd?(n+u)/2:Vd(y,_),C=T(w,x),E=C[0],S=C[1],A=E-t,k=S-e,M=g*A-p*k;if(M*M/v>B||jd((p*A+g*k)/v-.5)>.3||i*h+r*l+o*f<I_){D(t,e,n,i,r,o,E,S,w,_/=b,y/=b,m,c,d);d.point(E,S);D(E,S,w,_,y,m,a,s,u,h,l,f,c,d)}}}return function(r){var n,i,o,a,s,u,h,l,f,c,d,p;var g={point:t,lineStart:e,lineEnd:_,polygonStart:function(){r.polygonStart();g.lineStart=y},polygonEnd:function(){r.polygonEnd();g.lineStart=e}};function t(t,e){t=T(t,e);r.point(t[0],t[1])}function e(){l=NaN;g.point=v;r.lineStart()}function v(t,e){var n=wp([t,e]),i=T(t,e);D(l,f,h,c,d,p,l=i[0],f=i[1],h=t,c=n[0],d=n[1],p=n[2],R_,r);r.point(l,f)}function _(){g.point=t;r.lineEnd()}function y(){e();g.point=m;g.lineEnd=b}function m(t,e){v(n=t,e),i=l,o=f,a=c,s=d,u=p;g.point=v}function b(){D(l,f,h,c,d,p,i,o,n,a,s,u,R_,r);g.lineEnd=_;_()}return g}}var V_=B_({point:function(t,e){this.stream.point(t*Ld,e*Ld)}});function U_(i){return B_({point:function(t,e){var n=i(t,e);return this.stream.point(n[0],n[1])}})}function W_(n,i,r){function t(t,e){return[i+n*t,r-n*e]}t.invert=function(t,e){return[(t-i)/n,(r-e)/n]};return t}function q_(t,n,i,e){var r=Ud(e),o=Yd(e),a=r*t,s=o*t,u=r/t,h=o/t,l=(o*i-r*n)/t,f=(o*n+r*i)/t;function c(t,e){return[a*t-s*e+n,i-s*t-a*e]}c.invert=function(t,e){return[u*t-h*e+l,f-h*t-u*e]};return c}function X_(t){return G_(function(){return t})()}function G_(t){var n,i=150,r=480,o=250,a=0,s=0,u=0,h=0,l=0,f,c=0,e=null,d=Xg,p=null,g,v,_,y=Tv,m=.5,b,x,w,C,E;function S(t){return w(t[0]*Ld,t[1]*Ld)}function A(t){t=w.invert(t[0],t[1]);return t&&[t[0]*Id,t[1]*Id]}S.stream=function(t){return C&&E===t?C:C=V_(U_(f)(d(b(y(E=t)))))};S.preclip=function(t){return arguments.length?(d=t,e=undefined,M()):d};S.postclip=function(t){return arguments.length?(y=t,p=g=v=_=null,M()):y};S.clipAngle=function(t){return arguments.length?(d=+t?Qg(e=t*Ld):(e=null,Xg),M()):e*Id};S.clipExtent=function(t){return arguments.length?(y=t==null?(p=g=v=_=null,Tv):tv(p=+t[0][0],g=+t[0][1],v=+t[1][0],_=+t[1][1]),M()):p==null?null:[[p,g],[v,_]]};S.scale=function(t){return arguments.length?(i=+t,k()):i};S.translate=function(t){return arguments.length?(r=+t[0],o=+t[1],k()):[r,o]};S.center=function(t){return arguments.length?(a=t[0]%360*Ld,s=t[1]%360*Ld,k()):[a*Id,s*Id]};S.rotate=function(t){return arguments.length?(u=t[0]%360*Ld,h=t[1]%360*Ld,l=t.length>2?t[2]%360*Ld:0,k()):[u*Id,h*Id,l*Id]};S.angle=function(t){return arguments.length?(c=t%360*Ld,k()):c*Id};S.precision=function(t){return arguments.length?(b=L_(x,m=t*t),M()):Qd(m)};S.fitExtent=function(t,e){return P_(S,t,e)};S.fitSize=function(t,e){return z_(S,t,e)};S.fitWidth=function(t,e){return O_(S,t,e)};S.fitHeight=function(t,e){return F_(S,t,e)};function k(){var t=q_(i,0,0,c).apply(null,n(a,s)),e=(c?q_:W_)(i,r-t[0],o-t[1],c);f=Mg(u,h,l);x=Ag(n,e);w=Ag(f,x);b=L_(x,m);return M()}function M(){C=E=null;return S}return function(){n=t.apply(this,arguments);S.invert=n.invert&&A;return k()}}function Y_(t){var e=0,n=zd/3,i=G_(t),r=i(e,n);r.parallels=function(t){return arguments.length?i(e=t[0]*Ld,n=t[1]*Ld):[e*Id,n*Id]};return r}function $_(t){var n=Ud(t);function e(t,e){return[t*n,Yd(e)/n]}e.invert=function(t,e){return[t/n,Jd(e*n)]};return e}function Q_(t,e){var n=Yd(t),i=(n+Yd(e))/2;if(jd(i)<Nd){return $_(t)}var r=1+n*(2*i-n),o=Qd(r)/i;function a(t,e){var n=Qd(r-2*i*Yd(e))/i;return[n*Yd(t*=i),o-n*Ud(t)]}a.invert=function(t,e){var n=o-e;return[Vd(t,jd(n))/i*$d(n),Jd((r-(t*t+n*n)*i*i)/(2*i))]};return a}var Z_=function(){return Y_(Q_).scale(155.424).center([0,33.6442])};var K_=function(){return Z_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function J_(i){var r=i.length;return{point:function(t,e){var n=-1;while(++n<r){i[n].point(t,e)}},sphere:function(){var t=-1;while(++t<r){i[t].sphere()}},lineStart:function(){var t=-1;while(++t<r){i[t].lineStart()}},lineEnd:function(){var t=-1;while(++t<r){i[t].lineEnd()}},polygonStart:function(){var t=-1;while(++t<r){i[t].polygonStart()}},polygonEnd:function(){var t=-1;while(++t<r){i[t].polygonEnd()}}}}var ty=function(){var e,n,o=K_(),r,a=Z_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s,u=Z_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h,i,l={point:function(t,e){i=[t,e]}};function f(t){var e=t[0],n=t[1];return i=null,(r.point(e,n),i)||(s.point(e,n),i)||(h.point(e,n),i)}f.invert=function(t){var e=o.scale(),n=o.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?u:o).invert(t)};f.stream=function(t){return e&&n===t?e:e=J_([o.stream(n=t),a.stream(t),u.stream(t)])};f.precision=function(t){if(!arguments.length){return o.precision()}o.precision(t),a.precision(t),u.precision(t);return c()};f.scale=function(t){if(!arguments.length){return o.scale()}o.scale(t),a.scale(t*.35),u.scale(t);return f.translate(o.translate())};f.translate=function(t){if(!arguments.length){return o.translate()}var e=o.scale(),n=+t[0],i=+t[1];r=o.translate(t).clipExtent([[n-.455*e,i-.238*e],[n+.455*e,i+.238*e]]).stream(l);s=a.translate([n-.307*e,i+.201*e]).clipExtent([[n-.425*e+Nd,i+.12*e+Nd],[n-.214*e-Nd,i+.234*e-Nd]]).stream(l);h=u.translate([n-.205*e,i+.212*e]).clipExtent([[n-.214*e+Nd,i+.166*e+Nd],[n-.115*e-Nd,i+.234*e-Nd]]).stream(l);return c()};f.fitExtent=function(t,e){return P_(f,t,e)};f.fitSize=function(t,e){return z_(f,t,e)};f.fitWidth=function(t,e){return O_(f,t,e)};f.fitHeight=function(t,e){return F_(f,t,e)};function c(){e=n=null;return f}return f.scale(1070)};function ey(o){return function(t,e){var n=Ud(t),i=Ud(e),r=o(n*i);return[r*i*Yd(t),r*Yd(e)]}}function ny(a){return function(t,e){var n=Qd(t*t+e*e),i=a(n),r=Yd(i),o=Ud(i);return[Vd(t*r,n*o),Jd(n&&e*r/n)]}}var iy=ey(function(t){return Qd(2/(1+t))});iy.invert=ny(function(t){return 2*Jd(t/2)});var ry=function(){return X_(iy).scale(124.75).clipAngle(180-.001)};var oy=ey(function(t){return(t=Kd(t))&&t/Yd(t)});oy.invert=ny(function(t){return t});var ay=function(){return X_(oy).scale(79.4188).clipAngle(180-.001)};function sy(t,e){return[t,Xd(Zd((Od+e)/2))]}sy.invert=function(t,e){return[t,2*Hd(qd(e))-Od]};var uy=function(){return hy(sy).scale(961/Rd)};function hy(n){var i=X_(n),e=i.center,r=i.scale,o=i.translate,a=i.clipExtent,s=null,u,h,l;i.scale=function(t){return arguments.length?(r(t),f()):r()};i.translate=function(t){return arguments.length?(o(t),f()):o()};i.center=function(t){return arguments.length?(e(t),f()):e()};i.clipExtent=function(t){return arguments.length?(t==null?s=u=h=l=null:(s=+t[0][0],u=+t[0][1],h=+t[1][0],l=+t[1][1]),f()):s==null?null:[[s,u],[h,l]]};function f(){var t=zd*r(),e=i(Ng(i.rotate()).invert([0,0]));return a(s==null?[[e[0]-t,e[1]-t],[e[0]+t,e[1]+t]]:n===sy?[[Math.max(e[0]-t,s),u],[Math.min(e[0]+t,h),l]]:[[s,Math.max(e[1]-t,u)],[h,Math.min(e[1]+t,l)]])}return f()}function ly(t){return Zd((Od+t)/2)}function fy(t,e){var n=Ud(t),r=t===e?Yd(t):Xd(n/Ud(e))/Xd(ly(e)/ly(t)),o=n*Gd(ly(t),r)/r;if(!r){return sy}function i(t,e){if(o>0){if(e<-Od+Nd){e=-Od+Nd}}else{if(e>Od-Nd){e=Od-Nd}}var n=o/Gd(ly(e),r);return[n*Yd(r*t),o-n*Ud(r*t)]}i.invert=function(t,e){var n=o-e,i=$d(r)*Qd(t*t+n*n);return[Vd(t,jd(n))/r*$d(n),2*Hd(Gd(o/i,1/r))-Od]};return i}var cy=function(){return Y_(fy).scale(109.5).parallels([30,30])};function dy(t,e){return[t,e]}dy.invert=dy;var py=function(){return X_(dy).scale(152.63)};function gy(t,e){var n=Ud(t),r=t===e?Yd(t):(n-Ud(e))/(e-t),o=n/r+t;if(jd(r)<Nd){return dy}function i(t,e){var n=o-e,i=r*t;return[n*Yd(i),o-n*Ud(i)]}i.invert=function(t,e){var n=o-e;return[Vd(t,jd(n))/r*$d(n),o-$d(r)*Qd(t*t+n*n)]};return i}var vy=function(){return Y_(gy).scale(131.154).center([0,13.9389])};function _y(t,e){var n=Ud(e),i=Ud(t)*n;return[n*Yd(t)/i,Yd(e)/i]}_y.invert=ny(Hd);var yy=function(){return X_(_y).scale(144.049).clipAngle(60)};function my(n,i,r,o){return n===1&&i===1&&r===0&&o===0?Tv:B_({point:function(t,e){this.stream.point(t*n+r,e*i+o)}})}var by=function(){var e=1,n=0,i=0,r=1,o=1,a=Tv,s=null,u,h,l,f=Tv,c,d,p;function g(){c=d=null;return p}return p={stream:function(t){return c&&d===t?c:c=a(f(d=t))},postclip:function(t){return arguments.length?(f=t,s=u=h=l=null,g()):f},clipExtent:function(t){return arguments.length?(f=t==null?(s=u=h=l=null,Tv):tv(s=+t[0][0],u=+t[0][1],h=+t[1][0],l=+t[1][1]),g()):s==null?null:[[s,u],[h,l]]},scale:function(t){return arguments.length?(a=my((e=+t)*r,e*o,n,i),g()):e},translate:function(t){return arguments.length?(a=my(e*r,e*o,n=+t[0],i=+t[1]),g()):[n,i]},reflectX:function(t){return arguments.length?(a=my(e*(r=t?-1:1),e*o,n,i),g()):r<0},reflectY:function(t){return arguments.length?(a=my(e*r,e*(o=t?-1:1),n,i),g()):o<0},fitExtent:function(t,e){return P_(p,t,e)},fitSize:function(t,e){return z_(p,t,e)},fitWidth:function(t,e){return O_(p,t,e)},fitHeight:function(t,e){return F_(p,t,e)}}};function xy(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),e*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}xy.invert=function(t,e){var n=e,i=25,r;do{var o=n*n,a=o*o;n-=r=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-e)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(jd(r)>Nd&&--i>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};var wy=function(){return X_(xy).scale(175.295)};function Cy(t,e){return[Ud(e)*Yd(t),Yd(e)]}Cy.invert=ny(Jd);var Ey=function(){return X_(Cy).scale(249.5).clipAngle(90+Nd)};function Sy(t,e){var n=Ud(e),i=1+Ud(t)*n;return[n*Yd(t)/i,Yd(e)/i]}Sy.invert=ny(function(t){return 2*Hd(t)});var Ay=function(){return X_(Sy).scale(250).clipAngle(142)};function ky(t,e){return[Xd(Zd((Od+e)/2)),-t]}ky.invert=function(t,e){return[-e,2*Hd(qd(t))-Od]};var My=function(){var t=hy(ky),e=t.center,n=t.rotate;t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90]).scale(159.155)};var Ty=Object.freeze({geoArea:bp,geoBounds:Qp,geoCentroid:Eg,geoCircle:Og,geoClipAntimeridian:Xg,geoClipCircle:Qg,geoClipExtent:ev,geoClipRectangle:tv,geoContains:Cv,geoDistance:pv,geoGraticule:Av,geoGraticule10:kv,geoInterpolate:Mv,geoLength:fv,geoPath:M_,geoAlbers:K_,geoAlbersUsa:ty,geoAzimuthalEqualArea:ry,geoAzimuthalEqualAreaRaw:iy,geoAzimuthalEquidistant:ay,geoAzimuthalEquidistantRaw:oy,geoConicConformal:cy,geoConicConformalRaw:fy,geoConicEqualArea:Z_,geoConicEqualAreaRaw:Q_,geoConicEquidistant:vy,geoConicEquidistantRaw:gy,geoEquirectangular:py,geoEquirectangularRaw:dy,geoGnomonic:yy,geoGnomonicRaw:_y,geoIdentity:by,geoProjection:X_,geoProjectionMutator:G_,geoMercator:uy,geoMercatorRaw:sy,geoNaturalEarth1:wy,geoNaturalEarth1Raw:xy,geoOrthographic:Ey,geoOrthographicRaw:Cy,geoStereographic:Ay,geoStereographicRaw:Sy,geoTransverseMercator:My,geoTransverseMercatorRaw:ky,geoRotation:Ng,geoStream:sp,geoTransform:T_});var By=function(){var h=0,l=0,f=960,c=500,d=(h+f)/2,p=(l+c)/2,g=256,v=0,_=true;function e(){var t=Math.max(Math.log(g)/Math.LN2-8,0),n=Math.round(t+v),i=1<<n,e=Math.pow(2,t-n+8),r=d-g/2,o=p-g/2,a=[],s=Vt(Math.max(_?-Infinity:0,Math.floor((h-r)/e)),Math.min(Math.ceil((f-r)/e),_?Infinity:i)),u=Vt(Math.max(0,Math.floor((l-o)/e)),Math.min(Math.ceil((c-o)/e),i));u.forEach(function(e){s.forEach(function(t){a.push({x:(t%i+i)%i,y:e,z:n,tx:t*256,ty:e*256})})});a.translate=[r/e,o/e];a.scale=e;return a}e.size=function(t){return arguments.length?(h=l=0,f=+t[0],c=+t[1],e):[f-h,c-l]};e.extent=function(t){return arguments.length?(h=+t[0][0],l=+t[0][1],f=+t[1][0],c=+t[1][1],e):[[h,l],[f,c]]};e.scale=function(t){return arguments.length?(g=+t,e):g};e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],e):[d,p]};e.zoomDelta=function(t){return arguments.length?(v=+t,e):v};e.wrap=function(t){return arguments.length?(_=t,e):_};return e};var Dy=function(t){return t};var Ny=function(t){if(t==null){return Dy}var o,a,s=t.scale[0],u=t.scale[1],h=t.translate[0],l=t.translate[1];return function(t,e){if(!e){o=a=0}var n=2,i=t.length,r=new Array(i);r[0]=(o+=t[0])*s+h;r[1]=(a+=t[1])*u+l;while(n<i){r[n]=t[n],++n}return r}};var Py=function(t,e){var n,i=t.length,r=i-e;while(r<--i){n=t[r],t[r++]=t[i],t[i]=n}};var zy=function(e,t){return t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(t){return Oy(e,t)})}:Oy(e,t)};function Oy(t,e){var n=e.id,i=e.bbox,r=e.properties==null?{}:e.properties,o=Fy(t,e);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function Fy(t,e){var o=Ny(t.transform),a=t.arcs;function r(t,e){if(e.length){e.pop()}for(var n=a[t<0?~t:t],i=0,r=n.length;i<r;++i){e.push(o(n[i],i))}if(t<0){Py(e,r)}}function i(t){return o(t)}function s(t){var e=[];for(var n=0,i=t.length;n<i;++n){r(t[n],e)}if(e.length<2){e.push(e[0])}return e}function n(t){var e=s(t);while(e.length<4){e.push(e[0])}return e}function u(t){return t.map(n)}function h(t){var e=t.type,n;switch(e){case"GeometryCollection":return{type:e,geometries:t.geometries.map(h)};case"Point":n=i(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(i);break;case"LineString":n=s(t.arcs);break;case"MultiLineString":n=t.arcs.map(s);break;case"Polygon":n=u(t.arcs);break;case"MultiPolygon":n=t.arcs.map(u);break;default:return null}return{type:e,coordinates:n}}return h(e)}var Ry=function(t,e,n){if(e===void 0){e="data"}if(n===void 0){n="headers"}return t[e].map(function(i){return t[n].reduce(function(t,e,n){return t[e]=i[n],t},{})})};var Iy=function(i,t){var r,o=Ka("beforesend","progress","load","error"),a,s=_(),u=new XMLHttpRequest,h=null,l=null,f,c,d=0;if(typeof XDomainRequest!=="undefined"&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(i)){u=new XDomainRequest}"onload"in u?u.onload=u.onerror=u.ontimeout=e:u.onreadystatechange=function(t){u.readyState>3&&e(t)};function e(t){var e=u.status,n;if(!e&&jy(u)||e>=200&&e<300||e===304){if(f){try{n=f.call(r,u)}catch(t){o.call("error",r,t);return}}else{n=u}o.call("load",r,n)}else{o.call("error",r,t)}}u.onprogress=function(t){o.call("progress",r,t)};r={header:function(t,e){t=(t+"").toLowerCase();if(arguments.length<2){return s.get(t)}if(e==null){s.remove(t)}else{s.set(t,e+"")}return r},mimeType:function(t){if(!arguments.length){return a}a=t==null?null:t+"";return r},responseType:function(t){if(!arguments.length){return c}c=t;return r},timeout:function(t){if(!arguments.length){return d}d=+t;return r},user:function(t){return arguments.length<1?h:(h=t==null?null:t+"",r)},password:function(t){return arguments.length<1?l:(l=t==null?null:t+"",r)},response:function(t){f=t;return r},get:function(t,e){return r.send("GET",t,e)},post:function(t,e){return r.send("POST",t,e)},send:function(t,e,n){u.open(t,i,true,h,l);if(a!=null&&!s.has("accept")){s.set("accept",a+",*/*")}if(u.setRequestHeader){s.each(function(t,e){u.setRequestHeader(e,t)})}if(a!=null&&u.overrideMimeType){u.overrideMimeType(a)}if(c!=null){u.responseType=c}if(d>0){u.timeout=d}if(n==null&&typeof e==="function"){n=e,e=null}if(n!=null&&n.length===1){n=Ly(n)}if(n!=null){r.on("error",n).on("load",function(t){n(null,t)})}o.call("beforesend",r,u);u.send(e==null?null:e);return r},abort:function(){u.abort();return r},on:function(){var t=o.on.apply(o,arguments);return t===o?r:t}};if(t!=null){if(typeof t!=="function"){throw new Error("invalid callback: "+t)}return r.get(t)}return r};function Ly(n){return function(t,e){n(t==null?e:null)}}function jy(t){var e=t.responseType;return e&&e!=="text"?t.response:t.responseText}var Hy=function(i,r){return function(t,e){var n=Iy(t).mimeType(i).response(r);if(e!=null){if(typeof e!=="function"){throw new Error("invalid callback: "+e)}return n.get(e)}return n}};Hy("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)});var Vy=Hy("application/json",function(t){return JSON.parse(t.responseText)});var Uy=Hy("text/plain",function(t){return t.responseText});Hy("application/xml",function(t){var e=t.responseXML;if(!e){throw new Error("parse error")}return e});var Wy={};var qy={};var Xy=34;var Gy=10;var Yy=13;function $y(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}")}function Qy(n,i){var r=$y(n);return function(t,e){return i(r(t),e,n)}}function Zy(t){var n=Object.create(null),i=[];t.forEach(function(t){for(var e in t){if(!(e in n)){i.push(n[e]=e)}}});return i}var Ky=function(i){var e=new RegExp('["'+i+"\n\r]"),f=i.charCodeAt(0);function t(t,n){var i,r,e=o(t,function(t,e){if(i){return i(t,e-1)}r=t,i=n?Qy(t,n):$y(t)});e.columns=r||[];return e}function o(i,t){var e=[],r=i.length,o=0,n=0,a,s=r<=0,u=false;if(i.charCodeAt(r-1)===Gy){--r}if(i.charCodeAt(r-1)===Yy){--r}function h(){if(s){return qy}if(u){return u=false,Wy}var t,e=o,n;if(i.charCodeAt(e)===Xy){while(o++<r&&i.charCodeAt(o)!==Xy||i.charCodeAt(++o)===Xy){}if((t=o)>=r){s=true}else if((n=i.charCodeAt(o++))===Gy){u=true}else if(n===Yy){u=true;if(i.charCodeAt(o)===Gy){++o}}return i.slice(e+1,t-1).replace(/""/g,'"')}while(o<r){if((n=i.charCodeAt(t=o++))===Gy){u=true}else if(n===Yy){u=true;if(i.charCodeAt(o)===Gy){++o}}else if(n!==f){continue}return i.slice(e,t)}return s=true,i.slice(e,r)}while((a=h())!==qy){var l=[];while(a!==Wy&&a!==qy){l.push(a),a=h()}if(t&&(l=t(l,n++))==null){continue}e.push(l)}return e}function n(t,n){if(n==null){n=Zy(t)}return[n.map(s).join(i)].concat(t.map(function(e){return n.map(function(t){return s(e[t])}).join(i)})).join("\n")}function r(t){return t.map(a).join("\n")}function a(t){return t.map(s).join(i)}function s(t){return t==null?"":e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:t,parseRows:o,format:n,formatRows:r}};var Jy=Ky(",");var tm=Jy.parse;var em=Ky("\t");var nm=em.parse;var im=function(r,o){return function(t,e,n){if(arguments.length<3){n=e,e=null}var i=Iy(t).mimeType(r);i.row=function(t){return arguments.length?i.response(rm(o,e=t)):e};i.row(e);return n?i.get(n):i}};function rm(e,n){return function(t){return e(t.responseText,n)}}var om=im("text/csv",tm);var am=im("text/tab-separated-values",nm);var sm=function(n,i,r,o){var a=this;if(typeof n!=="string"){var t=i?i(n):n;if(r&&"_"+r in this){this["_"+r]=t}if(o){o(null,t)}}else{var s=n.slice(n.length-4)===".csv"?om:n.slice(n.length-4)===".tsv"?am:n.slice(n.length-4)===".txt"?Uy:Vy;s(n,function(t,e){if(s!==Vy&&!t&&e&&e instanceof Array){e.forEach(function(t){for(var e in t){if(!isNaN(t[e])){t[e]=parseFloat(t[e])}else if(t[e].toLowerCase()==="false"){t[e]=false}else if(t[e].toLowerCase()==="true"){t[e]=true}else if(t[e].toLowerCase()==="null"){t[e]=null}else if(t[e].toLowerCase()==="undefined"){t[e]=undefined}}})}e=t?[]:i?i(e):e;if(e&&!(e instanceof Array)&&e.data&&e.headers){e=Ry(e)}if(r&&"_"+r in a){a["_"+r]=e}if(a._cache){a._lrucache.set(n,e)}if(o){o(t,e)}})}};var um=function(){Ta.preventDefault();Ta.stopImmediatePropagation()};var hm=function(t){var e=t.document.documentElement,n=qa(t).on("dragstart.drag",um,true);if("onselectstart"in e){n.on("selectstart.drag",um,true)}else{e.__noselect=e.style.MozUserSelect;e.style.MozUserSelect="none"}};function lm(t,e){var n=t.document.documentElement,i=qa(t).on("dragstart.drag",null);if(e){i.on("click.drag",um,true);setTimeout(function(){i.on("click.drag",null)},0)}if("onselectstart"in n){i.on("selectstart.drag",null)}else{n.style.MozUserSelect=n.__noselect;delete n.__noselect}}function fm(t,e,n,i,r,o,a,s,u,h){this.target=t;this.type=e;this.subject=n;this.identifier=i;this.active=r;this.x=o;this.y=a;this.dx=s;this.dy=u;this._=h}fm.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var cm=function(t){return function(){return t}};var dm=function(t,e,n){this.target=t;this.type=e;this.selection=n};function pm(){Ta.stopImmediatePropagation()}var gm=function(){Ta.preventDefault();Ta.stopImmediatePropagation()};var vm={name:"drag"};var _m={name:"space"};var ym={name:"handle"};var mm={name:"center"};var bm={name:"x",handles:["e","w"].map(Mm),input:function(t,e){return t&&[[t[0],e[0][1]],[t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}};var xm={name:"y",handles:["n","s"].map(Mm),input:function(t,e){return t&&[[e[0][0],t[0]],[e[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}};var wm={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(Mm),input:function(t){return t},output:function(t){return t}};var Cm={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};var Em={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"};var Sm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"};var Am={overlay:+1,selection:+1,n:null,e:+1,s:null,w:-1,nw:-1,ne:+1,se:+1,sw:-1};var km={overlay:+1,selection:+1,n:-1,e:null,s:+1,w:null,nw:-1,ne:-1,se:+1,sw:+1};function Mm(t){return{type:t}}function Tm(){return!Ta.button}function Bm(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Dm(t){while(!t.__brush){if(!(t=t.parentNode)){return}}return t.__brush}function Nm(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Pm(){return Om(bm)}var zm=function(){return Om(wm)};function Om(R){var e=Bm,I=Tm,n=Ka(r,"start","brush","end"),i=6,L;function r(t){var e=t.property("__brush",s).selectAll(".overlay").data([Mm("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Cm.overlay).merge(e).each(function(){var t=Dm(this).extent;qa(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])});t.selectAll(".selection").data([Mm("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Cm.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var n=t.selectAll(".handle").data(R.handles,function(t){return t.type});n.exit().remove();n.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Cm[t.type]});t.each(j).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",a)}r.move=function(t,s){if(t.selection){t.on("start.brush",function(){H(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){H(this,arguments).end()}).tween("brush",function(){var e=this,n=e.__brush,i=H(e,arguments),t=n.selection,r=R.input(typeof s==="function"?s.apply(this,arguments):s,n.extent),o=ue(t,r);function a(t){n.selection=t===1&&Nm(r)?null:o(t);j.call(e);i.brush()}return t&&r?a:a(1)})}else{t.each(function(){var t=this,e=arguments,n=t.__brush,i=R.input(typeof s==="function"?s.apply(t,e):s,n.extent),r=H(t,e).beforestart();Is(t);n.selection=i==null||Nm(i)?null:i;j.call(t);r.start().brush().end()})}};function j(){var t=qa(this),e=Dm(this).selection;if(e){t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]);t.selectAll(".handle").style("display",null).attr("x",function(t){return t.type[t.type.length-1]==="e"?e[1][0]-i/2:e[0][0]-i/2}).attr("y",function(t){return t.type[0]==="s"?e[1][1]-i/2:e[0][1]-i/2}).attr("width",function(t){return t.type==="n"||t.type==="s"?e[1][0]-e[0][0]+i:i}).attr("height",function(t){return t.type==="e"||t.type==="w"?e[1][1]-e[0][1]+i:i})}else{t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}}function H(t,e){return t.__brush.emitter||new o(t,e)}function o(t,e){this.that=t;this.args=e;this.state=t.__brush;this.active=0}o.prototype={beforestart:function(){if(++this.active===1){this.state.emitter=this,this.starting=true}return this},start:function(){if(this.starting){this.starting=false,this.emit("start")}return this},brush:function(){this.emit("brush");return this},end:function(){if(--this.active===0){delete this.state.emitter,this.emit("end")}return this},emit:function(t){Ra(new dm(r,t,R.output(this.state.selection)),n.apply,n,[t,this.that,this.args])}};function a(){if(Ta.touches){if(Ta.changedTouches.length<Ta.touches.length){return gm()}}else if(L){return}if(!I.apply(this,arguments)){return}var e=this,n=Ta.target.__data__.type,i=(Ta.metaKey?n="overlay":n)==="selection"?vm:Ta.altKey?mm:ym,r=R===xm?null:Am[n],o=R===bm?null:km[n],a=Dm(e),t=a.extent,s=a.selection,u=t[0][0],h,l,f=t[0][1],c,d,p=t[1][0],g,v,_=t[1][1],y,m,b,x,w,C=r&&o&&Ta.shiftKey,E,S,A=Ya(e),k=A,M=H(e,arguments).beforestart();if(n==="overlay"){a.selection=s=[[h=R===xm?u:A[0],c=R===bm?f:A[1]],[g=R===xm?p:h,y=R===bm?_:c]]}else{h=s[0][0];c=s[0][1];g=s[1][0];y=s[1][1]}l=h;d=c;v=g;m=y;var T=qa(e).attr("pointer-events","none");var B=T.selectAll(".overlay").attr("cursor",Cm[n]);if(Ta.touches){T.on("touchmove.brush",N,true).on("touchend.brush touchcancel.brush",z,true)}else{var D=qa(Ta.view).on("keydown.brush",O,true).on("keyup.brush",F,true).on("mousemove.brush",N,true).on("mouseup.brush",z,true);hm(Ta.view)}pm();Is(e);j.call(e);M.start();function N(){var t=Ya(e);if(C&&!E&&!S){if(Math.abs(t[0]-k[0])>Math.abs(t[1]-k[1])){S=true}else{E=true}}k=t;w=true;gm();P()}function P(){var t;b=k[0]-A[0];x=k[1]-A[1];switch(i){case _m:case vm:{if(r){b=Math.max(u-h,Math.min(p-g,b)),l=h+b,v=g+b}if(o){x=Math.max(f-c,Math.min(_-y,x)),d=c+x,m=y+x}break}case ym:{if(r<0){b=Math.max(u-h,Math.min(p-h,b)),l=h+b,v=g}else if(r>0){b=Math.max(u-g,Math.min(p-g,b)),l=h,v=g+b}if(o<0){x=Math.max(f-c,Math.min(_-c,x)),d=c+x,m=y}else if(o>0){x=Math.max(f-y,Math.min(_-y,x)),d=c,m=y+x}break}case mm:{if(r){l=Math.max(u,Math.min(p,h-b*r)),v=Math.max(u,Math.min(p,g+b*r))}if(o){d=Math.max(f,Math.min(_,c-x*o)),m=Math.max(f,Math.min(_,y+x*o))}break}}if(v<l){r*=-1;t=h,h=g,g=t;t=l,l=v,v=t;if(n in Em){B.attr("cursor",Cm[n=Em[n]])}}if(m<d){o*=-1;t=c,c=y,y=t;t=d,d=m,m=t;if(n in Sm){B.attr("cursor",Cm[n=Sm[n]])}}if(a.selection){s=a.selection}if(E){l=s[0][0],v=s[1][0]}if(S){d=s[0][1],m=s[1][1]}if(s[0][0]!==l||s[0][1]!==d||s[1][0]!==v||s[1][1]!==m){a.selection=[[l,d],[v,m]];j.call(e);M.brush()}}function z(){pm();if(Ta.touches){if(Ta.touches.length){return}if(L){clearTimeout(L)}L=setTimeout(function(){L=null},500);T.on("touchmove.brush touchend.brush touchcancel.brush",null)}else{lm(Ta.view,w);D.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null)}T.attr("pointer-events","all");B.attr("cursor",Cm.overlay);if(a.selection){s=a.selection}if(Nm(s)){a.selection=null,j.call(e)}M.end()}function O(){switch(Ta.keyCode){case 16:{C=r&&o;break}case 18:{if(i===ym){if(r){g=v-b*r,h=l+b*r}if(o){y=m-x*o,c=d+x*o}i=mm;P()}break}case 32:{if(i===ym||i===mm){if(r<0){g=v-b}else if(r>0){h=l-b}if(o<0){y=m-x}else if(o>0){c=d-x}i=_m;B.attr("cursor",Cm.selection);P()}break}default:return}gm()}function F(){switch(Ta.keyCode){case 16:{if(C){E=S=C=false;P()}break}case 18:{if(i===mm){if(r<0){g=v}else if(r>0){h=l}if(o<0){y=m}else if(o>0){c=d}i=ym;P()}break}case 32:{if(i===_m){if(Ta.altKey){if(r){g=v-b*r,h=l+b*r}if(o){y=m-x*o,c=d+x*o}i=mm}else{if(r<0){g=v}else if(r>0){h=l}if(o<0){y=m}else if(o>0){c=d}i=ym}B.attr("cursor",Cm[n]);P()}break}default:return}gm()}}function s(){var t=this.__brush||{selection:null};t.extent=e.apply(this,arguments);t.dim=R;return t}r.extent=function(t){return arguments.length?(e=typeof t==="function"?t:cm([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),r):e};r.filter=function(t){return arguments.length?(I=typeof t==="function"?t:cm(!!t),r):I};r.handleSize=function(t){return arguments.length?(i=+t,r):i};r.on=function(){var t=n.on.apply(n,arguments);return t===n?r:t};return r}var Fm=[].slice;var Rm={};function Im(t){this._size=t;this._call=this._error=null;this._tasks=[];this._data=[];this._waiting=this._active=this._ended=this._start=0}Im.prototype=Wm.prototype={constructor:Im,defer:function(t){if(typeof t!=="function"){throw new Error("invalid callback")}if(this._call){throw new Error("defer after await")}if(this._error!=null){return this}var e=Fm.call(arguments,1);e.push(t);++this._waiting,this._tasks.push(e);Lm(this);return this},abort:function(){if(this._error==null){Vm(this,new Error("abort"))}return this},await:function(n){if(typeof n!=="function"){throw new Error("invalid callback")}if(this._call){throw new Error("multiple await")}this._call=function(t,e){n.apply(null,[t].concat(e))};Um(this);return this},awaitAll:function(t){if(typeof t!=="function"){throw new Error("invalid callback")}if(this._call){throw new Error("multiple await")}this._call=t;Um(this);return this}};function Lm(e){if(!e._start){try{jm(e)}catch(t){if(e._tasks[e._ended+e._active-1]){Vm(e,t)}else if(!e._data){throw t}}}}function jm(t){while(t._start=t._waiting&&t._active<t._size){var e=t._ended+t._active,n=t._tasks[e],i=n.length-1,r=n[i];n[i]=Hm(t,e);--t._waiting,++t._active;n=r.apply(null,n);if(!t._tasks[e]){continue}t._tasks[e]=n||Rm}}function Hm(n,i){return function(t,e){if(!n._tasks[i]){return}--n._active,++n._ended;n._tasks[i]=null;if(n._error!=null){return}if(t!=null){Vm(n,t)}else{n._data[i]=e;if(n._waiting){Lm(n)}else{Um(n)}}}}function Vm(t,e){var n=t._tasks.length,i;t._error=e;t._data=undefined;t._waiting=NaN;while(--n>=0){if(i=t._tasks[n]){t._tasks[n]=null;if(i.abort){try{i.abort()}catch(e){}}}}t._active=NaN;Um(t)}function Um(t){if(!t._active&&t._call){var e=t._data;t._data=undefined;t._call(t._error,e)}}function Wm(t){if(t==null){t=Infinity}else if(!((t=+t)>=1)){throw new Error("invalid concurrency")}return new Im(t)}var qm=function(t){return function(){return t}};function Xm(t,e,n){this.target=t;this.type=e;this.transform=n}function Gm(t,e,n){this.k=t;this.x=e;this.y=n}Gm.prototype={constructor:Gm,scale:function(t){return t===1?this:new Gm(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Gm(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+")"}};var Ym=new Gm(1,0,0);$m.prototype=Gm.prototype;function $m(t){return t.__zoom||Ym}function Qm(){Ta.stopImmediatePropagation()}var Zm=function(){Ta.preventDefault();Ta.stopImmediatePropagation()};function Km(){return!Ta.button}function Jm(){var t=this,e,n;if(t instanceof SVGElement){t=t.ownerSVGElement||t;e=t.width.baseVal.value;n=t.height.baseVal.value}else{e=t.clientWidth;n=t.clientHeight}return[[0,0],[e,n]]}function tb(){return this.__zoom||Ym}function eb(){return-Ta.deltaY*(Ta.deltaMode?120:1)/500}function nb(){return"ontouchstart"in this}function ib(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var rb=function(){var u=Km,f=Jm,p=ib,o=eb,e=nb,a=[0,Infinity],g=[[-Infinity,-Infinity],[Infinity,Infinity]],s=250,c=Te,h=[],n=Ka("start","zoom","end"),v,l,d=500,_=150,y=0;function m(t){t.property("__zoom",tb).on("wheel.zoom",i).on("mousedown.zoom",r).on("dblclick.zoom",A).filter(e).on("touchstart.zoom",k).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(t,e){var n=t.selection?t.selection():t;n.property("__zoom",tb);if(t!==n){C(t,e)}else{n.interrupt().each(function(){E(this,arguments).start().zoom(null,typeof e==="function"?e.apply(this,arguments):e).end()})}};m.scaleBy=function(t,n){m.scaleTo(t,function(){var t=this.__zoom.k,e=typeof n==="function"?n.apply(this,arguments):n;return t*e})};m.scaleTo=function(t,o){m.transform(t,function(){var t=f.apply(this,arguments),e=this.__zoom,n=w(t),i=e.invert(n),r=typeof o==="function"?o.apply(this,arguments):o;return p(x(b(e,r),n,i),t,g)})};m.translateBy=function(t,e,n){m.transform(t,function(){return p(this.__zoom.translate(typeof e==="function"?e.apply(this,arguments):e,typeof n==="function"?n.apply(this,arguments):n),f.apply(this,arguments),g)})};m.translateTo=function(t,i,r){m.transform(t,function(){var t=f.apply(this,arguments),e=this.__zoom,n=w(t);return p(Ym.translate(n[0],n[1]).scale(e.k).translate(typeof i==="function"?-i.apply(this,arguments):-i,typeof r==="function"?-r.apply(this,arguments):-r),t,g)})};function b(t,e){e=Math.max(a[0],Math.min(a[1],e));return e===t.k?t:new Gm(e,t.x,t.y)}function x(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new Gm(t.k,i,r)}function w(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function C(t,h,l){t.on("start.zoom",function(){E(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).end()}).tween("zoom",function(){var t=this,e=arguments,i=E(t,e),n=f.apply(t,e),r=l||w(n),o=Math.max(n[1][0]-n[0][0],n[1][1]-n[0][1]),a=t.__zoom,s=typeof h==="function"?h.apply(t,e):h,u=c(a.invert(r).concat(o/a.k),s.invert(r).concat(o/s.k));return function(t){if(t===1){t=s}else{var e=u(t),n=o/e[2];t=new Gm(n,r[0]-e[0]*n,r[1]-e[1]*n)}i.zoom(null,t)}})}function E(t,e){for(var n=0,i=h.length,r;n<i;++n){if((r=h[n]).that===t){return r}}return new S(t,e)}function S(t,e){this.that=t;this.args=e;this.index=-1;this.active=0;this.extent=f.apply(t,e)}S.prototype={start:function(){if(++this.active===1){this.index=h.push(this)-1;this.emit("start")}return this},zoom:function(t,e){if(this.mouse&&t!=="mouse"){this.mouse[1]=e.invert(this.mouse[0])}if(this.touch0&&t!=="touch"){this.touch0[1]=e.invert(this.touch0[0])}if(this.touch1&&t!=="touch"){this.touch1[1]=e.invert(this.touch1[0])}this.that.__zoom=e;this.emit("zoom");return this},end:function(){if(--this.active===0){h.splice(this.index,1);this.index=-1;this.emit("end")}return this},emit:function(t){Ra(new Xm(m,t,this.that.__zoom),n.apply,n,[t,this.that,this.args])}};function i(){if(!u.apply(this,arguments)){return}var t=E(this,arguments),e=this.__zoom,n=Math.max(a[0],Math.min(a[1],e.k*Math.pow(2,o.apply(this,arguments)))),i=Ya(this);if(t.wheel){if(t.mouse[0][0]!==i[0]||t.mouse[0][1]!==i[1]){t.mouse[1]=e.invert(t.mouse[0]=i)}clearTimeout(t.wheel)}else if(e.k===n){return}else{t.mouse=[i,e.invert(i)];Is(this);t.start()}Zm();t.wheel=setTimeout(r,_);t.zoom("mouse",p(x(b(e,n),t.mouse[0],t.mouse[1]),t.extent,g));function r(){t.wheel=null;t.end()}}function r(){if(l||!u.apply(this,arguments)){return}var n=E(this,arguments),t=qa(Ta.view).on("mousemove.zoom",o,true).on("mouseup.zoom",a,true),e=Ya(this),i=Ta.clientX,r=Ta.clientY;hm(Ta.view);Qm();n.mouse=[e,this.__zoom.invert(e)];Is(this);n.start();function o(){Zm();if(!n.moved){var t=Ta.clientX-i,e=Ta.clientY-r;n.moved=t*t+e*e>y}n.zoom("mouse",p(x(n.that.__zoom,n.mouse[0]=Ya(n.that),n.mouse[1]),n.extent,g))}function a(){t.on("mousemove.zoom mouseup.zoom",null);lm(Ta.view,n.moved);Zm();n.end()}}function A(){if(!u.apply(this,arguments)){return}var t=this.__zoom,e=Ya(this),n=t.invert(e),i=t.k*(Ta.shiftKey?.5:2),r=p(x(b(t,i),e,n),f.apply(this,arguments),g);Zm();if(s>0){qa(this).transition().duration(s).call(C,r,e)}else{qa(this).call(m.transform,r)}}function k(){var t=this;if(!u.apply(this,arguments)){return}var e=E(this,arguments),n=Ta.changedTouches,i,r=n.length,o,a,s;Qm();for(o=0;o<r;++o){a=n[o],s=Qa(t,n,a.identifier);s=[s,t.__zoom.invert(s),a.identifier];if(!e.touch0){e.touch0=s,i=true}else if(!e.touch1){e.touch1=s}}if(v){v=clearTimeout(v);if(!e.touch1){e.end();s=qa(this).on("dblclick.zoom");if(s){s.apply(this,arguments)}return}}if(i){v=setTimeout(function(){v=null},d);Is(this);e.start()}}function M(){var t=this;var e=E(this,arguments),n=Ta.changedTouches,i=n.length,r,o,a,s;Zm();if(v){v=clearTimeout(v)}for(r=0;r<i;++r){o=n[r],a=Qa(t,n,o.identifier);if(e.touch0&&e.touch0[2]===o.identifier){e.touch0[0]=a}else if(e.touch1&&e.touch1[2]===o.identifier){e.touch1[0]=a}}o=e.that.__zoom;if(e.touch1){var u=e.touch0[0],h=e.touch0[1],l=e.touch1[0],f=e.touch1[1],c=(c=l[0]-u[0])*c+(c=l[1]-u[1])*c,d=(d=f[0]-h[0])*d+(d=f[1]-h[1])*d;o=b(o,Math.sqrt(c/d));a=[(u[0]+l[0])/2,(u[1]+l[1])/2];s=[(h[0]+f[0])/2,(h[1]+f[1])/2]}else if(e.touch0){a=e.touch0[0],s=e.touch0[1]}else{return}e.zoom("touch",p(x(o,a,s),e.extent,g))}function T(){var t=E(this,arguments),e=Ta.changedTouches,n=e.length,i,r;Qm();if(l){clearTimeout(l)}l=setTimeout(function(){l=null},d);for(i=0;i<n;++i){r=e[i];if(t.touch0&&t.touch0[2]===r.identifier){delete t.touch0}else if(t.touch1&&t.touch1[2]===r.identifier){delete t.touch1}}if(t.touch1&&!t.touch0){t.touch0=t.touch1,delete t.touch1}if(t.touch0){t.touch0[1]=this.__zoom.invert(t.touch0[0])}else{t.end()}}m.wheelDelta=function(t){return arguments.length?(o=typeof t==="function"?t:qm(+t),m):o};m.filter=function(t){return arguments.length?(u=typeof t==="function"?t:qm(!!t),m):u};m.touchable=function(t){return arguments.length?(e=typeof t==="function"?t:qm(!!t),m):e};m.extent=function(t){return arguments.length?(f=typeof t==="function"?t:qm([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):f};m.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],m):[a[0],a[1]]};m.translateExtent=function(t){return arguments.length?(g[0][0]=+t[0][0],g[1][0]=+t[1][0],g[0][1]=+t[0][1],g[1][1]=+t[1][1],m):[[g[0][0],g[0][1]],[g[1][0],g[1][1]]]};m.constrain=function(t){return arguments.length?(p=t,m):p};m.duration=function(t){return arguments.length?(s=+t,m):s};m.interpolate=function(t){return arguments.length?(c=t,m):c};m.on=function(){var t=n.on.apply(n,arguments);return t===n?m:t};m.clickDistance=function(t){return arguments.length?(y=(t=+t)*t,m):Math.sqrt(y)};return m};var ob=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function ab(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function sb(t,e){return e={exports:{}},t(e,e.exports),e.exports}var ub=sb(function(n){(function(t,e){"use strict";{n.exports=e()}})(typeof window==="object"?window:ob,function(){"use strict";var r=void 0;function e(t){if(!(this instanceof e)){return new e(t)}this._LRUCacheState=new n(t)}var t=e.prototype;t.get=function(t){var e=this._LRUCacheState;var n=e.hash[t];if(!n){return}a(e.linkedList,n);return e.data[t]};t.set=function(t,e){var n=this._LRUCacheState;var i=n.hash[t];if(e===r){return this}if(!i){n.hash[t]=new o(t);n.linkedList.length+=1;i=n.hash[t]}a(n.linkedList,i);n.data[t]=e;if(n.linkedList.length>n.capacity){this.remove(n.linkedList.end.key)}return this};t.update=function(t,e){if(this.has(t)){this.set(t,e(this.get(t)))}return this};t.remove=function(t){var e=this._LRUCacheState;var n=e.hash[t];if(!n){return this}if(n===e.linkedList.head){e.linkedList.head=n.p}if(n===e.linkedList.end){e.linkedList.end=n.n}s(n.n,n.p);delete e.hash[t];delete e.data[t];e.linkedList.length-=1;return this};t.removeAll=function(){this._LRUCacheState=new n(this._LRUCacheState.capacity);return this};t.info=function(){var t=this._LRUCacheState;return{capacity:t.capacity,length:t.linkedList.length}};t.keys=function(){var t=[];var e=this._LRUCacheState.linkedList.head;while(e){t.push(e.key);e=e.p}return t};t.has=function(t){return!!this._LRUCacheState.hash[t]};t.staleKey=function(){return this._LRUCacheState.linkedList.end&&this._LRUCacheState.linkedList.end.key};t.popStale=function(){var t=this.staleKey();if(!t){return null}var e=[t,this._LRUCacheState.data[t]];this.remove(t);return e};function n(t){this.capacity=t>0?+t:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE;this.data=Object.create?Object.create(null):{};this.hash=Object.create?Object.create(null):{};this.linkedList=new i}function i(){this.length=0;this.head=null;this.end=null}function o(t){this.key=t;this.p=null;this.n=null}function a(t,e){if(e===t.head){return}if(!t.end){t.end=e}else if(t.end===e){t.end=e.n}s(e.n,e.p);s(e,t.head);t.head=e;t.head.n=null}function s(t,e){if(t===e){return}if(t){t.p=e}if(e){e.n=t}}return e})});var hb=function(t){function e(){t.call(this);this._buttonStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px",margin:"0 5px"};this._data=[];this._text=ju("text");this._value=ju("value")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.render=function t(){var n=this;if(this._container===void 0){this.container(qa("body").append("div").node())}var e=this._container.selectAll("div#d3plus-Form-"+this._uuid).data([0]);var i=this._container.node().tagName.toLowerCase()==="foreignobject";e=e.enter().append(i?"xhtml:div":"div").attr("id","d3plus-Form-"+this._uuid).attr("class","d3plus-Form d3plus-Form-Button").merge(e);var r=e.selectAll("button").data(this._data,function(t,e){return n._value(t,e)});r.exit().remove();r=r.enter().append("button").attr("class","d3plus-Button").attr("type","button").merge(r).call(nh,this._buttonStyle).html(function(t,e){return n._text(t,e)});for(var o in n._on){if({}.hasOwnProperty.call(n._on,o)){r.on(o,n._on[o])}}return this};e.prototype.buttonStyle=function t(e){return arguments.length?(this._buttonStyle=e,this):this._buttonStyle};e.prototype.container=function t(e){return arguments.length?(this._container=qa(e),this):this._container};e.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};e.prototype.text=function t(e){return arguments.length?(this._text=typeof e==="function"?e:Zu(e),this):this._text};e.prototype.value=function t(e){return arguments.length?(this._value=e,this):this._value};return e}(Yu);var lb=function(t){function e(){t.call(this);this._labelStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px","padding-right":"5px"};this._legendStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px","padding-right":"5px"};this._options=[];this._radioStyle={"margin-right":"10px"};this._text=ju("text");this._value=ju("value")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.render=function t(){var n=this;if(this._container===void 0){this.container(qa("body").append("div").node())}var o=this;var e=this._container.selectAll("div#d3plus-Form-"+this._uuid).data([0]);var i=this._container.node().tagName.toLowerCase()==="foreignobject";e=e.enter().append(i?"xhtml:div":"div").attr("id","d3plus-Form-"+this._uuid).attr("class","d3plus-Form d3plus-Form-Radio").merge(e);var a=e.selectAll("label").data(this._options,function(t,e){return n._value(t,e)});a.exit().each(function(){qa(this.nextSibling).remove()}).remove();a=a.enter().append("label").attr("class","d3plus-Label").attr("for",function(t,e){return n._uuid+"-"+n._value(t,e)}).each(function(t,e){var n=document.createElement("input");n.setAttribute("type","radio");n.setAttribute("name","d3plus-Radio-"+o._uuid);n.setAttribute("id",o._uuid+"-"+o._value(t,e));n.setAttribute("value",o._value(t,e));this.parentNode.insertBefore(n,this.nextSibling)}).merge(a).call(nh,this._labelStyle).html(function(t,e){return n._text(t,e)}).each(function(t,e){var n=o._checked===void 0?!e:""+o._value(t,e)===""+o._checked;qa(this).classed("active",n).style("cursor",n?"default":"pointer");var i=qa(this.nextSibling).property("checked",n).call(nh,o._radioStyle).style("cursor",n?"default":"pointer").on("change.d3plus",function(){o.checked(this.value);a.each(function(t,e){var n=""+o._value(t,e)===""+o._checked;qa(this).classed("active",n).style("cursor",n?"default":"pointer");qa(this.nextSibling).style("cursor",n?"default":"pointer")})});for(var r in o._on){if({}.hasOwnProperty.call(o._on,r)){i.on(r,o._on[r])}}});var r=e.selectAll("legend#d3plus-Legend-"+this._uuid).data(this._legend?[0]:[]);r.exit().remove();r.enter().insert("legend",".d3plus-Label").attr("id","d3plus-Legend-"+this._uuid).attr("class","d3plus-Legend").merge(r).call(nh,this._legendStyle).html(this._legend);return this};e.prototype.checked=function t(e){return arguments.length?(this._checked=e,this):this._checked};e.prototype.container=function t(e){return arguments.length?(this._container=qa(e),this):this._container};e.prototype.labelStyle=function t(e){return arguments.length?(this._labelStyle=e,this):this._labelStyle};e.prototype.legend=function t(e){return arguments.length?(this._legend=e,this):this._legend};e.prototype.legendStyle=function t(e){return arguments.length?(this._legendStyle=e,this):this._legendStyle};e.prototype.options=function t(e){return arguments.length?(this._options=e,this):this._options};e.prototype.radioStyle=function t(e){return arguments.length?(this._radioStyle=e,this):this._radioStyle};e.prototype.text=function t(e){return arguments.length?(this._text=typeof e==="function"?e:Zu(e),this):this._text};e.prototype.value=function t(e){return arguments.length?(this._value=e,this):this._value};return e}(Yu);var fb=function(t){function e(){t.call(this);this._labelStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px","margin-right":"5px"};this._options=[];this._optionStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px"};this._selectStyle={background:"#fafafa",border:"1px solid #ccc","border-radius":"0","font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px",outline:"0",padding:"3px 5px 4px"};this._text=ju("text");this._value=ju("value")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.render=function t(){var n=this;if(this._container===void 0){this.container(o("body").append("div").node())}var e=this;var i=this._container.selectAll("div#d3plus-Form-"+this._uuid).data([0]);var r=this._container.node().tagName.toLowerCase()==="foreignobject";i=i.enter().append(r?"xhtml:div":"div").attr("id","d3plus-Form-"+this._uuid).attr("class","d3plus-Form d3plus-Form-Select").merge(i);var o=i.selectAll("select#d3plus-Select-"+this._uuid).data([0]);o=o.enter().append("select").attr("id","d3plus-Select-"+this._uuid).attr("class","d3plus-Select").merge(o).call(nh,this._selectStyle).on("change.d3plus",function(){e.selected(this.value)});for(var a in n._on){if({}.hasOwnProperty.call(n._on,a)){o.on(a,n._on[a])}}var s=o.selectAll("option").data(this._options,function(t,e){return n._value(t,e)});s.exit().remove();s.enter().append("option").attr("class","d3plus-Option").merge(s).call(nh,this._optionStyle).attr("value",function(t,e){return n._value(t,e)}).html(function(t,e){return n._text(t,e)}).property("selected",function(t,e){return n._selected===void 0?!e:""+n._value(t,e)===""+n._selected});var u=i.selectAll("label#d3plus-Label-"+this._uuid).data(this._label?[0]:[]);u.exit().remove();u.enter().insert("label","#d3plus-Select-"+this._uuid).attr("id","d3plus-Label-"+this._uuid).attr("class","d3plus-Label").attr("for","d3plus-Select-"+this._uuid).merge(u).call(nh,this._labelStyle).html(this._label);return this};e.prototype.container=function t(e){return arguments.length?(this._container=qa(e),this):this._container};e.prototype.label=function t(e){return arguments.length?(this._label=e,this):this._label};e.prototype.labelStyle=function t(e){return arguments.length?(this._labelStyle=e,this):this._labelStyle};e.prototype.options=function t(e){return arguments.length?(this._options=e,this):this._options};e.prototype.optionStyle=function t(e){return arguments.length?(this._optionStyle=e,this):this._optionStyle};e.prototype.selected=function t(e){return arguments.length?(this._selected=e,this):this._selected};e.prototype.selectStyle=function t(e){return arguments.length?(this._selectStyle=e,this):this._selectStyle};e.prototype.text=function t(e){return arguments.length?(this._text=typeof e==="function"?e:Zu(e),this):this._text};e.prototype.value=function t(e){return arguments.length?(this._value=e,this):this._value};return e}(Yu);function cb(t){return t.slice().sort(function(t,e){return t-e})}function db(t){var e,n=0;for(var i=0;i<t.length;i++){if(i===0||t[i]!==e){e=t[i];n++}}return n}function pb(t,e){var n=[];for(var i=0;i<t;i++){var r=[];for(var o=0;o<e;o++){r.push(0)}n.push(r)}return n}function gb(t,e,n,i){var r;if(t>0){var o=(n[e]-n[t-1])/(e-t+1);r=i[e]-i[t-1]-(e-t+1)*o*o}else{r=i[e]-n[e]*n[e]/(e+1)}if(r<0){return 0}return r}function vb(t,e,n,i,r,o,a){if(t>e){return}var s=Math.floor((t+e)/2);i[n][s]=i[n-1][s-1];r[n][s]=s;var u=n;if(t>n){u=Math.max(u,r[n][t-1]||0)}u=Math.max(u,r[n-1][s]||0);var h=s-1;if(e<i.length-1){h=Math.min(h,r[n][e+1]||0)}for(var l=h;l>=u;--l){var f=gb(l,s,o,a);if(f+i[n-1][u-1]>=i[n][s]){break}var c=gb(u,s,o,a);var d=c+i[n-1][u-1];if(d<i[n][s]){i[n][s]=d;r[n][s]=u}u++;var p=f+i[n-1][l-1];if(p<i[n][s]){i[n][s]=p;r[n][s]=l}}vb(t,s-1,n,i,r,o,a);vb(s+1,e,n,i,r,o,a)}function _b(t,e,n){var i=e[0].length;var r=t[Math.floor(i/2)];var o=[];var a=[];for(var s=0,u=void 0;s<i;++s){u=t[s]-r;if(s===0){o.push(u);a.push(u*u)}else{o.push(o[s-1]+u);a.push(a[s-1]+u*u)}e[0][s]=gb(0,s,o,a);n[0][s]=0}for(var h=1;h<e.length;++h){var l=i-1;if(h<e.length-1){l=h}vb(l,i-1,h,e,n,o,a)}}var yb=function(t,e){if(e>t.length){throw new Error("Cannot generate more classes than there are data values")}var n=cb(t);var i=db(n);if(i===1){return[n]}var r=pb(e,n.length),o=pb(e,n.length);_b(n,o,r);var a=r[0].length-1;var s=[];for(var u=r.length-1;u>=0;u--){var h=r[u][a];s[u]=n.slice(h,a+1);if(u>0){a=h-1}}return s};var mb=function(t){function e(){t.call(this);this._axisClass=new Cd;this._axisConfig={gridSize:0};this._axisTest=new Cd;this._align="middle";this._color="#0C8040";this._data=[];this._duration=600;this._height=200;this._orient="bottom";this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._rectClass=new bd;this._rectConfig={stroke:"#000",strokeWidth:1};this._scale="linear";this._size=10;this._value=ju("value");this._width=400}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.render=function t(e){var n=this;var i;if(this._select===void 0){this.select(qa("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}var r=["bottom","top"].includes(this._orient);var o=r?"height":"width",a=r?"width":"height",s=r?"x":"y",u=r?"y":"x";this._group=Ku("g.d3plus-ColorScale",{parent:this._select});var h=Ht(this._data,this._value);var l=this._color,f,c;if(!(l instanceof Array)){l=[wh(l,.9),wh(l,.75),wh(l,.5),wh(l,.25),l]}if(this._scale==="jenks"){var d=this._data.map(this._value).filter(function(t){return t!==null&&typeof t==="number"});if(d.length<=l.length){var p=vn().domain(Vt(0,d.length-1)).interpolate(De).range(l);l=d.slice(0,d.length-1).map(function(t,e){return p(e)})}var g=yb(d,l.length);c=Wt(g.map(function(t,e){return e===g.length-1?[t[0],t[t.length-1]]:[t[0]]}));var v=new Set(c);if(c.length!==v.size){f=Array.from(v)}this._colorScale=Dn().domain(c).range(["black"].concat(l).concat(l[l.length-1]))}else{var _=(h[1]-h[0])/(l.length-1);var y=Vt(h[0],h[1]+_/2,_);if(this._scale==="buckets"){c=y}this._colorScale=vn().domain(y).range(l)}var m=Object.assign({domain:r?h:h.reverse(),duration:this._duration,height:this._height,labels:f||c,orient:this._orient,padding:this._padding,ticks:c,width:this._width},this._axisConfig);this._axisTest.select(Ku("g.d3plus-ColorScale-axisTest",{enter:{opacity:0},parent:this._group}).node()).config(m).render();var b=this._axisTest.outerBounds();this._outerBounds[a]=this["_"+a]-this._padding*2;this._outerBounds[o]=b[o]+this._size;this._outerBounds[s]=this._padding;this._outerBounds[u]=this._padding;if(this._align==="middle"){this._outerBounds[u]=(this["_"+o]-this._outerBounds[o])/2}else if(this._align==="end"){this._outerBounds[u]=this["_"+o]-this._padding-this._outerBounds[o]}var x=this._outerBounds[u]+(["bottom","right"].includes(this._orient)?this._size:0)-(m.padding||this._axisClass.padding());this._axisClass.select(Ku("g.d3plus-ColorScale-axis",{parent:this._group,update:{transform:"translate("+(r?0:x)+", "+(r?x:0)+")"}}).node()).config(m).align("start").render();var w=this._axisTest._getPosition.bind(this._axisTest);var C=this._axisTest._getRange();var E=this._group.selectAll("defs").data([0]);var S=E.enter().append("defs");S.append("linearGradient").attr("id","gradient-"+this._uuid);E=S.merge(E);E.select("linearGradient").attr(s+"1",r?"0%":"100%").attr(s+"2",r?"100%":"0%").attr(u+"1","0%").attr(u+"2","0%");var A=E.select("linearGradient").selectAll("stop").data(l);A.enter().append("stop").merge(A).attr("offset",function(t,e){return e/(l.length-1)*100+"%"}).attr("stop-color",String);function k(t,e){var n=Math.abs(w(c[e+1])-w(t));return n||2}this._rectClass.data(c?c.slice(0,c.length-1):[0]).id(function(t,e){return e}).select(Ku("g.d3plus-ColorScale-Rect",{parent:this._group}).node()).config((i={fill:c?function(t){return n._colorScale(t)}:"url(#gradient-"+this._uuid+")"},i[s]=c?function(t,e){return w(t)+k(t,e)/2-(["left","right"].includes(n._orient)?k(t,e):0)}:C[0]+(C[1]-C[0])/2,i[u]=this._outerBounds[u]+(["top","left"].includes(this._orient)?b[o]:0)+this._size/2,i[a]=c?k:C[1]-C[0],i[o]=this._size,i)).config(this._rectConfig).render();if(e){setTimeout(e,this._duration+100)}return this};e.prototype.axisConfig=function t(e){return arguments.length?(this._axisConfig=Object.assign(this._axisConfig,e),this):this._axisConfig};e.prototype.align=function t(e){return arguments.length?(this._align=e,this):this._align};e.prototype.color=function t(e){return arguments.length?(this._color=e,this):this._color};e.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};e.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};e.prototype.height=function t(e){return arguments.length?(this._height=e,this):this._height};e.prototype.orient=function t(e){return arguments.length?(this._orient=e,this):this._orient};e.prototype.outerBounds=function t(){return this._outerBounds};e.prototype.padding=function t(e){return arguments.length?(this._padding=e,this):this._padding};e.prototype.rectConfig=function t(e){return arguments.length?(this._rectConfig=Object.assign(this._rectConfig,e),this):this._rectConfig};e.prototype.scale=function t(e){return arguments.length?(this._scale=e,this):this._scale};e.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};e.prototype.size=function t(e){return arguments.length?(this._size=e,this):this._size};e.prototype.value=function t(e){return arguments.length?(this._value=typeof e==="function"?e:Zu(e),this):this._value};e.prototype.width=function t(e){return arguments.length?(this._width=e,this):this._width};return e}(Yu);var bb=function(t){function e(){var a=this;t.call(this);this._align="center";this._data=[];this._direction="row";this._duration=600;this._height=200;this._id=ju("id");this._label=ju("id");this._lineData=[];this._outerBounds={width:0,height:0,x:0,y:0};this._padding=5;this._shape=Zu("Rect");this._shapes=[];this._shapeConfig={duration:this._duration,fill:ju("color"),height:Zu(10),hitArea:function(t,e){var n=a._lineData[e],i=Ut([n.height,n.shapeHeight]);return{width:n.width+n.shapeWidth,height:i,x:-n.shapeWidth/2,y:-i/2}},labelBounds:function(t,e,n){var i=a._lineData[e],r=n.r!==void 0?n.r:n.width/2;return{width:i.width,height:i.height,x:r+a._padding,y:-i.height/2+(i.lh-i.s)/2+1}},labelConfig:{fontColor:Zu("#444"),fontFamily:(new Ac).fontFamily(),fontResize:false,fontSize:Zu(10)},opacity:1,r:Zu(5),width:Zu(10),x:function(t,e){var n=a._lineData[e];var i=n.y;var r=a._align==="left"||a._align==="right"&&a._direction==="column"?0:a._align==="center"?(a._outerBounds.width-a._rowWidth(a._lineData.filter(function(t){return i===t.y})))/2:a._outerBounds.width-a._rowWidth(a._lineData.filter(function(t){return i===t.y}));var o=a._lineData.slice(0,e).filter(function(t){return i===t.y});return a._rowWidth(o)+a._padding*(o.length?n.sentence?2:1:0)+a._outerBounds.x+n.shapeWidth/2+r},y:function(t,e){var n=a._lineData[e];return n.y+a._titleHeight+a._outerBounds.y+Ut(a._lineData.filter(function(t){return n.y===t.y}).map(function(t){return t.height}).concat(a._data.map(function(t,e){return a._fetchConfig("height",t,e)})))/2}};this._titleClass=new Ac;this._titleConfig={};this._verticalAlign="middle";this._width=400}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype._fetchConfig=function t(e,n,i){var r=this._shapeConfig[e]||this._shapeConfig.labelConfig[e];if(!r&&e==="lineHeight"){return this._fetchConfig("fontSize",n,i)*1.4}return typeof r==="function"?r(n,i):r};e.prototype._rowHeight=function t(e){return Ut(e.map(function(t){return t.height}).concat(e.map(function(t){return t.shapeHeight})))+this._padding};e.prototype._rowWidth=function t(i){var r=this;return Xt(i.map(function(t,e){var n=r._padding*(e===i.length-1?0:t.width?2:1);return t.shapeWidth+t.width+n}))};e.prototype.render=function t(e){var h=this;if(this._select===void 0){this.select(qa("body").append("svg").attr("width",this._width+"px").attr("height",this._height+"px").node())}this._group=Ku("g.d3plus-Legend",{parent:this._select});var l=this._height;this._titleHeight=0;if(this._title){var n=this._titleConfig.fontFamily||this._titleClass.fontFamily()(),i=this._titleConfig.fontSize||this._titleClass.fontSize()();var r=r=this._titleConfig.lineHeight||this._titleClass.lineHeight();r=r?r():i*1.4;var o=Sc().fontFamily(n).fontSize(i).lineHeight(r).width(this._width).height(this._height)(this._title);this._titleHeight=r+o.lines.length+this._padding;l-=this._titleHeight}this._lineData=this._data.map(function(t,e){var n=h._label(t,e);var i={data:t,i:e,id:h._id(t,e),shapeWidth:h._fetchConfig("width",t,e),shapeHeight:h._fetchConfig("height",t,e),y:0};if(!n){i.sentence=false;i.words=[];i.height=0;i.width=0;return i}var r=h._fetchConfig("fontFamily",t,e),o=h._fetchConfig("lineHeight",t,e),a=h._fetchConfig("fontSize",t,e);var s=l-(h._data.length+1)*h._padding,u=h._width;i=Object.assign(i,Sc().fontFamily(r).fontSize(a).lineHeight(o).width(u).height(s)(n));i.width=Math.ceil(Ut(i.lines.map(function(t){return Gf(t,{"font-family":r,"font-size":a})})))+a*.75;i.height=Math.ceil(i.lines.length*(o+1));i.og={height:i.height,width:i.width};i.f=r;i.s=a;i.lh=o;return i});var a;var s=this._width-this._padding*2;a=this._rowWidth(this._lineData);if(this._direction==="column"||a>s){var u=1,f=[];var c=Ut(this._lineData.map(function(t){return t.words.length}));this._wrapLines=function(){var e=this;u++;if(u>c){return}var o=u===1?this._lineData.slice():this._lineData.filter(function(t){return t.width+t.shapeWidth+e._padding*(t.width?2:1)>s&&t.words.length>=u}).sort(function(t,e){return e.sentence.length-t.sentence.length});if(o.length&&l>o[0].height*u){var a=false;var t=function(t){var e=o[t];var n=e.og.height*u,i=e.og.width*(1.5*(1/u));var r=Sc().fontFamily(e.f).fontSize(e.s).lineHeight(e.lh).width(i).height(n)(e.sentence);if(!r.truncated){e.width=Math.ceil(Ut(r.lines.map(function(t){return Gf(t,{"font-family":e.f,"font-size":e.s})})))+e.s;e.height=r.lines.length*(e.lh+1)}else{a=true;return"break"}};for(var n=0;n<o.length;n++){var i=t(n);if(i==="break"){break}}if(!a){this._wrapRows()}}else{f=[];return}};this._wrapRows=function(){var t=this;f=[];var e=1,n=0;for(var i=0;i<this._lineData.length;i++){var r=t._lineData[i],o=r.width+t._padding*(r.width?2:1)+r.shapeWidth;if(Xt(f.map(function(t){return Ut(t,function(t){return Ut([t.height,t.shapeHeight])})}))>l){f=[];break}if(o>s){f=[];t._wrapLines();break}else if(n+o<s){n+=o}else if(t._direction!=="column"){n=o;e++}if(!f[e-1]){f[e-1]=[]}f[e-1].push(r);if(t._direction==="column"){n=0;e++}}};this._wrapRows();if(!f.length||Xt(f,this._rowHeight.bind(this))+this._padding>l){a=Xt(this._lineData.map(function(t){return t.shapeWidth+h._padding}))-this._padding;for(var d=0;d<this._lineData.length;d++){h._lineData[d].width=0;h._lineData[d].height=0}this._wrapRows()}if(f.length&&Xt(f,this._rowHeight.bind(this))+this._padding<l){f.forEach(function(t,e){t.forEach(function(t){if(e){t.y=Xt(f.slice(0,e),h._rowHeight.bind(h))}})});a=Ut(f,this._rowWidth.bind(this))}}var p=Ut(this._lineData,function(t,e){return Ut([t.height,h._fetchConfig("height",t.data,e)])+t.y})+this._titleHeight,g=a;this._outerBounds.width=g;this._outerBounds.height=p;var v=this._padding,_=this._padding;if(this._align==="center"){v=(this._width-g)/2}else if(this._align==="right"){v=this._width-this._padding-g}if(this._verticalAlign==="middle"){_=(this._height-p)/2}else if(this._verticalAlign==="bottom"){_=this._height-this._padding-p}this._outerBounds.x=v;this._outerBounds.y=_;this._titleClass.data(this._title?[{text:this._title}]:[]).duration(this._duration).select(this._group.node()).textAnchor({left:"start",center:"middle",right:"end"}[this._align]).width(this._width-this._padding*2).x(this._padding).y(this._outerBounds.y).config(this._titleConfig).render();this._shapes=[];var y=Qu.bind(this)(this._shapeConfig,"legend"),m={id:function(t){return t.id},label:function(t){return t.label},lineHeight:function(t){return t.lH}};var b=this._data.map(function(t,e){var n={__d3plus__:true,data:t,i:e,id:h._id(t,e),label:h._lineData[e].width?h._label(t,e):false,lH:h._fetchConfig("lineHeight",t,e),shape:h._shape(t,e)};return n});this._shapes=[];["Circle","Rect"].forEach(function(e){h._shapes.push((new xd[e]).data(b.filter(function(t){return t.shape===e})).duration(h._duration).labelConfig({padding:0}).select(h._group.node()).verticalAlign("top").config(Vu({},y,m)).render())});if(e){setTimeout(e,this._duration+100)}return this};e.prototype.active=function t(e){this._shapes.forEach(function(t){return t.active(e)});return this};e.prototype.align=function t(e){return arguments.length?(this._align=e,this):this._align};e.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};e.prototype.direction=function t(e){return arguments.length?(this._direction=e,this):this._direction};e.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};e.prototype.height=function t(e){return arguments.length?(this._height=e,this):this._height};e.prototype.hover=function t(e){this._shapes.forEach(function(t){return t.hover(e)});return this};e.prototype.id=function t(e){return arguments.length?(this._id=e,this):this._id};e.prototype.label=function t(e){return arguments.length?(this._label=typeof e==="function"?e:Zu(e),this):this._label};e.prototype.outerBounds=function t(){return this._outerBounds};e.prototype.padding=function t(e){return arguments.length?(this._padding=e,this):this._padding};e.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};e.prototype.shape=function t(e){return arguments.length?(this._shape=typeof e==="function"?e:Zu(e),this):this._shape};e.prototype.shapeConfig=function t(e){return arguments.length?(this._shapeConfig=Vu(this._shapeConfig,e),this):this._shapeConfig};e.prototype.title=function t(e){return arguments.length?(this._title=e,this):this._title};e.prototype.titleConfig=function t(e){return arguments.length?(this._titleConfig=Vu(this._titleConfig,e),this):this._titleConfig};e.prototype.verticalAlign=function t(e){return arguments.length?(this._verticalAlign=e,this):this._verticalAlign};e.prototype.width=function t(e){return arguments.length?(this._width=e,this):this._width};return e}(Yu);var xb=function(l){function t(){var e=this;l.call(this);this._brushing=true;this._brushFilter=function(){return!Ta.button&&Ta.detail<2};this._domain=[2001,2010];this._gridSize=0;this._handleConfig={fill:"#444"};this._handleSize=6;this._height=100;this._on={};this.orient("bottom");this._scale="time";this._selectionConfig={fill:"#777","stroke-width":0};this._shape="Rect";this._shapeConfig=Object.assign({},this._shapeConfig,{height:function(t){return t.tick?10:0},width:function(t){return t.tick?e._domain.map(function(t){return wd(t).getTime()}).includes(t.id)?2:1:0}});this._snapping=true}if(l){t.__proto__=l}t.prototype=Object.create(l&&l.prototype);t.prototype.constructor=t;t.prototype._brushBrush=function t(){if(Ta.sourceEvent&&Ta.sourceEvent.offsetX&&Ta.selection!==null&&(!this._brushing||this._snapping)){var e=(this._brushing?Ta.selection:[Ta.selection[0],Ta.selection[0]]).map(this._d3Scale.invert).map(Number);var n=this._availableTicks.map(Number);e[0]=wd($u(e[0],n));e[1]=wd($u(e[1],n));var i=+e[0]===+e[1];this._selection=i?e[0]:e;var r=e.map(this._d3Scale);if(i){r[0]-=.1;r[1]+=.1}this._brushGroup.call(this._brush.move,r)}this._brushStyle();if(this._on.brush){this._on.brush(this._selection)}};t.prototype._brushEnd=function t(){if(!Ta.sourceEvent){return}var e=(Ta.selection&&this._brushing?Ta.selection:[Ta.sourceEvent.offsetX,Ta.sourceEvent.offsetX]).map(this._d3Scale.invert).map(Number);var n=this._availableTicks.map(Number);e[0]=wd($u(e[0],n));e[1]=wd($u(e[1],n));var i=+e[0]===+e[1];if(this._brushing||!this._snapping){var r=e.map(this._d3Scale);if(i){r[0]-=.1;r[1]+=.1}this._brushGroup.transition(this._transition).call(this._brush.move,r)}this._brushStyle();this._selection=i?e[0]:e;if(this._on.end){this._on.end(this._selection)}};t.prototype._brushStart=function t(){if(Ta.sourceEvent!==null&&(!this._brushing||this._snapping)){var e=(Ta.selection&&this._brushing?Ta.selection:[Ta.sourceEvent.offsetX,Ta.sourceEvent.offsetX]).map(this._d3Scale.invert).map(Number);var n=this._availableTicks.map(Number);e[0]=wd($u(e[0],n));e[1]=wd($u(e[1],n));var i=+e[0]===+e[1];var r=e.map(this._d3Scale);if(i){r[0]-=.1;r[1]+=.1}this._brushGroup.call(this._brush.move,r)}this._brushStyle();if(this._on.start){this._on.start()}};t.prototype._brushStyle=function t(){var e=this._position;var n=e.height;var i=this._shape==="Circle"?typeof this._shapeConfig.r==="function"?this._shapeConfig.r({tick:true})*2:this._shapeConfig.r:this._shape==="Rect"?typeof this._shapeConfig[n]==="function"?this._shapeConfig[n]({tick:true}):this._shapeConfig[n]:this._tickSize;this._brushGroup.selectAll(".overlay").attr("cursor",this._brushing?"crosshair":"pointer");this._brushGroup.selectAll(".selection").call(Uu,this._selectionConfig).attr("height",i);this._brushGroup.selectAll(".handle").call(Uu,this._handleConfig).attr("height",i+this._handleSize)};t.prototype.render=function t(e){l.prototype.render.call(this,e);var n=this._position;var i=n.height;var r=n.y;var o=this._outerBounds[r],a=this._d3Scale.range();var s=this._brush=Pm().extent([[a[0],o],[a[1],o+this._outerBounds[i]]]).filter(this._brushFilter).handleSize(this._handleSize).on("start",this._brushStart.bind(this)).on("brush",this._brushBrush.bind(this)).on("end",this._brushEnd.bind(this));var u=this._availableTicks[this._availableTicks.length-1];var h=(this._selection===void 0?[u,u]:this._selection instanceof Array?this._selection.slice():[this._selection,this._selection]).map(wd).map(this._d3Scale);if(h[0]===h[1]){h[0]-=.1;h[1]+=.1}this._brushGroup=Ku("g.brushGroup",{parent:this._group});this._brushGroup.call(s).transition(this._transition).call(s.move,h);this._outerBounds.y-=this._handleSize/2;this._outerBounds.height+=this._handleSize/2;return this};t.prototype.brushing=function t(e){return arguments.length?(this._brushing=e,this):this._brushing};t.prototype.brushFilter=function t(e){return arguments.length?(this._brushFilter=e,this):this._brushFilter};t.prototype.handleConfig=function t(e){return arguments.length?(this._handleConfig=Object.assign(this._handleConfig,e),this):this._handleConfig};t.prototype.handleSize=function t(e){return arguments.length?(this._handleSize=e,this):this._handleSize};t.prototype.on=function t(e,n){return arguments.length===2?(this._on[e]=n,this):arguments.length?typeof e==="string"?this._on[e]:(this._on=Object.assign({},this._on,e),this):this._on};t.prototype.selectionConfig=function t(e){return arguments.length?(this._selectionConfig=Object.assign(this._selectionConfig,e),this):this._selectionConfig};t.prototype.selection=function t(e){return arguments.length?(this._selection=e,this):this._selection};t.prototype.snapping=function t(e){return arguments.length?(this._snapping=e,this):this._snapping};return t}(Cd);
|
||
/**!
|
||
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
||
* @version 1.14.3
|
||
* @license
|
||
* Copyright (c) 2016 Federico Zivolo and contributors
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/var wb=typeof window!=="undefined"&&typeof document!=="undefined";var Cb=["Edge","Trident","Firefox"];var Eb=0;for(var Sb=0;Sb<Cb.length;Sb+=1){if(wb&&navigator.userAgent.indexOf(Cb[Sb])>=0){Eb=1;break}}function Ab(t){var e=false;return function(){if(e){return}e=true;window.Promise.resolve().then(function(){e=false;t()})}}function kb(t){var e=false;return function(){if(!e){e=true;setTimeout(function(){e=false;t()},Eb)}}}var Mb=wb&&window.Promise;var Tb=Mb?Ab:kb;function Bb(t){var e={};return t&&e.toString.call(t)==="[object Function]"}function Db(t,e){if(t.nodeType!==1){return[]}var n=getComputedStyle(t,null);return e?n[e]:n}function Nb(t){if(t.nodeName==="HTML"){return t}return t.parentNode||t.host}function Pb(t){if(!t){return document.body}switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=Db(t),n=e.overflow,i=e.overflowX,r=e.overflowY;if(/(auto|scroll|overlay)/.test(n+r+i)){return t}return Pb(Nb(t))}var zb=wb&&!!(window.MSInputMethodContext&&document.documentMode);var Ob=wb&&/MSIE 10/.test(navigator.userAgent);function Fb(t){if(t===11){return zb}if(t===10){return Ob}return zb||Ob}function Rb(t){if(!t){return document.documentElement}var e=Fb(10)?document.body:null;var n=t.offsetParent;while(n===e&&t.nextElementSibling){n=(t=t.nextElementSibling).offsetParent}var i=n&&n.nodeName;if(!i||i==="BODY"||i==="HTML"){return t?t.ownerDocument.documentElement:document.documentElement}if(["TD","TABLE"].indexOf(n.nodeName)!==-1&&Db(n,"position")==="static"){return Rb(n)}return n}function Ib(t){var e=t.nodeName;if(e==="BODY"){return false}return e==="HTML"||Rb(t.firstElementChild)===t}function Lb(t){if(t.parentNode!==null){return Lb(t.parentNode)}return t}function jb(t,e){if(!t||!t.nodeType||!e||!e.nodeType){return document.documentElement}var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING;var i=n?t:e;var r=n?e:t;var o=document.createRange();o.setStart(i,0);o.setEnd(r,0);var a=o.commonAncestorContainer;if(t!==a&&e!==a||i.contains(r)){if(Ib(a)){return a}return Rb(a)}var s=Lb(t);if(s.host){return jb(s.host,e)}else{return jb(t,Lb(e).host)}}function Hb(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"top";var n=e==="top"?"scrollTop":"scrollLeft";var i=t.nodeName;if(i==="BODY"||i==="HTML"){var r=t.ownerDocument.documentElement;var o=t.ownerDocument.scrollingElement||r;return o[n]}return t[n]}function Vb(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var i=Hb(e,"top");var r=Hb(e,"left");var o=n?-1:1;t.top+=i*o;t.bottom+=i*o;t.left+=r*o;t.right+=r*o;return t}function Ub(t,e){var n=e==="x"?"Left":"Top";var i=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+i+"Width"],10)}function Wb(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Fb(10)?n["offset"+t]+i["margin"+(t==="Height"?"Top":"Left")]+i["margin"+(t==="Height"?"Bottom":"Right")]:0)}function qb(){var t=document.body;var e=document.documentElement;var n=Fb(10)&&getComputedStyle(e);return{height:Wb("Height",t,e,n),width:Wb("Width",t,e,n)}}var Xb=function(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}};var Gb=function(){function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i){i.writable=true}Object.defineProperty(t,i.key,i)}}return function(t,e,n){if(e){i(t.prototype,e)}if(n){i(t,n)}return t}}();var Yb=function(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t};var $b=Object.assign||function(t){var e=arguments;for(var n=1;n<arguments.length;n++){var i=e[n];for(var r in i){if(Object.prototype.hasOwnProperty.call(i,r)){t[r]=i[r]}}}return t};function Qb(t){return $b({},t,{right:t.left+t.width,bottom:t.top+t.height})}function Zb(t){var e={};try{if(Fb(10)){e=t.getBoundingClientRect();var n=Hb(t,"top");var i=Hb(t,"left");e.top+=n;e.left+=i;e.bottom+=n;e.right+=i}else{e=t.getBoundingClientRect()}}catch(t){}var r={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top};var o=t.nodeName==="HTML"?qb():{};var a=o.width||t.clientWidth||r.right-r.left;var s=o.height||t.clientHeight||r.bottom-r.top;var u=t.offsetWidth-a;var h=t.offsetHeight-s;if(u||h){var l=Db(t);u-=Ub(l,"x");h-=Ub(l,"y");r.width-=u;r.height-=h}return Qb(r)}function Kb(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var i=Fb(10);var r=e.nodeName==="HTML";var o=Zb(t);var a=Zb(e);var s=Pb(t);var u=Db(e);var h=parseFloat(u.borderTopWidth,10);var l=parseFloat(u.borderLeftWidth,10);if(n&&e.nodeName==="HTML"){a.top=Math.max(a.top,0);a.left=Math.max(a.left,0)}var f=Qb({top:o.top-a.top-h,left:o.left-a.left-l,width:o.width,height:o.height});f.marginTop=0;f.marginLeft=0;if(!i&&r){var c=parseFloat(u.marginTop,10);var d=parseFloat(u.marginLeft,10);f.top-=h-c;f.bottom-=h-c;f.left-=l-d;f.right-=l-d;f.marginTop=c;f.marginLeft=d}if(i&&!n?e.contains(s):e===s&&s.nodeName!=="BODY"){f=Vb(f,e)}return f}function Jb(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=t.ownerDocument.documentElement;var i=Kb(t,n);var r=Math.max(n.clientWidth,window.innerWidth||0);var o=Math.max(n.clientHeight,window.innerHeight||0);var a=!e?Hb(n):0;var s=!e?Hb(n,"left"):0;var u={top:a-i.top+i.marginTop,left:s-i.left+i.marginLeft,width:r,height:o};return Qb(u)}function tx(t){var e=t.nodeName;if(e==="BODY"||e==="HTML"){return false}if(Db(t,"position")==="fixed"){return true}return tx(Nb(t))}function ex(t){if(!t||!t.parentElement||Fb()){return document.documentElement}var e=t.parentElement;while(e&&Db(e,"transform")==="none"){e=e.parentElement}return e||document.documentElement}function nx(t,e,n,i){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var o={top:0,left:0};var a=r?ex(t):jb(t,e);if(i==="viewport"){o=Jb(a,r)}else{var s=void 0;if(i==="scrollParent"){s=Pb(Nb(e));if(s.nodeName==="BODY"){s=t.ownerDocument.documentElement}}else if(i==="window"){s=t.ownerDocument.documentElement}else{s=i}var u=Kb(s,a,r);if(s.nodeName==="HTML"&&!tx(a)){var h=qb(),l=h.height,f=h.width;o.top+=u.top-u.marginTop;o.bottom=l+u.top;o.left+=u.left-u.marginLeft;o.right=f+u.left}else{o=u}}o.left+=n;o.top+=n;o.right-=n;o.bottom-=n;return o}function ix(t){var e=t.width,n=t.height;return e*n}function rx(t,e,i,n,r){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;if(t.indexOf("auto")===-1){return t}var a=nx(i,n,o,r);var s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}};var u=Object.keys(s).map(function(t){return $b({key:t},s[t],{area:ix(s[t])})}).sort(function(t,e){return e.area-t.area});var h=u.filter(function(t){var e=t.width,n=t.height;return e>=i.clientWidth&&n>=i.clientHeight});var l=h.length>0?h[0].key:u[0].key;var f=t.split("-")[1];return l+(f?"-"+f:"")}function ox(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var r=i?ex(e):jb(e,n);return Kb(n,r,i)}function ax(t){var e=getComputedStyle(t);var n=parseFloat(e.marginTop)+parseFloat(e.marginBottom);var i=parseFloat(e.marginLeft)+parseFloat(e.marginRight);var r={width:t.offsetWidth+i,height:t.offsetHeight+n};return r}function sx(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function ux(t,e,n){n=n.split("-")[0];var i=ax(t);var r={width:i.width,height:i.height};var o=["right","left"].indexOf(n)!==-1;var a=o?"top":"left";var s=o?"left":"top";var u=o?"height":"width";var h=!o?"height":"width";r[a]=e[a]+e[u]/2-i[u]/2;if(n===s){r[s]=e[s]-i[h]}else{r[s]=e[sx(s)]}return r}function hx(t,e){if(Array.prototype.find){return t.find(e)}return t.filter(e)[0]}function lx(t,e,n){if(Array.prototype.findIndex){return t.findIndex(function(t){return t[e]===n})}var i=hx(t,function(t){return t[e]===n});return t.indexOf(i)}function fx(t,n,e){var i=e===undefined?t:t.slice(0,lx(t,"name",e));i.forEach(function(t){if(t["function"]){console.warn("`modifier.function` is deprecated, use `modifier.fn`!")}var e=t["function"]||t.fn;if(t.enabled&&Bb(e)){n.offsets.popper=Qb(n.offsets.popper);n.offsets.reference=Qb(n.offsets.reference);n=e(n,t)}});return n}function cx(){if(this.state.isDestroyed){return}var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:false,offsets:{}};t.offsets.reference=ox(this.state,this.popper,this.reference,this.options.positionFixed);t.placement=rx(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding);t.originalPlacement=t.placement;t.positionFixed=this.options.positionFixed;t.offsets.popper=ux(this.popper,t.offsets.reference,t.placement);t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute";t=fx(this.modifiers,t);if(!this.state.isCreated){this.state.isCreated=true;this.options.onCreate(t)}else{this.options.onUpdate(t)}}function dx(t,i){return t.some(function(t){var e=t.name,n=t.enabled;return n&&e===i})}function px(t){var e=[false,"ms","Webkit","Moz","O"];var n=t.charAt(0).toUpperCase()+t.slice(1);for(var i=0;i<e.length;i++){var r=e[i];var o=r?""+r+n:t;if(typeof document.body.style[o]!=="undefined"){return o}}return null}function gx(){this.state.isDestroyed=true;if(dx(this.modifiers,"applyStyle")){this.popper.removeAttribute("x-placement");this.popper.style.position="";this.popper.style.top="";this.popper.style.left="";this.popper.style.right="";this.popper.style.bottom="";this.popper.style.willChange="";this.popper.style[px("transform")]=""}this.disableEventListeners();if(this.options.removeOnDestroy){this.popper.parentNode.removeChild(this.popper)}return this}function vx(t){var e=t.ownerDocument;return e?e.defaultView:window}function _x(t,e,n,i){var r=t.nodeName==="BODY";var o=r?t.ownerDocument.defaultView:t;o.addEventListener(e,n,{passive:true});if(!r){_x(Pb(o.parentNode),e,n,i)}i.push(o)}function yx(t,e,n,i){n.updateBound=i;vx(t).addEventListener("resize",n.updateBound,{passive:true});var r=Pb(t);_x(r,"scroll",n.updateBound,n.scrollParents);n.scrollElement=r;n.eventsEnabled=true;return n}function mx(){if(!this.state.eventsEnabled){this.state=yx(this.reference,this.options,this.state,this.scheduleUpdate)}}function bx(t,e){vx(t).removeEventListener("resize",e.updateBound);e.scrollParents.forEach(function(t){t.removeEventListener("scroll",e.updateBound)});e.updateBound=null;e.scrollParents=[];e.scrollElement=null;e.eventsEnabled=false;return e}function xx(){if(this.state.eventsEnabled){cancelAnimationFrame(this.scheduleUpdate);this.state=bx(this.reference,this.state)}}function wx(t){return t!==""&&!isNaN(parseFloat(t))&&isFinite(t)}function Cx(n,i){Object.keys(i).forEach(function(t){var e="";if(["width","height","top","right","bottom","left"].indexOf(t)!==-1&&wx(i[t])){e="px"}n.style[t]=i[t]+e})}function Ex(n,i){Object.keys(i).forEach(function(t){var e=i[t];if(e!==false){n.setAttribute(t,i[t])}else{n.removeAttribute(t)}})}function Sx(t){Cx(t.instance.popper,t.styles);Ex(t.instance.popper,t.attributes);if(t.arrowElement&&Object.keys(t.arrowStyles).length){Cx(t.arrowElement,t.arrowStyles)}return t}function Ax(t,e,n,i,r){var o=ox(r,e,t,n.positionFixed);var a=rx(n.placement,o,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);e.setAttribute("x-placement",a);Cx(e,{position:n.positionFixed?"fixed":"absolute"});return n}function kx(t,e){var n=e.x,i=e.y;var r=t.offsets.popper;var o=hx(t.instance.modifiers,function(t){return t.name==="applyStyle"}).gpuAcceleration;if(o!==undefined){console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!")}var a=o!==undefined?o:e.gpuAcceleration;var s=Rb(t.instance.popper);var u=Zb(s);var h={position:r.position};var l={left:Math.floor(r.left),top:Math.round(r.top),bottom:Math.round(r.bottom),right:Math.floor(r.right)};var f=n==="bottom"?"top":"bottom";var c=i==="right"?"left":"right";var d=px("transform");var p=void 0,g=void 0;if(f==="bottom"){g=-u.height+l.bottom}else{g=l.top}if(c==="right"){p=-u.width+l.right}else{p=l.left}if(a&&d){h[d]="translate3d("+p+"px, "+g+"px, 0)";h[f]=0;h[c]=0;h.willChange="transform"}else{var v=f==="bottom"?-1:1;var _=c==="right"?-1:1;h[f]=g*v;h[c]=p*_;h.willChange=f+", "+c}var y={"x-placement":t.placement};t.attributes=$b({},y,t.attributes);t.styles=$b({},h,t.styles);t.arrowStyles=$b({},t.offsets.arrow,t.arrowStyles);return t}function Mx(t,n,e){var i=hx(t,function(t){var e=t.name;return e===n});var r=!!i&&t.some(function(t){return t.name===e&&t.enabled&&t.order<i.order});if(!r){var o="`"+n+"`";var a="`"+e+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return r}function Tx(t,e){var n;if(!Mx(t.instance.modifiers,"arrow","keepTogether")){return t}var i=e.element;if(typeof i==="string"){i=t.instance.popper.querySelector(i);if(!i){return t}}else{if(!t.instance.popper.contains(i)){console.warn("WARNING: `arrow.element` must be child of its popper element!");return t}}var r=t.placement.split("-")[0];var o=t.offsets,a=o.popper,s=o.reference;var u=["left","right"].indexOf(r)!==-1;var h=u?"height":"width";var l=u?"Top":"Left";var f=l.toLowerCase();var c=u?"left":"top";var d=u?"bottom":"right";var p=ax(i)[h];if(s[d]-p<a[f]){t.offsets.popper[f]-=a[f]-(s[d]-p)}if(s[f]+p>a[d]){t.offsets.popper[f]+=s[f]+p-a[d]}t.offsets.popper=Qb(t.offsets.popper);var g=s[f]+s[h]/2-p/2;var v=Db(t.instance.popper);var _=parseFloat(v["margin"+l],10);var y=parseFloat(v["border"+l+"Width"],10);var m=g-t.offsets.popper[f]-_-y;m=Math.max(Math.min(a[h]-p,m),0);t.arrowElement=i;t.offsets.arrow=(n={},Yb(n,f,Math.round(m)),Yb(n,c,""),n);return t}function Bx(t){if(t==="end"){return"start"}else if(t==="start"){return"end"}return t}var Dx=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"];var Nx=Dx.slice(3);function Px(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n=Nx.indexOf(t);var i=Nx.slice(n+1).concat(Nx.slice(0,n));return e?i.reverse():i}var zx={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Ox(d,p){if(dx(d.instance.modifiers,"inner")){return d}if(d.flipped&&d.placement===d.originalPlacement){return d}var g=nx(d.instance.popper,d.instance.reference,p.padding,p.boundariesElement,d.positionFixed);var v=d.placement.split("-")[0];var _=sx(v);var y=d.placement.split("-")[1]||"";var m=[];switch(p.behavior){case zx.FLIP:m=[v,_];break;case zx.CLOCKWISE:m=Px(v);break;case zx.COUNTERCLOCKWISE:m=Px(v,true);break;default:m=p.behavior}m.forEach(function(t,e){if(v!==t||m.length===e+1){return d}v=d.placement.split("-")[0];_=sx(v);var n=d.offsets.popper;var i=d.offsets.reference;var r=Math.floor;var o=v==="left"&&r(n.right)>r(i.left)||v==="right"&&r(n.left)<r(i.right)||v==="top"&&r(n.bottom)>r(i.top)||v==="bottom"&&r(n.top)<r(i.bottom);var a=r(n.left)<r(g.left);var s=r(n.right)>r(g.right);var u=r(n.top)<r(g.top);var h=r(n.bottom)>r(g.bottom);var l=v==="left"&&a||v==="right"&&s||v==="top"&&u||v==="bottom"&&h;var f=["top","bottom"].indexOf(v)!==-1;var c=!!p.flipVariations&&(f&&y==="start"&&a||f&&y==="end"&&s||!f&&y==="start"&&u||!f&&y==="end"&&h);if(o||l||c){d.flipped=true;if(o||l){v=m[e+1]}if(c){y=Bx(y)}d.placement=v+(y?"-"+y:"");d.offsets.popper=$b({},d.offsets.popper,ux(d.instance.popper,d.offsets.reference,d.placement));d=fx(d.instance.modifiers,d,"flip")}});return d}function Fx(t){var e=t.offsets,n=e.popper,i=e.reference;var r=t.placement.split("-")[0];var o=Math.floor;var a=["top","bottom"].indexOf(r)!==-1;var s=a?"right":"bottom";var u=a?"left":"top";var h=a?"width":"height";if(n[s]<o(i[u])){t.offsets.popper[u]=o(i[u])-n[h]}if(n[u]>o(i[s])){t.offsets.popper[u]=o(i[s])}return t}function Rx(t,e,n,i){var r=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);var o=+r[1];var a=r[2];if(!o){return t}if(a.indexOf("%")===0){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=i}var u=Qb(s);return u[e]/100*o}else if(a==="vh"||a==="vw"){var h=void 0;if(a==="vh"){h=Math.max(document.documentElement.clientHeight,window.innerHeight||0)}else{h=Math.max(document.documentElement.clientWidth,window.innerWidth||0)}return h/100*o}else{return o}}function Ix(t,r,o,e){var a=[0,0];var s=["right","left"].indexOf(e)!==-1;var n=t.split(/(\+|\-)/).map(function(t){return t.trim()});var i=n.indexOf(hx(n,function(t){return t.search(/,|\s/)!==-1}));if(n[i]&&n[i].indexOf(",")===-1){console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.")}var u=/\s*,\s*|\s+/;var h=i!==-1?[n.slice(0,i).concat([n[i].split(u)[0]]),[n[i].split(u)[1]].concat(n.slice(i+1))]:[n];h=h.map(function(t,e){var n=(e===1?!s:s)?"height":"width";var i=false;return t.reduce(function(t,e){if(t[t.length-1]===""&&["+","-"].indexOf(e)!==-1){t[t.length-1]=e;i=true;return t}else if(i){t[t.length-1]+=e;i=false;return t}else{return t.concat(e)}},[]).map(function(t){return Rx(t,n,r,o)})});h.forEach(function(n,i){n.forEach(function(t,e){if(wx(t)){a[i]+=t*(n[e-1]==="-"?-1:1)}})});return a}function Lx(t,e){var n=e.offset;var i=t.placement,r=t.offsets,o=r.popper,a=r.reference;var s=i.split("-")[0];var u=void 0;if(wx(+n)){u=[+n,0]}else{u=Ix(n,o,a,s)}if(s==="left"){o.top+=u[0];o.left-=u[1]}else if(s==="right"){o.top+=u[0];o.left+=u[1]}else if(s==="top"){o.left+=u[0];o.top-=u[1]}else if(s==="bottom"){o.left+=u[0];o.top+=u[1]}t.popper=o;return t}function jx(t,r){var e=r.boundariesElement||Rb(t.instance.popper);if(t.instance.reference===e){e=Rb(e)}var n=px("transform");var i=t.instance.popper.style;var o=i.top,a=i.left,s=i[n];i.top="";i.left="";i[n]="";var u=nx(t.instance.popper,t.instance.reference,r.padding,e,t.positionFixed);i.top=o;i.left=a;i[n]=s;r.boundaries=u;var h=r.priority;var l=t.offsets.popper;var f={primary:function t(e){var n=l[e];if(l[e]<u[e]&&!r.escapeWithReference){n=Math.max(l[e],u[e])}return Yb({},e,n)},secondary:function t(e){var n=e==="right"?"left":"top";var i=l[n];if(l[e]>u[e]&&!r.escapeWithReference){i=Math.min(l[n],u[e]-(e==="right"?l.width:l.height))}return Yb({},n,i)}};h.forEach(function(t){var e=["left","top"].indexOf(t)!==-1?"primary":"secondary";l=$b({},l,f[e](t))});t.offsets.popper=l;return t}function Hx(t){var e=t.placement;var n=e.split("-")[0];var i=e.split("-")[1];if(i){var r=t.offsets,o=r.reference,a=r.popper;var s=["bottom","top"].indexOf(n)!==-1;var u=s?"left":"top";var h=s?"width":"height";var l={start:Yb({},u,o[u]),end:Yb({},u,o[u]+o[h]-a[h])};t.offsets.popper=$b({},a,l[i])}return t}function Vx(t){if(!Mx(t.instance.modifiers,"hide","preventOverflow")){return t}var e=t.offsets.reference;var n=hx(t.instance.modifiers,function(t){return t.name==="preventOverflow"}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(t.hide===true){return t}t.hide=true;t.attributes["x-out-of-boundaries"]=""}else{if(t.hide===false){return t}t.hide=false;t.attributes["x-out-of-boundaries"]=false}return t}function Ux(t){var e=t.placement;var n=e.split("-")[0];var i=t.offsets,r=i.popper,o=i.reference;var a=["left","right"].indexOf(n)!==-1;var s=["top","left"].indexOf(n)===-1;r[a?"left":"top"]=o[n]-(s?r[a?"width":"height"]:0);t.placement=sx(e);t.offsets.popper=Qb(r);return t}var Wx={shift:{order:100,enabled:true,fn:Hx},offset:{order:200,enabled:true,fn:Lx,offset:0},preventOverflow:{order:300,enabled:true,fn:jx,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:true,fn:Fx},arrow:{order:500,enabled:true,fn:Tx,element:"[x-arrow]"},flip:{order:600,enabled:true,fn:Ox,behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:false,fn:Ux},hide:{order:800,enabled:true,fn:Vx},computeStyle:{order:850,enabled:true,fn:kx,gpuAcceleration:true,x:"bottom",y:"right"},applyStyle:{order:900,enabled:true,fn:Sx,onLoad:Ax,gpuAcceleration:undefined}};var qx={placement:"bottom",positionFixed:false,eventsEnabled:true,removeOnDestroy:false,onCreate:function t(){},onUpdate:function t(){},modifiers:Wx};var Xx=function(){function o(t,e){var n=this;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};Xb(this,o);this.scheduleUpdate=function(){return requestAnimationFrame(n.update)};this.update=Tb(this.update.bind(this));this.options=$b({},o.Defaults,i);this.state={isDestroyed:false,isCreated:false,scrollParents:[]};this.reference=t&&t.jquery?t[0]:t;this.popper=e&&e.jquery?e[0]:e;this.options.modifiers={};Object.keys($b({},o.Defaults.modifiers,i.modifiers)).forEach(function(t){n.options.modifiers[t]=$b({},o.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})});this.modifiers=Object.keys(this.options.modifiers).map(function(t){return $b({name:t},n.options.modifiers[t])}).sort(function(t,e){return t.order-e.order});this.modifiers.forEach(function(t){if(t.enabled&&Bb(t.onLoad)){t.onLoad(n.reference,n.popper,n.options,t,n.state)}});this.update();var r=this.options.eventsEnabled;if(r){this.enableEventListeners()}this.state.eventsEnabled=r}Gb(o,[{key:"update",value:function t(){return cx.call(this)}},{key:"destroy",value:function t(){return gx.call(this)}},{key:"enableEventListeners",value:function t(){return mx.call(this)}},{key:"disableEventListeners",value:function t(){return xx.call(this)}}]);return o}();Xx.Utils=(typeof window!=="undefined"?window:global).PopperUtils;Xx.placements=Dx;Xx.Defaults=qx;var Gx=function(t){function e(){t.call(this);this._arrow=ju("arrow","");this._arrowStyle={content:"",background:"inherit",border:"inherit","border-width":"0 1px 1px 0",height:"10px",position:"absolute",transform:"rotate(45deg)",width:"10px","z-index":"-1"};this._background=Zu("rgba(255, 255, 255, 1)");this._body=ju("body","");this._bodyStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"12px","font-weight":"400","z-index":"1"};this._border=Zu("1px solid rgba(0, 0, 0, 0.1)");this._borderRadius=Zu("2px");this._className="d3plus-tooltip";this._data=[];this._duration=Zu(200);this._footer=ju("footer","");this._footerStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"12px","font-weight":"400","z-index":"1"};this._height=Zu("auto");this._id=function(t,e){return t.id||""+e};this._offset=Zu(5);this._padding=Zu("5px");this._pointerEvents=Zu("auto");this._position=function(t){return[t.x,t.y]};this._prefix=eh();this._tableStyle={"border-spacing":"0",width:"100%"};this._tbody=[];this._tbodyStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"12px","text-align":"center"};this._thead=[];this._theadStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"12px","font-weight":"600","text-align":"center"};this._title=ju("title","");this._titleStyle={"font-family":"'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif","font-size":"14px","font-weight":"600"};this._width=Zu("auto")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.render=function t(e){var n=this;var i=this;var r=qa("body").selectAll("."+this._className).data(this._data,this._id);var o=r.enter().append("div").attr("class",this._className);var a=r.merge(o);function s(n){o.append("div").attr("class","d3plus-tooltip-"+n).attr("id",function(t,e){return"d3plus-tooltip-"+n+"-"+(t?i._id(t,e):"")});var t=a.select(".d3plus-tooltip-"+n).html(i["_"+n]);nh(t,i["_"+n+"Style"])}function u(t){if(typeof t==="function"){var e=qa(this.parentNode.parentNode).datum();return t(e,i._data.indexOf(e))}else{return t}}function h(t){t.style("background",i._background).style(i._prefix+"border-radius",i._borderRadius).style("pointer-events",i._pointerEvents).style("padding",i._padding).style("width",i._width).style("height",i._height).style("border",function(t,e){var n=qa(this).style("border");return n!=="0px none rgb(0, 0, 0)"?n:i._border(t,e)})}s("title");s("body");var l=o.append("table").attr("class","d3plus-tooltip-table");var f=a.select(".d3plus-tooltip-table");nh(f,this._tableStyle);l.append("thead").attr("class","d3plus-tooltip-thead");var c=a.select(".d3plus-tooltip-thead");nh(c,this._theadStyle);var d=c.selectAll("th").data(this._thead);d.enter().append("th").merge(d).html(u);d.exit().remove();l.append("tbody").attr("class","d3plus-tooltip-tbody");var p=a.select(".d3plus-tooltip-tbody");nh(p,this._tbodyStyle);var g=p.selectAll("tr").data(this._tbody);var v=g.enter().append("tr");g.exit().remove();var _=g.merge(v);var y=_.selectAll("td").data(function(t){return t});y.enter().append("td").merge(y).html(u);s("footer");s("arrow");o.call(h);var m=Pu().duration(this._duration);a.attr("id",function(t,e){return"d3plus-tooltip-"+(t?n._id(t,e):"")}).transition(m).style("opacity",1).call(h);r.exit().transition(m).style("opacity",0).remove();for(var b=0;b<this._data.length;b++){var x=i._data[b];if(x){var w=document.getElementById("d3plus-tooltip-"+i._id(x,b));var C=document.getElementById("d3plus-tooltip-arrow-"+i._id(x,b));var E=C.offsetHeight;var S=C.getBoundingClientRect().height/2;C.style.bottom="-"+E/2+"px";var A=i._position(x,b);var k=Array.isArray(A)?{clientWidth:0,clientHeight:0,getBoundingClientRect:function(){return{top:A[1],right:A[0],bottom:A[1],left:A[0],width:0,height:0}}}:i._position(x,b);new Xx(k,w,{placement:"top",placements:["top","bottom","left","right"],modifiers:{arrow:{element:C},offset:{offset:"0,"+(i._offset(x,b)+S)},preventOverflow:{boundariesElement:"scrollParent"},flip:{behavior:"flip",boundariesElement:"viewport"}},onCreate:function t(e){var n=e.instance;document.onmousemove=function(){n.scheduleUpdate()}},onUpdate:function t(e){var n=e.arrowElement;var i=e.flipped;if(i){n.style.transform="rotate(225deg)";n.style.top="-"+E/2+"px"}else{n.style.transform="rotate(45deg)";n.style.bottom="-"+E/2+"px"}}})}}if(e){setTimeout(e,this._duration+100)}return this};e.prototype.arrow=function t(e){return arguments.length?(this._arrow=typeof e==="function"?e:Zu(e),this):this._arrow};e.prototype.arrowStyle=function t(e){return arguments.length?(this._arrowStyle=Object.assign(this._arrowStyle,e),this):this._arrowStyle};e.prototype.background=function t(e){return arguments.length?(this._background=typeof e==="function"?e:Zu(e),this):this._background};e.prototype.body=function t(e){return arguments.length?(this._body=typeof e==="function"?e:Zu(e),this):this._body};e.prototype.bodyStyle=function t(e){return arguments.length?(this._bodyStyle=Object.assign(this._bodyStyle,e),this):this._bodyStyle};e.prototype.border=function t(e){return arguments.length?(this._border=typeof e==="function"?e:Zu(e),this):this._border};e.prototype.borderRadius=function t(e){return arguments.length?(this._borderRadius=typeof e==="function"?e:Zu(e),this):this._borderRadius};e.prototype.className=function t(e){return arguments.length?(this._className=e,this):this._className};e.prototype.data=function t(e){return arguments.length?(this._data=e,this):this._data};e.prototype.duration=function t(e){return arguments.length?(this._duration=typeof e==="function"?e:Zu(e),this):this._duration};e.prototype.footer=function t(e){return arguments.length?(this._footer=typeof e==="function"?e:Zu(e),this):this._footer};e.prototype.footerStyle=function t(e){return arguments.length?(this._footerStyle=Object.assign(this._footerStyle,e),this):this._footerStyle};e.prototype.height=function t(e){return arguments.length?(this._height=typeof e==="function"?e:Zu(e),this):this._height};e.prototype.id=function t(e){return arguments.length?(this._id=typeof e==="function"?e:Zu(e),this):this._id};e.prototype.offset=function t(e){return arguments.length?(this._offset=typeof e==="function"?e:Zu(e),this):this._offset};e.prototype.padding=function t(e){return arguments.length?(this._padding=typeof e==="function"?e:Zu(e),this):this._padding};e.prototype.pointerEvents=function t(e){return arguments.length?(this._pointerEvents=typeof e==="function"?e:Zu(e),this):this._pointerEvents};e.prototype.position=function t(e){return arguments.length?(this._position=typeof e==="function"?e:Zu(e),this):this._position};e.prototype.tableStyle=function t(e){return arguments.length?(this._tableStyle=Object.assign(this._tableStyle,e),this):this._tableStyle};e.prototype.tbody=function t(e){return arguments.length?(this._tbody=e,this):this._tbody};e.prototype.tbodyStyle=function t(e){return arguments.length?(this._tbodyStyle=Object.assign(this._tbodyStyle,e),this):this._tbodyStyle};e.prototype.thead=function t(e){return arguments.length?(this._thead=e,this):this._thead};e.prototype.theadStyle=function t(e){return arguments.length?(this._theadStyle=Object.assign(this._theadStyle,e),this):this._theadStyle};e.prototype.title=function t(e){return arguments.length?(this._title=typeof e==="function"?e:Zu(e),this):this._title};e.prototype.titleStyle=function t(e){return arguments.length?(this._titleStyle=Object.assign(this._titleStyle,e),this):this._titleStyle};e.prototype.width=function t(e){return arguments.length?(this._width=typeof e==="function"?e:Zu(e),this):this._width};return e}(Yu);var Yx=function t(){this._isVisible=false};Yx.prototype.exit=function t(e,n){e.transition().duration(n).style("opacity",0).transition().remove();this._isVisible=false};Yx.prototype.hide=function t(e){if(e===void 0){e={}}var n=e.duration;if(n===void 0){n=600}var i=e.callback;this.mask.call(this.exit.bind(this),n);this.elem.call(this.exit.bind(this),n);if(i){setTimeout(i,n+100)}this._isVisible=false;return this};Yx.prototype.render=function t(e){if(e===void 0){e={}}var n=e.callback;var i=e.container;if(i===void 0){i="body"}var r=e.duration;if(r===void 0){r=600}var o=e.html;if(o===void 0){o="Please Wait"}var a=e.mask;if(a===void 0){a="rgba(0, 0, 0, 0.1)"}var s=e.style;if(s===void 0){s={}}var u=qa(i).style("position","relative");this.mask=u.selectAll("div.d3plus-Mask").data(a?[a]:[]);this.mask=this.mask.enter().append("div").attr("class","d3plus-Mask").style("opacity",1).merge(this.mask);this.mask.exit().call(this.exit.bind(this),r);nh(this.mask,{"background-color":String,bottom:"0px",left:"0px",position:"absolute",right:"0px",top:"0px"});this.elem=u.selectAll("div.d3plus-Message").data([o]);this.elem=this.elem.enter().append("div").attr("class","d3plus-Message").style("opacity",1).merge(this.elem).html(String);nh(this.elem,s);if(n){setTimeout(n,100)}this._isVisible=true;return this};var $x=function(){var t=this._history.length;var e=Ku("g.d3plus-viz-back",{parent:this._select,transition:this._transition,update:{transform:"translate("+this._margin.left+", "+this._margin.top+")"}}).node();this._backClass.data(t?[{text:"Back",x:0,y:0}]:[]).select(e).config(this._backConfig).render();this._margin.top+=t?this._backClass.fontSize()():0};var Qx=function(t){var i=this;if(t===void 0){t=[]}if(this._colorScale&&t){var e=this._colorScalePosition||"bottom";var n=["top","bottom"].includes(e);var r={opacity:this._colorScalePosition?1:0,transform:"translate("+(n?this._margin.left+this._padding.left:this._margin.left)+", "+(n?this._margin.top:this._margin.top+this._padding.top)+")"};var o=this._colorScale&&t&&t.length>1;var a=Ku("g.d3plus-viz-colorScale",{condition:o&&!this._colorScaleConfig.select,enter:r,parent:this._select,transition:this._transition,update:r}).node();var s=t.filter(function(t,e){var n=i._colorScale(t,e);return n!==undefined&&n!==null});this._colorScaleClass.align({bottom:"end",left:"start",right:"end",top:"start"}[e]).duration(this._duration).data(s).height(n?this._height-(this._margin.bottom+this._margin.top):this._height-(this._margin.bottom+this._margin.top+this._padding.bottom+this._padding.top)).orient(e).select(a).value(this._colorScale).width(n?this._width-(this._margin.left+this._margin.right+this._padding.left+this._padding.right):this._width-(this._margin.left+this._margin.right)).config(this._colorScaleConfig).render();if(o){var u=this._colorScaleClass.outerBounds();if(this._colorScalePosition&&!this._colorScaleConfig.select&&u.height){if(n){this._margin[e]+=u.height+this._legendClass.padding()*2}else{this._margin[e]+=u.width+this._legendClass.padding()*2}}}}};var Zx=sb(function(e,t){(function(t){{e.exports=t()}})(function(){var R;return function o(a,s,u){function h(n,t){if(!s[n]){if(!a[n]){var e=typeof ab=="function"&&ab;if(!t&&e){return e(n,!0)}if(l){return l(n,!0)}var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var r=s[n]={exports:{}};a[n][0].call(r.exports,function(t){var e=a[n][1][t];return h(e?e:t)},r,r.exports,o,a,s,u)}return s[n].exports}var l=typeof ab=="function"&&ab;for(var t=0;t<u.length;t++){h(u[t])}return h}({1:[function(t,O,F){(function(z){(function(t){var e=typeof F=="object"&&F&&!F.nodeType&&F;var n=typeof O=="object"&&O&&!O.nodeType&&O;var i=typeof z=="object"&&z;if(i.global===i||i.window===i||i.self===i){t=i}var r,_=2147483647,y=36,m=1,b=26,o=38,a=700,x=72,w=128,C="-",s=/^xn--/,u=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=y-m,E=Math.floor,S=String.fromCharCode,c;function A(t){throw new RangeError(l[t])}function d(t,e){var n=t.length;var i=[];while(n--){i[n]=e(t[n])}return i}function p(t,e){var n=t.split("@");var i="";if(n.length>1){i=n[0]+"@";t=n[1]}t=t.replace(h,".");var r=t.split(".");var o=d(r,e).join(".");return i+o}function k(t){var e=[],n=0,i=t.length,r,o;while(n<i){r=t.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){o=t.charCodeAt(n++);if((o&64512)==56320){e.push(((r&1023)<<10)+(o&1023)+65536)}else{e.push(r);n--}}else{e.push(r)}}return e}function v(t){return d(t,function(t){var e="";if(t>65535){t-=65536;e+=S(t>>>10&1023|55296);t=56320|t&1023}e+=S(t);return e}).join("")}function M(t){if(t-48<10){return t-22}if(t-65<26){return t-65}if(t-97<26){return t-97}return y}function T(t,e){return t+22+75*(t<26)-((e!=0)<<5)}function B(t,e,n){var i=0;t=n?E(t/a):t>>1;t+=E(t/e);for(;t>f*b>>1;i+=y){t=E(t/f)}return E(i+(f+1)*t/(t+o))}function g(t){var e=[],n=t.length,i,r=0,o=w,a=x,s,u,h,l,f,c,d,p,g;s=t.lastIndexOf(C);if(s<0){s=0}for(u=0;u<s;++u){if(t.charCodeAt(u)>=128){A("not-basic")}e.push(t.charCodeAt(u))}for(h=s>0?s+1:0;h<n;){for(l=r,f=1,c=y;;c+=y){if(h>=n){A("invalid-input")}d=M(t.charCodeAt(h++));if(d>=y||d>E((_-r)/f)){A("overflow")}r+=d*f;p=c<=a?m:c>=a+b?b:c-a;if(d<p){break}g=y-p;if(f>E(_/g)){A("overflow")}f*=g}i=e.length+1;a=B(r-l,i,l==0);if(E(r/i)>_-o){A("overflow")}o+=E(r/i);r%=i;e.splice(r++,0,o)}return v(e)}function D(t){var e,n,i,r,o,a,s,u,h,l,f,c=[],d,p,g,v;t=k(t);d=t.length;e=w;n=0;o=x;for(a=0;a<d;++a){f=t[a];if(f<128){c.push(S(f))}}i=r=c.length;if(r){c.push(C)}while(i<d){for(s=_,a=0;a<d;++a){f=t[a];if(f>=e&&f<s){s=f}}p=i+1;if(s-e>E((_-n)/p)){A("overflow")}n+=(s-e)*p;e=s;for(a=0;a<d;++a){f=t[a];if(f<e&&++n>_){A("overflow")}if(f==e){for(u=n,h=y;;h+=y){l=h<=o?m:h>=o+b?b:h-o;if(u<l){break}v=u-l;g=y-l;c.push(S(T(l+v%g,0)));u=E(v/g)}c.push(S(T(u,0)));o=B(n,p,i==r);n=0;++i}}++n;++e}return c.join("")}function N(t){return p(t,function(t){return s.test(t)?g(t.slice(4).toLowerCase()):t})}function P(t){return p(t,function(t){return u.test(t)?"xn--"+D(t):t})}r={version:"1.3.2",ucs2:{decode:k,encode:v},decode:g,encode:D,toASCII:P,toUnicode:N};if(typeof R=="function"&&typeof R.amd=="object"&&R.amd){}else if(e&&n){if(O.exports==e){n.exports=r}else{for(c in r){r.hasOwnProperty(c)&&(e[c]=r[c])}}}else{t.punycode=r}})(this)}).call(this,typeof ob!=="undefined"?ob:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],2:[function(t,e,n){var i=t("./log");function h(t,e,n){if(t.defaultView&&(e!==t.defaultView.pageXOffset||n!==t.defaultView.pageYOffset)){t.defaultView.scrollTo(e,n)}}function r(e,t){try{if(t){t.width=e.width;t.height=e.height;t.getContext("2d").putImageData(e.getContext("2d").getImageData(0,0,e.width,e.height),0,0)}}catch(t){i("Unable to copy canvas content from",e,t)}}function l(t,e){var n=t.nodeType===3?document.createTextNode(t.nodeValue):t.cloneNode(false);var i=t.firstChild;while(i){if(e===true||i.nodeType!==1||i.nodeName!=="SCRIPT"){n.appendChild(l(i,e))}i=i.nextSibling}if(t.nodeType===1){n._scrollTop=t.scrollTop;n._scrollLeft=t.scrollLeft;if(t.nodeName==="CANVAS"){r(t,n)}else if(t.nodeName==="TEXTAREA"||t.nodeName==="SELECT"){n.value=t.value}}return n}function f(t){if(t.nodeType===1){t.scrollTop=t._scrollTop;t.scrollLeft=t._scrollLeft;var e=t.firstChild;while(e){f(e);e=e.nextSibling}}}e.exports=function(t,e,n,i,r,o,a){var s=l(t.documentElement,r.javascriptEnabled);var u=e.createElement("iframe");u.className="html2canvas-container";u.style.visibility="hidden";u.style.position="fixed";u.style.left="-10000px";u.style.top="0px";u.style.border="0";u.width=n;u.height=i;u.scrolling="no";e.body.appendChild(u);return new Promise(function(e){var n=u.contentWindow.document;u.contentWindow.onload=u.onload=function(){var t=setInterval(function(){if(n.body.childNodes.length>0){f(n.documentElement);clearInterval(t);if(r.type==="view"){u.contentWindow.scrollTo(o,a);if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(u.contentWindow.scrollY!==a||u.contentWindow.scrollX!==o)){n.documentElement.style.top=-a+"px";n.documentElement.style.left=-o+"px";n.documentElement.style.position="absolute"}}e(u)}},50)};n.open();n.write("<!DOCTYPE html><html></html>");h(t,o,a);n.replaceChild(n.adoptNode(s),n.documentElement);n.close()})}},{"./log":13}],3:[function(t,e,n){function i(t){this.r=0;this.g=0;this.b=0;this.a=null;var e=this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t)}i.prototype.darken=function(t){var e=1-t;return new i([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])};i.prototype.isTransparent=function(){return this.a===0};i.prototype.isBlack=function(){return this.r===0&&this.g===0&&this.b===0};i.prototype.fromArray=function(t){if(Array.isArray(t)){this.r=Math.min(t[0],255);this.g=Math.min(t[1],255);this.b=Math.min(t[2],255);if(t.length>3){this.a=t[3]}}return Array.isArray(t)};var r=/^#([a-f0-9]{3})$/i;i.prototype.hex3=function(t){var e=null;if((e=t.match(r))!==null){this.r=parseInt(e[1][0]+e[1][0],16);this.g=parseInt(e[1][1]+e[1][1],16);this.b=parseInt(e[1][2]+e[1][2],16)}return e!==null};var o=/^#([a-f0-9]{6})$/i;i.prototype.hex6=function(t){var e=null;if((e=t.match(o))!==null){this.r=parseInt(e[1].substring(0,2),16);this.g=parseInt(e[1].substring(2,4),16);this.b=parseInt(e[1].substring(4,6),16)}return e!==null};var a=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;i.prototype.rgb=function(t){var e=null;if((e=t.match(a))!==null){this.r=Number(e[1]);this.g=Number(e[2]);this.b=Number(e[3])}return e!==null};var s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;i.prototype.rgba=function(t){var e=null;if((e=t.match(s))!==null){this.r=Number(e[1]);this.g=Number(e[2]);this.b=Number(e[3]);this.a=Number(e[4])}return e!==null};i.prototype.toString=function(){return this.a!==null&&this.a!==1?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"};i.prototype.namedColor=function(t){t=t.toLowerCase();var e=u[t];if(e){this.r=e[0];this.g=e[1];this.b=e[2]}else if(t==="transparent"){this.r=this.g=this.b=this.a=0;return true}return!!e};i.prototype.isColor=true;var u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};e.exports=i},{}],4:[function(t,e,n){var d=t("./support");var a=t("./renderers/canvas");var p=t("./imageloader");var g=t("./nodeparser");var i=t("./nodecontainer");var v=t("./log");var r=t("./utils");var o=t("./clone");var s=t("./proxy").loadUrlDocument;var _=r.getBounds;var f="data-html2canvas-node";var u=0;function h(t,e){var n=u++;e=e||{};if(e.logging){v.options.logging=true;v.options.start=Date.now()}e.async=typeof e.async==="undefined"?true:e.async;e.allowTaint=typeof e.allowTaint==="undefined"?false:e.allowTaint;e.removeContainer=typeof e.removeContainer==="undefined"?true:e.removeContainer;e.javascriptEnabled=typeof e.javascriptEnabled==="undefined"?false:e.javascriptEnabled;e.imageTimeout=typeof e.imageTimeout==="undefined"?1e4:e.imageTimeout;e.renderer=typeof e.renderer==="function"?e.renderer:a;e.strict=!!e.strict;if(typeof t==="string"){if(typeof e.proxy!=="string"){return Promise.reject("Proxy must be used when rendering url")}var i=e.width!=null?e.width:window.innerWidth;var r=e.height!=null?e.height:window.innerHeight;return s(C(t),e.proxy,document,i,r,e).then(function(t){return y(t.contentWindow.document.documentElement,t,e,i,r)})}var o=(t===undefined?[document.documentElement]:t.length?t:[t])[0];o.setAttribute(f+n,n);return c(o.ownerDocument,e,o.ownerDocument.defaultView.innerWidth,o.ownerDocument.defaultView.innerHeight,n).then(function(t){if(typeof e.onrendered==="function"){v("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");e.onrendered(t)}return t})}h.CanvasRenderer=a;h.NodeContainer=i;h.log=v;h.utils=r;var l=typeof document==="undefined"||typeof Object.create!=="function"||typeof document.createElement("canvas").getContext!=="function"?function(){return Promise.reject("No canvas support")}:h;e.exports=l;function c(a,s,u,h,l){return o(a,a,u,h,s,a.defaultView.pageXOffset,a.defaultView.pageYOffset).then(function(t){v("Document cloned");var e=f+l;var n="["+e+"='"+l+"']";a.querySelector(n).removeAttribute(e);var i=t.contentWindow;var r=i.document.querySelector(n);var o=typeof s.onclone==="function"?Promise.resolve(s.onclone(i.document)):Promise.resolve(true);return o.then(function(){return y(r,t,s,u,h)})})}function y(e,n,i,t,r){var o=n.contentWindow;var a=new d(o.document);var s=new p(i,a);var u=_(e);var h=i.type==="view"?t:x(o.document);var l=i.type==="view"?r:w(o.document);var f=new i.renderer(h,l,s,i,document);var c=new g(e,f,a,s,i);return c.ready.then(function(){v("Finished rendering");var t;if(i.type==="view"){t=b(f.canvas,{width:f.canvas.width,height:f.canvas.height,top:0,left:0,x:0,y:0})}else if(e===o.document.body||e===o.document.documentElement||i.canvas!=null){t=f.canvas}else{t=b(f.canvas,{width:i.width!=null?i.width:u.width,height:i.height!=null?i.height:u.height,top:u.top,left:u.left,x:0,y:0})}m(n,i);return t})}function m(t,e){if(e.removeContainer){t.parentNode.removeChild(t);v("Cleaned up container")}}function b(t,e){var n=document.createElement("canvas");var i=Math.min(t.width-1,Math.max(0,e.left));var r=Math.min(t.width,Math.max(1,e.left+e.width));var o=Math.min(t.height-1,Math.max(0,e.top));var a=Math.min(t.height,Math.max(1,e.top+e.height));n.width=e.width;n.height=e.height;var s=r-i;var u=a-o;v("Cropping canvas at:","left:",e.left,"top:",e.top,"width:",s,"height:",u);v("Resulting crop with width",e.width,"and height",e.height,"with x",i,"and y",o);n.getContext("2d").drawImage(t,i,o,s,u,e.x,e.y,s,u);return n}function x(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function w(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function C(t){var e=document.createElement("a");e.href=t;e.href=e.href;return e}},{"./clone":2,"./imageloader":11,"./log":13,"./nodecontainer":14,"./nodeparser":15,"./proxy":16,"./renderers/canvas":20,"./support":22,"./utils":26}],5:[function(t,e,n){var i=t("./log");var r=t("./utils").smallImage;function o(t){this.src=t;i("DummyImageContainer for",t);if(!this.promise||!this.image){i("Initiating DummyImageContainer");o.prototype.image=new Image;var n=this.image;o.prototype.promise=new Promise(function(t,e){n.onload=t;n.onerror=e;n.src=r();if(n.complete===true){t(n)}})}}e.exports=o},{"./log":13,"./utils":26}],6:[function(t,e,n){var u=t("./utils").smallImage;function i(t,e){var n=document.createElement("div"),i=document.createElement("img"),r=document.createElement("span"),o="Hidden Text",a,s;n.style.visibility="hidden";n.style.fontFamily=t;n.style.fontSize=e;n.style.margin=0;n.style.padding=0;document.body.appendChild(n);i.src=u();i.width=1;i.height=1;i.style.margin=0;i.style.padding=0;i.style.verticalAlign="baseline";r.style.fontFamily=t;r.style.fontSize=e;r.style.margin=0;r.style.padding=0;r.appendChild(document.createTextNode(o));n.appendChild(r);n.appendChild(i);a=i.offsetTop-r.offsetTop+1;n.removeChild(r);n.appendChild(document.createTextNode(o));n.style.lineHeight="normal";i.style.verticalAlign="super";s=i.offsetTop-n.offsetTop+1;document.body.removeChild(n);this.baseline=a;this.lineWidth=1;this.middle=s}e.exports=i},{"./utils":26}],7:[function(t,e,n){var i=t("./font");function r(){this.data={}}r.prototype.getMetrics=function(t,e){if(this.data[t+"-"+e]===undefined){this.data[t+"-"+e]=new i(t,e)}return this.data[t+"-"+e]};e.exports=r},{"./font":6}],8:[function(o,t,e){var n=o("./utils");var a=n.getBounds;var r=o("./proxy").loadUrlDocument;function i(e,t,n){this.image=null;this.src=e;var i=this;var r=a(e);this.promise=(!t?this.proxyLoad(n.proxy,r,n):new Promise(function(t){if(e.contentWindow.document.URL==="about:blank"||e.contentWindow.document.documentElement==null){e.contentWindow.onload=e.onload=function(){t(e)}}else{t(e)}})).then(function(t){var e=o("./core");return e(t.contentWindow.document.documentElement,{type:"view",width:t.width,height:t.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return i.image=t})}i.prototype.proxyLoad=function(t,e,n){var i=this.src;return r(i.src,t,i.ownerDocument,e.width,e.height,n)};t.exports=i},{"./core":4,"./proxy":16,"./utils":26}],9:[function(t,e,n){function i(t){this.src=t.value;this.colorStops=[];this.type=null;this.x0=.5;this.y0=.5;this.x1=.5;this.y1=.5;this.promise=Promise.resolve(true)}i.TYPES={LINEAR:1,RADIAL:2};i.REGEXP_COLORSTOP=/^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i;e.exports=i},{}],10:[function(t,e,n){function i(n,i){this.src=n;this.image=new Image;var r=this;this.tainted=null;this.promise=new Promise(function(t,e){r.image.onload=t;r.image.onerror=e;if(i){r.image.crossOrigin="anonymous"}r.image.src=n;if(r.image.complete===true){t(r.image)}})}e.exports=i},{}],11:[function(t,e,n){var o=t("./log");var i=t("./imagecontainer");var r=t("./dummyimagecontainer");var a=t("./proxyimagecontainer");var s=t("./framecontainer");var u=t("./svgcontainer");var h=t("./svgnodecontainer");var l=t("./lineargradientcontainer");var f=t("./webkitgradientcontainer");var c=t("./utils").bind;function d(t,e){this.link=null;this.options=t;this.support=e;this.origin=this.getOrigin(window.location.href)}d.prototype.findImages=function(t){var e=[];t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this);return e};d.prototype.findBackgroundImage=function(t,e){e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this);return t};d.prototype.addImage=function(n,i){return function(e){e.args.forEach(function(t){if(!this.imageExists(n,t)){n.splice(0,0,i.call(this,e));o("Added image #"+n.length,typeof t==="string"?t.substring(0,100):t)}},this)}};d.prototype.hasImageBackground=function(t){return t.method!=="none"};d.prototype.loadImage=function(t){if(t.method==="url"){var e=t.args[0];if(this.isSVG(e)&&!this.support.svg&&!this.options.allowTaint){return new u(e)}else if(e.match(/data:image\/.*;base64,/i)){return new i(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),false)}else if(this.isSameOrigin(e)||this.options.allowTaint===true||this.isSVG(e)){return new i(e,false)}else if(this.support.cors&&!this.options.allowTaint&&this.options.useCORS){return new i(e,true)}else if(this.options.proxy){return new a(e,this.options.proxy)}else{return new r(e)}}else if(t.method==="linear-gradient"){return new l(t)}else if(t.method==="gradient"){return new f(t)}else if(t.method==="svg"){return new h(t.args[0],this.support.svg)}else if(t.method==="IFRAME"){return new s(t.args[0],this.isSameOrigin(t.args[0].src),this.options)}else{return new r(t)}};d.prototype.isSVG=function(t){return t.substring(t.length-3).toLowerCase()==="svg"||u.prototype.isInline(t)};d.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})};d.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin};d.prototype.getOrigin=function(t){var e=this.link||(this.link=document.createElement("a"));e.href=t;e.href=e.href;return e.protocol+e.hostname+e.port};d.prototype.getPromise=function(e){return this.timeout(e,this.options.imageTimeout)["catch"](function(){var t=new r(e.src);return t.promise.then(function(t){e.image=t})})};d.prototype.get=function(e){var n=null;return this.images.some(function(t){return(n=t).src===e})?n:null};d.prototype.fetch=function(t){this.images=t.reduce(c(this.findBackgroundImage,this),this.findImages(t));this.images.forEach(function(e,n){e.promise.then(function(){o("Succesfully loaded image #"+(n+1),e)},function(t){o("Failed loading image #"+(n+1),e,t)})});this.ready=Promise.all(this.images.map(this.getPromise,this));o("Finished searching images");return this};d.prototype.timeout=function(n,i){var r;var t=Promise.race([n.promise,new Promise(function(t,e){r=setTimeout(function(){o("Timed out loading image",n);e(n)},i)})]).then(function(t){clearTimeout(r);return t});t["catch"](function(){clearTimeout(r)});return t};e.exports=d},{"./dummyimagecontainer":5,"./framecontainer":8,"./imagecontainer":10,"./lineargradientcontainer":12,"./log":13,"./proxyimagecontainer":17,"./svgcontainer":23,"./svgnodecontainer":24,"./utils":26,"./webkitgradientcontainer":27}],12:[function(t,e,n){var r=t("./gradientcontainer");var o=t("./color");function i(t){r.apply(this,arguments);this.type=r.TYPES.LINEAR;var e=i.REGEXP_DIRECTION.test(t.args[0])||!r.REGEXP_COLORSTOP.test(t.args[0]);if(e){t.args[0].split(/\s+/).reverse().forEach(function(t,e){switch(t){case"left":this.x0=0;this.x1=1;break;case"top":this.y0=0;this.y1=1;break;case"right":this.x0=1;this.x1=0;break;case"bottom":this.y0=1;this.y1=0;break;case"to":var n=this.y0;var i=this.x0;this.y0=this.y1;this.x0=this.x1;this.x1=i;this.y1=n;break;case"center":break;default:var r=parseFloat(t,10)*.01;if(isNaN(r)){break}if(e===0){this.y0=r;this.y1=1-this.y0}else{this.x0=r;this.x1=1-this.x0}break}},this)}else{this.y0=0;this.y1=1}this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(r.REGEXP_COLORSTOP);var n=+e[2];var i=n===0?"%":e[3];return{color:new o(e[1]),stop:i==="%"?n/100:null}});if(this.colorStops[0].stop===null){this.colorStops[0].stop=0}if(this.colorStops[this.colorStops.length-1].stop===null){this.colorStops[this.colorStops.length-1].stop=1}this.colorStops.forEach(function(n,i){if(n.stop===null){this.colorStops.slice(i).some(function(t,e){if(t.stop!==null){n.stop=(t.stop-this.colorStops[i-1].stop)/(e+1)+this.colorStops[i-1].stop;return true}else{return false}},this)}},this)}i.prototype=Object.create(r.prototype);i.REGEXP_DIRECTION=/^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i;e.exports=i},{"./color":3,"./gradientcontainer":9}],13:[function(t,e,n){var i=function(){if(i.options.logging&&window.console&&window.console.log){Function.prototype.bind.call(window.console.log,window.console).apply(window.console,[Date.now()-i.options.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}};i.options={logging:false};e.exports=i},{}],14:[function(t,e,n){var a=t("./color");var i=t("./utils");var r=i.getBounds;var o=i.parseBackgrounds;var s=i.offsetBounds;function u(t,e){this.node=t;this.parent=e;this.stack=null;this.bounds=null;this.borders=null;this.clip=[];this.backgroundClip=[];this.offsetBounds=null;this.visible=null;this.computedStyles=null;this.colors={};this.styles={};this.backgroundImages=null;this.transformData=null;this.transformMatrix=null;this.isPseudoElement=false;this.opacity=null}u.prototype.cloneTo=function(t){t.visible=this.visible;t.borders=this.borders;t.bounds=this.bounds;t.clip=this.clip;t.backgroundClip=this.backgroundClip;t.computedStyles=this.computedStyles;t.styles=this.styles;t.backgroundImages=this.backgroundImages;t.opacity=this.opacity};u.prototype.getOpacity=function(){return this.opacity===null?this.opacity=this.cssFloat("opacity"):this.opacity};u.prototype.assignStack=function(t){this.stack=t;t.children.push(this)};u.prototype.isElementVisible=function(){return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:this.css("display")!=="none"&&this.css("visibility")!=="hidden"&&!this.node.hasAttribute("data-html2canvas-ignore")&&(this.node.nodeName!=="INPUT"||this.node.getAttribute("type")!=="hidden")};u.prototype.css=function(t){if(!this.computedStyles){this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)}return this.styles[t]||(this.styles[t]=this.computedStyles[t])};u.prototype.prefixedCss=function(e){var t=["webkit","moz","ms","o"];var n=this.css(e);if(n===undefined){t.some(function(t){n=this.css(t+e.substr(0,1).toUpperCase()+e.substr(1));return n!==undefined},this)}return n===undefined?null:n};u.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)};u.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e};u.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new a(this.css(t)))};u.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e};u.prototype.fontWeight=function(){var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal";break}return t};u.prototype.parseClip=function(){var t=this.css("clip").match(this.CLIP);if(t){return{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}}return null};u.prototype.parseBackgroundImages=function(){return this.backgroundImages||(this.backgroundImages=o(this.css("backgroundImage")))};u.prototype.cssList=function(t,e){var n=(this.css(t)||"").split(",");n=n[e||0]||n[0]||"auto";n=n.trim().split(" ");if(n.length===1){n=[n[0],f(n[0])?"auto":n[0]]}return n};u.prototype.parseBackgroundSize=function(t,e,n){var i=this.cssList("backgroundSize",n);var r,o;if(f(i[0])){r=t.width*parseFloat(i[0])/100}else if(/contain|cover/.test(i[0])){var a=t.width/t.height,s=e.width/e.height;return a<s^i[0]==="contain"?{width:t.height*s,height:t.height}:{width:t.width,height:t.width/s}}else{r=parseInt(i[0],10)}if(i[0]==="auto"&&i[1]==="auto"){o=e.height}else if(i[1]==="auto"){o=r/e.width*e.height}else if(f(i[1])){o=t.height*parseFloat(i[1])/100}else{o=parseInt(i[1],10)}if(i[0]==="auto"){r=o/e.height*e.width}return{width:r,height:o}};u.prototype.parseBackgroundPosition=function(t,e,n,i){var r=this.cssList("backgroundPosition",n);var o,a;if(f(r[0])){o=(t.width-(i||e).width)*(parseFloat(r[0])/100)}else{o=parseInt(r[0],10)}if(r[1]==="auto"){a=o/e.width*e.height}else if(f(r[1])){a=(t.height-(i||e).height)*parseFloat(r[1])/100}else{a=parseInt(r[1],10)}if(r[0]==="auto"){o=a/e.height*e.width}return{left:o,top:a}};u.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]};u.prototype.parseTextShadows=function(){var t=this;var e=this.css("textShadow");var n=[];if(e&&e!=="none"){var i=e.match(this.TEXT_SHADOW_PROPERTY);for(var r=0;i&&r<i.length;r++){var o=i[r].match(t.TEXT_SHADOW_VALUES);n.push({color:new a(o[0]),offsetX:o[1]?parseFloat(o[1].replace("px","")):0,offsetY:o[2]?parseFloat(o[2].replace("px","")):0,blur:o[3]?o[3].replace("px",""):0})}}return n};u.prototype.parseTransform=function(){if(!this.transformData){if(this.hasTransform()){var t=this.parseBounds();var e=this.prefixedCss("transformOrigin").split(" ").map(c).map(d);e[0]+=t.left;e[1]+=t.top;this.transformData={origin:e,matrix:this.parseTransformMatrix()}}else{this.transformData={origin:[0,0],matrix:[1,0,0,1,0,0]}}}return this.transformData};u.prototype.parseTransformMatrix=function(){if(!this.transformMatrix){var t=this.prefixedCss("transform");var e=t?l(t.match(this.MATRIX_PROPERTY)):null;this.transformMatrix=e?e:[1,0,0,1,0,0]}return this.transformMatrix};u.prototype.parseBounds=function(){return this.bounds||(this.bounds=this.hasTransform()?s(this.node):r(this.node))};u.prototype.hasTransform=function(){return this.parseTransformMatrix().join(",")!=="1,0,0,1,0,0"||this.parent&&this.parent.hasTransform()};u.prototype.getValue=function(){var t=this.node.value||"";if(this.node.tagName==="SELECT"){t=h(this.node)}else if(this.node.type==="password"){t=Array(t.length+1).join("•")}return t.length===0?this.node.placeholder||"":t};u.prototype.MATRIX_PROPERTY=/(matrix|matrix3d)\((.+)\)/;u.prototype.TEXT_SHADOW_PROPERTY=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g;u.prototype.TEXT_SHADOW_VALUES=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g;u.prototype.CLIP=/^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/;function h(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function l(t){if(t&&t[1]==="matrix"){return t[2].split(",").map(function(t){return parseFloat(t.trim())})}else if(t&&t[1]==="matrix3d"){var e=t[2].split(",").map(function(t){return parseFloat(t.trim())});return[e[0],e[1],e[4],e[5],e[12],e[13]]}}function f(t){return t.toString().indexOf("%")!==-1}function c(t){return t.replace("px","")}function d(t){return parseFloat(t)}e.exports=u},{"./color":3,"./utils":26}],15:[function(t,e,n){var s=t("./log");var u=t("punycode");var h=t("./nodecontainer");var l=t("./textcontainer");var f=t("./pseudoelementcontainer");var c=t("./fontmetrics");var d=t("./color");var p=t("./stackingcontext");var i=t("./utils");var g=i.bind;var a=i.getBounds;var v=i.parseBackgrounds;var _=i.offsetBounds;function r(t,e,n,i,r){s("Starting NodeParser");this.renderer=e;this.options=r;this.range=null;this.support=n;this.renderQueue=[];this.stack=new p(true,1,t.ownerDocument,null);var o=new h(t,null);if(r.background){e.rectangle(0,0,e.width,e.height,new d(r.background))}if(t===t.ownerDocument.documentElement){var a=new h(o.color("backgroundColor").isTransparent()?t.ownerDocument.body:t.ownerDocument.documentElement,null);e.rectangle(0,0,e.width,e.height,a.color("backgroundColor"))}o.visibile=o.isElementVisible();this.createPseudoHideStyles(t.ownerDocument);this.disableAnimations(t.ownerDocument);this.nodes=$([o].concat(this.getChildren(o)).filter(function(t){return t.visible=t.isElementVisible()}).map(this.getPseudoElements,this));this.fontMetrics=new c;s("Fetched nodes, total:",this.nodes.length);s("Calculate overflow clips");this.calculateOverflowClips();s("Start fetching images");this.images=i.fetch(this.nodes.filter(H));this.ready=this.images.ready.then(g(function(){s("Images loaded, starting parsing");s("Creating stacking contexts");this.createStackingContexts();s("Sorting stacking contexts");this.sortStackingContexts(this.stack);this.parse(this.stack);s("Render queue created with "+this.renderQueue.length+" items");return new Promise(g(function(t){if(!r.async){this.renderQueue.forEach(this.paint,this);t()}else if(typeof r.async==="function"){r.async.call(this,this.renderQueue,t)}else if(this.renderQueue.length>0){this.renderIndex=0;this.asyncRenderer(this.renderQueue,t)}else{t()}},this))},this))}r.prototype.calculateOverflowClips=function(){this.nodes.forEach(function(t){if(H(t)){if(V(t)){t.appendToDOM()}t.borders=this.parseBorders(t);var e=t.css("overflow")==="hidden"?[t.borders.clip]:[];var n=t.parseClip();if(n&&["absolute","fixed"].indexOf(t.css("position"))!==-1){e.push([["rect",t.bounds.left+n.left,t.bounds.top+n.top,n.right-n.left,n.bottom-n.top]])}t.clip=o(t)?t.parent.clip.concat(e):e;t.backgroundClip=t.css("overflow")!=="hidden"?t.clip.concat([t.borders.clip]):t.clip;if(V(t)){t.cleanDOM()}}else if(U(t)){t.clip=o(t)?t.parent.clip:[]}if(!V(t)){t.bounds=null}},this)};function o(t){return t.parent&&t.parent.clip.length}r.prototype.asyncRenderer=function(t,e,n){n=n||Date.now();this.paint(t[this.renderIndex++]);if(t.length===this.renderIndex){e()}else if(n+20>Date.now()){this.asyncRenderer(t,e,n)}else{setTimeout(g(function(){this.asyncRenderer(t,e)},this),0)}};r.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+f.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }'+"."+f.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')};r.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; "+"-webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")};r.prototype.createStyles=function(t,e){var n=t.createElement("style");n.innerHTML=e;t.body.appendChild(n)};r.prototype.getPseudoElements=function(t){var e=[[t]];if(t.node.nodeType===Node.ELEMENT_NODE){var n=this.getPseudoElement(t,":before");var i=this.getPseudoElement(t,":after");if(n){e.push(n)}if(i){e.push(i)}}return $(e)};function y(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}r.prototype.getPseudoElement=function(t,e){var n=t.computedStyle(e);if(!n||!n.content||n.content==="none"||n.content==="-moz-alt-content"||n.display==="none"){return null}var i=Q(n.content);var r=i.substr(0,3)==="url";var o=document.createElement(r?"img":"html2canvaspseudoelement");var a=new f(o,t,e);for(var s=n.length-1;s>=0;s--){var u=y(n.item(s));o.style[u]=n[u]}o.className=f.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+f.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER;if(r){o.src=v(i)[0].args[0];return[a]}else{var h=document.createTextNode(i);o.appendChild(h);return[a,new l(h,a)]}};r.prototype.getChildren=function(n){return $([].filter.call(n.node.childNodes,O).map(function(t){var e=[t.nodeType===Node.TEXT_NODE?new l(t,n):new h(t,n)].filter(Y);return t.nodeType===Node.ELEMENT_NODE&&e.length&&t.tagName!=="TEXTAREA"?e[0].isElementVisible()?e.concat(this.getChildren(e[0])):[]:e},this))};r.prototype.newStackingContext=function(t,e){var n=new p(e,t.getOpacity(),t.node,t.parent);t.cloneTo(n);var i=e?n.getParentStack(this):n.parent.stack;i.contexts.push(n);t.stack=n};r.prototype.createStackingContexts=function(){this.nodes.forEach(function(t){if(H(t)&&(this.isRootElement(t)||q(t)||F(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform())){this.newStackingContext(t,true)}else if(H(t)&&(R(t)&&T(t)||L(t)||I(t))){this.newStackingContext(t,false)}else{t.assignStack(t.parent.stack)}},this)};r.prototype.isBodyWithTransparentRoot=function(t){return t.node.nodeName==="BODY"&&t.parent.color("backgroundColor").isTransparent()};r.prototype.isRootElement=function(t){return t.parent===null};r.prototype.sortStackingContexts=function(t){t.contexts.sort(W(t.contexts.slice(0)));t.contexts.forEach(this.sortStackingContexts,this)};r.prototype.parseTextBounds=function(a){return function(t,e,n){if(a.parent.css("textDecoration").substr(0,4)!=="none"||t.trim().length!==0){if(this.support.rangeBounds&&!a.parent.hasTransform()){var i=n.slice(0,e).join("").length;return this.getRangeBounds(a.node,i,t.length)}else if(a.node&&typeof a.node.data==="string"){var r=a.node.splitText(t.length);var o=this.getWrapperBounds(a.node,a.parent.hasTransform());a.node=r;return o}}else if(!this.support.rangeBounds||a.parent.hasTransform()){a.node=a.node.splitText(t.length)}return{}}};r.prototype.getWrapperBounds=function(t,e){var n=t.ownerDocument.createElement("html2canvaswrapper");var i=t.parentNode,r=t.cloneNode(true);n.appendChild(t.cloneNode(true));i.replaceChild(n,t);var o=e?_(n):a(n);i.replaceChild(r,n);return o};r.prototype.getRangeBounds=function(t,e,n){var i=this.range||(this.range=t.ownerDocument.createRange());i.setStart(t,e);i.setEnd(t,e+n);return i.getBoundingClientRect()};function m(){}r.prototype.parse=function(t){var e=t.contexts.filter(k);var n=t.children.filter(H);var i=n.filter(j(I));var r=i.filter(j(R)).filter(j(B));var o=n.filter(j(R)).filter(I);var a=i.filter(j(R)).filter(B);var s=t.contexts.concat(i.filter(R)).filter(T);var u=t.children.filter(U).filter(N);var h=t.contexts.filter(M);e.concat(r).concat(o).concat(a).concat(s).concat(u).concat(h).forEach(function(t){this.renderQueue.push(t);if(D(t)){this.parse(t);this.renderQueue.push(new m)}},this)};r.prototype.paint=function(t){try{if(t instanceof m){this.renderer.ctx.restore()}else if(U(t)){if(V(t.parent)){t.parent.appendToDOM()}this.paintText(t);if(V(t.parent)){t.parent.cleanDOM()}}else{this.paintNode(t)}}catch(t){s(t);if(this.options.strict){throw t}}};r.prototype.paintNode=function(t){if(D(t)){this.renderer.setOpacity(t.opacity);this.renderer.ctx.save();if(t.hasTransform()){this.renderer.setTransform(t.parseTransform())}}if(t.node.nodeName==="INPUT"&&t.node.type==="checkbox"){this.paintCheckbox(t)}else if(t.node.nodeName==="INPUT"&&t.node.type==="radio"){this.paintRadio(t)}else{this.paintElement(t)}};r.prototype.paintElement=function(n){var i=n.parseBounds();this.renderer.clip(n.backgroundClip,function(){this.renderer.renderBackground(n,i,n.borders.borders.map(G))},this);this.renderer.clip(n.clip,function(){this.renderer.renderBorders(n.borders.borders)},this);this.renderer.clip(n.backgroundClip,function(){switch(n.node.nodeName){case"svg":case"IFRAME":var t=this.images.get(n.node);if(t){this.renderer.renderImage(n,i,n.borders,t)}else{s("Error loading <"+n.node.nodeName+">",n.node)}break;case"IMG":var e=this.images.get(n.node.src);if(e){this.renderer.renderImage(n,i,n.borders,e)}else{s("Error loading <img>",n.node.src)}break;case"CANVAS":this.renderer.renderImage(n,i,n.borders,{image:n.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(n);break}},this)};r.prototype.paintCheckbox=function(t){var e=t.parseBounds();var n=Math.min(e.width,e.height);var i={width:n-1,height:n-1,top:e.top,left:e.left};var r=[3,3];var o=[r,r,r,r];var a=[1,1,1,1].map(function(t){return{color:new d("#A5A5A5"),width:t}});var s=C(i,o,a);this.renderer.clip(t.backgroundClip,function(){this.renderer.rectangle(i.left+1,i.top+1,i.width-2,i.height-2,new d("#DEDEDE"));this.renderer.renderBorders(x(a,i,s,o));if(t.node.checked){this.renderer.font(new d("#424242"),"normal","normal","bold",n-3+"px","arial");this.renderer.text("✔",i.left+n/6,i.top+n-1)}},this)};r.prototype.paintRadio=function(t){var e=t.parseBounds();var n=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function(){this.renderer.circleStroke(e.left+1,e.top+1,n,new d("#DEDEDE"),1,new d("#A5A5A5"));if(t.node.checked){this.renderer.circle(Math.ceil(e.left+n/4)+1,Math.ceil(e.top+n/4)+1,Math.floor(n/2),new d("#424242"))}},this)};r.prototype.paintFormValue=function(e){var t=e.getValue();if(t.length>0){var n=e.node.ownerDocument;var i=n.createElement("html2canvaswrapper");var r=["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"];r.forEach(function(t){try{i.style[t]=e.css(t)}catch(t){s("html2canvas: Parse: Exception caught in renderFormValue: "+t.message)}});var o=e.parseBounds();i.style.position="fixed";i.style.left=o.left+"px";i.style.top=o.top+"px";i.textContent=t;n.body.appendChild(i);this.paintText(new l(i.firstChild,e));n.body.removeChild(i)}};r.prototype.paintText=function(n){n.applyTextTransform();var t=u.ucs2.decode(n.node.data);var i=(!this.options.letterRendering||P(n))&&!J(n.node.data)?Z(t):t.map(function(t){return u.ucs2.encode([t])});var e=n.parent.fontWeight();var r=n.parent.css("fontSize");var o=n.parent.css("fontFamily");var a=n.parent.parseTextShadows();this.renderer.font(n.parent.color("color"),n.parent.css("fontStyle"),n.parent.css("fontVariant"),e,r,o);if(a.length){this.renderer.fontShadow(a[0].color,a[0].offsetX,a[0].offsetY,a[0].blur)}else{this.renderer.clearShadow()}this.renderer.clip(n.parent.clip,function(){i.map(this.parseTextBounds(n),this).forEach(function(t,e){if(t){this.renderer.text(i[e],t.left,t.bottom);this.renderTextDecoration(n.parent,t,this.fontMetrics.getMetrics(o,r))}},this)},this)};r.prototype.renderTextDecoration=function(t,e,n){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+n.baseline+n.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+n.middle+n.lineWidth),e.width,1,t.color("color"));break}};var b={inset:[["darken",.6],["darken",.1],["darken",.1],["darken",.6]]};r.prototype.parseBorders=function(o){var t=o.parseBounds();var e=z(o);var n=["Top","Right","Bottom","Left"].map(function(t,e){var n=o.css("border"+t+"Style");var i=o.color("border"+t+"Color");if(n==="inset"&&i.isBlack()){i=new d([255,255,255,i.a])}var r=b[n]?b[n][e]:null;return{width:o.cssInt("border"+t+"Width"),color:r?i[r[0]](r[1]):i,args:null}});var i=C(t,e,n);return{clip:this.parseBackgroundClip(o,i,n,e,t),borders:x(n,t,i,e)}};function x(a,s,u,h){return a.map(function(t,e){if(t.width>0){var n=s.left;var i=s.top;var r=s.width;var o=s.height-a[2].width;switch(e){case 0:o=a[0].width;t.args=S({c1:[n,i],c2:[n+r,i],c3:[n+r-a[1].width,i+o],c4:[n+a[3].width,i+o]},h[0],h[1],u.topLeftOuter,u.topLeftInner,u.topRightOuter,u.topRightInner);break;case 1:n=s.left+s.width-a[1].width;r=a[1].width;t.args=S({c1:[n+r,i],c2:[n+r,i+o+a[2].width],c3:[n,i+o],c4:[n,i+a[0].width]},h[1],h[2],u.topRightOuter,u.topRightInner,u.bottomRightOuter,u.bottomRightInner);break;case 2:i=i+s.height-a[2].width;o=a[2].width;t.args=S({c1:[n+r,i+o],c2:[n,i+o],c3:[n+a[3].width,i],c4:[n+r-a[3].width,i]},h[2],h[3],u.bottomRightOuter,u.bottomRightInner,u.bottomLeftOuter,u.bottomLeftInner);break;case 3:r=a[3].width;t.args=S({c1:[n,i+o+a[2].width],c2:[n,i],c3:[n+r,i+a[0].width],c4:[n+r,i+o]},h[3],h[0],u.bottomLeftOuter,u.bottomLeftInner,u.topLeftOuter,u.topLeftInner);break}}return t})}r.prototype.parseBackgroundClip=function(t,e,n,i,r){var o=t.css("backgroundClip"),a=[];switch(o){case"content-box":case"padding-box":A(a,i[0],i[1],e.topLeftInner,e.topRightInner,r.left+n[3].width,r.top+n[0].width);A(a,i[1],i[2],e.topRightInner,e.bottomRightInner,r.left+r.width-n[1].width,r.top+n[0].width);A(a,i[2],i[3],e.bottomRightInner,e.bottomLeftInner,r.left+r.width-n[1].width,r.top+r.height-n[2].width);A(a,i[3],i[0],e.bottomLeftInner,e.topLeftInner,r.left+n[3].width,r.top+r.height-n[2].width);break;default:A(a,i[0],i[1],e.topLeftOuter,e.topRightOuter,r.left,r.top);A(a,i[1],i[2],e.topRightOuter,e.bottomRightOuter,r.left+r.width,r.top);A(a,i[2],i[3],e.bottomRightOuter,e.bottomLeftOuter,r.left+r.width,r.top+r.height);A(a,i[3],i[0],e.bottomLeftOuter,e.topLeftOuter,r.left,r.top+r.height);break}return a};function w(t,e,n,i){var r=4*((Math.sqrt(2)-1)/3);var o=n*r,a=i*r,s=t+n,u=e+i;return{topLeft:E({x:t,y:u},{x:t,y:u-a},{x:s-o,y:e},{x:s,y:e}),topRight:E({x:t,y:e},{x:t+o,y:e},{x:s,y:u-a},{x:s,y:u}),bottomRight:E({x:s,y:e},{x:s,y:e+a},{x:t+o,y:u},{x:t,y:u}),bottomLeft:E({x:s,y:u},{x:s-o,y:u},{x:t,y:e+a},{x:t,y:e})}}function C(t,e,n){var i=t.left,r=t.top,o=t.width,a=t.height,s=e[0][0]<o/2?e[0][0]:o/2,u=e[0][1]<a/2?e[0][1]:a/2,h=e[1][0]<o/2?e[1][0]:o/2,l=e[1][1]<a/2?e[1][1]:a/2,f=e[2][0]<o/2?e[2][0]:o/2,c=e[2][1]<a/2?e[2][1]:a/2,d=e[3][0]<o/2?e[3][0]:o/2,p=e[3][1]<a/2?e[3][1]:a/2;var g=o-h,v=a-c,_=o-f,y=a-p;return{topLeftOuter:w(i,r,s,u).topLeft.subdivide(.5),topLeftInner:w(i+n[3].width,r+n[0].width,Math.max(0,s-n[3].width),Math.max(0,u-n[0].width)).topLeft.subdivide(.5),topRightOuter:w(i+g,r,h,l).topRight.subdivide(.5),topRightInner:w(i+Math.min(g,o+n[3].width),r+n[0].width,g>o+n[3].width?0:h-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:w(i+_,r+v,f,c).bottomRight.subdivide(.5),bottomRightInner:w(i+Math.min(_,o-n[3].width),r+Math.min(v,a+n[0].width),Math.max(0,f-n[1].width),c-n[2].width).bottomRight.subdivide(.5),bottomLeftOuter:w(i,r+y,d,p).bottomLeft.subdivide(.5),bottomLeftInner:w(i+n[3].width,r+y,Math.max(0,d-n[3].width),p-n[2].width).bottomLeft.subdivide(.5)}}function E(s,u,h,l){var f=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:s,startControl:u,endControl:h,end:l,subdivide:function(t){var e=f(s,u,t),n=f(u,h,t),i=f(h,l,t),r=f(e,n,t),o=f(n,i,t),a=f(r,o,t);return[E(s,e,r,a),E(a,o,i,l)]},curveTo:function(t){t.push(["bezierCurve",u.x,u.y,h.x,h.y,l.x,l.y])},curveToReversed:function(t){t.push(["bezierCurve",h.x,h.y,u.x,u.y,s.x,s.y])}}}function S(t,e,n,i,r,o,a){var s=[];if(e[0]>0||e[1]>0){s.push(["line",i[1].start.x,i[1].start.y]);i[1].curveTo(s)}else{s.push(["line",t.c1[0],t.c1[1]])}if(n[0]>0||n[1]>0){s.push(["line",o[0].start.x,o[0].start.y]);o[0].curveTo(s);s.push(["line",a[0].end.x,a[0].end.y]);a[0].curveToReversed(s)}else{s.push(["line",t.c2[0],t.c2[1]]);s.push(["line",t.c3[0],t.c3[1]])}if(e[0]>0||e[1]>0){s.push(["line",r[1].end.x,r[1].end.y]);r[1].curveToReversed(s)}else{s.push(["line",t.c4[0],t.c4[1]])}return s}function A(t,e,n,i,r,o,a){if(e[0]>0||e[1]>0){t.push(["line",i[0].start.x,i[0].start.y]);i[0].curveTo(t);i[1].curveTo(t)}else{t.push(["line",o,a])}if(n[0]>0||n[1]>0){t.push(["line",r[0].start.x,r[0].start.y])}}function k(t){return t.cssInt("zIndex")<0}function M(t){return t.cssInt("zIndex")>0}function T(t){return t.cssInt("zIndex")===0}function B(t){return["inline","inline-block","inline-table"].indexOf(t.css("display"))!==-1}function D(t){return t instanceof p}function N(t){return t.node.data.trim().length>0}function P(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function z(i){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(t){var e=i.css("border"+t+"Radius");var n=e.split(" ");if(n.length<=1){n[1]=n[0]}return n.map(X)})}function O(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function F(t){var e=t.css("position");var n=["absolute","relative","fixed"].indexOf(e)!==-1?t.css("zIndex"):"auto";return n!=="auto"}function R(t){return t.css("position")!=="static"}function I(t){return t.css("float")!=="none"}function L(t){return["inline-block","inline-table"].indexOf(t.css("display"))!==-1}function j(t){var e=this;return function(){return!t.apply(e,arguments)}}function H(t){return t.node.nodeType===Node.ELEMENT_NODE}function V(t){return t.isPseudoElement===true}function U(t){return t.node.nodeType===Node.TEXT_NODE}function W(n){return function(t,e){return t.cssInt("zIndex")+n.indexOf(t)/n.length-(e.cssInt("zIndex")+n.indexOf(e)/n.length)}}function q(t){return t.getOpacity()<1}function X(t){return parseInt(t,10)}function G(t){return t.width}function Y(t){return t.node.nodeType!==Node.ELEMENT_NODE||["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)===-1}function $(t){return[].concat.apply([],t)}function Q(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function Z(t){var e=[],n=0,i=false,r;while(t.length){if(K(t[n])===i){r=t.splice(0,n);if(r.length){e.push(u.ucs2.encode(r))}i=!i;n=0}else{n++}if(n>=t.length){r=t.splice(0,n);if(r.length){e.push(u.ucs2.encode(r))}}}return e}function K(t){return[32,13,10,9,45].indexOf(t)!==-1}function J(t){return/[^\u0000-\u00ff]/.test(t)}e.exports=r},{"./color":3,"./fontmetrics":7,"./log":13,"./nodecontainer":14,"./pseudoelementcontainer":18,"./stackingcontext":21,"./textcontainer":25,"./utils":26,punycode:1}],16:[function(t,e,n){var a=t("./xhr");var i=t("./utils");var s=t("./log");var u=t("./clone");var h=i.decode64;function l(t,e,n){var i="withCredentials"in new XMLHttpRequest;if(!e){return Promise.reject("No proxy configured")}var r=c(i);var o=d(e,t,r);return i?a(o):f(n,o,r).then(function(t){return h(t.content)})}var r=0;function o(t,e,n){var i="crossOrigin"in new Image;var r=c(i);var o=d(e,t,r);return i?Promise.resolve(o):f(n,o,r).then(function(t){return"data:"+t.type+";base64,"+t.content})}function f(r,o,a){return new Promise(function(e,n){var t=r.createElement("script");var i=function(){delete window.html2canvas.proxy[a];r.body.removeChild(t)};window.html2canvas.proxy[a]=function(t){i();e(t)};t.src=o;t.onerror=function(t){i();n(t)};r.body.appendChild(t)})}function c(t){return!t?"html2canvas_"+Date.now()+"_"+ ++r+"_"+Math.round(Math.random()*1e5):""}function d(t,e,n){return t+"?url="+encodeURIComponent(e)+(n.length?"&callback=html2canvas.proxy."+n:"")}function p(o){return function(e){var t=new DOMParser,n;try{n=t.parseFromString(e,"text/html")}catch(t){s("DOMParser not supported, falling back to createHTMLDocument");n=document.implementation.createHTMLDocument("");try{n.open();n.write(e);n.close()}catch(t){s("createHTMLDocument write not supported, falling back to document.body.innerHTML");n.body.innerHTML=e}}var i=n.querySelector("base");if(!i||!i.href.host){var r=n.createElement("base");r.href=o;n.head.insertBefore(r,n.head.firstChild)}return n}}function g(t,e,n,i,r,o){return new l(t,e,window.document).then(p(t)).then(function(t){return u(t,n,i,r,o,0,0)})}n.Proxy=l;n.ProxyURL=o;n.loadUrlDocument=g},{"./clone":2,"./log":13,"./utils":26,"./xhr":28}],17:[function(t,e,n){var o=t("./proxy").ProxyURL;function i(n,i){var t=document.createElement("a");t.href=n;n=t.href;this.src=n;this.image=new Image;var r=this;this.promise=new Promise(function(t,e){r.image.crossOrigin="Anonymous";r.image.onload=t;r.image.onerror=e;new o(n,i,document).then(function(t){r.image.src=t})["catch"](e)})}e.exports=i},{"./proxy":16}],18:[function(t,e,n){var i=t("./nodecontainer");function r(t,e,n){i.call(this,t,e);this.isPseudoElement=true;this.before=n===":before"}r.prototype.cloneTo=function(t){r.prototype.cloneTo.call(this,t);t.isPseudoElement=true;t.before=this.before};r.prototype=Object.create(i.prototype);r.prototype.appendToDOM=function(){if(this.before){this.parent.node.insertBefore(this.node,this.parent.node.firstChild)}else{this.parent.node.appendChild(this.node)}this.parent.node.className+=" "+this.getHideClass()};r.prototype.cleanDOM=function(){this.node.parentNode.removeChild(this.node);this.parent.node.className=this.parent.node.className.replace(this.getHideClass(),"")};r.prototype.getHideClass=function(){return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]};r.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before";r.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after";e.exports=r},{"./nodecontainer":14}],19:[function(t,e,n){var u=t("./log");function i(t,e,n,i,r){this.width=t;this.height=e;this.images=n;this.options=i;this.document=r}i.prototype.renderImage=function(t,e,n,i){var r=t.cssInt("paddingLeft"),o=t.cssInt("paddingTop"),a=t.cssInt("paddingRight"),s=t.cssInt("paddingBottom"),u=n.borders;var h=e.width-(u[1].width+u[3].width+r+a);var l=e.height-(u[0].width+u[2].width+o+s);this.drawImage(i,0,0,i.image.width||h,i.image.height||l,e.left+r+u[3].width,e.top+o+u[0].width,h,l)};i.prototype.renderBackground=function(t,e,n){if(e.height>0&&e.width>0){this.renderBackgroundColor(t,e);this.renderBackgroundImage(t,e,n)}};i.prototype.renderBackgroundColor=function(t,e){var n=t.color("backgroundColor");if(!n.isTransparent()){this.rectangle(e.left,e.top,e.width,e.height,n)}};i.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)};i.prototype.renderBorder=function(t){if(!t.color.isTransparent()&&t.args!==null){this.drawShape(t.args,t.color)}};i.prototype.renderBackgroundImage=function(o,a,s){var t=o.parseBackgroundImages();t.reverse().forEach(function(t,e,n){switch(t.method){case"url":var i=this.images.get(t.args[0]);if(i){this.renderBackgroundRepeating(o,a,i,n.length-(e+1),s)}else{u("Error loading background-image",t.args[0])}break;case"linear-gradient":case"gradient":var r=this.images.get(t.value);if(r){this.renderBackgroundGradient(r,a,s)}else{u("Error loading background-image",t.args[0])}break;case"none":break;default:u("Unknown background-image type",t.args[0])}},this)};i.prototype.renderBackgroundRepeating=function(t,e,n,i,r){var o=t.parseBackgroundSize(e,n.image,i);var a=t.parseBackgroundPosition(e,n.image,i,o);var s=t.parseBackgroundRepeat(i);switch(s){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(n,a,o,e,e.left+r[3],e.top+a.top+r[0],99999,o.height,r);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(n,a,o,e,e.left+a.left+r[3],e.top+r[0],o.width,99999,r);break;case"no-repeat":this.backgroundRepeatShape(n,a,o,e,e.left+a.left+r[3],e.top+a.top+r[0],o.width,o.height,r);break;default:this.renderBackgroundRepeat(n,a,o,{top:e.top,left:e.left},r[3],r[0]);break}};e.exports=i},{"./log":13}],20:[function(t,e,n){var i=t("../renderer");var r=t("../lineargradientcontainer");var o=t("../log");function a(t,e){i.apply(this,arguments);this.canvas=this.options.canvas||this.document.createElement("canvas");if(!this.options.canvas){this.canvas.width=t;this.canvas.height=e}this.ctx=this.canvas.getContext("2d");this.taintCtx=this.document.createElement("canvas").getContext("2d");this.ctx.textBaseline="bottom";this.variables={};o("Initialized CanvasRenderer with size",t,"x",e)}a.prototype=Object.create(i.prototype);a.prototype.setFillStyle=function(t){this.ctx.fillStyle=typeof t==="object"&&!!t.isColor?t.toString():t;return this.ctx};a.prototype.rectangle=function(t,e,n,i,r){this.setFillStyle(r).fillRect(t,e,n,i)};a.prototype.circle=function(t,e,n,i){this.setFillStyle(i);this.ctx.beginPath();this.ctx.arc(t+n/2,e+n/2,n/2,0,Math.PI*2,true);this.ctx.closePath();this.ctx.fill()};a.prototype.circleStroke=function(t,e,n,i,r,o){this.circle(t,e,n,i);this.ctx.strokeStyle=o.toString();this.ctx.stroke()};a.prototype.drawShape=function(t,e){this.shape(t);this.setFillStyle(e).fill()};a.prototype.taints=function(e){if(e.tainted===null){this.taintCtx.drawImage(e.image,0,0);try{this.taintCtx.getImageData(0,0,1,1);e.tainted=false}catch(t){this.taintCtx=document.createElement("canvas").getContext("2d");e.tainted=true}}return e.tainted};a.prototype.drawImage=function(t,e,n,i,r,o,a,s,u){if(!this.taints(t)||this.options.allowTaint){this.ctx.drawImage(t.image,e,n,i,r,o,a,s,u)}};a.prototype.clip=function(t,e,n){this.ctx.save();t.filter(s).forEach(function(t){this.shape(t).clip()},this);e.call(n);this.ctx.restore()};a.prototype.shape=function(t){this.ctx.beginPath();t.forEach(function(t,e){if(t[0]==="rect"){this.ctx.rect.apply(this.ctx,t.slice(1))}else{this.ctx[e===0?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1))}},this);this.ctx.closePath();return this.ctx};a.prototype.font=function(t,e,n,i,r,o){this.setFillStyle(t).font=[e,n,i,r,o].join(" ").split(",")[0]};a.prototype.fontShadow=function(t,e,n,i){this.setVariable("shadowColor",t.toString()).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",n).setVariable("shadowBlur",i)};a.prototype.clearShadow=function(){this.setVariable("shadowColor","rgba(0,0,0,0)")};a.prototype.setOpacity=function(t){this.ctx.globalAlpha=t};a.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]);this.ctx.transform.apply(this.ctx,t.matrix);this.ctx.translate(-t.origin[0],-t.origin[1])};a.prototype.setVariable=function(t,e){if(this.variables[t]!==e){this.variables[t]=this.ctx[t]=e}return this};a.prototype.text=function(t,e,n){this.ctx.fillText(t,e,n)};a.prototype.backgroundRepeatShape=function(t,e,n,i,r,o,a,s,u){var h=[["line",Math.round(r),Math.round(o)],["line",Math.round(r+a),Math.round(o)],["line",Math.round(r+a),Math.round(s+o)],["line",Math.round(r),Math.round(s+o)]];this.clip([h],function(){this.renderBackgroundRepeat(t,e,n,i,u[3],u[0])},this)};a.prototype.renderBackgroundRepeat=function(t,e,n,i,r,o){var a=Math.round(i.left+e.left+r),s=Math.round(i.top+e.top+o);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,n),"repeat"));this.ctx.translate(a,s);this.ctx.fill();this.ctx.translate(-a,-s)};a.prototype.renderBackgroundGradient=function(t,e){if(t instanceof r){var n=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){n.addColorStop(t.stop,t.color.toString())});this.rectangle(e.left,e.top,e.width,e.height,n)}};a.prototype.resizeImage=function(t,e){var n=t.image;if(n.width===e.width&&n.height===e.height){return n}var i,r=document.createElement("canvas");r.width=e.width;r.height=e.height;i=r.getContext("2d");i.drawImage(n,0,0,n.width,n.height,0,0,e.width,e.height);return r};function s(t){return t.length>0}e.exports=a},{"../lineargradientcontainer":12,"../log":13,"../renderer":19}],21:[function(t,e,n){var r=t("./nodecontainer");function i(t,e,n,i){r.call(this,n,i);this.ownStacking=t;this.contexts=[];this.children=[];this.opacity=(this.parent?this.parent.stack.opacity:1)*e}i.prototype=Object.create(r.prototype);i.prototype.getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack};e.exports=i},{"./nodecontainer":14}],22:[function(t,e,n){function i(t){this.rangeBounds=this.testRangeBounds(t);this.cors=this.testCORS();this.svg=this.testSVG()}i.prototype.testRangeBounds=function(t){var e,n,i,r,o=false;if(t.createRange){e=t.createRange();if(e.getBoundingClientRect){n=t.createElement("boundtest");n.style.height="123px";n.style.display="block";t.body.appendChild(n);e.selectNode(n);i=e.getBoundingClientRect();r=i.height;if(r===123){o=true}t.body.removeChild(n)}}return o};i.prototype.testCORS=function(){return typeof(new Image).crossOrigin!=="undefined"};i.prototype.testSVG=function(){var t=new Image;var e=document.createElement("canvas");var n=e.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(t,0,0);e.toDataURL()}catch(t){return false}return true};e.exports=i},{}],23:[function(t,e,n){var i=t("./xhr");var r=t("./utils").decode64;function o(t){this.src=t;this.image=null;var n=this;this.promise=this.hasFabric().then(function(){return n.isInline(t)?Promise.resolve(n.inlineFormatting(t)):i(t)}).then(function(e){return new Promise(function(t){window.html2canvas.svg.fabric.loadSVGFromString(e,n.createCanvas.call(n,t))})})}o.prototype.hasFabric=function(){return!window.html2canvas.svg||!window.html2canvas.svg.fabric?Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg")):Promise.resolve()};o.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)};o.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(;base64)?,/,"")};o.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)};o.prototype.createCanvas=function(i){var r=this;return function(t,e){var n=new window.html2canvas.svg.fabric.StaticCanvas("c");r.image=n.lowerCanvasEl;n.setWidth(e.width).setHeight(e.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(t,e)).renderAll();i(n.lowerCanvasEl)}};o.prototype.decode64=function(t){return typeof window.atob==="function"?window.atob(t):r(t)};e.exports=o},{"./utils":26,"./xhr":28}],24:[function(t,e,n){var i=t("./svgcontainer");function r(n,t){this.src=n;this.image=null;var i=this;this.promise=t?new Promise(function(t,e){i.image=new Image;i.image.onload=t;i.image.onerror=e;i.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(n);if(i.image.complete===true){t(i.image)}}):this.hasFabric().then(function(){return new Promise(function(t){window.html2canvas.svg.fabric.parseSVGDocument(n,i.createCanvas.call(i,t))})})}r.prototype=Object.create(i.prototype);e.exports=r},{"./svgcontainer":23}],25:[function(t,e,n){var i=t("./nodecontainer");function r(t,e){i.call(this,t,e)}r.prototype=Object.create(i.prototype);r.prototype.applyTextTransform=function(){this.node.data=this.transform(this.parent.css("textTransform"))};r.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,o);case"uppercase":return e.toUpperCase();default:return e}};function o(t,e,n){if(t.length>0){return e+n.toUpperCase()}}e.exports=r},{"./nodecontainer":14}],26:[function(t,e,n){n.smallImage=function t(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"};n.bind=function(t,e){return function(){return t.apply(e,arguments)}};n.decode64=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var n=t.length,i,r,o,a,s,u,h,l;var f="";for(i=0;i<n;i+=4){r=e.indexOf(t[i]);o=e.indexOf(t[i+1]);a=e.indexOf(t[i+2]);s=e.indexOf(t[i+3]);u=r<<2|o>>4;h=(o&15)<<4|a>>2;l=(a&3)<<6|s;if(a===64){f+=String.fromCharCode(u)}else if(s===64||s===-1){f+=String.fromCharCode(u,h)}else{f+=String.fromCharCode(u,h,l)}}return f};n.getBounds=function(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect();var n=t.offsetWidth==null?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+n,left:e.left,width:n,height:t.offsetHeight==null?e.height:t.offsetHeight}}return{}};n.offsetBounds=function(t){var e=t.offsetParent?n.offsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}};n.parseBackgrounds=function(t){var e=" \r\n\t",n,i,r,o,a,s=[],u=0,h=0,l,f;var c=function(){if(n){if(i.substr(0,1)==='"'){i=i.substr(1,i.length-2)}if(i){f.push(i)}if(n.substr(0,1)==="-"&&(o=n.indexOf("-",1)+1)>0){r=n.substr(0,o);n=n.substr(o)}s.push({prefix:r,method:n.toLowerCase(),value:a,args:f,image:null})}f=[];n=r=i=a=""};f=[];n=r=i=a="";t.split("").forEach(function(t){if(u===0&&e.indexOf(t)>-1){return}switch(t){case'"':if(!l){l=t}else if(l===t){l=null}break;case"(":if(l){break}else if(u===0){u=1;a+=t;return}else{h++}break;case")":if(l){break}else if(u===1){if(h===0){u=0;a+=t;c();return}else{h--}}break;case",":if(l){break}else if(u===0){c();return}else if(u===1){if(h===0&&!n.match(/^url$/i)){f.push(i);i="";a+=t;return}}break}a+=t;if(u===0){n+=t}else{i+=t}});c();return s}},{}],27:[function(t,e,n){var i=t("./gradientcontainer");function r(t){i.apply(this,arguments);this.type=t.args[0]==="linear"?i.TYPES.LINEAR:i.TYPES.RADIAL}r.prototype=Object.create(i.prototype);e.exports=r},{"./gradientcontainer":9}],28:[function(t,e,n){function i(i){return new Promise(function(t,e){var n=new XMLHttpRequest;n.open("GET",i);n.onload=function(){if(n.status===200){t(n.responseText)}else{e(new Error(n.statusText))}};n.onerror=function(){e(new Error("Network Error"))};n.send()})}e.exports=i},{}]},{},[4])(4)})});var Kx=function(t){var e=this;this.ok=false;this.alpha=1;if(t.charAt(0)=="#"){t=t.substr(1,6)}t=t.replace(/ /g,"");t=t.toLowerCase();var l={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=l[t]||t;var f=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}];for(var n=0;n<f.length;n++){var i=f[n].re;var r=f[n].process;var o=i.exec(t);if(o){var a=r(o);e.r=a[0];e.g=a[1];e.b=a[2];if(a.length>3){e.alpha=a[3]}e.ok=true}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"};this.toHex=function(){var t=this.r.toString(16);var e=this.g.toString(16);var n=this.b.toString(16);if(t.length==1){t="0"+t}if(e.length==1){e="0"+e}if(n.length==1){n="0"+n}return"#"+t+e+n};this.getHelpXML=function(){var t=new Array;for(var e=0;e<f.length;e++){var n=f[e].example;for(var i=0;i<n.length;i++){t[t.length]=n[i]}}for(var r in l){t[t.length]=r}var o=document.createElement("ul");o.setAttribute("id","rgbcolor-examples");for(var e=0;e<t.length;e++){try{var a=document.createElement("li");var s=new RGBColor(t[e]);var u=document.createElement("div");u.style.cssText="margin: 3px; "+"border: 1px solid black; "+"background:"+s.toHex()+"; "+"color:"+s.toHex();u.appendChild(document.createTextNode("test"));var h=document.createTextNode(" "+t[e]+" -> "+s.toRGB()+" -> "+s.toHex());a.appendChild(u);a.appendChild(h);o.appendChild(a)}catch(t){}}return o}};var Jx=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259];var tw=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function ew(t,e,n,i){if(isNaN(i)||i<1){return}i|=0;var r,o,a,s,u,h,l,f,c,d,p,g,v,_,y,m,b,x,w,C,E,S,A,k;var M=i+i+1;var T=e-1;var B=n-1;var D=i+1;var N=D*(D+1)/2;var P=new nw;var z=P;for(a=1;a<M;a++){z=z.next=new nw;if(a==D){var O=z}}z.next=P;var F=null;var R=null;l=h=0;var I=Jx[i];var L=tw[i];for(o=0;o<n;o++){m=b=x=w=f=c=d=p=0;g=D*(C=t[h]);v=D*(E=t[h+1]);_=D*(S=t[h+2]);y=D*(A=t[h+3]);f+=N*C;c+=N*E;d+=N*S;p+=N*A;z=P;for(a=0;a<D;a++){z.r=C;z.g=E;z.b=S;z.a=A;z=z.next}for(a=1;a<D;a++){s=h+((T<a?T:a)<<2);f+=(z.r=C=t[s])*(k=D-a);c+=(z.g=E=t[s+1])*k;d+=(z.b=S=t[s+2])*k;p+=(z.a=A=t[s+3])*k;m+=C;b+=E;x+=S;w+=A;z=z.next}F=P;R=O;for(r=0;r<e;r++){t[h+3]=A=p*I>>L;if(A!=0){A=255/A;t[h]=(f*I>>L)*A;t[h+1]=(c*I>>L)*A;t[h+2]=(d*I>>L)*A}else{t[h]=t[h+1]=t[h+2]=0}f-=g;c-=v;d-=_;p-=y;g-=F.r;v-=F.g;_-=F.b;y-=F.a;s=l+((s=r+i+1)<T?s:T)<<2;m+=F.r=t[s];b+=F.g=t[s+1];x+=F.b=t[s+2];w+=F.a=t[s+3];f+=m;c+=b;d+=x;p+=w;F=F.next;g+=C=R.r;v+=E=R.g;_+=S=R.b;y+=A=R.a;m-=C;b-=E;x-=S;w-=A;R=R.next;h+=4}l+=e}for(r=0;r<e;r++){b=x=w=m=c=d=p=f=0;h=r<<2;g=D*(C=t[h]);v=D*(E=t[h+1]);_=D*(S=t[h+2]);y=D*(A=t[h+3]);f+=N*C;c+=N*E;d+=N*S;p+=N*A;z=P;for(a=0;a<D;a++){z.r=C;z.g=E;z.b=S;z.a=A;z=z.next}u=e;for(a=1;a<=i;a++){h=u+r<<2;f+=(z.r=C=t[h])*(k=D-a);c+=(z.g=E=t[h+1])*k;d+=(z.b=S=t[h+2])*k;p+=(z.a=A=t[h+3])*k;m+=C;b+=E;x+=S;w+=A;z=z.next;if(a<B){u+=e}}h=r;F=P;R=O;for(o=0;o<n;o++){s=h<<2;t[s+3]=A=p*I>>L;if(A>0){A=255/A;t[s]=(f*I>>L)*A;t[s+1]=(c*I>>L)*A;t[s+2]=(d*I>>L)*A}else{t[s]=t[s+1]=t[s+2]=0}f-=g;c-=v;d-=_;p-=y;g-=F.r;v-=F.g;_-=F.b;y-=F.a;s=r+((s=o+D)<B?s:B)*e<<2;f+=m+=F.r=t[s];c+=b+=F.g=t[s+1];d+=x+=F.b=t[s+2];p+=w+=F.a=t[s+3];F=F.next;g+=C=R.r;v+=E=R.g;_+=S=R.b;y+=A=R.a;m-=C;b-=E;x-=S;w-=A;R=R.next;h+=e}}}function nw(){this.r=0;this.g=0;this.b=0;this.a=0;this.next=null}var iw=ew;var rw=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var ow=new RegExp("[\\-\\.0-9"+rw.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var aw=new RegExp("^"+rw.source+ow.source+"*(?::"+rw.source+ow.source+"*)?$");var sw=0;var uw=1;var hw=2;var lw=3;var fw=4;var cw=5;var dw=6;var pw=7;function gw(){}gw.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument();ww(e,e={});vw(t,e,n,i,this.errorHandler);i.endDocument()}};function vw(n,t,i,r,o){function a(t){if(t>65535){t-=65536;var e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}else{return String.fromCharCode(t)}}function s(t){var e=t.slice(1,-1);if(e in i){return i[e]}else if(e.charAt(0)==="#"){return a(parseInt(e.substr(1).replace("x","0x")))}else{o.error("entity not found:"+t);return t}}function e(t){if(t>g){var e=n.substring(g,t).replace(/&#?\w+;/g,s);c&&u(g);r.characters(e,0,t-g);g=t}}function u(t,e){while(t>=l&&(e=f.exec(n))){h=e.index;l=h+e[0].length;c.lineNumber++}c.columnNumber=t-h+1}var h=0;var l=0;var f=/.*(?:\r\n?|\n)|.*$/g;var c=r.locator;var d=[{currentNSMap:t}];var p={};var g=0;while(true){try{var v=n.indexOf("<",g);if(v<0){if(!n.substr(g).match(/^\s*$/)){var _=r.doc;var y=_.createTextNode(n.substr(g));_.appendChild(y);r.currentElement=y}return}if(v>g){e(v)}switch(n.charAt(v+1)){case"/":var m=n.indexOf(">",v+3);var b=n.substring(v+2,m);var x=d.pop();if(m<0){b=n.substring(v+2).replace(/[\s<].*/,"");o.error("end tag name: "+b+" is not complete:"+x.tagName);m=v+1+b.length}else if(b.match(/\s</)){b=b.replace(/[\s<].*/,"");o.error("end tag name: "+b+" maybe not complete");m=v+1+b.length}var w=x.localNSMap;var C=x.tagName==b;var E=C||x.tagName&&x.tagName.toLowerCase()==b.toLowerCase();if(E){r.endElement(x.uri,x.localName,b);if(w){for(var S in w){r.endPrefixMapping(S)}}if(!C){o.fatalError("end tag name: "+b+" is not match the current start tagName:"+x.tagName)}}else{d.push(x)}m++;break;case"?":c&&u(v);m=Ew(n,v,r);break;case"!":c&&u(v);m=Cw(n,v,r,o);break;default:c&&u(v);var A=new Sw;var k=d[d.length-1].currentNSMap;var m=yw(n,v,A,k,s,o);var M=A.length;if(!A.closed&&xw(n,m,A.tagName,p)){A.closed=true;if(!i.nbsp){o.warning("unclosed xml attribute")}}if(c&&M){var T=_w(c,{});for(var B=0;B<M;B++){var D=A[B];u(D.offset);D.locator=_w(c,{})}r.locator=T;if(mw(A,r,k)){d.push(A)}r.locator=c}else{if(mw(A,r,k)){d.push(A)}}if(A.uri==="http://www.w3.org/1999/xhtml"&&!A.closed){m=bw(n,m,A.tagName,s,r)}else{m++}}}catch(t){o.error("element parse error: "+t);m=-1}if(m>g){g=m}else{e(Math.max(v,g)+1)}}}function _w(t,e){e.lineNumber=t.lineNumber;e.columnNumber=t.columnNumber;return e}function yw(t,e,n,i,r,o){var a;var s;var u=++e;var h=sw;while(true){var l=t.charAt(u);switch(l){case"=":if(h===uw){a=t.slice(e,u);h=lw}else if(h===hw){h=lw}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(h===lw||h===uw){if(h===uw){o.warning('attribute value must after "="');a=t.slice(e,u)}e=u+1;u=t.indexOf(l,e);if(u>0){s=t.slice(e,u).replace(/&#?\w+;/g,r);n.add(a,s,e-1);h=cw}else{throw new Error("attribute value no end '"+l+"' match")}}else if(h==fw){s=t.slice(e,u).replace(/&#?\w+;/g,r);n.add(a,s,e);o.warning('attribute "'+a+'" missed start quot('+l+")!!");e=u+1;h=cw}else{throw new Error('attribute value must after "="')}break;case"/":switch(h){case sw:n.setTagName(t.slice(e,u));case cw:case dw:case pw:h=pw;n.closed=true;case fw:case uw:case hw:break;default:throw new Error("attribute invalid close char('/')")}break;case"":o.error("unexpected end of input");if(h==sw){n.setTagName(t.slice(e,u))}return u;case">":switch(h){case sw:n.setTagName(t.slice(e,u));case cw:case dw:case pw:break;case fw:case uw:s=t.slice(e,u);if(s.slice(-1)==="/"){n.closed=true;s=s.slice(0,-1)}case hw:if(h===hw){s=a}if(h==fw){o.warning('attribute "'+s+'" missed quot(")!!');n.add(a,s.replace(/&#?\w+;/g,r),e)}else{if(i[""]!=="http://www.w3.org/1999/xhtml"||!s.match(/^(?:disabled|checked|selected)$/i)){o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!')}n.add(s,s,e)}break;case lw:throw new Error("attribute value missed!!")}return u;case"":l=" ";default:if(l<=" "){switch(h){case sw:n.setTagName(t.slice(e,u));h=dw;break;case uw:a=t.slice(e,u);h=hw;break;case fw:var s=t.slice(e,u).replace(/&#?\w+;/g,r);o.warning('attribute "'+s+'" missed quot(")!!');n.add(a,s,e);case cw:h=dw;break}}else{switch(h){case hw:if(i[""]!=="http://www.w3.org/1999/xhtml"||!a.match(/^(?:disabled|checked|selected)$/i)){o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!')}n.add(a,a,e);e=u;h=uw;break;case cw:o.warning('attribute space is required"'+a+'"!!');case dw:h=uw;e=u;break;case lw:h=fw;e=u;break;case pw:throw new Error("elements closed character '/' and '>' must be connected to")}}}u++}}function mw(t,e,n){var i=t.tagName;var r=null;var o=t.length;while(o--){var a=t[o];var s=a.qName;var u=a.value;var h=s.indexOf(":");if(h>0){var l=a.prefix=s.slice(0,h);var f=s.slice(h+1);var c=l==="xmlns"&&f}else{f=s;l=null;c=s==="xmlns"&&""}a.localName=f;if(c!==false){if(r==null){r={};ww(n,n={})}n[c]=r[c]=u;a.uri="http://www.w3.org/2000/xmlns/";e.startPrefixMapping(c,u)}}var o=t.length;while(o--){a=t[o];var l=a.prefix;if(l){if(l==="xml"){a.uri="http://www.w3.org/XML/1998/namespace"}if(l!=="xmlns"){a.uri=n[l||""]}}}var h=i.indexOf(":");if(h>0){l=t.prefix=i.slice(0,h);f=t.localName=i.slice(h+1)}else{l=null;f=t.localName=i}var d=t.uri=n[l||""];e.startElement(d,f,i,t);if(t.closed){e.endElement(d,f,i);if(r){for(l in r){e.endPrefixMapping(l)}}}else{t.currentNSMap=n;t.localNSMap=r;return true}}function bw(t,e,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e);var a=t.substring(e+1,o);if(/[&<]/.test(a)){if(/^script$/i.test(n)){r.characters(a,0,a.length);return o}a=a.replace(/&#?\w+;/g,i);r.characters(a,0,a.length);return o}}return e+1}function xw(t,e,n,i){var r=i[n];if(r==null){r=t.lastIndexOf("</"+n+">");if(r<e){r=t.lastIndexOf("</"+n)}i[n]=r}return r<e}function ww(t,e){for(var n in t){e[n]=t[n]}}function Cw(t,e,n,i){var r=t.charAt(e+2);switch(r){case"-":if(t.charAt(e+3)==="-"){var o=t.indexOf("--\x3e",e+4);if(o>e){n.comment(t,e+4,o-e-4);return o+3}else{i.error("Unclosed comment");return-1}}else{return-1}default:if(t.substr(e+3,6)=="CDATA["){var o=t.indexOf("]]>",e+9);n.startCDATA();n.characters(t,e+9,o-e-9);n.endCDATA();return o+3}var a=kw(t,e);var s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var u=a[1][0];var h=s>3&&/^public$/i.test(a[2][0])&&a[3][0];var l=s>4&&a[4][0];var f=a[s-1];n.startDTD(u,h&&h.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2"));n.endDTD();return f.index+f[0].length}}return-1}function Ew(t,e,n){var i=t.indexOf("?>",e);if(i){var r=t.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){n.processingInstruction(r[1],r[2]);return i+2}else{return-1}}return-1}function Sw(t){}Sw.prototype={setTagName:function(t){if(!aw.test(t)){throw new Error("invalid tagName:"+t)}this.tagName=t},add:function(t,e,n){if(!aw.test(t)){throw new Error("invalid attribute:"+t)}this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function Aw(t,e){t.__proto__=e;return t}if(!(Aw({},Aw.prototype)instanceof Aw)){Aw=function(t,e){function n(){}n.prototype=e;n=new n;for(e in t){n[e]=t[e]}return n}}function kw(t,e){var n;var i=[];var r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=e;r.exec(t);while(n=r.exec(t)){i.push(n);if(n[1]){return i}}}var Mw=gw;var Tw={XMLReader:Mw};function Bw(t,e){for(var n in t){e[n]=t[n]}}function Dw(t,e){var n=t.prototype;if(Object.create){var i=Object.create(e.prototype);n.__proto__=i}if(!(n instanceof e)){var r=function(){};r.prototype=e.prototype;r=new r;Bw(n,r);t.prototype=n=r}if(n.constructor!=t){if(typeof t!="function"){console.error("unknow Class:"+t)}n.constructor=t}}var Nw="http://www.w3.org/1999/xhtml";var Pw={};var zw=Pw.ELEMENT_NODE=1;var Ow=Pw.ATTRIBUTE_NODE=2;var Fw=Pw.TEXT_NODE=3;var Rw=Pw.CDATA_SECTION_NODE=4;var Iw=Pw.ENTITY_REFERENCE_NODE=5;var Lw=Pw.ENTITY_NODE=6;var jw=Pw.PROCESSING_INSTRUCTION_NODE=7;var Hw=Pw.COMMENT_NODE=8;var Vw=Pw.DOCUMENT_NODE=9;var Uw=Pw.DOCUMENT_TYPE_NODE=10;var Ww=Pw.DOCUMENT_FRAGMENT_NODE=11;var qw=Pw.NOTATION_NODE=12;var Xw={};var Gw={};var Yw=Xw.INDEX_SIZE_ERR=(Gw[1]="Index size error",1);var $w=Xw.DOMSTRING_SIZE_ERR=(Gw[2]="DOMString size error",2);var Qw=Xw.HIERARCHY_REQUEST_ERR=(Gw[3]="Hierarchy request error",3);var Zw=Xw.WRONG_DOCUMENT_ERR=(Gw[4]="Wrong document",4);var Kw=Xw.INVALID_CHARACTER_ERR=(Gw[5]="Invalid character",5);var Jw=Xw.NO_DATA_ALLOWED_ERR=(Gw[6]="No data allowed",6);var tC=Xw.NO_MODIFICATION_ALLOWED_ERR=(Gw[7]="No modification allowed",7);var eC=Xw.NOT_FOUND_ERR=(Gw[8]="Not found",8);var nC=Xw.NOT_SUPPORTED_ERR=(Gw[9]="Not supported",9);var iC=Xw.INUSE_ATTRIBUTE_ERR=(Gw[10]="Attribute in use",10);var rC=Xw.INVALID_STATE_ERR=(Gw[11]="Invalid state",11);var oC=Xw.SYNTAX_ERR=(Gw[12]="Syntax error",12);var aC=Xw.INVALID_MODIFICATION_ERR=(Gw[13]="Invalid modification",13);var sC=Xw.NAMESPACE_ERR=(Gw[14]="Invalid namespace",14);var uC=Xw.INVALID_ACCESS_ERR=(Gw[15]="Invalid access",15);function hC(t,e){if(e instanceof Error){var n=e}else{n=this;Error.call(this,Gw[t]);this.message=Gw[t];if(Error.captureStackTrace){Error.captureStackTrace(this,hC)}}n.code=t;if(e){this.message=this.message+": "+e}return n}hC.prototype=Error.prototype;Bw(Xw,hC);function lC(){}lC.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){var n=this;for(var i=[],r=0;r<this.length;r++){UC(n[r],i,t,e)}return i.join("")}};function fC(t,e){this._node=t;this._refresh=e;cC(this)}function cC(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);XC(t,"length",n.length);Bw(n,t);t._inc=e}}fC.prototype.item=function(t){cC(this);return this[t]};Dw(fC,lC);function dC(){}function pC(t,e){var n=t.length;while(n--){if(t[n]===e){return n}}}function gC(t,e,n,i){if(i){e[pC(e,i)]=n}else{e[e.length++]=n}if(t){n.ownerElement=t;var r=t.ownerDocument;if(r){i&&CC(r,t,i);wC(r,t,n)}}}function vC(t,e,n){var i=pC(e,n);if(i>=0){var r=e.length-1;while(i<r){e[i]=e[++i]}e.length=r;if(t){var o=t.ownerDocument;if(o){CC(o,t,n);n.ownerElement=null}}}else{throw hC(eC,new Error(t.tagName+"@"+n))}}dC.prototype={length:0,item:lC.prototype.item,getNamedItem:function(t){var e=this;var n=this.length;while(n--){var i=e[n];if(i.nodeName==t){return i}}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement){throw new hC(iC)}var n=this.getNamedItem(t.nodeName);gC(this._ownerElement,this,t,n);return n},setNamedItemNS:function(t){var e=t.ownerElement,n;if(e&&e!=this._ownerElement){throw new hC(iC)}n=this.getNamedItemNS(t.namespaceURI,t.localName);gC(this._ownerElement,this,t,n);return n},removeNamedItem:function(t){var e=this.getNamedItem(t);vC(this._ownerElement,this,e);return e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);vC(this._ownerElement,this,n);return n},getNamedItemNS:function(t,e){var n=this;var i=this.length;while(i--){var r=n[i];if(r.localName==e&&r.namespaceURI==t){return r}}return null}};function _C(t){var e=this;this._features={};if(t){for(var n in t){e._features=t[n]}}}_C.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];if(n&&(!e||e in n)){return true}else{return false}},createDocument:function(t,e,n){var i=new xC;i.implementation=this;i.childNodes=new lC;i.doctype=n;if(n){i.appendChild(n)}if(e){var r=i.createElementNS(t,e);i.appendChild(r)}return i},createDocumentType:function(t,e,n){var i=new zC;i.name=t;i.nodeName=t;i.publicId=e;i.systemId=n;return i}};function yC(){}yC.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return AC(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e);if(e){this.removeChild(e)}},removeChild:function(t){return SC(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return qC(this.ownerDocument||this,this,t)},normalize:function(){var t=this;var e=this.firstChild;while(e){var n=e.nextSibling;if(n&&n.nodeType==Fw&&e.nodeType==Fw){t.removeChild(n);e.appendData(n.data)}else{e.normalize();e=n}}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){var e=this;while(e){var n=e._nsMap;if(n){for(var i in n){if(n[i]==t){return i}}}e=e.nodeType==Ow?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){var e=this;while(e){var n=e._nsMap;if(n){if(t in n){return n[t]}}e=e.nodeType==Ow?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function mC(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}Bw(Pw,yC);Bw(Pw,yC.prototype);function bC(t,e){if(e(t)){return true}if(t=t.firstChild){do{if(bC(t,e)){return true}}while(t=t.nextSibling)}}function xC(){}function wC(t,e,n){t&&t._inc++;var i=n.namespaceURI;if(i=="http://www.w3.org/2000/xmlns/"){e._nsMap[n.prefix?n.localName:""]=n.value}}function CC(t,e,n,i){t&&t._inc++;var r=n.namespaceURI;if(r=="http://www.w3.org/2000/xmlns/"){delete e._nsMap[n.prefix?n.localName:""]}}function EC(t,e,n){if(t&&t._inc){t._inc++;var i=e.childNodes;if(n){i[i.length++]=n}else{var r=e.firstChild;var o=0;while(r){i[o++]=r;r=r.nextSibling}i.length=o}}}function SC(t,e){var n=e.previousSibling;var i=e.nextSibling;if(n){n.nextSibling=i}else{t.firstChild=i}if(i){i.previousSibling=n}else{t.lastChild=n}EC(t.ownerDocument,t);return e}function AC(t,e,n){var i=e.parentNode;if(i){i.removeChild(e)}if(e.nodeType===Ww){var r=e.firstChild;if(r==null){return e}var o=e.lastChild}else{r=o=e}var a=n?n.previousSibling:t.lastChild;r.previousSibling=a;o.nextSibling=n;if(a){a.nextSibling=r}else{t.firstChild=r}if(n==null){t.lastChild=o}else{n.previousSibling=o}do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));EC(t.ownerDocument||t,t);if(e.nodeType==Ww){e.firstChild=e.lastChild=null}return e}function kC(t,e){var n=e.parentNode;if(n){var i=t.lastChild;n.removeChild(e);var i=t.lastChild}var i=t.lastChild;e.parentNode=t;e.previousSibling=i;e.nextSibling=null;if(i){i.nextSibling=e}else{t.firstChild=e}t.lastChild=e;EC(t.ownerDocument,t,e);return e}xC.prototype={nodeName:"#document",nodeType:Vw,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){var n=this;if(t.nodeType==Ww){var i=t.firstChild;while(i){var r=i.nextSibling;n.insertBefore(i,e);i=r}return t}if(this.documentElement==null&&t.nodeType==zw){this.documentElement=t}return AC(this,t,e),t.ownerDocument=this,t},removeChild:function(t){if(this.documentElement==t){this.documentElement=null}return SC(this,t)},importNode:function(t,e){return WC(this,t,e)},getElementById:function(e){var n=null;bC(this.documentElement,function(t){if(t.nodeType==zw){if(t.getAttribute("id")==e){n=t;return true}}});return n},createElement:function(t){var e=new MC;e.ownerDocument=this;e.nodeName=t;e.tagName=t;e.childNodes=new lC;var n=e.attributes=new dC;n._ownerElement=e;return e},createDocumentFragment:function(){var t=new IC;t.ownerDocument=this;t.childNodes=new lC;return t},createTextNode:function(t){var e=new DC;e.ownerDocument=this;e.appendData(t);return e},createComment:function(t){var e=new NC;e.ownerDocument=this;e.appendData(t);return e},createCDATASection:function(t){var e=new PC;e.ownerDocument=this;e.appendData(t);return e},createProcessingInstruction:function(t,e){var n=new LC;n.ownerDocument=this;n.tagName=n.target=t;n.nodeValue=n.data=e;return n},createAttribute:function(t){var e=new TC;e.ownerDocument=this;e.name=t;e.nodeName=t;e.localName=t;e.specified=true;return e},createEntityReference:function(t){var e=new RC;e.ownerDocument=this;e.nodeName=t;return e},createElementNS:function(t,e){var n=new MC;var i=e.split(":");var r=n.attributes=new dC;n.childNodes=new lC;n.ownerDocument=this;n.nodeName=e;n.tagName=e;n.namespaceURI=t;if(i.length==2){n.prefix=i[0];n.localName=i[1]}else{n.localName=e}r._ownerElement=n;return n},createAttributeNS:function(t,e){var n=new TC;var i=e.split(":");n.ownerDocument=this;n.nodeName=e;n.name=e;n.namespaceURI=t;n.specified=true;if(i.length==2){n.prefix=i[0];n.localName=i[1]}else{n.localName=e}return n}};Dw(xC,yC);function MC(){this._nsMap={}}MC.prototype={nodeType:zw,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e;this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){if(t.nodeType===Ww){return this.insertBefore(t,null)}else{return kC(this,t)}},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var i=this.ownerDocument.createAttributeNS(t,e);i.value=i.nodeValue=""+n;this.setAttributeNode(i)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(i){return new fC(this,function(e){var n=[];bC(e,function(t){if(t!==e&&t.nodeType==zw&&(i==="*"||t.tagName==i)){n.push(t)}});return n})},getElementsByTagNameNS:function(i,r){return new fC(this,function(e){var n=[];bC(e,function(t){if(t!==e&&t.nodeType===zw&&(i==="*"||t.namespaceURI===i)&&(r==="*"||t.localName==r)){n.push(t)}});return n})}};xC.prototype.getElementsByTagName=MC.prototype.getElementsByTagName;xC.prototype.getElementsByTagNameNS=MC.prototype.getElementsByTagNameNS;Dw(MC,yC);function TC(){}TC.prototype.nodeType=Ow;Dw(TC,yC);function BC(){}BC.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t;this.nodeValue=this.data=t;this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(Gw[Qw])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var i=this.data.substring(0,t);var r=this.data.substring(t+e);n=i+n+r;this.nodeValue=this.data=n;this.length=n.length}};Dw(BC,yC);function DC(){}DC.prototype={nodeName:"#text",nodeType:Fw,splitText:function(t){var e=this.data;var n=e.substring(t);e=e.substring(0,t);this.data=this.nodeValue=e;this.length=e.length;var i=this.ownerDocument.createTextNode(n);if(this.parentNode){this.parentNode.insertBefore(i,this.nextSibling)}return i}};Dw(DC,BC);function NC(){}NC.prototype={nodeName:"#comment",nodeType:Hw};Dw(NC,BC);function PC(){}PC.prototype={nodeName:"#cdata-section",nodeType:Rw};Dw(PC,BC);function zC(){}zC.prototype.nodeType=Uw;Dw(zC,yC);function OC(){}OC.prototype.nodeType=qw;Dw(OC,yC);function FC(){}FC.prototype.nodeType=Lw;Dw(FC,yC);function RC(){}RC.prototype.nodeType=Iw;Dw(RC,yC);function IC(){}IC.prototype.nodeName="#document-fragment";IC.prototype.nodeType=Ww;Dw(IC,yC);function LC(){}LC.prototype.nodeType=jw;Dw(LC,yC);function jC(){}jC.prototype.serializeToString=function(t,e,n){return HC.call(t,e,n)};yC.prototype.toString=HC;function HC(t,e){var n=[];var i=this.nodeType==9?this.documentElement:this;var r=i.prefix;var o=i.namespaceURI;if(o&&r==null){var r=i.lookupPrefix(o);if(r==null){var a=[{namespace:o,prefix:null}]}}UC(this,n,t,e,a);return n.join("")}function VC(t,e,n){var i=t.prefix||"";var r=t.namespaceURI;if(!i&&!r){return false}if(i==="xml"&&r==="http://www.w3.org/XML/1998/namespace"||r=="http://www.w3.org/2000/xmlns/"){return false}var o=n.length;while(o--){var a=n[o];if(a.prefix==i){return a.namespace!=r}}return true}function UC(t,e,n,i,r){if(i){t=i(t);if(t){if(typeof t=="string"){e.push(t);return}}else{return}}switch(t.nodeType){case zw:if(!r){r=[]}var o=t.attributes;var a=o.length;var s=t.firstChild;var u=t.tagName;n=Nw===t.namespaceURI||n;e.push("<",u);for(var h=0;h<a;h++){var l=o.item(h);if(l.prefix=="xmlns"){r.push({prefix:l.localName,namespace:l.value})}else if(l.nodeName=="xmlns"){r.push({prefix:"",namespace:l.value})}}for(var h=0;h<a;h++){var l=o.item(h);if(VC(l,n,r)){var f=l.prefix||"";var c=l.namespaceURI;var d=f?" xmlns:"+f:" xmlns";e.push(d,'="',c,'"');r.push({prefix:f,namespace:c})}UC(l,e,n,i,r)}if(VC(t,n,r)){var f=t.prefix||"";var c=t.namespaceURI;var d=f?" xmlns:"+f:" xmlns";e.push(d,'="',c,'"');r.push({prefix:f,namespace:c})}if(s||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){e.push(">");if(n&&/^script$/i.test(u)){while(s){if(s.data){e.push(s.data)}else{UC(s,e,n,i,r)}s=s.nextSibling}}else{while(s){UC(s,e,n,i,r);s=s.nextSibling}}e.push("</",u,">")}else{e.push("/>")}return;case Vw:case Ww:var s=t.firstChild;while(s){UC(s,e,n,i,r);s=s.nextSibling}return;case Ow:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,mC),'"');case Fw:return e.push(t.data.replace(/[<&]/g,mC));case Rw:return e.push("<![CDATA[",t.data,"]]>");case Hw:return e.push("\x3c!--",t.data,"--\x3e");case Uw:var p=t.publicId;var g=t.systemId;e.push("<!DOCTYPE ",t.name);if(p){e.push(' PUBLIC "',p);if(g&&g!="."){e.push('" "',g)}e.push('">')}else if(g&&g!="."){e.push(' SYSTEM "',g,'">')}else{var v=t.internalSubset;if(v){e.push(" [",v,"]")}e.push(">")}return;case jw:return e.push("<?",t.target," ",t.data,"?>");case Iw:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function WC(t,e,n){var i;switch(e.nodeType){case zw:i=e.cloneNode(false);i.ownerDocument=t;case Ww:break;case Ow:n=true;break}if(!i){i=e.cloneNode(false)}i.ownerDocument=t;i.parentNode=null;if(n){var r=e.firstChild;while(r){i.appendChild(WC(t,r,n));r=r.nextSibling}}return i}function qC(t,e,n){var i=new e.constructor;for(var r in e){var o=e[r];if(typeof o!="object"){if(o!=i[r]){i[r]=o}}}if(e.childNodes){i.childNodes=new lC}i.ownerDocument=t;switch(i.nodeType){case zw:var a=e.attributes;var s=i.attributes=new dC;var u=a.length;s._ownerElement=i;for(var h=0;h<u;h++){i.setAttributeNode(qC(t,a.item(h),true))}break;case Ow:n=true}if(n){var l=e.firstChild;while(l){i.appendChild(qC(t,l,n));l=l.nextSibling}}return i}function XC(t,e,n){t[e]=n}try{if(Object.defineProperty){Object.defineProperty(fC.prototype,"length",{get:function(){cC(this);return this.$$length}});Object.defineProperty(yC.prototype,"textContent",{get:function(){return GC(this)},set:function(t){var e=this;switch(this.nodeType){case zw:case Ww:while(this.firstChild){e.removeChild(e.firstChild)}if(t||String(t)){this.appendChild(this.ownerDocument.createTextNode(t))}break;default:this.data=t;this.value=t;this.nodeValue=t}}});var GC=function(t){switch(t.nodeType){case zw:case Ww:var e=[];t=t.firstChild;while(t){if(t.nodeType!==7&&t.nodeType!==8){e.push(GC(t))}t=t.nextSibling}return e.join("");default:return t.nodeValue}};XC=function(t,e,n){t["$$"+e]=n}}}catch(t){}var YC=_C;var $C=jC;var QC={DOMImplementation:YC,XMLSerializer:$C};var ZC=sb(function(t,e){function n(t){this.options=t||{locator:{}}}n.prototype.parseFromString=function(t,e){var n=this.options;var i=new d;var r=n.domBuilder||new l;var o=n.errorHandler;var a=n.locator;var s=n.xmlns||{};var u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};if(a){r.setDocumentLocator(a)}i.errorHandler=h(o,r,a);i.domBuilder=n.domBuilder||r;if(/\/x?html?$/.test(e)){u.nbsp=" ";u.copy="©";s[""]="http://www.w3.org/1999/xhtml"}s.xml=s.xml||"http://www.w3.org/XML/1998/namespace";if(t){i.parse(t,s,u)}else{i.errorHandler.error("invalid doc source")}return r.doc};function h(i,t,r){if(!i){if(t instanceof l){return t}i=t}var o={};var a=i instanceof Function;r=r||{};function e(e){var n=i[e];if(!n&&a){n=i.length==2?function(t){i(e,t)}:i}o[e]=n&&function(t){n("[xmldom "+e+"]\t"+t+s(r))}||function(){}}e("warning");e("error");e("fatalError");return o}function l(){this.cdata=false}function f(t,e){e.lineNumber=t.lineNumber;e.columnNumber=t.columnNumber}l.prototype={startDocument:function(){this.doc=(new i).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(t,e,n,i){var r=this;var o=this.doc;var a=o.createElementNS(t,n||e);var s=i.length;c(this,a);this.currentElement=a;this.locator&&f(this.locator,a);for(var u=0;u<s;u++){var t=i.getURI(u);var h=i.getValue(u);var n=i.getQName(u);var l=o.createAttributeNS(t,n);r.locator&&f(i.getLocator(u),l);l.value=l.nodeValue=h;a.setAttributeNode(l)}},endElement:function(t,e,n){var i=this.currentElement;this.currentElement=i.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&f(this.locator,n);c(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){t=r.apply(this,arguments);if(t){if(this.cdata){var i=this.doc.createCDATASection(t)}else{var i=this.doc.createTextNode(t)}if(this.currentElement){this.currentElement.appendChild(i)}else if(/^\s*$/.test(t)){this.doc.appendChild(i)}this.locator&&f(this.locator,i)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){if(this.locator=t){t.lineNumber=0}},comment:function(t,e,n){t=r.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&f(this.locator,i);c(this,i)},startCDATA:function(){this.cdata=true},endCDATA:function(){this.cdata=false},startDTD:function(t,e,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(t,e,n);this.locator&&f(this.locator,r);c(this,r)}},warning:function(t){console.warn("[xmldom warning]\t"+t,s(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,s(this.locator))},fatalError:function(t){console.error("[xmldom fatalError]\t"+t,s(this.locator));throw t}};function s(t){if(t){return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}}function r(t,e,n){if(typeof t=="string"){return t.substr(e,n)}else{if(t.length>=e+n||e){return new java.lang.String(t,e,n)+""}return t}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){l.prototype[t]=function(){return null}});function c(t,e){if(!t.currentElement){t.doc.appendChild(e)}else{t.currentElement.appendChild(e)}}var d=Tw.XMLReader;var i=e.DOMImplementation=QC.DOMImplementation;e.XMLSerializer=QC.XMLSerializer;e.DOMParser=n});"use strict";function KC(t,e,n){if(t==null&&e==null&&n==null){var i=document.querySelectorAll("svg");for(var r=0;r<i.length;r++){var o=i[r];var a=document.createElement("canvas");a.width=o.clientWidth;a.height=o.clientHeight;o.parentNode.insertBefore(a,o);o.parentNode.removeChild(o);var s=document.createElement("div");s.appendChild(o);KC(a,s.innerHTML)}return}if(typeof t=="string"){t=document.getElementById(t)}if(t.svg!=null){t.svg.stop()}var u=eE(n||{});if(!(t.childNodes.length==1&&t.childNodes[0].nodeName=="OBJECT")){t.svg=u}var h=t.getContext("2d");if(typeof e.documentElement!="undefined"){u.loadXmlDoc(h,e)}else if(e.substr(0,1)=="<"){u.loadXml(h,e)}else{u.load(h,e)}}function JC(){var t;if(typeof Element.prototype.matches!="undefined"){t=function(t,e){return t.matches(e)}}else if(typeof Element.prototype.webkitMatchesSelector!="undefined"){t=function(t,e){return t.webkitMatchesSelector(e)}}else if(typeof Element.prototype.mozMatchesSelector!="undefined"){t=function(t,e){return t.mozMatchesSelector(e)}}else if(typeof Element.prototype.msMatchesSelector!="undefined"){t=function(t,e){return t.msMatchesSelector(e)}}else if(typeof Element.prototype.oMatchesSelector!="undefined"){t=function(t,e){return t.oMatchesSelector(e)}}else{if(typeof jQuery=="function"||typeof Zepto=="function"){t=function(t,e){return $(t).is(e)}}if(typeof t=="undefined"){t=Sizzle.matchesSelector}}return t}function tE(i){var r=[0,0,0];var t=/(\[[^\]]+\])/g;var e=/(#[^\s\+>~\.\[:]+)/g;var n=/(\.[^\s\+>~\.\[:]+)/g;var o=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi;var a=/(:[\w-]+\([^\)]*\))/gi;var s=/(:[^\s\+>~\.\[:]+)/g;var u=/([^\s\+>~\.\[:]+)/g;var h=function(t,e){var n=i.match(t);if(n==null){return}r[e]+=n.length;i=i.replace(t," ")};i=i.replace(/:not\(([^\)]*)\)/g," $1 ");i=i.replace(/{[^]*/gm," ");h(t,1);h(e,0);h(n,1);h(o,2);h(a,1);h(s,1);i=i.replace(/[\*\s\+>~]/g," ");i=i.replace(/[#\.]/g," ");h(u,2);return r.join("")}function eE(t){var N={opts:t};var l=JC();if(typeof CanvasRenderingContext2D!="undefined"){CanvasRenderingContext2D.prototype.drawSvg=function(t,e,n,i,r,o){var a={ignoreMouse:true,ignoreAnimation:true,ignoreDimensions:true,ignoreClear:true,offsetX:e,offsetY:n,scaleWidth:i,scaleHeight:r};for(var s in o){if(o.hasOwnProperty(s)){a[s]=o[s]}}KC(this.canvas,t,a)}}N.FRAMERATE=30;N.MAX_VIRTUAL_PIXELS=3e4;N.log=function(t){};if(N.opts.log==true&&typeof console!="undefined"){N.log=function(t){console.log(t)}}N.init=function(t){var e=0;N.UniqueId=function(){e++;return"canvg"+e};N.Definitions={};N.Styles={};N.StylesSpecificity={};N.Animations=[];N.Images=[];N.ctx=t;N.ViewPort=new function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(t,e){this.viewPorts.push({width:t,height:e})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height};this.ComputeSize=function(t){if(t!=null&&typeof t=="number"){return t}if(t=="x"){return this.width()}if(t=="y"){return this.height()}return Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}};N.init();N.ImagesLoaded=function(){for(var t=0;t<N.Images.length;t++){if(!N.Images[t].loaded){return false}}return true};N.trim=function(t){return t.replace(/^\s+|\s+$/g,"")};N.compressSpaces=function(t){return t.replace(/[\s\r\t\n]+/gm," ")};N.ajax=function(t){var e;if(window.XMLHttpRequest){e=new XMLHttpRequest}else{e=new ActiveXObject("Microsoft.XMLHTTP")}if(e){e.open("GET",t,false);e.send(null);return e.responseText}return null};N.parseXml=function(t){if(typeof Windows!="undefined"&&typeof Windows.Data!="undefined"&&typeof Windows.Data.Xml!="undefined"){var e=new Windows.Data.Xml.Dom.XmlDocument;var n=new Windows.Data.Xml.Dom.XmlLoadSettings;n.prohibitDtd=false;e.loadXml(t,n);return e}else if(window.DOMParser){var i=new DOMParser;return i.parseFromString(t,"text/xml")}else{t=t.replace(/<!DOCTYPE svg[^>]*>/,"");var e=new ActiveXObject("Microsoft.XMLDOM");e.async="false";e.loadXML(t);return e}};N.Property=function(t,e){this.name=t;this.value=e};N.Property.prototype.getValue=function(){return this.value};N.Property.prototype.hasValue=function(){return this.value!=null&&this.value!=""};N.Property.prototype.numValue=function(){if(!this.hasValue()){return 0}var t=parseFloat(this.value);if((this.value+"").match(/%$/)){t=t/100}return t};N.Property.prototype.valueOrDefault=function(t){if(this.hasValue()){return this.value}return t};N.Property.prototype.numValueOrDefault=function(t){if(this.hasValue()){return this.numValue()}return t};N.Property.prototype.addOpacity=function(t){var e=this.value;if(t.value!=null&&t.value!=""&&typeof this.value=="string"){var n=new Kx(this.value);if(n.ok){e="rgba("+n.r+", "+n.g+", "+n.b+", "+t.numValue()+")"}}return new N.Property(this.name,e)};N.Property.prototype.getDefinition=function(){var t=this.value.match(/#([^\)'"]+)/);if(t){t=t[1]}if(!t){t=this.value}return N.Definitions[t]};N.Property.prototype.isUrlDefinition=function(){return this.value.indexOf("url(")==0};N.Property.prototype.getFillStyleDefinition=function(t,e){var n=this.getDefinition();if(n!=null&&n.createGradient){return n.createGradient(N.ctx,t,e)}if(n!=null&&n.createPattern){if(n.getHrefAttribute().hasValue()){var i=n.attribute("patternTransform");n=n.getHrefAttribute().getDefinition();if(i.hasValue()){n.attribute("patternTransform",true).value=i.value}}return n.createPattern(N.ctx,t)}return null};N.Property.prototype.getDPI=function(t){return 96};N.Property.prototype.getEM=function(t){var e=12;var n=new N.Property("fontSize",N.Font.Parse(N.ctx.font).fontSize);if(n.hasValue()){e=n.toPixels(t)}return e};N.Property.prototype.getUnits=function(){var t=this.value+"";return t.replace(/[0-9\.\-]/g,"")};N.Property.prototype.toPixels=function(t,e){if(!this.hasValue()){return 0}var n=this.value+"";if(n.match(/em$/)){return this.numValue()*this.getEM(t)}if(n.match(/ex$/)){return this.numValue()*this.getEM(t)/2}if(n.match(/px$/)){return this.numValue()}if(n.match(/pt$/)){return this.numValue()*this.getDPI(t)*(1/72)}if(n.match(/pc$/)){return this.numValue()*15}if(n.match(/cm$/)){return this.numValue()*this.getDPI(t)/2.54}if(n.match(/mm$/)){return this.numValue()*this.getDPI(t)/25.4}if(n.match(/in$/)){return this.numValue()*this.getDPI(t)}if(n.match(/%$/)){return this.numValue()*N.ViewPort.ComputeSize(t)}var i=this.numValue();if(e&&i<1){return i*N.ViewPort.ComputeSize(t)}return i};N.Property.prototype.toMilliseconds=function(){if(!this.hasValue()){return 0}var t=this.value+"";if(t.match(/s$/)){return this.numValue()*1e3}if(t.match(/ms$/)){return this.numValue()}return this.numValue()};N.Property.prototype.toRadians=function(){if(!this.hasValue()){return 0}var t=this.value+"";if(t.match(/deg$/)){return this.numValue()*(Math.PI/180)}if(t.match(/grad$/)){return this.numValue()*(Math.PI/200)}if(t.match(/rad$/)){return this.numValue()}return this.numValue()*(Math.PI/180)};var e={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};N.Property.prototype.toTextBaseline=function(){if(!this.hasValue()){return null}return e[this.value]};N.Font=new function(){this.Styles="normal|italic|oblique|inherit";this.Variants="normal|small-caps|inherit";this.Weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";this.CreateFont=function(t,e,n,i,r,o){var a=o!=null?this.Parse(o):this.CreateFont("","","","","",N.ctx.font);return{fontFamily:r||a.fontFamily,fontSize:i||a.fontSize,fontStyle:t||a.fontStyle,fontWeight:n||a.fontWeight,fontVariant:e||a.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var a=this;this.Parse=function(t){var e={};var n=N.trim(N.compressSpaces(t||"")).split(" ");var i={fontSize:false,fontStyle:false,fontWeight:false,fontVariant:false};var r="";for(var o=0;o<n.length;o++){if(!i.fontStyle&&a.Styles.indexOf(n[o])!=-1){if(n[o]!="inherit"){e.fontStyle=n[o]}i.fontStyle=true}else if(!i.fontVariant&&a.Variants.indexOf(n[o])!=-1){if(n[o]!="inherit"){e.fontVariant=n[o]}i.fontStyle=i.fontVariant=true}else if(!i.fontWeight&&a.Weights.indexOf(n[o])!=-1){if(n[o]!="inherit"){e.fontWeight=n[o]}i.fontStyle=i.fontVariant=i.fontWeight=true}else if(!i.fontSize){if(n[o]!="inherit"){e.fontSize=n[o].split("/")[0]}i.fontStyle=i.fontVariant=i.fontWeight=i.fontSize=true}else{if(n[o]!="inherit"){r+=n[o]}}}if(r!=""){e.fontFamily=r}return e}};N.ToNumberArray=function(t){var e=N.trim(N.compressSpaces((t||"").replace(/,/g," "))).split(" ");for(var n=0;n<e.length;n++){e[n]=parseFloat(e[n])}return e};N.Point=function(t,e){this.x=t;this.y=e};N.Point.prototype.angleTo=function(t){return Math.atan2(t.y-this.y,t.x-this.x)};N.Point.prototype.applyTransform=function(t){var e=this.x*t[0]+this.y*t[2]+t[4];var n=this.x*t[1]+this.y*t[3]+t[5];this.x=e;this.y=n};N.CreatePoint=function(t){var e=N.ToNumberArray(t);return new N.Point(e[0],e[1])};N.CreatePath=function(t){var e=N.ToNumberArray(t);var n=[];for(var i=0;i<e.length;i+=2){n.push(new N.Point(e[i],e[i+1]))}return n};N.BoundingBox=function(t,e,n,i){this.x1=Number.NaN;this.y1=Number.NaN;this.x2=Number.NaN;this.y2=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-this.y1};this.addPoint=function(t,e){if(t!=null){if(isNaN(this.x1)||isNaN(this.x2)){this.x1=t;this.x2=t}if(t<this.x1){this.x1=t}if(t>this.x2){this.x2=t}}if(e!=null){if(isNaN(this.y1)||isNaN(this.y2)){this.y1=e;this.y2=e}if(e<this.y1){this.y1=e}if(e>this.y2){this.y2=e}}};this.addX=function(t){this.addPoint(t,null)};this.addY=function(t){this.addPoint(null,t)};this.addBoundingBox=function(t){this.addPoint(t.x1,t.y1);this.addPoint(t.x2,t.y2)};this.addQuadraticCurve=function(t,e,n,i,r,o){var a=t+2/3*(n-t);var s=e+2/3*(i-e);var u=a+1/3*(r-t);var h=s+1/3*(o-e);this.addBezierCurve(t,e,a,u,s,h,r,o)};this.addBezierCurve=function(t,e,n,i,r,o,a,s){var u=this;var h=[t,e],l=[n,i],f=[r,o],c=[a,s];this.addPoint(h[0],h[1]);this.addPoint(c[0],c[1]);for(var d=0;d<=1;d++){var p=function(t){return Math.pow(1-t,3)*h[d]+3*Math.pow(1-t,2)*t*l[d]+3*(1-t)*Math.pow(t,2)*f[d]+Math.pow(t,3)*c[d]};var g=6*h[d]-12*l[d]+6*f[d];var v=-3*h[d]+9*l[d]-9*f[d]+3*c[d];var _=3*l[d]-3*h[d];if(v==0){if(g==0){continue}var y=-_/g;if(0<y&&y<1){if(d==0){u.addX(p(y))}if(d==1){u.addY(p(y))}}continue}var m=Math.pow(g,2)-4*_*v;if(m<0){continue}var b=(-g+Math.sqrt(m))/(2*v);if(0<b&&b<1){if(d==0){u.addX(p(b))}if(d==1){u.addY(p(b))}}var x=(-g-Math.sqrt(m))/(2*v);if(0<x&&x<1){if(d==0){u.addX(p(x))}if(d==1){u.addY(p(x))}}}};this.isPointInBox=function(t,e){return this.x1<=t&&t<=this.x2&&this.y1<=e&&e<=this.y2};this.addPoint(t,e);this.addPoint(n,i)};N.Transform=function(t){var e=this;var n=this;this.Type={};this.Type.translate=function(t){this.p=N.CreatePoint(t);this.apply=function(t){t.translate(this.p.x||0,this.p.y||0)};this.unapply=function(t){t.translate(-1*this.p.x||0,-1*this.p.y||0)};this.applyToPoint=function(t){t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}};this.Type.rotate=function(t){var e=N.ToNumberArray(t);this.angle=new N.Property("angle",e[0]);this.cx=e[1]||0;this.cy=e[2]||0;this.apply=function(t){t.translate(this.cx,this.cy);t.rotate(this.angle.toRadians());t.translate(-this.cx,-this.cy)};this.unapply=function(t){t.translate(this.cx,this.cy);t.rotate(-1*this.angle.toRadians());t.translate(-this.cx,-this.cy)};this.applyToPoint=function(t){var e=this.angle.toRadians();t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);t.applyTransform([Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]);t.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}};this.Type.scale=function(t){this.p=N.CreatePoint(t);this.apply=function(t){t.scale(this.p.x||1,this.p.y||this.p.x||1)};this.unapply=function(t){t.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)};this.applyToPoint=function(t){t.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}};this.Type.matrix=function(t){this.m=N.ToNumberArray(t);this.apply=function(t){t.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.unapply=function(t){var e=this.m[0];var n=this.m[2];var i=this.m[4];var r=this.m[1];var o=this.m[3];var a=this.m[5];var s=0;var u=0;var h=1;var l=1/(e*(o*h-a*u)-n*(r*h-a*s)+i*(r*u-o*s));t.transform(l*(o*h-a*u),l*(a*s-r*h),l*(i*u-n*h),l*(e*h-i*s),l*(n*a-i*o),l*(i*r-e*a))};this.applyToPoint=function(t){t.applyTransform(this.m)}};this.Type.SkewBase=function(t){this.base=n.Type.matrix;this.base(t);this.angle=new N.Property("angle",t)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(t){this.base=n.Type.SkewBase;this.base(t);this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(t){this.base=n.Type.SkewBase;this.base(t);this.m=[1,Math.tan(this.angle.toRadians()),0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(t){var e=this;for(var n=0;n<this.transforms.length;n++){e.transforms[n].apply(t)}};this.unapply=function(t){var e=this;for(var n=this.transforms.length-1;n>=0;n--){e.transforms[n].unapply(t)}};this.applyToPoint=function(t){var e=this;for(var n=0;n<this.transforms.length;n++){e.transforms[n].applyToPoint(t)}};var i=N.trim(N.compressSpaces(t)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/);for(var r=0;r<i.length;r++){var o=N.trim(i[r].split("(")[0]);var a=i[r].split("(")[1].replace(")","");var s=e.Type[o];if(typeof s!="undefined"){var u=new s(a);u.type=o;e.transforms.push(u)}}};N.AspectRatio=function(t,e,n,i,r,o,a,s,u,h){e=N.compressSpaces(e);e=e.replace(/^defer\s/,"");var l=e.split(" ")[0]||"xMidYMid";var f=e.split(" ")[1]||"meet";var c=n/i;var d=r/o;var p=Math.min(c,d);var g=Math.max(c,d);if(f=="meet"){i*=p;o*=p}if(f=="slice"){i*=g;o*=g}u=new N.Property("refX",u);h=new N.Property("refY",h);if(u.hasValue()&&h.hasValue()){t.translate(-p*u.toPixels("x"),-p*h.toPixels("y"))}else{if(l.match(/^xMid/)&&(f=="meet"&&p==d||f=="slice"&&g==d)){t.translate(n/2-i/2,0)}if(l.match(/YMid$/)&&(f=="meet"&&p==c||f=="slice"&&g==c)){t.translate(0,r/2-o/2)}if(l.match(/^xMax/)&&(f=="meet"&&p==d||f=="slice"&&g==d)){t.translate(n-i,0)}if(l.match(/YMax$/)&&(f=="meet"&&p==c||f=="slice"&&g==c)){t.translate(0,r-o)}}if(l=="none"){t.scale(c,d)}else if(f=="meet"){t.scale(p,p)}else if(f=="slice"){t.scale(g,g)}t.translate(a==null?0:-a,s==null?0:-s)};N.Element={};N.EmptyProperty=new N.Property("EMPTY","");N.Element.ElementBase=function(a){var t=this;this.attributes={};this.styles={};this.stylesSpecificity={};this.children=[];this.attribute=function(t,e){var n=this.attributes[t];if(n!=null){return n}if(e==true){n=new N.Property(t,"");this.attributes[t]=n}return n||N.EmptyProperty};this.getHrefAttribute=function(){var t=this;for(var e in t.attributes){if(e=="href"||e.match(/:href$/)){return t.attributes[e]}}return N.EmptyProperty};this.style=function(t,e,n){var i=this.styles[t];if(i!=null){return i}var r=this.attribute(t);if(r!=null&&r.hasValue()){this.styles[t]=r;return r}if(n!=true){var o=this.parent;if(o!=null){var a=o.style(t);if(a!=null&&a.hasValue()){return a}}}if(e==true){i=new N.Property(t,"");this.styles[t]=i}return i||N.EmptyProperty};this.render=function(t){if(this.style("display").value=="none"){return}if(this.style("visibility").value=="hidden"){return}t.save();if(this.style("mask").hasValue()){var e=this.style("mask").getDefinition();if(e!=null){e.apply(t,this)}}else if(this.style("filter").hasValue()){var n=this.style("filter").getDefinition();if(n!=null){n.apply(t,this)}}else{this.setContext(t);this.renderChildren(t);this.clearContext(t)}t.restore()};this.setContext=function(t){};this.clearContext=function(t){};this.renderChildren=function(t){var e=this;for(var n=0;n<this.children.length;n++){e.children[n].render(t)}};this.addChild=function(t,e){var n=t;if(e){n=N.CreateElement(t)}n.parent=this;if(n.type!="title"){this.children.push(n)}};this.addStylesFromStyleDefinition=function(){var t=this;for(var e in N.Styles){if(e[0]!="@"&&l(a,e)){var n=N.Styles[e];var i=N.StylesSpecificity[e];if(n!=null){for(var r in n){var o=t.stylesSpecificity[r];if(typeof o=="undefined"){o="000"}if(i>o){t.styles[r]=n[r];t.stylesSpecificity[r]=i}}}}}};if(a!=null&&a.nodeType==1){for(var e=0;e<a.attributes.length;e++){var n=a.attributes[e];t.attributes[n.nodeName]=new N.Property(n.nodeName,n.value)}this.addStylesFromStyleDefinition();if(this.attribute("style").hasValue()){var i=this.attribute("style").value.split(";");for(var e=0;e<i.length;e++){if(N.trim(i[e])!=""){var r=i[e].split(":");var o=N.trim(r[0]);var s=N.trim(r[1]);t.styles[o]=new N.Property(o,s)}}}if(this.attribute("id").hasValue()){if(N.Definitions[this.attribute("id").value]==null){N.Definitions[this.attribute("id").value]=this}}for(var e=0;e<a.childNodes.length;e++){var u=a.childNodes[e];if(u.nodeType==1){t.addChild(u,true)}if(t.captureTextNodes&&(u.nodeType==3||u.nodeType==4)){var h=u.value||u.text||u.textContent||"";if(N.compressSpaces(h)!=""){t.addChild(new N.Element.tspan(u),false)}}}}};N.Element.RenderedElementBase=function(t){this.base=N.Element.ElementBase;this.base(t);this.setContext=function(t){if(this.style("fill").isUrlDefinition()){var e=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));if(e!=null){t.fillStyle=e}}else if(this.style("fill").hasValue()){var n=this.style("fill");if(n.value=="currentColor"){n.value=this.style("color").value}if(n.value!="inherit"){t.fillStyle=n.value=="none"?"rgba(0,0,0,0)":n.value}}if(this.style("fill-opacity").hasValue()){var n=new N.Property("fill",t.fillStyle);n=n.addOpacity(this.style("fill-opacity"));t.fillStyle=n.value}if(this.style("stroke").isUrlDefinition()){var e=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity"));if(e!=null){t.strokeStyle=e}}else if(this.style("stroke").hasValue()){var i=this.style("stroke");if(i.value=="currentColor"){i.value=this.style("color").value}if(i.value!="inherit"){t.strokeStyle=i.value=="none"?"rgba(0,0,0,0)":i.value}}if(this.style("stroke-opacity").hasValue()){var i=new N.Property("stroke",t.strokeStyle);i=i.addOpacity(this.style("stroke-opacity"));t.strokeStyle=i.value}if(this.style("stroke-width").hasValue()){var r=this.style("stroke-width").toPixels();t.lineWidth=r==0?.001:r}if(this.style("stroke-linecap").hasValue()){t.lineCap=this.style("stroke-linecap").value}if(this.style("stroke-linejoin").hasValue()){t.lineJoin=this.style("stroke-linejoin").value}if(this.style("stroke-miterlimit").hasValue()){t.miterLimit=this.style("stroke-miterlimit").value}if(this.style("stroke-dasharray").hasValue()&&this.style("stroke-dasharray").value!="none"){var o=N.ToNumberArray(this.style("stroke-dasharray").value);if(typeof t.setLineDash!="undefined"){t.setLineDash(o)}else if(typeof t.webkitLineDash!="undefined"){t.webkitLineDash=o}else if(typeof t.mozDash!="undefined"&&!(o.length==1&&o[0]==0)){t.mozDash=o}var a=this.style("stroke-dashoffset").numValueOrDefault(1);if(typeof t.lineDashOffset!="undefined"){t.lineDashOffset=a}else if(typeof t.webkitLineDashOffset!="undefined"){t.webkitLineDashOffset=a}else if(typeof t.mozDashOffset!="undefined"){t.mozDashOffset=a}}if(typeof t.font!="undefined"){t.font=N.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString()}if(this.style("transform",false,true).hasValue()){var s=new N.Transform(this.style("transform",false,true).value);s.apply(t)}if(this.style("clip-path",false,true).hasValue()){var u=this.style("clip-path",false,true).getDefinition();if(u!=null){u.apply(t)}}if(this.style("opacity").hasValue()){t.globalAlpha=this.style("opacity").numValue()}}};N.Element.RenderedElementBase.prototype=new N.Element.ElementBase;N.Element.PathElementBase=function(t){this.base=N.Element.RenderedElementBase;this.base(t);this.path=function(t){if(t!=null){t.beginPath()}return new N.BoundingBox};this.renderChildren=function(t){this.path(t);N.Mouse.checkPath(this,t);if(t.fillStyle!=""){if(this.style("fill-rule").valueOrDefault("inherit")!="inherit"){t.fill(this.style("fill-rule").value)}else{t.fill()}}if(t.strokeStyle!=""){t.stroke()}var e=this.getMarkers();if(e!=null){if(this.style("marker-start").isUrlDefinition()){var n=this.style("marker-start").getDefinition();n.render(t,e[0][0],e[0][1])}if(this.style("marker-mid").isUrlDefinition()){var n=this.style("marker-mid").getDefinition();for(var i=1;i<e.length-1;i++){n.render(t,e[i][0],e[i][1])}}if(this.style("marker-end").isUrlDefinition()){var n=this.style("marker-end").getDefinition();n.render(t,e[e.length-1][0],e[e.length-1][1])}}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}};N.Element.PathElementBase.prototype=new N.Element.RenderedElementBase;N.Element.svg=function(t){this.base=N.Element.RenderedElementBase;this.base(t);this.baseClearContext=this.clearContext;this.clearContext=function(t){this.baseClearContext(t);N.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;this.setContext=function(t){t.strokeStyle="rgba(0,0,0,0)";t.lineCap="butt";t.lineJoin="miter";t.miterLimit=4;if(typeof t.font!="undefined"&&typeof window.getComputedStyle!="undefined"){t.font=window.getComputedStyle(t.canvas).getPropertyValue("font")}this.baseSetContext(t);if(!this.attribute("x").hasValue()){this.attribute("x",true).value=0}if(!this.attribute("y").hasValue()){this.attribute("y",true).value=0}t.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var e=N.ViewPort.width();var n=N.ViewPort.height();if(!this.attribute("width").hasValue()){this.attribute("width",true).value="100%"}if(!this.attribute("height").hasValue()){this.attribute("height",true).value="100%"}if(typeof this.root=="undefined"){e=this.attribute("width").toPixels("x");n=this.attribute("height").toPixels("y");var i=0;var r=0;if(this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()){i=-this.attribute("refX").toPixels("x");r=-this.attribute("refY").toPixels("y")}if(this.attribute("overflow").valueOrDefault("hidden")!="visible"){t.beginPath();t.moveTo(i,r);t.lineTo(e,r);t.lineTo(e,n);t.lineTo(i,n);t.closePath();t.clip()}}N.ViewPort.SetCurrent(e,n);if(this.attribute("viewBox").hasValue()){var o=N.ToNumberArray(this.attribute("viewBox").value);var a=o[0];var s=o[1];e=o[2];n=o[3];N.AspectRatio(t,this.attribute("preserveAspectRatio").value,N.ViewPort.width(),e,N.ViewPort.height(),n,a,s,this.attribute("refX").value,this.attribute("refY").value);N.ViewPort.RemoveCurrent();N.ViewPort.SetCurrent(o[2],o[3])}}};N.Element.svg.prototype=new N.Element.RenderedElementBase;N.Element.rect=function(t){this.base=N.Element.PathElementBase;this.base(t);this.path=function(t){var e=this.attribute("x").toPixels("x");var n=this.attribute("y").toPixels("y");var i=this.attribute("width").toPixels("x");var r=this.attribute("height").toPixels("y");var o=this.attribute("rx").toPixels("x");var a=this.attribute("ry").toPixels("y");if(this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()){a=o}if(this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()){o=a}o=Math.min(o,i/2);a=Math.min(a,r/2);if(t!=null){t.beginPath();t.moveTo(e+o,n);t.lineTo(e+i-o,n);t.quadraticCurveTo(e+i,n,e+i,n+a);t.lineTo(e+i,n+r-a);t.quadraticCurveTo(e+i,n+r,e+i-o,n+r);t.lineTo(e+o,n+r);t.quadraticCurveTo(e,n+r,e,n+r-a);t.lineTo(e,n+a);t.quadraticCurveTo(e,n,e+o,n);t.closePath()}return new N.BoundingBox(e,n,e+i,n+r)}};N.Element.rect.prototype=new N.Element.PathElementBase;N.Element.circle=function(t){this.base=N.Element.PathElementBase;this.base(t);this.path=function(t){var e=this.attribute("cx").toPixels("x");var n=this.attribute("cy").toPixels("y");var i=this.attribute("r").toPixels();if(t!=null){t.beginPath();t.arc(e,n,i,0,Math.PI*2,true);t.closePath()}return new N.BoundingBox(e-i,n-i,e+i,n+i)}};N.Element.circle.prototype=new N.Element.PathElementBase;N.Element.ellipse=function(t){this.base=N.Element.PathElementBase;this.base(t);this.path=function(t){var e=4*((Math.sqrt(2)-1)/3);var n=this.attribute("rx").toPixels("x");var i=this.attribute("ry").toPixels("y");var r=this.attribute("cx").toPixels("x");var o=this.attribute("cy").toPixels("y");if(t!=null){t.beginPath();t.moveTo(r,o-i);t.bezierCurveTo(r+e*n,o-i,r+n,o-e*i,r+n,o);t.bezierCurveTo(r+n,o+e*i,r+e*n,o+i,r,o+i);t.bezierCurveTo(r-e*n,o+i,r-n,o+e*i,r-n,o);t.bezierCurveTo(r-n,o-e*i,r-e*n,o-i,r,o-i);t.closePath()}return new N.BoundingBox(r-n,o-i,r+n,o+i)}};N.Element.ellipse.prototype=new N.Element.PathElementBase;N.Element.line=function(t){this.base=N.Element.PathElementBase;this.base(t);this.getPoints=function(){return[new N.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new N.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]};this.path=function(t){var e=this.getPoints();if(t!=null){t.beginPath();t.moveTo(e[0].x,e[0].y);t.lineTo(e[1].x,e[1].y)}return new N.BoundingBox(e[0].x,e[0].y,e[1].x,e[1].y)};this.getMarkers=function(){var t=this.getPoints();var e=t[0].angleTo(t[1]);return[[t[0],e],[t[1],e]]}};N.Element.line.prototype=new N.Element.PathElementBase;N.Element.polyline=function(t){this.base=N.Element.PathElementBase;this.base(t);this.points=N.CreatePath(this.attribute("points").value);this.path=function(t){var e=this;var n=new N.BoundingBox(this.points[0].x,this.points[0].y);if(t!=null){t.beginPath();t.moveTo(this.points[0].x,this.points[0].y)}for(var i=1;i<this.points.length;i++){n.addPoint(e.points[i].x,e.points[i].y);if(t!=null){t.lineTo(e.points[i].x,e.points[i].y)}}return n};this.getMarkers=function(){var t=this;var e=[];for(var n=0;n<this.points.length-1;n++){e.push([t.points[n],t.points[n].angleTo(t.points[n+1])])}if(e.length>0){e.push([this.points[this.points.length-1],e[e.length-1][1]])}return e}};N.Element.polyline.prototype=new N.Element.PathElementBase;N.Element.polygon=function(t){this.base=N.Element.polyline;this.base(t);this.basePath=this.path;this.path=function(t){var e=this.basePath(t);if(t!=null){t.lineTo(this.points[0].x,this.points[0].y);t.closePath()}return e}};N.Element.polygon.prototype=new N.Element.polyline;N.Element.path=function(t){this.base=N.Element.PathElementBase;this.base(t);var e=this.attribute("d").value;e=e.replace(/,/gm," ");for(var n=0;n<2;n++){e=e.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2")}e=e.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");e=e.replace(/([0-9])([+\-])/gm,"$1 $2");for(var n=0;n<2;n++){e=e.replace(/(\.[0-9]*)(\.)/gm,"$1 $2")}e=e.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");e=N.compressSpaces(e);e=N.trim(e);this.PathParser=new function(t){this.tokens=t.split(" ");this.reset=function(){this.i=-1;this.command="";this.previousCommand="";this.start=new N.Point(0,0);this.control=new N.Point(0,0);this.current=new N.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){if(this.isEnd()){return true}return this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return true;break}return false};this.getToken=function(){this.i++;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){var t=new N.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(t)};this.getAsControlPoint=function(){var t=this.getPoint();this.control=t;return t};this.getAsCurrentPoint=function(){var t=this.getPoint();this.current=t;return t};this.getReflectedControlPoint=function(){if(this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"&&this.previousCommand.toLowerCase()!="q"&&this.previousCommand.toLowerCase()!="t"){return this.current}var t=new N.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return t};this.makeAbsolute=function(t){if(this.isRelativeCommand()){t.x+=this.current.x;t.y+=this.current.y}return t};this.addMarker=function(t,e,n){if(n!=null&&this.angles.length>0&&this.angles[this.angles.length-1]==null){this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(n)}this.addMarkerAngle(t,e==null?null:e.angleTo(t))};this.addMarkerAngle=function(t,e){this.points.push(t);this.angles.push(e)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){var t=this;for(var e=0;e<this.angles.length;e++){if(t.angles[e]==null){for(var n=e+1;n<this.angles.length;n++){if(t.angles[n]!=null){t.angles[e]=t.angles[n];break}}}}return this.angles}}(e);this.path=function(t){var e=this.PathParser;e.reset();var n=new N.BoundingBox;if(t!=null){t.beginPath()}while(!e.isEnd()){e.nextCommand();switch(e.command){case"M":case"m":var i=e.getAsCurrentPoint();e.addMarker(i);n.addPoint(i.x,i.y);if(t!=null){t.moveTo(i.x,i.y)}e.start=e.current;while(!e.isCommandOrEnd()){var i=e.getAsCurrentPoint();e.addMarker(i,e.start);n.addPoint(i.x,i.y);if(t!=null){t.lineTo(i.x,i.y)}}break;case"L":case"l":while(!e.isCommandOrEnd()){var r=e.current;var i=e.getAsCurrentPoint();e.addMarker(i,r);n.addPoint(i.x,i.y);if(t!=null){t.lineTo(i.x,i.y)}}break;case"H":case"h":while(!e.isCommandOrEnd()){var o=new N.Point((e.isRelativeCommand()?e.current.x:0)+e.getScalar(),e.current.y);e.addMarker(o,e.current);e.current=o;n.addPoint(e.current.x,e.current.y);if(t!=null){t.lineTo(e.current.x,e.current.y)}}break;case"V":case"v":while(!e.isCommandOrEnd()){var o=new N.Point(e.current.x,(e.isRelativeCommand()?e.current.y:0)+e.getScalar());e.addMarker(o,e.current);e.current=o;n.addPoint(e.current.x,e.current.y);if(t!=null){t.lineTo(e.current.x,e.current.y)}}break;case"C":case"c":while(!e.isCommandOrEnd()){var a=e.current;var s=e.getPoint();var u=e.getAsControlPoint();var h=e.getAsCurrentPoint();e.addMarker(h,u,s);n.addBezierCurve(a.x,a.y,s.x,s.y,u.x,u.y,h.x,h.y);if(t!=null){t.bezierCurveTo(s.x,s.y,u.x,u.y,h.x,h.y)}}break;case"S":case"s":while(!e.isCommandOrEnd()){var a=e.current;var s=e.getReflectedControlPoint();var u=e.getAsControlPoint();var h=e.getAsCurrentPoint();e.addMarker(h,u,s);n.addBezierCurve(a.x,a.y,s.x,s.y,u.x,u.y,h.x,h.y);if(t!=null){t.bezierCurveTo(s.x,s.y,u.x,u.y,h.x,h.y)}}break;case"Q":case"q":while(!e.isCommandOrEnd()){var a=e.current;var u=e.getAsControlPoint();var h=e.getAsCurrentPoint();e.addMarker(h,u,u);n.addQuadraticCurve(a.x,a.y,u.x,u.y,h.x,h.y);if(t!=null){t.quadraticCurveTo(u.x,u.y,h.x,h.y)}}break;case"T":case"t":while(!e.isCommandOrEnd()){var a=e.current;var u=e.getReflectedControlPoint();e.control=u;var h=e.getAsCurrentPoint();e.addMarker(h,u,u);n.addQuadraticCurve(a.x,a.y,u.x,u.y,h.x,h.y);if(t!=null){t.quadraticCurveTo(u.x,u.y,h.x,h.y)}}break;case"A":case"a":while(!e.isCommandOrEnd()){var a=e.current;var l=e.getScalar();var f=e.getScalar();var c=e.getScalar()*(Math.PI/180);var d=e.getScalar();var p=e.getScalar();var h=e.getAsCurrentPoint();var g=new N.Point(Math.cos(c)*(a.x-h.x)/2+Math.sin(c)*(a.y-h.y)/2,-Math.sin(c)*(a.x-h.x)/2+Math.cos(c)*(a.y-h.y)/2);var v=Math.pow(g.x,2)/Math.pow(l,2)+Math.pow(g.y,2)/Math.pow(f,2);if(v>1){l*=Math.sqrt(v);f*=Math.sqrt(v)}var _=(d==p?-1:1)*Math.sqrt((Math.pow(l,2)*Math.pow(f,2)-Math.pow(l,2)*Math.pow(g.y,2)-Math.pow(f,2)*Math.pow(g.x,2))/(Math.pow(l,2)*Math.pow(g.y,2)+Math.pow(f,2)*Math.pow(g.x,2)));if(isNaN(_)){_=0}var y=new N.Point(_*l*g.y/f,_*-f*g.x/l);var m=new N.Point((a.x+h.x)/2+Math.cos(c)*y.x-Math.sin(c)*y.y,(a.y+h.y)/2+Math.sin(c)*y.x+Math.cos(c)*y.y);var b=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))};var x=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(b(t)*b(e))};var w=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(x(t,e))};var C=w([1,0],[(g.x-y.x)/l,(g.y-y.y)/f]);var E=[(g.x-y.x)/l,(g.y-y.y)/f];var S=[(-g.x-y.x)/l,(-g.y-y.y)/f];var A=w(E,S);if(x(E,S)<=-1){A=Math.PI}if(x(E,S)>=1){A=0}var k=1-p?1:-1;var M=C+k*(A/2);var T=new N.Point(m.x+l*Math.cos(M),m.y+f*Math.sin(M));e.addMarkerAngle(T,M-k*Math.PI/2);e.addMarkerAngle(h,M-k*Math.PI);n.addPoint(h.x,h.y);if(t!=null){var x=l>f?l:f;var B=l>f?1:l/f;var D=l>f?f/l:1;t.translate(m.x,m.y);t.rotate(c);t.scale(B,D);t.arc(0,0,x,C,C+A,1-p);t.scale(1/B,1/D);t.rotate(-c);t.translate(-m.x,-m.y)}}break;case"Z":case"z":if(t!=null){t.closePath()}e.current=e.start}}return n};this.getMarkers=function(){var t=this.PathParser.getMarkerPoints();var e=this.PathParser.getMarkerAngles();var n=[];for(var i=0;i<t.length;i++){n.push([t[i],e[i]])}return n}};N.Element.path.prototype=new N.Element.PathElementBase;N.Element.pattern=function(t){this.base=N.Element.ElementBase;this.base(t);this.createPattern=function(t,e){var n=this.attribute("width").toPixels("x",true);var i=this.attribute("height").toPixels("y",true);var r=new N.Element.svg;r.attributes["viewBox"]=new N.Property("viewBox",this.attribute("viewBox").value);r.attributes["width"]=new N.Property("width",n+"px");r.attributes["height"]=new N.Property("height",i+"px");r.attributes["transform"]=new N.Property("transform",this.attribute("patternTransform").value);r.children=this.children;var o=document.createElement("canvas");o.width=n;o.height=i;var a=o.getContext("2d");if(this.attribute("x").hasValue()&&this.attribute("y").hasValue()){a.translate(this.attribute("x").toPixels("x",true),this.attribute("y").toPixels("y",true))}for(var s=-1;s<=1;s++){for(var u=-1;u<=1;u++){a.save();r.attributes["x"]=new N.Property("x",s*o.width);r.attributes["y"]=new N.Property("y",u*o.height);r.render(a);a.restore()}}var h=t.createPattern(o,"repeat");return h}};N.Element.pattern.prototype=new N.Element.ElementBase;N.Element.marker=function(t){this.base=N.Element.ElementBase;this.base(t);this.baseRender=this.render;this.render=function(t,e,n){t.translate(e.x,e.y);if(this.attribute("orient").valueOrDefault("auto")=="auto"){t.rotate(n)}if(this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"){t.scale(t.lineWidth,t.lineWidth)}t.save();var i=new N.Element.svg;i.attributes["viewBox"]=new N.Property("viewBox",this.attribute("viewBox").value);i.attributes["refX"]=new N.Property("refX",this.attribute("refX").value);i.attributes["refY"]=new N.Property("refY",this.attribute("refY").value);i.attributes["width"]=new N.Property("width",this.attribute("markerWidth").value);i.attributes["height"]=new N.Property("height",this.attribute("markerHeight").value);i.attributes["fill"]=new N.Property("fill",this.attribute("fill").valueOrDefault("black"));i.attributes["stroke"]=new N.Property("stroke",this.attribute("stroke").valueOrDefault("none"));i.children=this.children;i.render(t);t.restore();if(this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"){t.scale(1/t.lineWidth,1/t.lineWidth)}if(this.attribute("orient").valueOrDefault("auto")=="auto"){t.rotate(-n)}t.translate(-e.x,-e.y)}};N.Element.marker.prototype=new N.Element.ElementBase;N.Element.defs=function(t){this.base=N.Element.ElementBase;this.base(t);this.render=function(t){}};N.Element.defs.prototype=new N.Element.ElementBase;N.Element.GradientBase=function(t){var e=this;this.base=N.Element.ElementBase;this.base(t);this.stops=[];for(var n=0;n<this.children.length;n++){var i=e.children[n];if(i.type=="stop"){e.stops.push(i)}}this.getGradient=function(){};this.gradientUnits=function(){return this.attribute("gradientUnits").valueOrDefault("objectBoundingBox")};this.attributesToInherit=["gradientUnits"];this.inheritStopContainer=function(t){var e=this;for(var n=0;n<this.attributesToInherit.length;n++){var i=e.attributesToInherit[n];if(!e.attribute(i).hasValue()&&t.attribute(i).hasValue()){e.attribute(i,true).value=t.attribute(i).value}}};this.createGradient=function(t,e,n){var i=this;if(this.getHrefAttribute().hasValue()){i=this.getHrefAttribute().getDefinition();this.inheritStopContainer(i)}var r=function(t){if(n.hasValue()){var e=new N.Property("color",t);return e.addOpacity(n).value}return t};var o=this.getGradient(t,e);if(o==null){return r(i.stops[i.stops.length-1].color)}for(var a=0;a<i.stops.length;a++){o.addColorStop(i.stops[a].offset,r(i.stops[a].color))}if(this.attribute("gradientTransform").hasValue()){var s=N.ViewPort.viewPorts[0];var u=new N.Element.rect;u.attributes["x"]=new N.Property("x",-N.MAX_VIRTUAL_PIXELS/3);u.attributes["y"]=new N.Property("y",-N.MAX_VIRTUAL_PIXELS/3);u.attributes["width"]=new N.Property("width",N.MAX_VIRTUAL_PIXELS);u.attributes["height"]=new N.Property("height",N.MAX_VIRTUAL_PIXELS);var h=new N.Element.g;h.attributes["transform"]=new N.Property("transform",this.attribute("gradientTransform").value);h.children=[u];var l=new N.Element.svg;l.attributes["x"]=new N.Property("x",0);l.attributes["y"]=new N.Property("y",0);l.attributes["width"]=new N.Property("width",s.width);l.attributes["height"]=new N.Property("height",s.height);l.children=[h];var f=document.createElement("canvas");f.width=s.width;f.height=s.height;var c=f.getContext("2d");c.fillStyle=o;l.render(c);return c.createPattern(f,"no-repeat")}return o}};N.Element.GradientBase.prototype=new N.Element.ElementBase;N.Element.linearGradient=function(t){this.base=N.Element.GradientBase;this.base(t);this.attributesToInherit.push("x1");this.attributesToInherit.push("y1");this.attributesToInherit.push("x2");this.attributesToInherit.push("y2");this.getGradient=function(t,e){var n=this.gradientUnits()=="objectBoundingBox"?e.getBoundingBox():null;if(!this.attribute("x1").hasValue()&&!this.attribute("y1").hasValue()&&!this.attribute("x2").hasValue()&&!this.attribute("y2").hasValue()){this.attribute("x1",true).value=0;this.attribute("y1",true).value=0;this.attribute("x2",true).value=1;this.attribute("y2",true).value=0}var i=this.gradientUnits()=="objectBoundingBox"?n.x()+n.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x");var r=this.gradientUnits()=="objectBoundingBox"?n.y()+n.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y");var o=this.gradientUnits()=="objectBoundingBox"?n.x()+n.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x");var a=this.gradientUnits()=="objectBoundingBox"?n.y()+n.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");if(i==o&&r==a){return null}return t.createLinearGradient(i,r,o,a)}};N.Element.linearGradient.prototype=new N.Element.GradientBase;N.Element.radialGradient=function(t){this.base=N.Element.GradientBase;this.base(t);this.attributesToInherit.push("cx");this.attributesToInherit.push("cy");this.attributesToInherit.push("r");this.attributesToInherit.push("fx");this.attributesToInherit.push("fy");this.getGradient=function(t,e){var n=e.getBoundingBox();if(!this.attribute("cx").hasValue()){this.attribute("cx",true).value="50%"}if(!this.attribute("cy").hasValue()){this.attribute("cy",true).value="50%"}if(!this.attribute("r").hasValue()){this.attribute("r",true).value="50%"}var i=this.gradientUnits()=="objectBoundingBox"?n.x()+n.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x");var r=this.gradientUnits()=="objectBoundingBox"?n.y()+n.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y");var o=i;var a=r;if(this.attribute("fx").hasValue()){o=this.gradientUnits()=="objectBoundingBox"?n.x()+n.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")}if(this.attribute("fy").hasValue()){a=this.gradientUnits()=="objectBoundingBox"?n.y()+n.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y")}var s=this.gradientUnits()=="objectBoundingBox"?(n.width()+n.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return t.createRadialGradient(o,a,0,i,r,s)}};N.Element.radialGradient.prototype=new N.Element.GradientBase;N.Element.stop=function(t){this.base=N.Element.ElementBase;this.base(t);this.offset=this.attribute("offset").numValue();if(this.offset<0){this.offset=0}if(this.offset>1){this.offset=1}var e=this.style("stop-color",true);if(e.value==""){e.value="#000"}if(this.style("stop-opacity").hasValue()){e=e.addOpacity(this.style("stop-opacity"))}this.color=e.value};N.Element.stop.prototype=new N.Element.ElementBase;N.Element.AnimateBase=function(t){this.base=N.Element.ElementBase;this.base(t);N.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").toMilliseconds();this.getProperty=function(){var t=this.attribute("attributeType").value;var e=this.attribute("attributeName").value;if(t=="CSS"){return this.parent.style(e,true)}return this.parent.attribute(e,true)};this.initialValue=null;this.initialUnits="";this.removed=false;this.calcValue=function(){return""};this.update=function(t){if(this.initialValue==null){this.initialValue=this.getProperty().value;this.initialUnits=this.getProperty().getUnits()}if(this.duration>this.maxDuration){if(this.attribute("repeatCount").value=="indefinite"||this.attribute("repeatDur").value=="indefinite"){this.duration=0}else if(this.attribute("fill").valueOrDefault("remove")=="freeze"&&!this.frozen){this.frozen=true;this.parent.animationFrozen=true;this.parent.animationFrozenValue=this.getProperty().value}else if(this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed){this.removed=true;this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue;return true}return false}this.duration=this.duration+t;var e=false;if(this.begin<this.duration){var n=this.calcValue();if(this.attribute("type").hasValue()){var i=this.attribute("type").value;n=i+"("+n+")"}this.getProperty().value=n;e=true}return e};this.from=this.attribute("from");this.to=this.attribute("to");this.values=this.attribute("values");if(this.values.hasValue()){this.values.value=this.values.value.split(";")}this.progress=function(){var t={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var e=t.progress*(this.values.value.length-1);var n=Math.floor(e),i=Math.ceil(e);t.from=new N.Property("from",parseFloat(this.values.value[n]));t.to=new N.Property("to",parseFloat(this.values.value[i]));t.progress=(e-n)/(i-n)}else{t.from=this.from;t.to=this.to}return t}};N.Element.AnimateBase.prototype=new N.Element.ElementBase;N.Element.animate=function(t){this.base=N.Element.AnimateBase;this.base(t);this.calcValue=function(){var t=this.progress();var e=t.from.numValue()+(t.to.numValue()-t.from.numValue())*t.progress;return e+this.initialUnits}};N.Element.animate.prototype=new N.Element.AnimateBase;N.Element.animateColor=function(t){this.base=N.Element.AnimateBase;this.base(t);this.calcValue=function(){var t=this.progress();var e=new Kx(t.from.value);var n=new Kx(t.to.value);if(e.ok&&n.ok){var i=e.r+(n.r-e.r)*t.progress;var r=e.g+(n.g-e.g)*t.progress;var o=e.b+(n.b-e.b)*t.progress;return"rgb("+parseInt(i,10)+","+parseInt(r,10)+","+parseInt(o,10)+")"}return this.attribute("from").value}};N.Element.animateColor.prototype=new N.Element.AnimateBase;N.Element.animateTransform=function(t){this.base=N.Element.AnimateBase;this.base(t);this.calcValue=function(){var t=this.progress();var e=N.ToNumberArray(t.from.value);var n=N.ToNumberArray(t.to.value);var i="";for(var r=0;r<e.length;r++){i+=e[r]+(n[r]-e[r])*t.progress+" "}return i}};N.Element.animateTransform.prototype=new N.Element.animate;N.Element.font=function(t){var e=this;this.base=N.Element.ElementBase;this.base(t);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.isRTL=false;this.isArabic=false;this.fontFace=null;this.missingGlyph=null;this.glyphs=[];for(var n=0;n<this.children.length;n++){var i=e.children[n];if(i.type=="font-face"){e.fontFace=i;if(i.style("font-family").hasValue()){N.Definitions[i.style("font-family").value]=e}}else if(i.type=="missing-glyph"){e.missingGlyph=i}else if(i.type=="glyph"){if(i.arabicForm!=""){e.isRTL=true;e.isArabic=true;if(typeof e.glyphs[i.unicode]=="undefined"){e.glyphs[i.unicode]=[]}e.glyphs[i.unicode][i.arabicForm]=i}else{e.glyphs[i.unicode]=i}}}};N.Element.font.prototype=new N.Element.ElementBase;N.Element.fontface=function(t){this.base=N.Element.ElementBase;this.base(t);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()};N.Element.fontface.prototype=new N.Element.ElementBase;N.Element.missingglyph=function(t){this.base=N.Element.path;this.base(t);this.horizAdvX=0};N.Element.missingglyph.prototype=new N.Element.path;N.Element.glyph=function(t){this.base=N.Element.path;this.base(t);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value};N.Element.glyph.prototype=new N.Element.path;N.Element.text=function(t){this.captureTextNodes=true;this.base=N.Element.RenderedElementBase;this.base(t);this.baseSetContext=this.setContext;this.setContext=function(t){this.baseSetContext(t);var e=this.style("dominant-baseline").toTextBaseline();if(e==null){e=this.style("alignment-baseline").toTextBaseline()}if(e!=null){t.textBaseline=e}};this.getBoundingBox=function(){var t=this.attribute("x").toPixels("x");var e=this.attribute("y").toPixels("y");var n=this.parent.style("font-size").numValueOrDefault(N.Font.Parse(N.ctx.font).fontSize);return new N.BoundingBox(t,e-n,t+Math.floor(n*2/3)*this.children[0].getText().length,e)};this.renderChildren=function(t){var e=this;this.x=this.attribute("x").toPixels("x");this.y=this.attribute("y").toPixels("y");if(this.attribute("dx").hasValue()){this.x+=this.attribute("dx").toPixels("x")}if(this.attribute("dy").hasValue()){this.y+=this.attribute("dy").toPixels("y")}this.x+=this.getAnchorDelta(t,this,0);for(var n=0;n<this.children.length;n++){e.renderChild(t,e,e,n)}};this.getAnchorDelta=function(t,e,n){var i=this.style("text-anchor").valueOrDefault("start");if(i!="start"){var r=0;for(var o=n;o<e.children.length;o++){var a=e.children[o];if(o>n&&a.attribute("x").hasValue()){break}r+=a.measureTextRecursive(t)}return-1*(i=="end"?r:r/2)}return 0};this.renderChild=function(t,e,n,i){var r=n.children[i];if(r.attribute("x").hasValue()){r.x=r.attribute("x").toPixels("x")+e.getAnchorDelta(t,n,i);if(r.attribute("dx").hasValue()){r.x+=r.attribute("dx").toPixels("x")}}else{if(r.attribute("dx").hasValue()){e.x+=r.attribute("dx").toPixels("x")}r.x=e.x}e.x=r.x+r.measureText(t);if(r.attribute("y").hasValue()){r.y=r.attribute("y").toPixels("y");if(r.attribute("dy").hasValue()){r.y+=r.attribute("dy").toPixels("y")}}else{if(r.attribute("dy").hasValue()){e.y+=r.attribute("dy").toPixels("y")}r.y=e.y}e.y=r.y;r.render(t);for(var i=0;i<r.children.length;i++){e.renderChild(t,e,r,i)}}};N.Element.text.prototype=new N.Element.RenderedElementBase;N.Element.TextElementBase=function(t){this.base=N.Element.RenderedElementBase;this.base(t);this.getGlyph=function(t,e,n){var i=e[n];var r=null;if(t.isArabic){var o="isolated";if((n==0||e[n-1]==" ")&&n<e.length-2&&e[n+1]!=" "){o="terminal"}if(n>0&&e[n-1]!=" "&&n<e.length-2&&e[n+1]!=" "){o="medial"}if(n>0&&e[n-1]!=" "&&(n==e.length-1||e[n+1]==" ")){o="initial"}if(typeof t.glyphs[i]!="undefined"){r=t.glyphs[i][o];if(r==null&&t.glyphs[i].type=="glyph"){r=t.glyphs[i]}}}else{r=t.glyphs[i]}if(r==null){r=t.missingGlyph}return r};this.renderChildren=function(t){var e=this;var n=this.parent.style("font-family").getDefinition();if(n!=null){var i=this.parent.style("font-size").numValueOrDefault(N.Font.Parse(N.ctx.font).fontSize);var r=this.parent.style("font-style").valueOrDefault(N.Font.Parse(N.ctx.font).fontStyle);var o=this.getText();if(n.isRTL){o=o.split("").reverse().join("")}var a=N.ToNumberArray(this.parent.attribute("dx").value);for(var s=0;s<o.length;s++){var u=e.getGlyph(n,o,s);var h=i/n.fontFace.unitsPerEm;t.translate(e.x,e.y);t.scale(h,-h);var l=t.lineWidth;t.lineWidth=t.lineWidth*n.fontFace.unitsPerEm/i;if(r=="italic"){t.transform(1,0,.4,1,0,0)}u.render(t);if(r=="italic"){t.transform(1,0,-.4,1,0,0)}t.lineWidth=l;t.scale(1/h,-1/h);t.translate(-e.x,-e.y);e.x+=i*(u.horizAdvX||n.horizAdvX)/n.fontFace.unitsPerEm;if(typeof a[s]!="undefined"&&!isNaN(a[s])){e.x+=a[s]}}return}if(t.fillStyle!=""){t.fillText(N.compressSpaces(this.getText()),this.x,this.y)}if(t.strokeStyle!=""){t.strokeText(N.compressSpaces(this.getText()),this.x,this.y)}};this.getText=function(){};this.measureTextRecursive=function(t){var e=this;var n=this.measureText(t);for(var i=0;i<this.children.length;i++){n+=e.children[i].measureTextRecursive(t)}return n};this.measureText=function(t){var e=this;var n=this.parent.style("font-family").getDefinition();if(n!=null){var i=this.parent.style("font-size").numValueOrDefault(N.Font.Parse(N.ctx.font).fontSize);var r=0;var o=this.getText();if(n.isRTL){o=o.split("").reverse().join("")}var a=N.ToNumberArray(this.parent.attribute("dx").value);for(var s=0;s<o.length;s++){var u=e.getGlyph(n,o,s);r+=(u.horizAdvX||n.horizAdvX)*i/n.fontFace.unitsPerEm;if(typeof a[s]!="undefined"&&!isNaN(a[s])){r+=a[s]}}return r}var h=N.compressSpaces(this.getText());if(!t.measureText){return h.length*10}t.save();this.setContext(t);var l=t.measureText(h).width;t.restore();return l}};N.Element.TextElementBase.prototype=new N.Element.RenderedElementBase;N.Element.tspan=function(t){this.captureTextNodes=true;this.base=N.Element.TextElementBase;this.base(t);this.text=N.compressSpaces(t.value||t.text||t.textContent||"");this.getText=function(){if(this.children.length>0){return""}return this.text}};N.Element.tspan.prototype=new N.Element.TextElementBase;N.Element.tref=function(t){this.base=N.Element.TextElementBase;this.base(t);this.getText=function(){var t=this.getHrefAttribute().getDefinition();if(t!=null){return t.children[0].getText()}}};N.Element.tref.prototype=new N.Element.TextElementBase;N.Element.a=function(t){var e=this;this.base=N.Element.TextElementBase;this.base(t);this.hasText=t.childNodes.length>0;for(var n=0;n<t.childNodes.length;n++){if(t.childNodes[n].nodeType!=3){e.hasText=false}}this.text=this.hasText?t.childNodes[0].value:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(t){if(this.hasText){this.baseRenderChildren(t);var e=new N.Property("fontSize",N.Font.Parse(N.ctx.font).fontSize);N.Mouse.checkBoundingBox(this,new N.BoundingBox(this.x,this.y-e.toPixels("y"),this.x+this.measureText(t),this.y))}else if(this.children.length>0){var n=new N.Element.g;n.children=this.children;n.parent=this;n.render(t)}};this.onclick=function(){window.open(this.getHrefAttribute().value)};this.onmousemove=function(){N.ctx.canvas.style.cursor="pointer"}};N.Element.a.prototype=new N.Element.TextElementBase;N.Element.image=function(t){this.base=N.Element.RenderedElementBase;this.base(t);var e=this.getHrefAttribute().value;if(e==""){return}var o=e.match(/\.svg$/);N.Images.push(this);this.loaded=false;if(!o){this.img=document.createElement("img");if(N.opts["useCORS"]==true){this.img.crossOrigin="Anonymous"}var n=this;this.img.onload=function(){n.loaded=true};this.img.onerror=function(){N.log('ERROR: image "'+e+'" not found');n.loaded=true};this.img.src=e}else{this.img=N.ajax(e);this.loaded=true}this.renderChildren=function(t){var e=this.attribute("x").toPixels("x");var n=this.attribute("y").toPixels("y");var i=this.attribute("width").toPixels("x");var r=this.attribute("height").toPixels("y");if(i==0||r==0){return}t.save();if(o){t.drawSvg(this.img,e,n,i,r)}else{t.translate(e,n);N.AspectRatio(t,this.attribute("preserveAspectRatio").value,i,this.img.width,r,this.img.height,0,0);t.drawImage(this.img,0,0)}t.restore()};this.getBoundingBox=function(){var t=this.attribute("x").toPixels("x");var e=this.attribute("y").toPixels("y");var n=this.attribute("width").toPixels("x");var i=this.attribute("height").toPixels("y");return new N.BoundingBox(t,e,t+n,e+i)}};N.Element.image.prototype=new N.Element.RenderedElementBase;N.Element.g=function(t){this.base=N.Element.RenderedElementBase;this.base(t);this.getBoundingBox=function(){var t=this;var e=new N.BoundingBox;for(var n=0;n<this.children.length;n++){e.addBoundingBox(t.children[n].getBoundingBox())}return e}};N.Element.g.prototype=new N.Element.RenderedElementBase;N.Element.symbol=function(t){this.base=N.Element.RenderedElementBase;this.base(t);this.render=function(t){}};N.Element.symbol.prototype=new N.Element.RenderedElementBase;N.Element.style=function(t){this.base=N.Element.ElementBase;this.base(t);var e="";for(var n=0;n<t.childNodes.length;n++){e+=t.childNodes[n].data}e=e.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"");e=N.compressSpaces(e);var i=e.split("}");for(var n=0;n<i.length;n++){if(N.trim(i[n])!=""){var r=i[n].split("{");var o=r[0].split(",");var a=r[1].split(";");for(var s=0;s<o.length;s++){var u=N.trim(o[s]);if(u!=""){var h=N.Styles[u]||{};for(var l=0;l<a.length;l++){var f=a[l].indexOf(":");var c=a[l].substr(0,f);var d=a[l].substr(f+1,a[l].length-f);if(c!=null&&d!=null){h[N.trim(c)]=new N.Property(N.trim(c),N.trim(d))}}N.Styles[u]=h;N.StylesSpecificity[u]=tE(u);if(u=="@font-face"){var p=h["font-family"].value.replace(/"/g,"");var g=h["src"].value.split(",");for(var v=0;v<g.length;v++){if(g[v].indexOf('format("svg")')>0){var _=g[v].indexOf("url");var y=g[v].indexOf(")",_);var m=g[v].substr(_+5,y-_-6);var b=N.parseXml(N.ajax(m));var x=b.getElementsByTagName("font");for(var w=0;w<x.length;w++){var C=N.CreateElement(x[w]);N.Definitions[p]=C}}}}}}}}};N.Element.style.prototype=new N.Element.ElementBase;N.Element.use=function(t){this.base=N.Element.RenderedElementBase;this.base(t);this.baseSetContext=this.setContext;this.setContext=function(t){this.baseSetContext(t);if(this.attribute("x").hasValue()){t.translate(this.attribute("x").toPixels("x"),0)}if(this.attribute("y").hasValue()){t.translate(0,this.attribute("y").toPixels("y"))}};var i=this.getHrefAttribute().getDefinition();this.path=function(t){if(i!=null){i.path(t)}};this.getBoundingBox=function(){if(i!=null){return i.getBoundingBox()}};this.renderChildren=function(t){if(i!=null){var e=i;if(i.type=="symbol"){e=new N.Element.svg;e.type="svg";e.attributes["viewBox"]=new N.Property("viewBox",i.attribute("viewBox").value);e.attributes["preserveAspectRatio"]=new N.Property("preserveAspectRatio",i.attribute("preserveAspectRatio").value);e.attributes["overflow"]=new N.Property("overflow",i.attribute("overflow").value);e.children=i.children}if(e.type=="svg"){if(this.attribute("width").hasValue()){e.attributes["width"]=new N.Property("width",this.attribute("width").value)}if(this.attribute("height").hasValue()){e.attributes["height"]=new N.Property("height",this.attribute("height").value)}}var n=e.parent;e.parent=null;e.render(t);e.parent=n}}};N.Element.use.prototype=new N.Element.RenderedElementBase;N.Element.mask=function(t){this.base=N.Element.ElementBase;this.base(t);this.apply=function(t,e){var n=this;var i=this.attribute("x").toPixels("x");var r=this.attribute("y").toPixels("y");var o=this.attribute("width").toPixels("x");var a=this.attribute("height").toPixels("y");if(o==0&&a==0){var s=new N.BoundingBox;for(var u=0;u<this.children.length;u++){s.addBoundingBox(n.children[u].getBoundingBox())}var i=Math.floor(s.x1);var r=Math.floor(s.y1);var o=Math.floor(s.width());var a=Math.floor(s.height())}var h=e.attribute("mask").value;e.attribute("mask").value="";var l=document.createElement("canvas");l.width=i+o;l.height=r+a;var f=l.getContext("2d");this.renderChildren(f);var c=document.createElement("canvas");c.width=i+o;c.height=r+a;var d=c.getContext("2d");e.render(d);d.globalCompositeOperation="destination-in";d.fillStyle=f.createPattern(l,"no-repeat");d.fillRect(0,0,i+o,r+a);t.fillStyle=d.createPattern(c,"no-repeat");t.fillRect(0,0,i+o,r+a);e.attribute("mask").value=h};this.render=function(t){}};N.Element.mask.prototype=new N.Element.ElementBase;N.Element.clipPath=function(t){this.base=N.Element.ElementBase;this.base(t);this.apply=function(t){var e=this;var n=CanvasRenderingContext2D.prototype.beginPath;CanvasRenderingContext2D.prototype.beginPath=function(){};var i=CanvasRenderingContext2D.prototype.closePath;CanvasRenderingContext2D.prototype.closePath=function(){};n.call(t);for(var r=0;r<this.children.length;r++){var o=e.children[r];if(typeof o.path!="undefined"){var a=null;if(o.style("transform",false,true).hasValue()){a=new N.Transform(o.style("transform",false,true).value);a.apply(t)}o.path(t);CanvasRenderingContext2D.prototype.closePath=i;if(a){a.unapply(t)}}}i.call(t);t.clip();CanvasRenderingContext2D.prototype.beginPath=n;CanvasRenderingContext2D.prototype.closePath=i};this.render=function(t){}};N.Element.clipPath.prototype=new N.Element.ElementBase;N.Element.filter=function(t){this.base=N.Element.ElementBase;this.base(t);this.apply=function(t,e){var n=this;var i=e.getBoundingBox();var r=Math.floor(i.x1);var o=Math.floor(i.y1);var a=Math.floor(i.width());var s=Math.floor(i.height());var u=e.style("filter").value;e.style("filter").value="";var h=0,l=0;for(var f=0;f<this.children.length;f++){var c=n.children[f].extraFilterDistance||0;h=Math.max(h,c);l=Math.max(l,c)}var d=document.createElement("canvas");d.width=a+2*h;d.height=s+2*l;var p=d.getContext("2d");p.translate(-r+h,-o+l);e.render(p);for(var f=0;f<this.children.length;f++){if(typeof n.children[f].apply=="function"){n.children[f].apply(p,0,0,a+2*h,s+2*l)}}t.drawImage(d,0,0,a+2*h,s+2*l,r-h,o-l,a+2*h,s+2*l);e.style("filter",true).value=u};this.render=function(t){}};N.Element.filter.prototype=new N.Element.ElementBase;N.Element.feMorphology=function(t){this.base=N.Element.ElementBase;this.base(t);this.apply=function(t,e,n,i,r){}};N.Element.feMorphology.prototype=new N.Element.ElementBase;N.Element.feComposite=function(t){this.base=N.Element.ElementBase;this.base(t);this.apply=function(t,e,n,i,r){}};N.Element.feComposite.prototype=new N.Element.ElementBase;N.Element.feColorMatrix=function(t){this.base=N.Element.ElementBase;this.base(t);var i=N.ToNumberArray(this.attribute("values").value);switch(this.attribute("type").valueOrDefault("matrix")){case"saturate":var e=i[0];i=[.213+.787*e,.715-.715*e,.072-.072*e,0,0,.213-.213*e,.715+.285*e,.072-.072*e,0,0,.213-.213*e,.715-.715*e,.072+.928*e,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var r=i[0]*Math.PI/180;var n=function(t,e,n){return t+Math.cos(r)*e+Math.sin(r)*n};i=[n(.213,.787,-.213),n(.715,-.715,-.715),n(.072,-.072,.928),0,0,n(.213,-.213,.143),n(.715,.285,.14),n(.072,-.072,-.283),0,0,n(.213,-.213,-.787),n(.715,-.715,.715),n(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}function l(t,e,n,i,r,o){return t[n*i*4+e*4+o]}function f(t,e,n,i,r,o,a){t[n*i*4+e*4+o]=a}function c(t,e){var n=i[t];return n*(n<0?e-255:e)}this.apply=function(t,e,n,i,r){var o=t.getImageData(0,0,i,r);for(var n=0;n<r;n++){for(var e=0;e<i;e++){var a=l(o.data,e,n,i,r,0);var s=l(o.data,e,n,i,r,1);var u=l(o.data,e,n,i,r,2);var h=l(o.data,e,n,i,r,3);f(o.data,e,n,i,r,0,c(0,a)+c(1,s)+c(2,u)+c(3,h)+c(4,1));f(o.data,e,n,i,r,1,c(5,a)+c(6,s)+c(7,u)+c(8,h)+c(9,1));f(o.data,e,n,i,r,2,c(10,a)+c(11,s)+c(12,u)+c(13,h)+c(14,1));f(o.data,e,n,i,r,3,c(15,a)+c(16,s)+c(17,u)+c(18,h)+c(19,1))}}t.clearRect(0,0,i,r);t.putImageData(o,0,0)}};N.Element.feColorMatrix.prototype=new N.Element.ElementBase;N.Element.feGaussianBlur=function(t){this.base=N.Element.ElementBase;this.base(t);this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue());this.extraFilterDistance=this.blurRadius;this.apply=function(t,e,n,i,r){if(typeof iw.canvasRGBA=="undefined"){N.log("ERROR: StackBlur.js must be included for blur to work");return}t.canvas.id=N.UniqueId();t.canvas.style.display="none";document.body.appendChild(t.canvas);iw.canvasRGBA(t.canvas.id,e,n,i,r,this.blurRadius);document.body.removeChild(t.canvas)}};N.Element.feGaussianBlur.prototype=new N.Element.ElementBase;N.Element.title=function(t){};N.Element.title.prototype=new N.Element.ElementBase;N.Element.desc=function(t){};N.Element.desc.prototype=new N.Element.ElementBase;N.Element.MISSING=function(t){N.log("ERROR: Element '"+t.nodeName+"' not yet implemented.")};N.Element.MISSING.prototype=new N.Element.ElementBase;N.CreateElement=function(t){var e=t.nodeName.replace(/^[^:]+:/,"");e=e.replace(/\-/g,"");var n=null;if(typeof N.Element[e]!="undefined"){n=new N.Element[e](t)}else{n=new N.Element.MISSING(t)}n.type=t.nodeName;return n};N.load=function(t,e){N.loadXml(t,N.ajax(e))};N.loadXml=function(t,e){N.loadXmlDoc(t,N.parseXml(e))};N.loadXmlDoc=function(o,a){N.init(o);var n=function(t){var e=o.canvas;while(e){t.x-=e.offsetLeft;t.y-=e.offsetTop;e=e.offsetParent}if(window.scrollX){t.x+=window.scrollX}if(window.scrollY){t.y+=window.scrollY}return t};if(N.opts["ignoreMouse"]!=true){o.canvas.onclick=function(t){var e=n(new N.Point(t!=null?t.clientX:event.clientX,t!=null?t.clientY:event.clientY));N.Mouse.onclick(e.x,e.y)};o.canvas.onmousemove=function(t){var e=n(new N.Point(t!=null?t.clientX:event.clientX,t!=null?t.clientY:event.clientY));N.Mouse.onmousemove(e.x,e.y)}}var s=N.CreateElement(a.documentElement);s.root=true;s.addStylesFromStyleDefinition();var u=true;var i=function(){N.ViewPort.Clear();if(o.canvas.parentNode){N.ViewPort.SetCurrent(o.canvas.parentNode.clientWidth,o.canvas.parentNode.clientHeight)}if(N.opts["ignoreDimensions"]!=true){if(s.style("width").hasValue()){o.canvas.width=s.style("width").toPixels("x");o.canvas.style.width=o.canvas.width+"px"}if(s.style("height").hasValue()){o.canvas.height=s.style("height").toPixels("y");o.canvas.style.height=o.canvas.height+"px"}}var t=o.canvas.clientWidth||o.canvas.width;var e=o.canvas.clientHeight||o.canvas.height;if(N.opts["ignoreDimensions"]==true&&s.style("width").hasValue()&&s.style("height").hasValue()){t=s.style("width").toPixels("x");e=s.style("height").toPixels("y")}N.ViewPort.SetCurrent(t,e);if(N.opts["offsetX"]!=null){s.attribute("x",true).value=N.opts["offsetX"]}if(N.opts["offsetY"]!=null){s.attribute("y",true).value=N.opts["offsetY"]}if(N.opts["scaleWidth"]!=null||N.opts["scaleHeight"]!=null){var n=null,i=null,r=N.ToNumberArray(s.attribute("viewBox").value);if(N.opts["scaleWidth"]!=null){if(s.attribute("width").hasValue()){n=s.attribute("width").toPixels("x")/N.opts["scaleWidth"]}else if(!isNaN(r[2])){n=r[2]/N.opts["scaleWidth"]}}if(N.opts["scaleHeight"]!=null){if(s.attribute("height").hasValue()){i=s.attribute("height").toPixels("y")/N.opts["scaleHeight"]}else if(!isNaN(r[3])){i=r[3]/N.opts["scaleHeight"]}}if(n==null){n=i}if(i==null){i=n}s.attribute("width",true).value=N.opts["scaleWidth"];s.attribute("height",true).value=N.opts["scaleHeight"];s.style("transform",true,true).value+=" scale("+1/n+","+1/i+")"}if(N.opts["ignoreClear"]!=true){o.clearRect(0,0,t,e)}s.render(o);if(u){u=false;if(typeof N.opts["renderCallback"]=="function"){N.opts["renderCallback"](a)}}};var r=true;if(N.ImagesLoaded()){r=false;i()}N.intervalID=setInterval(function(){var t=false;if(r&&N.ImagesLoaded()){r=false;t=true}if(N.opts["ignoreMouse"]!=true){t=t|N.Mouse.hasEvents()}if(N.opts["ignoreAnimation"]!=true){for(var e=0;e<N.Animations.length;e++){t=t|N.Animations[e].update(1e3/N.FRAMERATE)}}if(typeof N.opts["forceRedraw"]=="function"){if(N.opts["forceRedraw"]()==true){t=true}}if(t){i();N.Mouse.runEvents()}},1e3/N.FRAMERATE)};N.stop=function(){if(N.intervalID){clearInterval(N.intervalID)}};N.Mouse=new function(){this.events=[];this.hasEvents=function(){return this.events.length!=0};this.onclick=function(t,e){this.events.push({type:"onclick",x:t,y:e,run:function(t){if(t.onclick){t.onclick()}}})};this.onmousemove=function(t,e){this.events.push({type:"onmousemove",x:t,y:e,run:function(t){if(t.onmousemove){t.onmousemove()}}})};this.eventElements=[];this.checkPath=function(t,e){var n=this;for(var i=0;i<this.events.length;i++){var r=n.events[i];if(e.isPointInPath&&e.isPointInPath(r.x,r.y)){n.eventElements[i]=t}}};this.checkBoundingBox=function(t,e){var n=this;for(var i=0;i<this.events.length;i++){var r=n.events[i];if(e.isPointInBox(r.x,r.y)){n.eventElements[i]=t}}};this.runEvents=function(){var t=this;N.ctx.canvas.style.cursor="";for(var e=0;e<this.events.length;e++){var n=t.events[e];var i=t.eventElements[e];while(i){n.run(i);i=i.parent}}this.events=[];this.eventElements=[]}};return N}var nE=KC;var iE=function(t){var e=t.attr("stroke-width");t.attr("stroke-width",!e?0:e);var n=["none","transparent"].includes(t.attr("fill"));var i=t.attr("fill-opacity");t.attr("fill-opacity",n?0:i)};var rE={background:false,callback:function(){},exclude:[],padding:0,scale:1};var oE={ignoreMouse:true,ignoreAnimation:true,ignoreDimensions:true,ignoreClear:true};function aE(t){var e;var n=qa(t).attr("transform");var i=1,r=0,o=0;if(n){i=n.match(/scale\(([^a-z]+)\)/i);if(i){i=parseFloat(i[1])}else{i=1}var a=n.match(/translate\(([^a-z]+)\)/i);if(a){e=a[1].replace(", ",",").replace(/([^a-z]),*\s([^a-z])/gi,"$1,$2").split(",").map(function(t){return parseFloat(t)*i}),r=e[0],o=e[1]}}return[i,r,o]}var sE=function(t,H){if(!t){return}if(!(t instanceof Array)){t=[t]}H=Object.assign({},rE,H);var l=new RegExp(/(MSIE|Trident\/|Edge\/)/i).test(navigator.userAgent);var V=window?window.devicePixelRatio||1:1;var e=t[0];if(e.constructor===Object){e=e.element}var U=H.height||parseFloat(qa(e).style("height")),W=H.width||parseFloat(qa(e).style("width"));var q,X,G=0,Y=0;if(e.getBoundingClientRect){var n=e.getBoundingClientRect();G=n.left;Y=n.top}else{G=e.offsetLeft;Y=e.offsetTop}var f=document.createElement("canvas");f.width=(W+H.padding*2)*H.scale*V;f.height=(U+H.padding*2)*H.scale*V;f.style.width=(W+H.padding*2)*H.scale;f.style.height=(U+H.padding*2)*H.scale;var c=f.getContext("2d");c.scale(H.scale*V,H.scale*V);c.clearRect(0,0,f.width/V,f.height/V);if(H.background){c.beginPath();c.rect(0,0,f.width/V,f.height/V);c.fillStyle=H.background;c.fill()}var $=[];function i(t){var e=(this.tagName||"").toLowerCase();if(H.exclude.includes(this)||e==="foreignobject"){return}var n=Object.assign({},t);if(this.tagName){var i=qa(this).attr("opacity")||qa(this).style("opacity");var r=qa(this).style("display");var o=qa(this).style("visibility");if(r==="none"||o==="hidden"||i&&parseFloat(i)===0){return}var a=this.tagName.toLowerCase();var s=aE(this);var u=s[0];var h=s[1];var l=s[2];if(a==="g"){n.scale*=u;n.x+=h;n.y+=l}if(a==="svg"){var f=this.getBoundingClientRect();n.x+=f.left-G;n.y+=f.top-Y;var c=qa(this).attr("x");c=c?parseFloat(c)*n.scale:0;n.x+=c;var d=qa(this).attr("y");d=d?parseFloat(d)*n.scale:0;n.y+=d;n.clip={height:parseFloat(qa(this).attr("height")||qa(this).style("height")),width:parseFloat(qa(this).attr("width")||qa(this).style("width")),x:c,y:d}}else{var p=qa(this).attr("x");if(p){n.x+=parseFloat(p)*n.scale}var g=qa(this).attr("y");if(g){n.y+=parseFloat(g)*n.scale}}}if(!e.length){var v=(this.wholeText||"").replace(/\s/g,"");if(v.length){var _=this.nodeValue.replace(/^\s*/,"").replace(/^\n/,"").replace(/^\s*/,"").replace(/\n$/,"").replace(/\s*$/,"").replace(/\n$/,"");$.push({type:"text",style:this.parentNode,value:_,x:n.x,y:n.y})}}else if(e==="defs"){return}else if(e==="text"){var y=this.cloneNode(true);qa(y).call(iE);$.push(Object.assign({},n,{type:"svg",value:y}))}else if(["image","img"].includes(e)){var m=qa(this).attr("href")||qa(this).attr("xlink:href");if(m.length){var b=parseFloat(qa(this).attr("height"))*n.scale,x=parseFloat(qa(this).attr("width"))*n.scale;var w={clip:n.clip,height:b,loaded:false,type:"img",width:x,x:n.x,y:n.y};$.push(w);var C=new Image;C.crossOrigin="Anonymous";C.onload=function(){var t=document.createElement("canvas");var e=t.getContext("2d");t.height=b*V;t.width=x*V;e.drawImage(this,0,0,x*V,b*V);var n=document.createElement("img");n.src=t.toDataURL("image/png");w.value=n;w.loaded=true};C.src=m}}else if(["div","span"].includes(e)&&!qa(this).selectAll("svg").size()){var E={height:U,loaded:false,type:"html",width:W,x:q-G,y:X-Y};var S=document.createElement("canvas");S.width=(W+H.padding*2)*H.scale*V;S.height=(U+H.padding*2)*H.scale*V;var A=S.getContext("2d");A.scale(H.scale*V,H.scale*V);$.push(E);Zx(this,{allowTaint:true,canvas:S,height:U,width:W}).then(function(t){E.value=t;E.loaded=true})}else if(e!=="svg"&&this.childNodes.length>0&&!qa(this).selectAll("image, img, svg").size()){var k=this.cloneNode(true);qa(k).selectAll("*").each(function(){qa(this).call(iE);if(qa(this).attr("opacity")==="0"){this.parentNode.removeChild(this)}});$.push(Object.assign({},n,{type:"svg",value:k,tag:e}))}else if(this.childNodes.length>0){Q(this,n)}else{var M=this.cloneNode(true);qa(M).selectAll("*").each(function(){if(qa(this).attr("opacity")==="0"){this.parentNode.removeChild(this)}});if(e==="line"){qa(M).attr("x1",parseFloat(qa(M).attr("x1"))+n.x);qa(M).attr("x2",parseFloat(qa(M).attr("x2"))+n.x);qa(M).attr("y1",parseFloat(qa(M).attr("y1"))+n.y);qa(M).attr("y2",parseFloat(qa(M).attr("y2"))+n.y)}else if(e==="path"){var T=aE(M);var B=T[0];var D=T[1];var N=T[2];if(qa(M).attr("transform")){qa(M).attr("transform","scale("+B+")translate("+(D+n.x)+","+(N+n.y)+")")}}qa(M).call(iE);var P=qa(M).attr("fill");var z=P&&P.indexOf("url")===0;$.push(Object.assign({},n,{type:"svg",value:M,tag:e}));if(z){var O=qa(P.slice(4,-1)).node().cloneNode(true);var F=(O.tagName||"").toLowerCase();if(F==="pattern"){var R=aE(M);var I=R[0];var L=R[1];var j=R[2];n.scale*=I;n.x+=L;n.y+=j;Q(O,n)}}}}function Q(t,e){$a(t.childNodes).each(function(){i.bind(this)(e)})}for(var r=0;r<t.length;r++){var o=t[r],a={scale:1,x:0,y:0};if(o.constructor===Object){a=Object.assign(a,o);o=o.element}q=a.x;X=a.y;i.bind(o)(a)}function s(){var t=true;for(var e=0;e<$.length;e++){if($[e].loaded===false){t=false;break}}if(t){u()}else{setTimeout(s,500)}}s();function u(){for(var t=0;t<$.length;t++){var e=$[t];var n=e.clip||{height:U,width:W,x:0,y:0};switch(e.type){case"img":c.save();c.beginPath();c.translate(H.padding+n.x,H.padding+n.y);c.rect(0,0,n.width,n.height);c.clip();c.drawImage(e.value,e.x+n.x,e.y+n.y,e.width,e.height);c.restore();break;case"html":c.save();c.beginPath();c.translate(H.padding,H.padding);c.drawImage(e.value,e.x,e.y,e.width,e.height);c.restore();break;case"text":var i=qa(e.style);var r=e.value.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'");var o=i.style("color"),a=i.style("font-size");var s=i.style("font-family").split(",")[0];if(s.indexOf("'")!==0){s="'"+s+"'"}var u="<text stroke='none' dy='"+a+"' fill='"+o+"' font-family="+s+" font-size='"+a+"'>"+r+"</text>";c.save();c.translate(H.padding,H.padding);nE(f,u,Object.assign({},oE,{offsetX:e.x,offsetY:e.y}));c.restore();break;case"svg":var h=l?(new XMLSerializer).serializeToString(e.value):e.value.outerHTML;c.save();c.translate(H.padding+n.x,H.padding+n.y);c.rect(0,0,n.width,n.height);c.clip();nE(f,h,Object.assign({},oE,{offsetX:e.x+n.x,offsetY:e.y+n.y}));c.restore();break;default:console.warn("uncaught",e);break}}H.callback(f)}};(function(t){"use strict";var f=t.Uint8Array,e=t.HTMLCanvasElement,n=e&&e.prototype,u=/\s*;\s*base64\s*(?:;|$)/i,h="toDataURL",c,l=function(t){var e=t.length,n=new f(e/4*3|0),i=0,r=0,o=[0,0],a=0,s=0,u,h,l;while(e--){h=t.charCodeAt(i++);u=c[h-43];if(u!==255&&u!==l){o[1]=o[0];o[0]=h;s=s<<6|u;a++;if(a===4){n[r++]=s>>>16;if(o[1]!==61){n[r++]=s>>>8}if(o[0]!==61){n[r++]=s}a=0}}}return n};if(f){c=new f([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])}if(e&&(!n.toBlob||!n.toBlobHD)){if(!n.toBlob){n.toBlob=function(t,e){if(!e){e="image/png"}if(this.mozGetAsFile){t(this.mozGetAsFile("canvas",e));return}if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(e)){t(this.msToBlob());return}var n=Array.prototype.slice.call(arguments,1),i=this[h].apply(this,n),r=i.indexOf(","),o=i.substring(r+1),a=u.test(i.substring(0,r)),s;if(Blob.fake){s=new Blob;if(a){s.encoding="base64"}else{s.encoding="URI"}s.data=o;s.size=o.length}else if(f){if(a){s=new Blob([l(o)],{type:e})}else{s=new Blob([decodeURIComponent(o)],{type:e})}}t(s)}}if(!n.toBlobHD&&n.toDataURLHD){n.toBlobHD=function(){h="toDataURLHD";var t=this.toBlob();h="toDataURL";return t}}else{n.toBlobHD=n.toBlob}}})(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||ob.content||ob);var uE=sb(function(t){var e=e||function(h){"use strict";if(typeof h==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=h.document,l=function(){return h.URL||h.webkitURL||h},f=t.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in f,d=function(t){var e=new MouseEvent("click");t.dispatchEvent(e)},p=/constructor/i.test(h.HTMLElement)||h.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent),o=function(t){(h.setImmediate||h.setTimeout)(function(){throw t},0)},v="application/octet-stream",n=1e3*40,_=function(t){var e=function(){if(typeof t==="string"){l().revokeObjectURL(t)}else{t.remove()}};setTimeout(e,n)},y=function(t,e,n){e=[].concat(e);var i=e.length;while(i--){var r=t["on"+e[i]];if(typeof r==="function"){try{r.call(t,n||t)}catch(t){o(t)}}}},m=function(t){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)){return new Blob([String.fromCharCode(65279),t],{type:t.type})}return t},i=function(e,t,n){if(!n){e=m(e)}var i=this,r=e.type,o=r===v,a,s=function(){y(i,"writestart progress write writeend".split(" "))},u=function(){if((g||o&&p)&&h.FileReader){var n=new FileReader;n.onloadend=function(){var t=g?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");var e=h.open(t,"_blank");if(!e){h.location.href=t}t=undefined;i.readyState=i.DONE;s()};n.readAsDataURL(e);i.readyState=i.INIT;return}if(!a){a=l().createObjectURL(e)}if(o){h.location.href=a}else{var t=h.open(a,"_blank");if(!t){h.location.href=a}}i.readyState=i.DONE;s();_(a)};i.readyState=i.INIT;if(c){a=l().createObjectURL(e);setTimeout(function(){f.href=a;f.download=t;d(f);s();_(a);i.readyState=i.DONE});return}u()},e=i.prototype,r=function(t,e,n){return new i(t,e||t.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(t,e,n){e=e||t.name||"download";if(!n){t=m(t)}return navigator.msSaveOrOpenBlob(t,e)}}e.abort=function(){};e.readyState=e.INIT=0;e.WRITING=1;e.DONE=2;e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null;return r}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||ob.content);if("object"!=="undefined"&&t.exports){t.exports.saveAs=e}else if(typeof undefined!=="undefined"&&undefined!==null&&undefined.amd!==null){undefined("FileSaver.js",function(){return e})}});var hE=uE.saveAs;var lE={filename:"download",type:"png"};var fE=function(t,e,n){if(e===void 0){e={}}if(n===void 0){n={}}if(!t){return}e=Object.assign({},lE,e);var i=new RegExp(/(MSIE|Trident\/|Edge\/)/i).test(navigator.userAgent);if(!(t instanceof Array)&&e.type==="svg"){var r=i?(new XMLSerializer).serializeToString(t):t.outerHTML;hE(new Blob([r],{type:"application/svg+xml"}),e.filename+".svg")}sE(t,Object.assign({},n,{callback:function(t){if(n.callback){n.callback(t)}if(["jpg","png"].includes(e.type)){t.toBlob(function(t){return hE(t,e.filename)})}}}))};var cE={Button:hb,Radio:lb,Select:fb};var dE=function(){var l=this;var f=this;var c=["left","right","top","bottom"];var t=function(t){var s=c[t];var u=(l._controls||[]).filter(function(t){return!t.position&&s==="bottom"||t.position===s});if(l._downloadButton&&l._downloadPosition===s){u.push({data:[{text:"Download",value:1}],label:"downloadButton",on:{click:function(){var t=l._detectResize;if(t){l.detectResize(false).render()}fE(l._select.node(),Object.assign({title:l._title||undefined},l._downloadConfig),{callback:function(){setTimeout(function(){if(t){l.detectResize(t).render()}},5e3)}})}},type:"Button"})}var e=s==="top"||s==="bottom";var n={height:e?l._height-(l._margin.top+l._margin.bottom):l._height-(l._margin.top+l._margin.bottom+l._padding.top+l._padding.bottom),width:e?l._width-(l._margin.left+l._margin.right+l._padding.left+l._padding.right):l._width-(l._margin.left+l._margin.right)};n.x=(e?l._margin.left+l._padding.left:l._margin.left)+(s==="right"?n.width:0);n.y=(e?l._margin.top:l._margin.top+l._padding.top)+(s==="bottom"?n.height:0);var i=Ku("foreignObject.d3plus-viz-controls-"+s,{condition:u.length,enter:Object.assign({opacity:0},n),exit:Object.assign({opacity:0},n),parent:l._select,transition:l._transition,update:{height:n.height,opacity:1,width:n.width}});var h=i.selectAll("div.d3plus-viz-controls-container").data([null]);h=h.enter().append("xhtml:div").attr("class","d3plus-viz-controls-container").merge(h);if(u.length){var r=function(t){var e=Object.assign({},u[t]);var n={};if(e.on){var i=function(t){if({}.hasOwnProperty.call(e.on,t)){n[t]=function(){e.on[t].bind(f)(this.value)}}};for(var r in e.on){i(r)}}var o=e.label||s+"-"+t;if(!l._controlCache[o]){var a=e.type&&cE[e.type]?e.type:"Select";l._controlCache[o]=(new cE[a]).container(h.node());if(e.checked){l._controlCache[o].checked(e.checked)}if(e.selected){l._controlCache[o].selected(e.selected)}}delete e.checked;delete e.selected;l._controlCache[o].config(e).config({on:n}).config(l._controlConfig).render()};for(var o=0;o<u.length;o++){r(o)}h.style("display",["top","bottom"].includes(s)?"block":"inline-block").style("text-align",["top","bottom"].includes(s)?"center":s);var a=h.node().getBoundingClientRect();i.transition(l._transition).attr("x",n.x-(s==="right"?a.width:0)).attr("y",n.y-(s==="bottom"?a.height:0));l._margin[s]+=["top","bottom"].includes(s)?a.height:a.width}};for(var e=0;e<c.length;e++){t(e)}};function pE(t,e){var n=this._drawLabel(t,e);return n instanceof Array?n.join(", "):n}var gE=function(t){var o=this;if(t===void 0){t=[]}if(this._legend){var e=this._legendClass.outerBounds();var n=this._legendPosition;var i=["top","bottom"].includes(n);var r={transform:"translate("+(i?this._margin.left+this._padding.left:this._margin.left)+", "+(i?this._margin.top:this._margin.top+this._padding.top)+")"};var a=Ku("g.d3plus-viz-legend",{condition:this._legend&&!this._legendConfig.select,enter:r,parent:this._select,transition:this._transition,update:r}).node();var s=[];var u=function(t,e){var n=o._shape(t,e);var i=n==="Line"?"stroke":"fill";var r=o._shapeConfig[n]&&o._shapeConfig[n][i]?o._shapeConfig[n][i]:o._shapeConfig[i];return typeof r==="function"?r(t,e):r};var h=function(t,e){var n=o._shape(t,e);var i=o._shapeConfig[n]&&o._shapeConfig[n].opacity?o._shapeConfig[n].opacity:o._shapeConfig.opacity;return typeof i==="function"?i(t,e):i};var l=function(t,e){return u(t,e)+"_"+h(t,e)};Gt().key(l).rollup(function(t){return s.push(Ju(t,o._aggs))}).entries(this._colorScale?t.filter(function(t,e){return o._colorScale(t,e)===undefined}):t);this._legendClass.id(l).align(i?"center":n).direction(i?"row":"column").duration(this._duration).data(s.length>1||this._colorScale?s:[]).height(i?this._height-(this._margin.bottom+this._margin.top):this._height-(this._margin.bottom+this._margin.top+this._padding.bottom+this._padding.top)).select(a).verticalAlign(!i?"middle":n).width(i?this._width-(this._margin.left+this._margin.right+this._padding.left+this._padding.right):this._width-(this._margin.left+this._margin.right)).shapeConfig(Qu.bind(this)(this._shapeConfig,"legend")).config(this._legendConfig).shapeConfig({fill:u,opacity:h}).render();if(!this._legendConfig.select&&e.height){if(i){this._margin[n]+=e.height+this._legendClass.padding()*2}else{this._margin[n]+=e.width+this._legendClass.padding()*2}}}};function vE(n){var i=this;if(JSON.stringify(n)!==JSON.stringify(this._timelineSelection)){this._timelineSelection=n;if(!(n instanceof Array)){n=[n,n]}n=n.map(Number);this.timeFilter(function(t){var e=wd(i._time(t)).getTime();return e>=n[0]&&e<=n[1]}).render()}}var _E=function(t){var e=this;if(t===void 0){t=[]}var n=this._time&&this._timeline;var i=n?Array.from(new Set(this._data.map(this._time))).map(wd):[];n=n&&i.length>1;var r={transform:"translate("+(this._margin.left+this._padding.left)+", 0)"};var o=Ku("g.d3plus-viz-timeline",{condition:n,enter:r,parent:this._select,transition:this._transition,update:r}).node();if(n){var a=this._timelineClass.domain(Ht(i)).duration(this._duration).height(this._height-this._margin.bottom).select(o).ticks(i.sort(function(t,e){return+t-+e})).width(this._width-(this._margin.left+this._margin.right+this._padding.left+this._padding.right));if(this._timelineSelection===void 0){var s=Ht(t.map(this._time).map(wd));this._timelineSelection=s[0]===s[1]?s[0]:s;a.selection(this._timelineSelection)}var u=this._timelineConfig;a.config(u).on("brush",function(t){vE.bind(e)(t);if(u.on&&u.on.brush){u.on.brush(t)}}).on("end",function(t){vE.bind(e)(t);if(u.on&&u.on.end){u.on.end(t)}}).render();this._margin.bottom+=a.outerBounds().height+a.padding()*2}};var yE=function(t){if(t===void 0){t=[]}var e=this._title?this._title(t):false;var n={transform:"translate("+(this._margin.left+this._padding.left)+", "+this._margin.top+")"};var i=Ku("g.d3plus-viz-title",{enter:n,parent:this._select,transition:this._transition,update:n}).node();this._titleClass.data(e?[{text:e}]:[]).select(i).width(this._width-(this._margin.left+this._margin.right+this._padding.left+this._padding.right)).config(this._titleConfig).render();this._margin.top+=e?i.getBBox().height:0};var mE=function(t){if(t===void 0){t=[]}var e=typeof this._total==="function"?Xt(t.map(this._total)):this._total===true&&this._size?Xt(t.map(this._size)):false;var n={transform:"translate("+(this._margin.left+this._padding.left)+", "+this._margin.top+")"};var i=Ku("g.d3plus-viz-total",{enter:n,parent:this._select,transition:this._transition,update:n}).node();var r=typeof e==="number";this._totalClass.data(r?[{text:"Total: "+e}]:[]).select(i).width(this._width-(this._margin.left+this._margin.right+this._padding.left+this._padding.right)).config(this._totalConfig).render();this._margin.top+=r?i.getBBox().height:0};function bE(t,e){if(!t){return undefined}if(t.tagName===undefined||["BODY","HTML"].indexOf(t.tagName)>=0){var n=window["inner"+(e.charAt(0).toUpperCase()+e.slice(1))];var i=qa(t);if(e==="width"){n-=parseFloat(i.style("margin-left"),10);n-=parseFloat(i.style("margin-right"),10);n-=parseFloat(i.style("padding-left"),10);n-=parseFloat(i.style("padding-right"),10)}else{n-=parseFloat(i.style("margin-top"),10);n-=parseFloat(i.style("margin-bottom"),10);n-=parseFloat(i.style("padding-top"),10);n-=parseFloat(i.style("padding-bottom"),10)}return n}else{var r=parseFloat(qa(t).style(e),10);if(typeof r==="number"&&r>0){return r}else{return bE(t.parentNode,e)}}}var xE=function(t){return[bE(t,"width"),bE(t,"height")]};var wE=function(t,e){if(e===void 0){e=0}var n=window.pageXOffset!==undefined?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;var i=window.pageYOffset!==undefined?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;var r=t.getBoundingClientRect();var o=r.height,a=r.left+n,s=r.top+i,u=r.width;return i+window.innerHeight>s+e&&i+e<s+o&&n+window.innerWidth>a+e&&n+e<a+u};var CE=function(t,e){this._select.style("cursor","auto");if(this._drawDepth<this._groupBy.length-1){var n=this._groupBy[this._drawDepth],i=n(t,e);this.hover(false);if(this._tooltip){this._tooltipClass.data([]).render()}this._history.push({depth:this._depth,filter:this._filter});this.config({depth:this._drawDepth+1,filter:function(t,e){return n(t,e)===i}}).render()}};var EE=function(t,e){var r=this;var o=this._ids(t,e);this.hover(function(t,e){var n=r._ids(t,e);var i=qt([n.length-1,o.length-1,r._drawDepth]);return o.slice(0,i+1).join("_")===n.slice(0,i+1).join("_")})};var SE=function(){this.hover(false);this._select.style("cursor","auto");if(this._tooltip){this._tooltipClass.data([]).render()}};var AE=function(t){var e=Ta.touches?[Ta.touches[0].clientX,Ta.touches[0].clientY]:[Ta.clientX,Ta.clientY];if(this._tooltip&&t){this._select.style("cursor","pointer");this._tooltipClass.data([t]).footer(this._drawDepth<this._groupBy.length-1?"Click to Expand":"").title(this._legendConfig.label?this._legendClass.label():pE.bind(this)).position(e).config(this._tooltipConfig).config(this._legendTooltip).render()}};var kE=function(t){var e=Ta.touches?[Ta.touches[0].clientX,Ta.touches[0].clientY]:[Ta.clientX,Ta.clientY];if(this._tooltip&&t){this._select.style("cursor","pointer");this._tooltipClass.data([t]).footer(this._drawDepth<this._groupBy.length-1?"Click to Expand":"").title(this._drawLabel).position(e).config(this._tooltipConfig).render()}};var ME=function(t){Ta.preventDefault();Ta.stopPropagation();if(this._tooltip&&!t){this._tooltipClass.data([]).render()}};var TE=false;var BE=function(){if(!this._container||!this._zoomGroup){return}var t=this._zoomHeight||this._height-this._margin.top-this._margin.bottom,e=this,n=this._zoomWidth||this._width-this._margin.left-this._margin.right;this._zoomBehavior.extent([[0,0],[n,t]]).scaleExtent([1,this._zoomMax]).translateExtent([[0,0],[n,t]]).on("zoom",NE.bind(this));this._zoomToBounds=zE.bind(this);var i=qa(this._select.node().parentNode).selectAll("div.d3plus-zoom-control").data(this._zoom?[0]:[]);var r=i.enter().append("div").attr("class","d3plus-zoom-control");i.exit().remove();i=i.merge(r).style("position","absolute").style("top",this._margin.top+"px").style("left",this._margin.left+"px");r.append("div").attr("class","zoom-control zoom-in");i.select(".zoom-in").on("click",PE.bind(this,this._zoomFactor)).html("+");r.append("div").attr("class","zoom-control zoom-out");i.select(".zoom-out").on("click",PE.bind(this,1/this._zoomFactor)).html("-");r.append("div").attr("class","zoom-control zoom-reset");i.select(".zoom-reset").on("click",PE.bind(this,0)).html("↺");r.append("div").attr("class","zoom-control zoom-brush");i.select(".zoom-brush").on("click",function(){qa(this).classed("active",!TE).call(nh,TE?e._zoomControlStyle||{}:e._zoomControlStyleActive||{});DE.bind(e)(!TE)}).html("¤");i.selectAll(".zoom-control").call(nh,e._zoomControlStyle).on("mouseenter",function(){qa(this).call(nh,e._zoomControlStyleHover||{})}).on("mouseleave",function(){qa(this).call(nh,qa(this).classed("active")?e._zoomControlStyleActive||{}:e._zoomControlStyle||{})});this._zoomBrush.extent([[0,0],[n,t]]).filter(function(){return!Ta.button&&Ta.detail<2}).handleSize(this._zoomBrushHandleSize).on("start",RE.bind(this)).on("brush",OE.bind(this)).on("end",FE.bind(this));var o=this._container.selectAll("g.brush").data([0]);this._brushGroup=o.enter().append("g").attr("class","brush").merge(o).call(this._zoomBrush);DE.bind(this)();if(this._renderTiles){this._renderTiles($m(this._container.node()),0)}};function DE(t){if(t===void 0){t=false}TE=t;if(TE){this._brushGroup.style("display","inline")}else{this._brushGroup.style("display","none")}if(!TE&&this._zoom){this._container.call(this._zoomBehavior);if(!this._zoomScroll){this._container.on("wheel.zoom",null)}if(!this._zoomPan){this._container.on("mousedown.zoom mousemove.zoom",null).on("touchstart.zoom touchmove.zoom touchend.zoom touchcancel.zoom",null)}}else{this._container.on(".zoom",null)}}function NE(t,e){if(t===void 0){t=false}if(e===void 0){e=0}if(this._zoomGroup){if(!e){this._zoomGroup.attr("transform",t||Ta.transform)}else{this._zoomGroup.transition().duration(e).attr("transform",t||Ta.transform)}}if(this._renderTiles){this._renderTiles($m(this._container.node()),e)}}function PE(t){if(t===void 0){t=0}if(!this._container){return}var e=this._zoomBehavior.extent().bind(document)()[1].map(function(t){return t/2}),n=this._zoomBehavior.scaleExtent(),i=$m(this._container.node());if(!t){i.k=n[0];i.x=0;i.y=0}else{var r=[(e[0]-i.x)/i.k,(e[1]-i.y)/i.k];i.k=Math.min(n[1],i.k*t);if(i.k<=n[0]){i.k=n[0];i.x=0;i.y=0}else{i.x+=e[0]-(r[0]*i.k+i.x);i.y+=e[1]-(r[1]*i.k+i.y)}}NE.bind(this)(i,this._duration)}function zE(t,e){if(e===void 0){e=this._duration}var n=this._zoomBehavior.scaleExtent(),i=$m(this._container.node());if(t){var r=this._zoomBehavior.translateExtent()[1];var o=r[0];var a=r[1];var s=t[1][0]-t[0][0],u=t[1][1]-t[0][1];var h=Math.min(n[1],1/Math.max(s/o,u/a));var l,f;if(s/u<o/a){h*=(a-this._zoomPadding*2)/a;l=(o-s*h)/2/h;f=this._zoomPadding/h}else{h*=(o-this._zoomPadding*2)/o;f=(a-u*h)/2/h;l=this._zoomPadding/h}i.x=(i.x-t[0][0]+l)*(i.k*h/i.k);i.y=(i.y-t[0][1]+f)*(i.k*h/i.k);i.k*=h;if(i.x>0){i.x=0}else if(i.x<o*-i.k+o){i.x=o*-i.k+o}if(i.y>0){i.y=0}else if(i.y<a*-i.k+a){i.y=a*-i.k+a}}else{i.k=n[0];i.x=0;i.y=0}NE.bind(this)(i,e)}function OE(){IE.bind(this)()}function FE(){if(!Ta.selection){return}this._brushGroup.call(this._zoomBrush.move,null);zE.bind(this)(Ta.selection)}function RE(){IE.bind(this)()}function IE(){this._brushGroup.selectAll(".selection").call(Uu,this._zoomBrushSelectionStyle||{});this._brushGroup.selectAll(".handle").call(Uu,this._zoomBrushHandleStyle||{})}var LE=function(e){function t(){var o=this;e.call(this);this._aggs={};this._backClass=(new Ac).on("click",function(){if(o._history.length){o.config(o._history.pop()).render()}else{o.depth(o._drawDepth-1).filter(false).render()}}).on("mousemove",function(){return o._backClass.select().style("cursor","pointer")});this._backConfig={fontSize:10,padding:5,resize:false};this._cache=true;this._color=function(t,e){return o._groupBy[0](t,e)};this._colorScaleClass=new mb;this._colorScaleConfig={};this._colorScalePosition="bottom";var t=new fb;this._controlCache={};this._controlConfig={selectStyle:Object.assign({margin:"5px"},t.selectStyle())};this._data=[];this._detectResize=true;this._detectResizeDelay=400;this._detectVisible=true;this._detectVisibleInterval=1e3;this._downloadButton=false;this._downloadConfig={type:"png"};this._downloadPosition="top";this._duration=600;this._history=[];this._groupBy=[ju("id")];this._legend=true;this._legendConfig={label:pE.bind(this),shapeConfig:{labelConfig:{fontColor:undefined,fontResize:false,padding:0}}};this._legendTooltip={};this._legendClass=new bb;this._legendPosition="bottom";this._loadingHTML=Zu('\n <div style="font-family: \'Roboto\', \'Helvetica Neue\', Helvetica, Arial, sans-serif;">\n <strong>Loading Visualization</strong>\n <sub style="display: block; margin-top: 5px;"><a href="https://d3plus.org" target="_blank">Powered by D3plus</a></sub>\n </div>');this._loadingMessage=true;this._locale="en-US";this._lrucache=ub(10);this._messageClass=new Yx;this._messageMask="rgba(0, 0, 0, 0.1)";this._messageStyle={left:"0px",position:"absolute","text-align":"center",top:"45%",width:"100%"};this._noDataHTML=Zu("\n <div style=\"font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;\">\n <strong>No Data Available</strong>\n </div>");this._noDataMessage=true;this._on={click:CE.bind(this),mouseenter:EE.bind(this),mouseleave:SE.bind(this),"mousemove.shape":kE.bind(this),"mousemove.legend":AE.bind(this)};this._queue=[];this._scrollContainer=typeof window===undefined?"":window;this._shape=Zu("Rect");this._shapes=[];this._shapeConfig={fill:function(t,e){while(t.__d3plus__&&t.data){t=t.data;e=t.i}if(o._colorScale){var n=o._colorScale(t,e);if(n!==undefined&&n!==null){var i=o._colorScaleClass._colorScale;if(!i.domain().length){return i.range()[i.range().length-1]}return i(n)}}var r=o._color(t,e);if(Q(r)){return r}return mh(r)},labelConfig:{fontColor:function(t,e){var n=typeof o._shapeConfig.fill==="function"?o._shapeConfig.fill(t,e):o._shapeConfig.fill;return bh(n)}},opacity:Zu(1),stroke:function(t,e){var n=typeof o._shapeConfig.fill==="function"?o._shapeConfig.fill(t,e):o._shapeConfig.fill;return Q(n).darker()},strokeWidth:Zu(0)};this._timeline=true;this._timelineClass=(new xb).align("end");this._timelineConfig={};this._titleClass=new Ac;this._titleConfig={fontSize:12,padding:5,resize:false,textAnchor:"middle"};this._tooltip=true;this._tooltipClass=new Gx;this._tooltipConfig={duration:50,pointerEvents:"none",titleStyle:{"max-width":"200px"}};this._totalClass=new Ac;this._totalConfig={fontSize:10,padding:5,resize:false,textAnchor:"middle"};this._zoom=false;this._zoomBehavior=rb();this._zoomBrush=zm();this._zoomBrushHandleSize=1;this._zoomBrushHandleStyle={fill:"#444"};this._zoomBrushSelectionStyle={fill:"#777","stroke-width":0};this._zoomControlStyle={background:"rgba(255, 255, 255, 0.75)",border:"1px solid rgba(0, 0, 0, 0.75)",color:"rgba(0, 0, 0, 0.75)",display:"block",font:"900 15px/21px 'Roboto', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",height:"20px",margin:"5px",opacity:.75,padding:0,"text-align":"center",width:"20px"};this._zoomControlStyleActive={background:"rgba(0, 0, 0, 0.75)",color:"rgba(255, 255, 255, 0.75)",opacity:1};this._zoomControlStyleHover={cursor:"pointer",opacity:1};this._zoomFactor=2;this._zoomMax=16;this._zoomPadding=20;this._zoomPan=true;this._zoomScroll=true}if(e){t.__proto__=e}t.prototype=Object.create(e&&e.prototype);t.prototype.constructor=t;t.prototype._preDraw=function t(){var i=this;var r=this;this._drawDepth=this._depth!==void 0?this._depth:this._groupBy.length-1;this._id=this._groupBy[this._drawDepth];this._ids=function(e,n){return i._groupBy.map(function(t){return!e||e.__d3plus__&&!e.data?undefined:t(e.__d3plus__?e.data:e,e.__d3plus__?e.i:n)}).filter(function(t){return t!==undefined&&t!==null&&t.constructor!==Array})};this._drawLabel=function(t,e){if(!t){return""}while(t.__d3plus__&&t.data){t=t.data;e=t.i}if(i._label){return i._label(t,e)}var n=r._ids(t,e).slice(0,i._drawDepth+1);return n[n.length-1]};if(this._time&&this._timeFilter===void 0&&this._data.length){var e=this._data.map(this._time).map(wd);var n=this._data[0],o=0;if(this._discrete&&"_"+this._discrete in this&&this["_"+this._discrete](n,o)===this._time(n,o)){this._timeFilter=function(){return true}}else{var a=+Ut(e);this._timeFilter=function(t,e){return+wd(i._time(t,e))===a}}}this._filteredData=[];var s=[];if(this._data.length){s=this._timeFilter?this._data.filter(this._timeFilter):this._data;if(this._filter){s=s.filter(this._filter)}var u=Gt();for(var h=0;h<=this._drawDepth;h++){u.key(i._groupBy[h])}if(this._discrete&&"_"+this._discrete in this){u.key(this["_"+this._discrete])}if(this._discrete&&"_"+this._discrete+"2"in this){u.key(this["_"+this._discrete+"2"])}u.rollup(function(t){return i._filteredData.push(Ju(t,i._aggs))}).entries(s)}if(this._noDataMessage&&!this._filteredData.length){this._messageClass.render({container:this._select.node().parentNode,html:this._noDataHTML(this),mask:this._messageMask,style:this._messageStyle})}};t.prototype._draw=function t(){if(this.legendPosition()==="left"||this.legendPosition()==="right"){gE.bind(this)(this._filteredData)}if(this.colorScalePosition()==="left"||this.colorScalePosition()==="right"){Qx.bind(this)(this._filteredData)}$x.bind(this)();yE.bind(this)(this._filteredData);mE.bind(this)(this._filteredData);_E.bind(this)(this._filteredData);dE.bind(this)(this._filteredData);if(this.legendPosition()==="top"||this.legendPosition()==="bottom"){gE.bind(this)(this._filteredData)}if(this.colorScalePosition()==="top"||this.colorScalePosition()==="bottom"){Qx.bind(this)(this._filteredData)}this._shapes=[]};t.prototype.render=function t(r){var o=this;this._margin={bottom:0,left:0,right:0,top:0};this._padding={bottom:0,left:0,right:0,top:0};this._transition=Pu().duration(this._duration);if(this._select===void 0||this._select.node().tagName.toLowerCase()!=="svg"){var e=this._select===void 0?qa("body").append("div"):this._select;var n=xE(e.node());var i=n[0];var a=n[1];var s=e.append("svg");i-=parseFloat(s.style("border-left-width"),10);i-=parseFloat(s.style("border-right-width"),10);a-=parseFloat(s.style("border-top-width"),10);a-=parseFloat(s.style("border-bottom-width"),10);if(!this._width){this._autoWidth=true;this.width(i)}if(!this._height){this._autoHeight=true;this.height(a)}s.style("width",this._width+"px").style("height",this._height+"px");this.select(s.node())}if(!this._width||!this._height){var u=xE(this._select.node());var h=u[0];var l=u[1];if(!this._width){this.width(h)}if(!this._height){this.height(l)}}this._select.transition(this._transition).style("width",this._width+"px").style("height",this._height+"px");clearInterval(this._visiblePoll);clearTimeout(this._resizePoll);qa(this._scrollContainer).on("scroll."+this._uuid,null);qa(this._scrollContainer).on("resize."+this._uuid,null);if(this._detectVisible&&this._select.style("visibility")==="hidden"){this._visiblePoll=setInterval(function(){if(o._select.style("visibility")!=="hidden"){clearInterval(o._visiblePoll);o.render(r)}},this._detectVisibleInterval)}else if(this._detectVisible&&this._select.style("display")==="none"){this._visiblePoll=setInterval(function(){if(o._select.style("display")!=="none"){clearInterval(o._visiblePoll);o.render(r)}},this._detectVisibleInterval)}else if(this._detectVisible&&!wE(this._select.node())){qa(this._scrollContainer).on("scroll."+this._uuid,function(){if(wE(o._select.node())){qa(o._scrollContainer).on("scroll."+o._uuid,null);o.render(r)}})}else{var f=Wm();if(this._loadingMessage){this._messageClass.render({container:this._select.node().parentNode,html:this._loadingHTML(this),mask:this._messageMask,style:this._messageStyle})}this._queue.forEach(function(t){var e=o._cache?o._lrucache.get(t[1]):undefined;if(!e){f.defer.apply(f,t)}else{o["_"+t[3]]=e}});this._queue=[];f.awaitAll(function(){o._preDraw();o._draw(r);BE.bind(o)();if(o._messageClass._isVisible&&(!o._noDataMessage||o._filteredData.length)){o._messageClass.hide()}if(o._detectResize&&(o._autoWidth||o._autoHeight)){qa(o._scrollContainer).on("resize."+o._uuid,function(){clearTimeout(o._resizePoll);o._resizePoll=setTimeout(function(){clearTimeout(o._resizePoll);var t=o._select.style("display");o._select.style("display","none");var e=xE(o._select.node().parentNode);var n=e[0];var i=e[1];n-=parseFloat(o._select.style("border-left-width"),10);n-=parseFloat(o._select.style("border-right-width"),10);i-=parseFloat(o._select.style("border-top-width"),10);i-=parseFloat(o._select.style("border-bottom-width"),10);o._select.style("display",t);if(o._autoWidth){o.width(n)}if(o._autoHeight){o.height(i)}o.render(r)},o._detectResizeDelay)})}if(r){setTimeout(r,o._duration+100)}})}qa("body").on("touchstart."+this._uuid,ME.bind(this));return this};t.prototype.active=function t(e){this._active=e;if(this._shapeConfig.activeOpacity!==1){this._shapes.forEach(function(t){return t.active(e)});if(this._legend){this._legendClass.active(e)}}return this};t.prototype.aggs=function t(e){return arguments.length?(this._aggs=Vu(this._aggs,e),this):this._aggs};t.prototype.backConfig=function t(e){return arguments.length?(this._backConfig=Vu(this._backConfig,e),this):this._backConfig};t.prototype.cache=function t(e){return arguments.length?(this._cache=e,this):this._cache};t.prototype.color=function t(e){return arguments.length?(this._color=!e||typeof e==="function"?e:ju(e),this):this._color};t.prototype.colorScale=function t(e){return arguments.length?(this._colorScale=!e||typeof e==="function"?e:ju(e),this):this._colorScale};t.prototype.colorScaleConfig=function t(e){return arguments.length?(this._colorScaleConfig=Vu(this._colorScaleConfig,e),this):this._colorScaleConfig};t.prototype.colorScalePosition=function t(e){return arguments.length?(this._colorScalePosition=e,this):this._colorScalePosition};t.prototype.controls=function t(e){return arguments.length?(this._controls=e,this):this._controls};t.prototype.controlConfig=function t(e){return arguments.length?(this._controlConfig=Vu(this._controlConfig,e),this):this._controlConfig};t.prototype.data=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="data"});var r=[sm.bind(this),e,n,"data"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._data};t.prototype.depth=function t(e){return arguments.length?(this._depth=e,this):this._depth};t.prototype.detectResize=function t(e){return arguments.length?(this._detectResize=e,this):this._detectResize};t.prototype.detectResizeDelay=function t(e){return arguments.length?(this._detectResizeDelay=e,this):this._detectResizeDelay};t.prototype.detectVisible=function t(e){return arguments.length?(this._detectVisible=e,this):this._detectVisible};t.prototype.detectVisibleInterval=function t(e){return arguments.length?(this._detectVisibleInterval=e,this):this._detectVisibleInterval};t.prototype.discrete=function t(e){return arguments.length?(this._discrete=e,this):this._discrete};t.prototype.downloadButton=function t(e){return arguments.length?(this._downloadButton=e,this):this._downloadButton};t.prototype.downloadConfig=function t(e){return arguments.length?(this._downloadConfig=Vu(this._downloadConfig,e),this):this._downloadConfig};t.prototype.downloadPosition=function t(e){return arguments.length?(this._downloadPosition=e,this):this._downloadPosition};t.prototype.duration=function t(e){return arguments.length?(this._duration=e,this):this._duration};t.prototype.filter=function t(e){return arguments.length?(this._filter=e,this):this._filter};t.prototype.groupBy=function t(e){var n=this;if(!arguments.length){return this._groupBy}if(!(e instanceof Array)){e=[e]}return this._groupBy=e.map(function(t){if(typeof t==="function"){return t}else{if(!n._aggs[t]){n._aggs[t]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}return ju(t)}}),this};t.prototype.height=function t(e){return arguments.length?(this._height=e,this):this._height};t.prototype.hover=function t(e){var n=this;var i=this._hover=e;if(this._shapeConfig.hoverOpacity!==1){if(typeof e==="function"){var r=Wt(this._shapes.map(function(t){return t.data()}));r=r.concat(this._legendClass.data());var o=e?r.filter(e):[];var a=[];o.map(this._ids).forEach(function(t){for(var e=1;e<=t.length;e++){a.push(JSON.stringify(t.slice(0,e)))}});a=a.filter(function(t,e){return a.indexOf(t)===e});if(a.length){i=function(t,e){return a.includes(JSON.stringify(n._ids(t,e)))}}}this._shapes.forEach(function(t){return t.hover(i)});if(this._legend){this._legendClass.hover(i)}}return this};t.prototype.label=function t(e){return arguments.length?(this._label=typeof e==="function"?e:Zu(e),this):this._label};t.prototype.legend=function t(e){return arguments.length?(this._legend=e,this):this._legend};t.prototype.legendConfig=function t(e){return arguments.length?(this._legendConfig=Vu(this._legendConfig,e),this):this._legendConfig};t.prototype.legendTooltip=function t(e){return arguments.length?(this._legendTooltip=Vu(this._legendTooltip,e),this):this._legendTooltip};t.prototype.legendPosition=function t(e){return arguments.length?(this._legendPosition=e,this):this._legendPosition};t.prototype.loadingHTML=function t(e){return arguments.length?(this._loadingHTML=typeof e==="function"?e:Zu(e),this):this._loadingHTML};t.prototype.loadingMessage=function t(e){return arguments.length?(this._loadingMessage=e,this):this._loadingMessage};t.prototype.locale=function t(e){return arguments.length?(this._locale=e,this):this._locale};t.prototype.messageMask=function t(e){return arguments.length?(this._messageMask=e,this):this._messageMask};t.prototype.messageStyle=function t(e){return arguments.length?(this._messageStyle=Vu(this._messageStyle,e),this):this._messageStyle};t.prototype.noDataHTML=function t(e){return arguments.length?(this._noDataHTML=typeof e==="function"?e:Zu(e),this):this._noDataHTML};t.prototype.noDataMessage=function t(e){return arguments.length?(this._noDataMessage=e,this):this._noDataMessage};t.prototype.scrollContainer=function t(e){return arguments.length?(this._scrollContainer=e,this):this._scrollContainer};t.prototype.select=function t(e){return arguments.length?(this._select=qa(e),this):this._select};t.prototype.shape=function t(e){return arguments.length?(this._shape=typeof e==="function"?e:Zu(e),this):this._shape};t.prototype.shapeConfig=function t(e){return arguments.length?(this._shapeConfig=Vu(this._shapeConfig,e),this):this._shapeConfig};t.prototype.time=function t(e){if(arguments.length){if(typeof e==="function"){this._time=e}else{this._time=ju(e);if(!this._aggs[e]){this._aggs[e]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}}return this}else{return this._time}};t.prototype.timeFilter=function t(e){return arguments.length?(this._timeFilter=e,this):this._timeFilter};t.prototype.timeline=function t(e){return arguments.length?(this._timeline=e,this):this._timeline};t.prototype.timelineConfig=function t(e){return arguments.length?(this._timelineConfig=Vu(this._timelineConfig,e),this):this._timelineConfig};t.prototype.title=function t(e){return arguments.length?(this._title=typeof e==="function"?e:Zu(e),this):this._title};t.prototype.titleConfig=function t(e){return arguments.length?(this._titleConfig=Vu(this._titleConfig,e),this):this._titleConfig};t.prototype.tooltip=function t(e){return arguments.length?(this._tooltip=e,this):this._tooltip};t.prototype.tooltipConfig=function t(e){return arguments.length?(this._tooltipConfig=Vu(this._tooltipConfig,e),this):this._tooltipConfig};t.prototype.total=function t(e){return arguments.length?(this._total=typeof e==="function"?e:ju(e),this):this._total};t.prototype.totalConfig=function t(e){return arguments.length?(this._totalConfig=Vu(this._totalConfig,e),this):this._totalConfig};t.prototype.width=function t(e){return arguments.length?(this._width=e,this):this._width};t.prototype.zoom=function t(e){return arguments.length?(this._zoom=e,this):this._zoom};t.prototype.zoomBrushHandleSize=function t(e){return arguments.length?(this._zoomBrushHandleSize=e,this):this._zoomBrushHandleSize};t.prototype.zoomBrushHandleStyle=function t(e){return arguments.length?(this._zoomBrushHandleStyle=e,this):this._zoomBrushHandleStyle};t.prototype.zoomBrushSelectionStyle=function t(e){return arguments.length?(this._zoomBrushSelectionStyle=e,this):this._zoomBrushSelectionStyle};t.prototype.zoomControlStyle=function t(e){return arguments.length?(this._zoomControlStyle=e,this):this._zoomControlStyle};t.prototype.zoomControlStyleActive=function t(e){return arguments.length?(this._zoomControlStyleActive=e,this):this._zoomControlStyleActive};t.prototype.zoomControlStyleHover=function t(e){return arguments.length?(this._zoomControlStyleHover=e,this):this._zoomControlStyleHover};t.prototype.zoomFactor=function t(e){return arguments.length?(this._zoomFactor=e,this):this._zoomFactor};t.prototype.zoomMax=function t(e){return arguments.length?(this._zoomMax=e,this):this._zoomMax};t.prototype.zoomPan=function t(e){return arguments.length?(this._zoomPan=e,this):this._zoomPan};t.prototype.zoomPadding=function t(e){return arguments.length?(this._zoomPadding=e,this):this._zoomPadding};t.prototype.zoomScroll=function t(e){return arguments.length?(this._zoomScroll=e,this):this._zoomScroll};return t}(Yu);function jE(t,e){var n=e&&t.objects[e]?e:Object.keys(t.objects)[0];return zy(t,t.objects[n])}var HE=function(S){function t(){var i=this;S.call(this);this._fitObject=false;this._noDataMessage=false;this._ocean="#cdd1d3";this._point=ju("point");this._pointSize=Zu(1);this._pointSizeMax=10;this._pointSizeMin=5;this._pointSizeScale="linear";this._projection=uy();this._projectionPadding=th(20);this._rotate=[0,0];this._shape=Zu("Circle");this._shapeConfig=Vu(this._shapeConfig,{hoverOpacity:1,Path:{fill:function(t){if(i._colorScale&&!i._coordData.features.includes(t)){var e=i._colorScale(t);if(e!==undefined&&e!==null){return i._colorScaleClass._colorScale(e)}}return"#f5f5f3"},on:{mouseenter:function(t){return!i._coordData.features.includes(t)?i._on.mouseenter.bind(i)(t):null},"mousemove.shape":function(t){return!i._coordData.features.includes(t)?i._on["mousemove.shape"].bind(i)(t):null},mouseleave:function(t){return!i._coordData.features.includes(t)?i._on.mouseleave.bind(i)(t):null}},stroke:function(t,e){var n=typeof i._shapeConfig.Path.fill==="function"?i._shapeConfig.Path.fill(t,e):i._shapeConfig.Path.fill;return Q(n).darker()},strokeWidth:1}});this._tiles=true;this._tileGen=By().wrap(false);this._tileUrl="https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}@2x.png";this._topojson=false;this._topojsonFilter=function(t){return!["010"].includes(t.id)};this._topojsonId=ju("id");this._zoom=true;this._zoomSet=false}if(S){t.__proto__=S}t.prototype=Object.create(S&&S.prototype);t.prototype.constructor=t;t.prototype._renderTiles=function t(e,n){var i=this;if(n===void 0){n=0}var r=[];if(this._tiles){r=this._tileGen.extent(this._zoomBehavior.translateExtent()).scale(this._projection.scale()*(2*Math.PI)*e.k).translate(e.apply(this._projection.translate()))();this._tileGroup.transition().duration(n).attr("transform",e)}var o=this._tileGroup.selectAll("image.tile").data(r,function(t){return t.x+"-"+t.y+"-"+t.z});o.exit().transition().duration(n).attr("opacity",0).remove();var a=r.scale/e.k;o.enter().append("image").attr("class","tile").attr("opacity",0).attr("xlink:href",function(t){return i._tileUrl.replace("{s}",["a","b","c"][Math.random()*3|0]).replace("{z}",t.z).replace("{x}",t.x).replace("{y}",t.y)}).attr("width",a).attr("height",a).attr("x",function(t){return t.x*a+r.translate[0]*a-e.x/e.k}).attr("y",function(t){return t.y*a+r.translate[1]*a-e.y/e.k}).transition().duration(n).attr("opacity",1)};t.prototype._draw=function t(e){var i=this;S.prototype._draw.call(this,e);var n=this._height-this._margin.top-this._margin.bottom,r=this._width-this._margin.left-this._margin.right;this._container=this._select.selectAll("svg.d3plus-geomap").data([0]);this._container=this._container.enter().append("svg").attr("class","d3plus-geomap").attr("opacity",0).attr("width",r).attr("height",n).attr("x",this._margin.left).attr("y",this._margin.top).style("background-color",this._ocean||"transparent").merge(this._container);this._container.transition(this._transition).attr("opacity",1).attr("width",r).attr("height",n).attr("x",this._margin.left).attr("y",this._margin.top);var o=this._container.selectAll("rect.d3plus-geomap-ocean").data([0]);o.enter().append("rect").attr("class","d3plus-geomap-ocean").merge(o).attr("width",r).attr("height",n).attr("fill",this._ocean||"transparent");this._tileGroup=this._container.selectAll("g.d3plus-geomap-tileGroup").data([0]);this._tileGroup=this._tileGroup.enter().append("g").attr("class","d3plus-geomap-tileGroup").merge(this._tileGroup);this._zoomGroup=this._container.selectAll("g.d3plus-geomap-zoomGroup").data([0]);this._zoomGroup=this._zoomGroup.enter().append("g").attr("class","d3plus-geomap-zoomGroup").merge(this._zoomGroup);var a=this._zoomGroup.selectAll("g.d3plus-geomap-paths").data([0]);a=a.enter().append("g").attr("class","d3plus-geomap-paths").merge(a);var s=this._coordData=this._topojson?jE(this._topojson,this._topojsonKey):{type:"FeatureCollection",features:[]};if(this._topojsonFilter){s.features=s.features.filter(this._topojsonFilter)}var u=this._path=M_().projection(this._projection);var h=this._filteredData.filter(function(t,e){return i._point(t,e)instanceof Array});var l=this._filteredData.filter(function(t,e){return!(i._point(t,e)instanceof Array)}).reduce(function(t,e){t[i._id(e)]=e;return t},{});var f=s.features.reduce(function(t,e){var n=i._topojsonId(e);t.push({__d3plus__:true,data:l[n],feature:e,id:n});return t},[]);var c=Zr["scale"+this._pointSizeScale.charAt(0).toUpperCase()+this._pointSizeScale.slice(1)]().domain(Ht(h,function(t,e){return i._pointSize(t,e)})).range([this._pointSizeMin,this._pointSizeMax]);if(!this._zoomSet){var d=this._fitObject?jE(this._fitObject,this._fitKey):s;this._extentBounds={type:"FeatureCollection",features:this._fitFilter?d.features.filter(this._fitFilter):d.features.slice()};this._extentBounds.features=this._extentBounds.features.reduce(function(t,e){if(e.geometry){var n={type:e.type,id:e.id,geometry:{coordinates:e.geometry.coordinates,type:e.geometry.type}};if(e.geometry.coordinates.length>1){var i=[],r=[];e.geometry.coordinates.forEach(function(t){n.geometry.coordinates=[t];i.push(u.area(n))});n.geometry.coordinates=[e.geometry.coordinates[i.indexOf(Ut(i))]];var o=u.centroid(n);e.geometry.coordinates.forEach(function(t){n.geometry.coordinates=[t];r.push(Dc(u.centroid(n),o))});var a=A(i.reduce(function(t,e,n){if(e){t.push(i[n]/e)}return t},[]),.9);n.geometry.coordinates=e.geometry.coordinates.filter(function(t,e){var n=r[e];return n===0||i[e]/n>=a})}t.push(n)}return t},[]);if(!this._extentBounds.features.length&&h.length){var p=[[undefined,undefined],[undefined,undefined]];h.forEach(function(t,e){var n=i._projection(i._point(t,e));if(p[0][0]===void 0||n[0]<p[0][0]){p[0][0]=n[0]}if(p[1][0]===void 0||n[0]>p[1][0]){p[1][0]=n[0]}if(p[0][1]===void 0||n[1]<p[0][1]){p[0][1]=n[1]}if(p[1][1]===void 0||n[1]>p[1][1]){p[1][1]=n[1]}});this._extentBounds={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:p.map(function(t){return i._projection.invert(t)})}}]};var g=Ut(h,function(t,e){return c(i._pointSize(t,e))});this._projectionPadding.top+=g;this._projectionPadding.right+=g;this._projectionPadding.bottom+=g;this._projectionPadding.left+=g}this._zoomBehavior.extent([[0,0],[r,n]]).scaleExtent([1,this._zoomMax]).translateExtent([[0,0],[r,n]]);this._zoomSet=true}this._projection=this._projection.fitExtent(this._extentBounds.features.length?[[this._projectionPadding.left,this._projectionPadding.top],[r-this._projectionPadding.right,n-this._projectionPadding.bottom]]:[[0,0],[r,n]],this._extentBounds.features.length?this._extentBounds:{type:"Sphere"});this._shapes.push((new md).data(f).d(function(t){return u(t.feature)}).select(a.node()).x(0).y(0).config(Qu.bind(this)(this._shapeConfig,"shape","Path")).render());var v=this._zoomGroup.selectAll("g.d3plus-geomap-pins").data([0]);v=v.enter().append("g").attr("class","d3plus-geomap-pins").merge(v);var _=(new dd).config(Qu.bind(this)(this._shapeConfig,"shape","Circle")).data(h).r(function(t,e){return c(i._pointSize(t,e))}).select(v.node()).sort(function(t,e){return i._pointSize(e)-i._pointSize(t)}).x(function(t,e){return i._projection(i._point(t,e))[0]}).y(function(t,e){return i._projection(i._point(t,e))[1]});var y=Object.keys(this._on);var m=y.filter(function(t){return t.includes(".Circle")}),b=y.filter(function(t){return!t.includes(".")}),x=y.filter(function(t){return t.includes(".shape")});for(var w=0;w<b.length;w++){_.on(b[w],i._on[b[w]])}for(var C=0;C<x.length;C++){_.on(x[C],i._on[x[C]])}for(var E=0;E<m.length;E++){_.on(m[E],i._on[m[E]])}this._shapes.push(_.render());return this};t.prototype.fitFilter=function t(e){if(arguments.length){if(typeof e==="function"){return this._fitFilter=e,this}if(!(e instanceof Array)){e=[e]}return this._fitFilter=function(t){return e.includes(t.id)},this}return this._fitFilter};t.prototype.fitKey=function t(e){return arguments.length?(this._fitKey=e,this):this._fitKey};t.prototype.fitObject=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="fitObject"});var r=[sm.bind(this),e,n,"fitObject"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._fitObject};t.prototype.ocean=function t(e){return arguments.length?(this._ocean=e,this):this._ocean};t.prototype.point=function t(e){return arguments.length?(this._point=typeof e==="function"?e:Zu(e),this):this._point};t.prototype.pointSize=function t(e){return arguments.length?(this._pointSize=typeof e==="function"?e:Zu(e),this):this._pointSize};t.prototype.pointSizeMax=function t(e){return arguments.length?(this._pointSizeMax=e,this):this._pointSizeMax};t.prototype.pointSizeMin=function t(e){return arguments.length?(this._pointSizeMin=e,this):this._pointSizeMin};t.prototype.projection=function t(e){if(arguments.length&&e!=="geoMercator"){this._tiles=false}return arguments.length?(this._projection=typeof e==="string"?Ty[e]():e,this):this._projection};t.prototype.projectionPadding=function t(e){return arguments.length?(this._projectionPadding=th(e),this):this._projectionPadding};t.prototype.tiles=function t(e){return arguments.length?(this._tiles=e,this):this._tiles};t.prototype.tileUrl=function t(e){return arguments.length?(this._tileUrl=e,this):this._tileUrl};t.prototype.topojson=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="topojson"});var r=[sm.bind(this),e,n,"topojson"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._topojson};t.prototype.topojsonFilter=function t(e){if(arguments.length){if(typeof e==="function"){return this._topojsonFilter=e,this}if(!(e instanceof Array)){e=[e]}return this._topojsonFilter=function(t){return e.includes(t.id)},this}return this._topojsonFilter};t.prototype.topojsonKey=function t(e){return arguments.length?(this._topojsonKey=e,this):this._topojsonKey};t.prototype.topojsonId=function t(e){return arguments.length?(this._topojsonId=typeof e==="function"?e:ju(e),this,this):this._topojsonId};return t}(LE);var VE=function(h){function t(){h.call(this);this._shapeConfig=Vu(this._shapeConfig,{Path:{labelConfig:{fontResize:true}}});this._innerRadius=0;this._padPixel=0;this._pie=al();this._sort=function(t,e){return e.value-t.value};this._value=ju("value")}if(h){t.__proto__=h}t.prototype=Object.create(h&&h.prototype);t.prototype.constructor=t;t.prototype._draw=function t(e){var n=this;h.prototype._draw.call(this,e);var i=this._height-this._margin.top-this._margin.bottom,r=this._width-this._margin.left-this._margin.right;var o=qt([r,i])/2;var a=this._pie.padAngle(this._padAngle||this._padPixel/o).sort(this._sort).value(this._value)(this._filteredData);a.forEach(function(t,e){t.__d3plus__=true;t.i=e});var s=Zh().innerRadius(this._innerRadius).outerRadius(o);var u="translate("+r/2+", "+i/2+")";this._shapes.push((new md).data(a).d(s).select(Ku("g.d3plus-Pie",{parent:this._select,enter:{transform:u},update:{transform:u}}).node()).config({id:function(t){return n._ids(t).join("-")},x:0,y:0}).config(Qu.bind(this)(this._shapeConfig,"shape","Path")).render());return this};t.prototype.innerRadius=function t(e){return arguments.length?(this._innerRadius=e,this):this._innerRadius};t.prototype.padAngle=function t(e){return arguments.length?(this._padAngle=e,this):this._padAngle};t.prototype.padPixel=function t(e){return arguments.length?(this._padPixel=e,this):this._padPixel};t.prototype.sort=function t(e){return arguments.length?(this._sort=e,this):this._sort};t.prototype.value=function t(e){return arguments.length?(this._value=typeof e==="function"?e:ju(e),this):this._value};return t}(LE);var UE=function(e){function t(){var t=this;e.call(this);this._innerRadius=function(){return qt([t._width-t._margin.left-t._margin.right,t._height-t._margin.top-t._margin.bottom])/4};this._padPixel=5}if(e){t.__proto__=e}t.prototype=Object.create(e&&e.prototype);t.prototype.constructor=t;return t}(VE);function WE(t){var e=0,n=t.children,i=n&&n.length;if(!i){e=1}else{while(--i>=0){e+=n[i].value}}t.value=e}var qE=function(){return this.eachAfter(WE)};var XE=function(t){var e=this,n,i=[e],r,o,a;do{n=i.reverse(),i=[];while(e=n.pop()){t(e),r=e.children;if(r){for(o=0,a=r.length;o<a;++o){i.push(r[o])}}}}while(i.length);return this};var GE=function(t){var e=this,n=[e],i,r;while(e=n.pop()){t(e),i=e.children;if(i){for(r=i.length-1;r>=0;--r){n.push(i[r])}}}return this};var YE=function(t){var e=this,n=[e],i=[],r,o,a;while(e=n.pop()){i.push(e),r=e.children;if(r){for(o=0,a=r.length;o<a;++o){n.push(r[o])}}}while(e=i.pop()){t(e)}return this};var $E=function(r){return this.eachAfter(function(t){var e=+r(t.data)||0,n=t.children,i=n&&n.length;while(--i>=0){e+=n[i].value}t.value=e})};var QE=function(e){return this.eachBefore(function(t){if(t.children){t.children.sort(e)}})};var ZE=function(t){var e=this,n=KE(e,t),i=[e];while(e!==n){e=e.parent;i.push(e)}var r=i.length;while(t!==n){i.splice(r,0,t);t=t.parent}return i};function KE(t,e){if(t===e){return t}var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop();e=i.pop();while(t===e){r=t;t=n.pop();e=i.pop()}return r}var JE=function(){var t=this,e=[t];while(t=t.parent){e.push(t)}return e};var tS=function(){var e=[];this.each(function(t){e.push(t)});return e};var eS=function(){var e=[];this.eachBefore(function(t){if(!t.children){e.push(t)}});return e};var nS=function(){var e=this,n=[];e.each(function(t){if(t!==e){n.push({source:t.parent,target:t})}});return n};function iS(t,e){var n=new uS(t),i=+t.value&&(n.value=t.value),r,o=[n],a,s,u,h;if(e==null){e=oS}while(r=o.pop()){if(i){r.value=+r.data.value}if((s=e(r.data))&&(h=s.length)){r.children=new Array(h);for(u=h-1;u>=0;--u){o.push(a=r.children[u]=new uS(s[u]));a.parent=r;a.depth=r.depth+1}}}return n.eachBefore(sS)}function rS(){return iS(this).eachBefore(aS)}function oS(t){return t.children}function aS(t){t.data=t.data.data}function sS(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function uS(t){this.data=t;this.depth=this.height=0;this.parent=null}uS.prototype=iS.prototype={constructor:uS,count:qE,each:XE,eachAfter:YE,eachBefore:GE,sum:$E,sort:QE,path:ZE,ancestors:JE,descendants:tS,leaves:eS,links:nS,copy:rS};function hS(t){if(typeof t!=="function"){throw new Error}return t}function lS(){return 0}var fS=function(t){return function(){return t}};var cS=function(t){t.x0=Math.round(t.x0);t.y0=Math.round(t.y0);t.x1=Math.round(t.x1);t.y1=Math.round(t.y1)};var dS=function(t,e,n,i,r){var o=t.children,a,s=-1,u=o.length,h=t.value&&(i-e)/t.value;while(++s<u){a=o[s],a.y0=n,a.y1=r;a.x0=e,a.x1=e+=a.value*h}};function pS(t,e){return t.parent===e.parent?1:2}function gS(t){var e=t.children;return e?e[0]:t.t}function vS(t){var e=t.children;return e?e[e.length-1]:t.t}function _S(t,e,n){var i=n/(e.i-t.i);e.c-=i;e.s+=n;t.c+=i;e.z+=n;e.m+=n}function yS(t){var e=0,n=0,i=t.children,r=i.length,o;while(--r>=0){o=i[r];o.z+=e;o.m+=e;e+=o.s+(n+=o.c)}}function mS(t,e,n){return t.a.parent===e.parent?t.a:n}function bS(t,e){this._=t;this.parent=null;this.children=null;this.A=null;this.a=this;this.z=0;this.m=0;this.c=0;this.s=0;this.t=null;this.i=e}bS.prototype=Object.create(uS.prototype);function xS(t){var e=new bS(t,0),n,i=[e],r,o,a,s;while(n=i.pop()){if(o=n._.children){n.children=new Array(s=o.length);for(a=s-1;a>=0;--a){i.push(r=n.children[a]=new bS(o[a],a));r.parent=n}}}(e.parent=new bS(null,0)).children=[e];return e}var wS=function(){var c=pS,h=1,l=1,f=null;function e(t){var e=xS(t);e.eachAfter(d),e.parent.m=-e.z;e.eachBefore(p);if(f){t.eachBefore(g)}else{var n=t,i=t,r=t;t.eachBefore(function(t){if(t.x<n.x){n=t}if(t.x>i.x){i=t}if(t.depth>r.depth){r=t}});var o=n===i?1:c(n,i)/2,a=o-n.x,s=h/(i.x+o+a),u=l/(r.depth||1);t.eachBefore(function(t){t.x=(t.x+a)*s;t.y=t.depth*u})}return t}function d(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e){yS(t);var r=(e[0].z+e[e.length-1].z)/2;if(i){t.z=i.z+c(t._,i._);t.m=t.z-r}else{t.z=r}}else if(i){t.z=i.z+c(t._,i._)}t.parent.A=o(t,i,t.parent.A||n[0])}function p(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function o(t,e,n){if(e){var i=t,r=t,o=e,a=i.parent.children[0],s=i.m,u=r.m,h=o.m,l=a.m,f;while(o=vS(o),i=gS(i),o&&i){a=gS(a);r=vS(r);r.a=t;f=o.z+h-i.z-s+c(o._,i._);if(f>0){_S(mS(o,t,n),t,f);s+=f;u+=f}h+=o.m;s+=i.m;l+=a.m;u+=r.m}if(o&&!vS(r)){r.t=o;r.m+=h-u}if(i&&!gS(a)){a.t=i;a.m+=s-l;n=t}}return n}function g(t){t.x*=h;t.y=t.depth*l}e.separation=function(t){return arguments.length?(c=t,e):c};e.size=function(t){return arguments.length?(f=false,h=+t[0],l=+t[1],e):f?null:[h,l]};e.nodeSize=function(t){return arguments.length?(f=true,h=+t[0],l=+t[1],e):f?[h,l]:null};return e};var CS=function(t,e,n,i,r){var o=t.children,a,s=-1,u=o.length,h=t.value&&(r-n)/t.value;while(++s<u){a=o[s],a.x0=e,a.x1=i;a.y0=n,a.y1=n+=a.value*h}};var ES=(1+Math.sqrt(5))/2;function SS(t,e,n,i,r,o){var a=[],s=e.children,u,h,l=0,f=0,c=s.length,d,p,g=e.value,v,_,y,m,b,x,w;while(l<c){d=r-n,p=o-i;do{v=s[f++].value}while(!v&&f<c);_=y=v;x=Math.max(p/d,d/p)/(g*t);w=v*v*x;b=Math.max(y/w,w/_);for(;f<c;++f){v+=h=s[f].value;if(h<_){_=h}if(h>y){y=h}w=v*v*x;m=Math.max(y/w,w/_);if(m>b){v-=h;break}b=m}a.push(u={value:v,dice:d<p,children:s.slice(l,f)});if(u.dice){dS(u,n,i,r,g?i+=p*v/g:o)}else{CS(u,n,i,g?n+=d*v/g:r,o)}g-=v,l=f}return a}var AS=function e(o){function t(t,e,n,i,r){SS(o,t,e,n,i,r)}t.ratio=function(t){return e((t=+t)>1?t:1)};return t}(ES);var kS=function(){var a=AS,e=false,n=1,i=1,s=[0],u=lS,h=lS,l=lS,f=lS,c=lS;function r(t){t.x0=t.y0=0;t.x1=n;t.y1=i;t.eachBefore(o);s=[0];if(e){t.eachBefore(cS)}return t}function o(t){var e=s[t.depth],n=t.x0+e,i=t.y0+e,r=t.x1-e,o=t.y1-e;if(r<n){n=r=(n+r)/2}if(o<i){i=o=(i+o)/2}t.x0=n;t.y0=i;t.x1=r;t.y1=o;if(t.children){e=s[t.depth+1]=u(t)/2;n+=c(t)-e;i+=h(t)-e;r-=l(t)-e;o-=f(t)-e;if(r<n){n=r=(n+r)/2}if(o<i){i=o=(i+o)/2}a(t,n,i,r,o)}}r.round=function(t){return arguments.length?(e=!!t,r):e};r.size=function(t){return arguments.length?(n=+t[0],i=+t[1],r):[n,i]};r.tile=function(t){return arguments.length?(a=hS(t),r):a};r.padding=function(t){return arguments.length?r.paddingInner(t).paddingOuter(t):r.paddingInner()};r.paddingInner=function(t){return arguments.length?(u=typeof t==="function"?t:fS(+t),r):u};r.paddingOuter=function(t){return arguments.length?r.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):r.paddingTop()};r.paddingTop=function(t){return arguments.length?(h=typeof t==="function"?t:fS(+t),r):h};r.paddingRight=function(t){return arguments.length?(l=typeof t==="function"?t:fS(+t),r):l};r.paddingBottom=function(t){return arguments.length?(f=typeof t==="function"?t:fS(+t),r):f};r.paddingLeft=function(t){return arguments.length?(c=typeof t==="function"?t:fS(+t),r):c};return r};var MS=function(t,e){if(!(e instanceof Array)){e=[e]}var n=Gt();for(var i=0;i<e.length;i++){n.key(e[i])}var r=n.entries(t);return TS(r)};function TS(t){return t.map(function(t){if(t.key&&t.values){if(t.values[0].key==="undefined"){return t.values[0].values[0]}else{t.values=TS(t.values)}}return t})}var BS=function(v){function t(){v.call(this);this._orient="vertical";this._separation=function(t,e){return t.parent===e.parent?1:2};this._shape=Zu("Circle");this._shapeConfig=Vu(this._shapeConfig,{labelConfig:{fontColor:"#444"},Path:{fill:"none",stroke:"#ccc",strokeWidth:1},r:Zu(5),width:Zu(10),height:Zu(10)});this._tree=wS()}if(v){t.__proto__=v}t.prototype=Object.create(v&&v.prototype);t.prototype.constructor=t;t.prototype._draw=function t(e){var l=this;v.prototype._draw.call(this,e);var n=this._orient==="vertical"?this._height-this._margin.top-this._margin.bottom:this._width-this._margin.left-this._margin.right,a=this._orient==="vertical"?"left":"top",i=this,r="translate("+this._margin.left+", "+this._margin.top+")",s=this._orient==="horizontal"?this._height-this._margin.top-this._margin.bottom:this._width-this._margin.left-this._margin.right;var o=this._tree.separation(this._separation).size([s,n])(iS({key:"root",values:MS(this._filteredData,this._groupBy.slice(0,this._drawDepth+1))},function(t){return t.key&&t.values?t.values:null}).sort(this._sort)).descendants().filter(function(t){return t.depth<=l._groupBy.length&&t.parent});function u(t){return Ju(t.values.map(function(t){return t.key&&t.values?u(t):t}),i._aggs)}o.forEach(function(t,e){if(t.data.key&&t.data.values){t.data=u(t.data)}t.__d3plus__=true;t.i=e});var h=this._shapeConfig.r;if(typeof h!=="function"){h=Zu(h)}var f=Ut(o,function(t){return t.depth===1?h(t.data,t.i):0});var c=Ut(o,function(t){return t.children?0:h(t.data,t.i)});var d=Ht(o,function(t){return t.y});this._labelHeight=qt([this._orient==="vertical"?50:100,(d[1]-f-c)/(this._groupBy.length+1)]);this._labelWidths=MS(o,function(t){return t.depth}).map(function(o){return o.values.reduce(function(t,e,n){var i=n<o.values.length-1?o.values[n+1].x:s+l._margin[a],r=n?o.values[n-1].x:l._margin[a];return qt([t,i-e.x,e.x-r])},s)});var p=vn().domain(d).range([f+this._labelHeight,n-c-this._labelHeight]);o.forEach(function(t){var e=p(t.y);if(l._orient==="horizontal"){t.y=t.x;t.x=e}else{t.y=e}});var g={parent:this._select,enter:{transform:r},update:{transform:r}};this._shapes.push((new md).data(o.filter(function(t){return t.depth>1})).select(Ku("g.d3plus-Tree-Links",g).node()).config(Qu.bind(this)(this._shapeConfig,"shape","Path")).config({d:function(t){var e=l._shapeConfig.r;if(typeof e==="function"){e=e(t.data,t.i)}var n=t.parent.x-t.x+(l._orient==="vertical"?0:e),i=t.parent.y-t.y+(l._orient==="vertical"?e:0),r=l._orient==="vertical"?0:-e,o=l._orient==="vertical"?-e:0;return l._orient==="vertical"?"M"+r+","+o+"C"+r+","+(o+i)/2+" "+n+","+(o+i)/2+" "+n+","+i:"M"+r+","+o+"C"+(r+n)/2+","+o+" "+(r+n)/2+","+i+" "+n+","+i},id:function(t,e){return l._ids(t,e).join("-")}}).render());this._shapes.push((new dd).data(o).select(Ku("g.d3plus-Tree-Shapes",g).node()).config(Qu.bind(this)(this._shapeConfig,"shape","Circle")).config({id:function(t,e){return l._ids(t,e).join("-")},label:function(t,e){if(l._label){return l._label(t.data,e)}var n=l._ids(t,e).slice(0,t.depth);return n[n.length-1]},labelConfig:{textAnchor:function(t){return l._orient==="vertical"?"middle":t.data.children&&t.data.depth!==l._groupBy.length?"end":"start"},verticalAlign:function(t){return l._orient==="vertical"?t.data.depth===1?"bottom":"top":"middle"}},hitArea:function(t,e,n){var i=l._labelHeight,r=l._labelWidths[t.depth-1];return{width:l._orient==="vertical"?r:n.r*2+r,height:l._orient==="horizontal"?i:n.r*2+i,x:l._orient==="vertical"?-r/2:t.children&&t.depth!==l._groupBy.length?-(n.r+r):-n.r,y:l._orient==="horizontal"?-i/2:t.children&&t.depth!==l._groupBy.length?-(n.r+l._labelHeight):-n.r}},labelBounds:function(t,e,n){var i;var r=l._labelHeight,o=l._orient==="vertical"?"height":"width",a=l._labelWidths[t.depth-1],s=l._orient==="vertical"?"width":"height",u=l._orient==="vertical"?"x":"y",h=l._orient==="vertical"?"y":"x";return i={},i[s]=a,i[o]=r,i[u]=-a/2,i[h]=t.children&&t.depth!==l._groupBy.length?-(n.r+r):n.r,i}}).render());return this};t.prototype.orient=function t(e){return arguments.length?(this._orient=e,this):this._orient};t.prototype.separation=function t(e){return arguments.length?(this._separation=e,this):this._separation};return t}(LE);var DS=function(f){function t(){f.call(this);this._layoutPadding=1;this._shapeConfig=Vu({},this._shapeConfig,{labelConfig:{fontMax:20,fontResize:true,padding:15}});this._sort=function(t,e){return e.value-t.value};this._sum=ju("value");this._tile=AS;this._treemap=kS().round(true)}if(f){t.__proto__=f}t.prototype=Object.create(f&&f.prototype);t.prototype.constructor=t;t.prototype._draw=function t(e){var n=this;f.prototype._draw.call(this,e);var i=Gt();for(var r=0;r<=this._drawDepth;r++){i.key(n._groupBy[r])}i=i.entries(this._filteredData);var o=this._treemap.padding(this._layoutPadding).size([this._width-this._margin.left-this._margin.right,this._height-this._margin.top-this._margin.bottom]).tile(this._tile)(iS({values:i},function(t){return t.values}).sum(this._sum).sort(this._sort));var a=[],s=this;function u(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.depth<=s._drawDepth){u(n.children)}else{n.__d3plus__=true;n.id=n.data.key;n.data=Ju(n.data.values);n.i=e;n.x=n.x0+(n.x1-n.x0)/2;n.y=n.y0+(n.y1-n.y0)/2;a.push(n)}}}if(o.children){u(o.children)}var h=o.value;var l="translate("+this._margin.left+", "+this._margin.top+")";this._shapes.push((new bd).data(a).label(function(t){return[n._drawLabel(t.data,t.i),Math.round(n._sum(t.data,t.i)/h*100)+"%"]}).select(Ku("g.d3plus-Treemap",{parent:this._select,enter:{transform:l},update:{transform:l}}).node()).config({height:function(t){return t.y1-t.y0},labelBounds:function(t,e,n){var i=n.height;var r=Math.min(50,i*.25);return[{width:n.width,height:i-r,x:-n.width/2,y:-i/2},{width:n.width,height:r,x:-n.width/2,y:i/2-r}]},labelConfig:{textAnchor:function(t){return t.l?"middle":"start"},verticalAlign:function(t){return t.l?"bottom":"top"}},width:function(t){return t.x1-t.x0}}).config(Qu.bind(this)(this._shapeConfig,"shape","Rect")).render());return this};t.prototype.layoutPadding=function t(e){return arguments.length?(this._layoutPadding=typeof e==="function"?e:Zu(e),this):this._layoutPadding};t.prototype.sort=function t(e){return arguments.length?(this._sort=e,this):this._sort};t.prototype.sum=function t(e){return arguments.length?(this._sum=typeof e==="function"?e:ju(e),this):this._sum};t.prototype.tile=function t(e){return arguments.length?(this._tile=e,this):this._tile};return t}(LE);var NS=function(N){function t(){var h=this;N.call(this);this._labelCutoff=100;this._links=[];this._noDataMessage=false;this._nodes=[];this._on["click.shape"]=function(t,e){h._tooltipClass.data([]).render();if(h._hover&&h._drawDepth>=h._groupBy.length-1){if(h._focus&&h._focus===t.id){h.active(false);h._on.mouseenter.bind(h)(t,e);h._focus=undefined;h._zoomToBounds(null)}else{h.hover(false);var n=h._nodeGroupBy&&h._nodeGroupBy[h._drawDepth](t,e)?h._nodeGroupBy[h._drawDepth](t,e):h._id(t,e),i=h._linkLookup[n],r=h._nodeLookup[n];var o=[r.id];var a=[r.x-r.r,r.x+r.r],s=[r.y-r.r,r.y+r.r];i.forEach(function(t){o.push(t.id);if(t.x-t.r<a[0]){a[0]=t.x-t.r}if(t.x+t.r>a[1]){a[1]=t.x+t.r}if(t.y-t.r<s[0]){s[0]=t.y-t.r}if(t.y+t.r>s[1]){s[1]=t.y+t.r}});h.active(function(t,e){if(t.source&&t.target){return t.source.id===r.id||t.target.id===r.id}else{return o.includes(h._ids(t,e)[h._drawDepth])}});h._focus=t.id;var u=$m(h._container.node());a=a.map(function(t){return t*u.k+u.x});s=s.map(function(t){return t*u.k+u.y});h._zoomToBounds([[a[0],s[0]],[a[1],s[1]]])}}};this._on["click.legend"]=function(t,e){var n=h._id(t);var i=h._ids(t);i=i[i.length-1];if(h._hover&&h._drawDepth>=h._groupBy.length-1){if(h._focus&&h._focus===n){h.active(false);h._on.mouseenter.bind(h)(t,e);h._focus=undefined;h._zoomToBounds(null)}else{h.hover(false);var r=n.map(function(t){return h._nodeLookup[t]});var o=[i];var a=[r[0].x-r[0].r,r[0].x+r[0].r],s=[r[0].y-r[0].r,r[0].y+r[0].r];r.forEach(function(t){o.push(t.id);if(t.x-t.r<a[0]){a[0]=t.x-t.r}if(t.x+t.r>a[1]){a[1]=t.x+t.r}if(t.y-t.r<s[0]){s[0]=t.y-t.r}if(t.y+t.r>s[1]){s[1]=t.y+t.r}});h.active(function(t,e){if(t.source&&t.target){return o.includes(t.source.id)&&o.includes(t.target.id)}else{var n=h._ids(t,e);return o.includes(n[n.length-1])}});h._focus=n;var u=$m(h._container.node());a=a.map(function(t){return t*u.k+u.x});s=s.map(function(t){return t*u.k+u.y});h._zoomToBounds([[a[0],s[0]],[a[1],s[1]]])}h._on["mousemove.legend"].bind(h)(t,e)}};this._sizeMin=5;this._sizeScale="sqrt";this._shape=Zu("Circle");this._shapeConfig=Vu(this._shapeConfig,{labelConfig:{duration:0,fontMin:1,fontResize:true,labelPadding:0,textAnchor:"middle",verticalAlign:"middle"},Path:{fill:"none",label:false,stroke:"#eee",strokeWidth:1}});this._x=ju("x");this._y=ju("y");this._zoom=true}if(N){t.__proto__=N}t.prototype=Object.create(N&&N.prototype);t.prototype.constructor=t;t.prototype._draw=function t(e){var r=this;N.prototype._draw.call(this,e);var n=this._height-this._margin.top-this._margin.bottom,i="translate("+this._margin.left+", "+this._margin.top+")",o=this._transition,a=this._width-this._margin.left-this._margin.right;var s=this._filteredData.reduce(function(t,e,n){t[r._id(e,n)]=e;return t},{});var u=this._nodes.reduce(function(t,e,n){t[r._nodeGroupBy?r._nodeGroupBy[r._drawDepth](e,n):r._id(e,n)]=e;return t},{});u=Array.from(new Set(Object.keys(s).concat(Object.keys(u)))).map(function(t,e){var n=s[t],i=u[t];if(i===undefined){return false}return{__d3plus__:true,data:n||i,i:e,id:t,fx:n!==undefined&&r._x(n)!==undefined?r._x(n):r._x(i),fy:n!==undefined&&r._y(n)!==undefined?r._y(n):r._y(i),node:i,r:r._size?n!==undefined&&r._size(n)!==undefined?r._size(n):r._size(i):r._sizeMin,shape:n!==undefined&&r._shape(n)!==undefined?r._shape(n):r._shape(i)}}).filter(function(t){return t});var h=Ht(u.map(function(t){return t.fx})),l=Ht(u.map(function(t){return t.fy}));var f=vn().domain(h).range([0,a]),c=vn().domain(l).range([0,n]);var d=(h[1]-h[0])/(l[1]-l[0]),p=a/n;if(d>p){var g=n*p/d;c.range([(n-g)/2,n-(n-g)/2])}else{var v=a*d/p;f.range([(a-v)/2,a-(a-v)/2])}u.forEach(function(t){t.x=f(t.fx);t.y=c(t.fy)});var _=Ht(u.map(function(t){return t.r}));var y=this._sizeMax||qt(Wt(u.map(function(e){return u.map(function(t){return e===t?null:Dc([e.x,e.y],[t.x,t.y])})})))/2;var m=Zr["scale"+this._sizeScale.charAt(0).toUpperCase()+this._sizeScale.slice(1)]().domain(_).range([_[0]===_[1]?y:qt([y/2,this._sizeMin]),y]),b=f.domain(),x=c.domain();var w=b[1]-b[0],C=x[1]-x[0];u.forEach(function(t){var e=m(t.r);if(b[0]>f.invert(t.x-e)){b[0]=f.invert(t.x-e)}if(b[1]<f.invert(t.x+e)){b[1]=f.invert(t.x+e)}if(x[0]>c.invert(t.y-e)){x[0]=c.invert(t.y-e)}if(x[1]<c.invert(t.y+e)){x[1]=c.invert(t.y+e)}});var E=b[1]-b[0],S=x[1]-x[0];y*=qt([w/E,C/S]);m.range([_[0]===_[1]?y:qt([y/2,this._sizeMin]),y]);f.domain(b);c.domain(x);u.forEach(function(t){t.x=f(t.fx);t.fx=t.x;t.y=c(t.fy);t.fy=t.y;t.r=m(t.r);t.width=t.r*2;t.height=t.r*2});var A=this._nodeLookup=u.reduce(function(t,e){t[e.id]=e;return t},{});var k=u.map(function(t){return t.node});var M=this._links.map(function(t){return{source:typeof t.source==="number"?u[k.indexOf(r._nodes[t.source])]:A[t.source.id],target:typeof t.target==="number"?u[k.indexOf(r._nodes[t.target])]:A[t.target.id]}});this._linkLookup=M.reduce(function(t,e){if(!t[e.source.id]){t[e.source.id]=[]}t[e.source.id].push(e.target);if(!t[e.target.id]){t[e.target.id]=[]}t[e.target.id].push(e.source);return t},{});this._container=this._select.selectAll("svg.d3plus-network").data([0]);this._container=this._container.enter().append("svg").attr("class","d3plus-network").attr("opacity",0).attr("width",a).attr("height",n).attr("x",this._margin.left).attr("y",this._margin.top).style("background-color","transparent").merge(this._container);this._container.transition(this._transition).attr("opacity",1).attr("width",a).attr("height",n).attr("x",this._margin.left).attr("y",this._margin.top);var T=this._container.selectAll("rect.d3plus-network-hitArea").data([0]);T.enter().append("rect").attr("class","d3plus-network-hitArea").merge(T).attr("width",a).attr("height",n).attr("fill","transparent").on("click",function(){if(r._focus){r.active(false);r._focus=undefined;r._zoomToBounds(null)}});this._zoomGroup=this._container.selectAll("g.d3plus-network-zoomGroup").data([0]);var B=this._zoomGroup=this._zoomGroup.enter().append("g").attr("class","d3plus-network-zoomGroup").merge(this._zoomGroup);this._shapes.push((new md).config(this._shapeConfig).config(this._shapeConfig.Path).d(function(t){return"M"+t.source.x+","+t.source.y+" "+t.target.x+","+t.target.y}).data(M).select(Ku("g.d3plus-network-links",{parent:B,transition:o,enter:{transform:i},update:{transform:i}}).node()).render());var D={label:function(t){return u.length<=r._labelCutoff||(r._hover&&r._hover(t)||r._active&&r._active(t))?r._drawLabel(t.data||t.node,t.i):false},select:Ku("g.d3plus-network-nodes",{parent:B,transition:o,enter:{transform:i},update:{transform:i}}).node()};Gt().key(function(t){return t.shape}).entries(u).forEach(function(t){r._shapes.push((new xd[t.key]).config(Qu.bind(r)(r._shapeConfig,"shape",t.key)).config(D).config(D[t.key]||{}).data(t.values).render())});return this};t.prototype.labelCutoff=function t(e){return arguments.length?(this._labelCutoff=e,this):this._labelCutoff};t.prototype.links=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="links"});var r=[sm.bind(this),e,n,"links"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._links};t.prototype.nodeGroupBy=function t(e){var n=this;if(!arguments.length){return this._nodeGroupBy}if(!(e instanceof Array)){e=[e]}return this._nodeGroupBy=e.map(function(t){if(typeof t==="function"){return t}else{if(!n._aggs[t]){n._aggs[t]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}return ju(t)}}),this};t.prototype.nodes=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="nodes"});var r=[sm.bind(this),e,n,"nodes"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._nodes};t.prototype.size=function t(e){return arguments.length?(this._size=typeof e==="function"||!e?e:ju(e),this):this._size};t.prototype.sizeMax=function t(e){return arguments.length?(this._sizeMax=e,this):this._sizeMax};t.prototype.sizeMin=function t(e){return arguments.length?(this._sizeMin=e,this):this._sizeMin};t.prototype.sizeScale=function t(e){return arguments.length?(this._sizeScale=e,this):this._sizeScale};t.prototype.x=function t(e){if(arguments.length){if(typeof e==="function"){this._x=e}else{this._x=ju(e);if(!this._aggs[e]){this._aggs[e]=function(t){return r(t)}}}return this}else{return this._x}};t.prototype.y=function t(e){if(arguments.length){if(typeof e==="function"){this._y=e}else{this._y=ju(e);if(!this._aggs[e]){this._aggs[e]=function(t){return r(t)}}}return this}else{return this._y}};return t}(LE);var PS=function(z){function t(){var u=this;z.call(this);this._labelCutoff=100;this._links=[];this._noDataMessage=false;this._nodes=[];this._on.mouseenter=function(){};this._on["mouseleave.shape"]=function(){u.hover(false)};this._on["mousemove.shape"]=function(t,e){if(u._focus&&u._focus===t.id){u.hover(false);u._on.mouseenter.bind(u)(t,e);u._focus=undefined}else{var n=u._nodeGroupBy&&u._nodeGroupBy[u._drawDepth](t,e)?u._nodeGroupBy[u._drawDepth](t,e):u._id(t,e),i=u._linkLookup[n],r=u._nodeLookup[n];var o=[r.id];var a=[r.x-r.r,r.x+r.r],s=[r.y-r.r,r.y+r.r];i.forEach(function(t){o.push(t.id);if(t.x-t.r<a[0]){a[0]=t.x-t.r}if(t.x+t.r>a[1]){a[1]=t.x+t.r}if(t.y-t.r<s[0]){s[0]=t.y-t.r}if(t.y+t.r>s[1]){s[1]=t.y+t.r}});u.hover(function(t,e){if(t.source&&t.target){return t.source.id===r.id||t.target.id===r.id}else{return o.includes(u._ids(t,e)[u._drawDepth])}})}};this._on["click.shape"]=function(t){u._center=t.id;u._draw()};this._sizeMin=5;this._sizeScale="sqrt";this._shape=Zu("Circle");this._shapeConfig=Vu(this._shapeConfig,{labelConfig:{duration:0,fontMin:1,fontResize:true,labelPadding:0,textAnchor:"middle",verticalAlign:"middle"},Path:{fill:"none",label:false,stroke:"#eee",strokeWidth:1}})}if(z){t.__proto__=z}t.prototype=Object.create(z&&z.prototype);t.prototype.constructor=t;t.prototype._draw=function t(e){var h=this;z.prototype._draw.call(this,e);var r=this._filteredData.reduce(function(t,e,n){t[h._id(e,n)]=e;return t},{});var l=this._nodes;if(!this._nodes.length&&this._links.length){var n=Array.from(new Set(this._links.reduce(function(t,e){return t.concat([e.source,e.target])},[])));l=n.map(function(t){return typeof t==="object"?t:{id:t}})}l=l.reduce(function(t,e,n){t[h._nodeGroupBy?h._nodeGroupBy[h._drawDepth](e,n):h._id(e,n)]=e;return t},{});l=Array.from(new Set(Object.keys(r).concat(Object.keys(l)))).map(function(t,e){var n=r[t],i=l[t];if(i===undefined){return false}return{__d3plus__:true,data:n||i,i:e,id:t,node:i,shape:n!==undefined&&h._shape(n)!==undefined?h._shape(n):h._shape(i)}}).filter(function(t){return t});var i=this._nodeLookup=l.reduce(function(t,e){t[e.id]=e;return t},{});var o=this._links.map(function(n){var t=["source","target"];return t.reduce(function(t,e){t[e]=typeof n[e]==="number"?l[n[e]]:i[n[e].id||n[e]];return t},{})});var a=o.reduce(function(t,e){if(!t[e.source.id]){t[e.source.id]=[]}t[e.source.id].push(e);if(!t[e.target.id]){t[e.target.id]=[]}t[e.target.id].push(e);return t},{});var f=this._height-this._margin.top-this._margin.bottom,s="translate("+this._margin.left+", "+this._margin.top+")",u=this._transition,c=this._width-this._margin.left-this._margin.right;var d=[],p=qt([f,c])/2,g=p/3;var v=g,_=g*2;var y=i[this._center];y.x=c/2;y.y=f/2;y.r=this._sizeMin?Ut([this._sizeMin,v*.65]):this._sizeMax?qt([this._sizeMax,v*.65]):v*.65;var m=[y],b=[];a[this._center].forEach(function(t){var e=t.source.id===h._center?t.target:t.source;e.edges=a[e.id].filter(function(t){return t.source.id!==h._center||t.target.id!==h._center});e.edge=t;m.push(e);b.push(e)});b.sort(function(t,e){return t.edges.length-e.edges.length});var x=[];var w=0;b.forEach(function(t){var r=t.id;t.edges=t.edges.filter(function(t){return!m.includes(t.source)&&t.target.id===r||!m.includes(t.target)&&t.source.id===r});w+=t.edges.length||1;t.edges.forEach(function(t){var e=t.source;var n=t.target;var i=n.id===r?e:n;m.push(i)})});var C=Math.PI*2;var E=0;b.forEach(function(o,t){var a=o.edges.length||1;var e=C/w*a;if(t===0){E-=e/2}var s=E+e/2-C/4;o.radians=s;o.x=c/2+v*Math.cos(s);o.y=f/2+v*Math.sin(s);E+=e;o.edges.forEach(function(t,e){var n=t.source.id===o.id?t.target:t.source;var i=C/w;var r=s-i*a/2+i/2+i*e;n.radians=r;n.x=c/2+_*Math.cos(r);n.y=f/2+_*Math.sin(r);x.push(n)})});var S=g/2;var A=g/4;var k=S/2-4;if(S/2-4<8){k=qt([S/2,8])}var M=A/2-4;if(A/2-4<4){M=qt([A/2,4])}if(M>g/10){M=g/10}if(M>k&&M>10){M=k*.75}if(k>M*1.5){k=M*1.5}k=Math.floor(k);M=Math.floor(M);var T;if(this._size){var B=Ht(r,function(t){return t.size});if(B[0]===B[1]){B[0]=0}T=vn().domain(B).rangeRound([3,qt([k,M])]);var D=y.size;y.r=T(D)}else{T=vn().domain([1,2]).rangeRound([k,M])}x.forEach(function(t){t.ring=2;var e=h._size?t.size:2;t.r=h._sizeMin?Ut([h._sizeMin,T(e)]):h._sizeMax?qt([h._sizeMax,T(e)]):T(e)});b.forEach(function(t){t.ring=1;var e=h._size?t.size:1;t.r=h._sizeMin?Ut([h._sizeMin,T(e)]):h._sizeMax?qt([h._sizeMax,T(e)]):T(e)});l=[y].concat(b).concat(x);b.forEach(function(u){var t=["source","target"];var n=u.edge;t.forEach(function(e){n[e]=l.find(function(t){return t.id===n[e].id})});d.push(n);a[u.id].forEach(function(i){var e=i.source.id===u.id?i.target:i.source;if(e.id!==y.id){var r=x.find(function(t){return t.id===e.id});if(!r){r=b.find(function(t){return t.id===e.id})}if(r){i.spline=true;var o=c/2;var a=f/2;var s=v+(_-v)*.5;var t=["source","target"];t.forEach(function(e,t){i[e+"X"]=i[e].x+Math.cos(i[e].ring===2?i[e].radians+Math.PI:i[e].radians)*i[e].r;i[e+"Y"]=i[e].y+Math.sin(i[e].ring===2?i[e].radians+Math.PI:i[e].radians)*i[e].r;i[e+"BisectX"]=o+s*Math.cos(i[e].radians);i[e+"BisectY"]=a+s*Math.sin(i[e].radians);i[e]=l.find(function(t){return t.id===i[e].id});if(i[e].edges===undefined){i[e].edges={}}var n=t===0?i.target.id:i.source.id;if(i[e].id===u.id){i[e].edges[n]={angle:u.radians+Math.PI,radius:g/2}}else{i[e].edges[n]={angle:r.radians,radius:g/2}}});d.push(i)}}})});l.forEach(function(t){if(t.id!==h._center){var e=h._shapeConfig.labelConfig.fontSize&&h._shapeConfig.labelConfig.fontSize(t)||11;var n=e*1.4;var i=n*2;var r=5;var o=g-t.r;var a=t.radians*(180/Math.PI);var s=t.r+r;var u="start";if(a<-90||a>90){s=-t.r-o-r;u="end";a+=180}t.labelBounds={x:s,y:-n/2,width:o,height:i};t.rotate=a;t.textAnchor=u}else{t.labelBounds={x:-v/2,y:-v/2,width:v,height:v}}});this._linkLookup=o.reduce(function(t,e){if(!t[e.source.id]){t[e.source.id]=[]}t[e.source.id].push(e.target);if(!t[e.target.id]){t[e.target.id]=[]}t[e.target.id].push(e.source);return t},{});this._shapes.push((new md).config(Qu.bind(this)(this._shapeConfig,"edge","Path")).id(function(t){return t.source.id+"_"+t.target.id}).d(function(t){return t.spline?"M"+t.sourceX+","+t.sourceY+"C"+t.sourceBisectX+","+t.sourceBisectY+" "+t.targetBisectX+","+t.targetBisectY+" "+t.targetX+","+t.targetY:"M"+t.source.x+","+t.source.y+" "+t.target.x+","+t.target.y}).data(d).select(Ku("g.d3plus-rings-links",{parent:this._select,transition:u,enter:{transform:s},update:{transform:s}}).node()).render());var N=this;var P={label:function(t){return l.length<=h._labelCutoff||(h._hover&&h._hover(t)||h._active&&h._active(t))?h._drawLabel(t.data||t.node,t.i):false},labelBounds:function(t){return t.labelBounds},labelConfig:{fontColor:function(t){return t.data.data.id===h._center?Qu.bind(N)(N._shapeConfig,"shape",t.key).labelConfig.fontColor(t):xh(Qu.bind(N)(N._shapeConfig,"shape",t.key).fill(t))},fontResize:function(t){return t.data.data.id===h._center},padding:0,textAnchor:function(t){return i[t.data.data.id].textAnchor||Qu.bind(N)(N._shapeConfig,"shape",t.key).labelConfig.textAnchor},verticalAlign:function(t){return t.data.data.id===h._center?"middle":"top"}},rotate:function(t){return i[t.id].rotate||0},select:Ku("g.d3plus-rings-nodes",{parent:this._select,transition:u,enter:{transform:s},update:{transform:s}}).node()};Gt().key(function(t){return t.shape}).entries(l).forEach(function(t){h._shapes.push((new xd[t.key]).config(Qu.bind(h)(h._shapeConfig,"shape",t.key)).config(P).data(t.values).render())});return this};t.prototype.center=function t(e){return arguments.length?(this._center=e,this):this._center};t.prototype.hover=function t(e){this._hover=e;this._shapes.forEach(function(t){return t.hover(e)});if(this._legend){this._legendClass.hover(e)}return this};t.prototype.links=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="links"});var r=[sm.bind(this),e,n,"links"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._links};t.prototype.nodeGroupBy=function t(e){var n=this;if(!arguments.length){return this._nodeGroupBy}if(!(e instanceof Array)){e=[e]}return this._nodeGroupBy=e.map(function(t){if(typeof t==="function"){return t}else{if(!n._aggs[t]){n._aggs[t]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}return ju(t)}}),this};t.prototype.nodes=function t(e,n){if(arguments.length){var i=this._queue.find(function(t){return t[3]==="nodes"});var r=[sm.bind(this),e,n,"nodes"];if(i){this._queue[this._queue.indexOf(i)]=r}else{this._queue.push(r)}return this}return this._nodes};t.prototype.size=function t(e){return arguments.length?(this._size=typeof e==="function"||!e?e:ju(e),this):this._size};t.prototype.sizeMax=function t(e){return arguments.length?(this._sizeMax=e,this):this._sizeMax};t.prototype.sizeMin=function t(e){return arguments.length?(this._sizeMin=e,this):this._sizeMin};t.prototype.sizeScale=function t(e){return arguments.length?(this._sizeScale=e,this):this._sizeScale};return t}(LE);var zS=function(t){if(t.includes("d3plus-buffer-start")){return t}var e=["d3plus-buffer-start"];t.forEach(function(t){e.push(t);e.push("d3plus-buffer-"+t)});return e};var OS=function(t){var e=this;var n=t.data;var i=t.x;var r=t.y;var o=t.x2;var a=t.y2;var s=t.buffer;if(s===void 0){s=10}var u=o?"x2":"x";var h=a?"y2":"y";var l=this._discrete==="x"?r:i;var f=l.domain().slice();var c=this._discrete==="x";if(c){f.reverse()}var d,p;if(this._stacked){var g=Gt().key(function(t){return t[e._discrete]}).entries(n).map(function(t){return t.values.map(function(t){return t[c?h:u]})});p=g.map(function(t){return Xt(t.filter(function(t){return t>0}))});d=g.map(function(t){return Xt(t.filter(function(t){return t<0}))})}else{p=n.map(function(t){return t[c?h:u]});d=p}var v=l(Ut(p));if(c?v<l(0):v>l(0)){v+=c?-s:s}v=l.invert(v);var _=l(qt(d));if(c?_>l(0):_<l(0)){_+=c?s:-s}_=l.invert(_);if(v>f[1]){f[1]=v}if(_<f[0]){f[0]=_}if(c){f.reverse()}l.domain(f);var y=c?i:r;y.domain(zS(y.domain()));return[i,r]};var FS=function(t){var e=t.data;var a=t.x;var s=t.y;var n=t.x2;var i=t.y2;var u=t.config;var h=t.buffer;var l=n?"x2":"x";var f=i?"y2":"y";var c=a.domain().slice(),d=s.domain().slice();var p=a.range(),g=s.range();if(!a.invert){c=zS(c)}if(!s.invert){d=zS(d)}e.forEach(function(t){var e=h?h:u.r(t.data,t.i)*2;if(a.invert&&a(t[l])-p[0]<e){var n=a.invert(a(t[l])-e);if(n<c[0]){c[0]=n}}if(a.invert&&p[1]-a(t[l])<e){var i=a.invert(a(t[l])+e);if(i>c[1]){c[1]=i}}if(s.invert&&s(t[f])-g[0]<e){var r=s.invert(s(t[f])-e);if(r>d[0]){d[0]=r}}if(s.invert&&g[1]-s(t[f])<e){var o=s.invert(s(t[f])+e);if(o<d[1]){d[1]=o}}});a.domain(c).range(p);s.domain(d).range(g);return[a,s]};var RS=function(t){var e=t.data;var s=t.x;var u=t.y;var n=t.x2;var i=t.y2;var h=t.config;var l=n?"x2":"x";var f=i?"y2":"y";var c=s.domain().slice(),d=u.domain().slice();var p=s.range(),g=u.range();if(!s.invert){c=zS(c)}if(!u.invert){d=zS(d)}e.forEach(function(t){var e=h.height(t.data,t.i),n=h.width(t.data,t.i);if(s.invert&&s(t[l])-p[0]<n){var i=s.invert(s(t[l])-n);if(i<c[0]){c[0]=i}}if(s.invert&&p[1]-s(t[l])<n){var r=s.invert(s(t[l])+n);if(r>c[1]){c[1]=r}}if(u.invert&&u(t[f])-g[0]<e){var o=u.invert(u(t[f])-e);if(o>d[0]){d[0]=o}}if(u.invert&&g[1]-u(t[f])<e){var a=u.invert(u(t[f])+e);if(a<d[1]){d[1]=a}}});s.domain(c);u.domain(d);return[s,u]};var IS=function(t){var e=this;var n=t.data;var i=t.x;var r=t.y;var o=t.x2;var a=t.y2;var s=o?"x2":"x";var u=a?"y2":"y";var h=this._discrete==="x"?r:i;var l=h.domain().slice();if(this._discrete==="x"){l.reverse()}var f=n.map(function(t){return t[e._discrete==="x"?u:s]});var c=h.invert(h(Ut(f))+(this._discrete==="x"?-10:10));if(c>l[1]){l[1]=c}if(this._discrete==="x"){l.reverse()}h.domain(l);return[i,r]};function LS(t){return this._sizeScaleD3(this._size?this._size(t):null)}var jS=function(jt){function t(){var n=this;jt.call(this);this._annotations=[];this._barPadding=0;this._buffer={Bar:OS,Circle:FS,Line:IS,Rect:RS};this._confidenceConfig={fillOpacity:Zu(.5)};this._groupPadding=5;this._shape=Zu("Circle");this._shapeConfig=Vu(this._shapeConfig,{Area:{label:function(t,e){return n._stacked?n._drawLabel(t,e):false},labelConfig:{fontResize:true}},Bar:{labelConfig:{textAnchor:function(){return n._discrete==="x"?"middle":"end"},verticalAlign:function(){return n._discrete==="x"?"top":"middle"}}},Circle:{r:LS.bind(this)},Line:{fill:Zu("none"),label:false,stroke:function(t,e){return mh(n._id(t,e))},strokeWidth:Zu(1)},Rect:{height:function(t){return LS.bind(n)(t)*2},width:function(t){return LS.bind(n)(t)*2}}});this._sizeMax=20;this._sizeMin=5;this._sizeScale="sqrt";this._stackOffset=If;this._stackOrder=zf;this._x=ju("x");this._x2=ju("x2");this._xAxis=(new Ed).align("end");this._x2Axis=(new kd).align("start");this._xTest=(new Ed).align("end").gridSize(0);this._x2Test=(new kd).align("start").gridSize(0);this._xConfig={};this._x2Config={padding:0};this._y=ju("y");this._y2=ju("y2");this._yAxis=(new Sd).align("start");this._yTest=(new Sd).align("start").gridSize(0);this._y2Axis=(new Ad).align("end");this._y2Test=(new Sd).align("end").gridSize(0);this._yConfig={gridConfig:{stroke:function(t){var e=n._yAxis.domain();return e[e.length-1]===t.id?"transparent":"#ccc"}}};this._y2Config={}}if(jt){t.__proto__=jt}t.prototype=Object.create(jt&&jt.prototype);t.prototype.constructor=t;t.prototype._draw=function t(e){var A=this;if(!this._filteredData.length){return this}var a=function(t,e){return A._stacked?""+(A._groupBy.length>1?A._ids(t,e).slice(0,-1).join("_"):"group"):""+A._ids(t,e).join("_")};var s=this._filteredData.map(function(t,e){return{__d3plus__:true,data:t,group:a(t,e),i:e,hci:A._confidence&&A._confidence[1]&&A._confidence[1](t,e),id:A._ids(t,e).slice(0,A._drawDepth+1).join("_"),lci:A._confidence&&A._confidence[0]&&A._confidence[0](t,e),shape:A._shape(t,e),x:A._x(t,e),x2:A._x2(t,e),y:A._y(t,e),y2:A._y2(t,e)}});this._formattedData=s;if(this._size){var n=Ht(s,function(t){return A._size(t.data)});this._sizeScaleD3=function(){return A._sizeMin};this._sizeScaleD3=Zr["scale"+this._sizeScale.charAt(0).toUpperCase()+this._sizeScale.slice(1)]().domain(n).range([n[0]===n[1]?this._sizeMax:qt([this._sizeMax/2,this._sizeMin]),this._sizeMax])}else{this._sizeScaleD3=function(){return A._sizeMin}}var i=s.some(function(t){return t.x2!==undefined}),r=s.some(function(t){return t.y2!==undefined});var o=this._height-this._margin.top-this._margin.bottom,u=this._discrete?this._discrete==="x"?"y":"x":undefined,h=this._discrete?this._discrete==="x"?"y2":"x2":undefined,l=[u,h],f=this._select,c=this._transition,d=this._width-this._margin.left-this._margin.right;var p=this._time&&s[0].x2===this._time(s[0].data,s[0].i),g=this._time&&s[0].x===this._time(s[0].data,s[0].i),v=this._time&&s[0].y2===this._time(s[0].data,s[0].i),_=this._time&&s[0].y===this._time(s[0].data,s[0].i);for(var y=0;y<s.length;y++){var m=s[y];if(g){m.x=wd(m.x)}if(p){m.x2=wd(m.x2)}if(_){m.y=wd(m.y)}if(v){m.y2=wd(m.y2)}m.discrete=m.shape==="Bar"?m[A._discrete]+"_"+m.group:""+m[A._discrete]}var b,x,w,C;if(this._stacked){var E=Gt().key(function(t){return t.group}).entries(s).reduce(function(t,e){if(!t[e.key]){t[e.key]=0}t[e.key]+=Xt(e.values,function(t){return t[u]});return t},{});s=s.sort(function(t,e){if(A["_"+A._discrete+"Sort"]){return A["_"+A._discrete+"Sort"](t.data,e.data)}var n=t[A._discrete],i=e[A._discrete];if(n-i!==0){return n-i}if(t.group!==e.group){return E[e.group]-E[t.group]}return e[u]-t[u]});b=Array.from(new Set(s.map(function(t){return t.discrete})));C=Array.from(new Set(s.map(function(t){return t.id})));w=Gt().key(function(t){return t.discrete}).entries(s).map(function(t){return t.values});w.forEach(function(r){var o=Array.from(new Set(r.map(function(t){return t.id})));if(o.length<C.length){C.forEach(function(e){if(!o.includes(e)){var t=s.filter(function(t){return t.id===e})[0];if(t.shape==="Area"){var n=a(t.data,t.i);var i={__d3plus__:true,data:t.data,discrete:t.shape==="Bar"?r[0][A._discrete]+"_"+n:""+r[0][A._discrete],group:n,id:e,shape:t.shape};i[A._discrete]=r[0][A._discrete];i[u]=0;s.push(i)}}})}});if(this["_"+this._discrete+"Sort"]){s.sort(function(t,e){return A["_"+A._discrete+"Sort"](t.data,e.data)})}else{s.sort(function(t,e){return t[A._discrete]-e[A._discrete]})}var S=this._stackOrder;if(S instanceof Array){C.sort(function(t,e){return S.indexOf(t)-S.indexOf(e)})}else if(S===zf){C.sort(function(t,e){return t.localeCompare(e)})}w=Ff().keys(C).offset(this._stackOffset).order(S instanceof Array?zf:S).value(function(t,e){var n=t.filter(function(t){return t.id===e});return n.length?n[0][u]:0})(w);x={};x[this._discrete]=Ht(s,function(t){return t[A._discrete]});x[u]=[qt(w.map(function(t){return qt(t.map(function(t){return t[0]}))})),Ut(w.map(function(t){return Ut(t.map(function(t){return t[1]}))}))]}else{var k=this._discrete==="x"?s.map(function(t){return t.x}):s.map(function(t){return t.x}).concat(this._confidence&&this._confidence[0]?s.map(function(t){return t.lci}):[]).concat(this._confidence&&this._confidence[1]?s.map(function(t){return t.hci}):[]);var M=this._discrete==="x"?s.map(function(t){return t.x2}):s.map(function(t){return t.x2}).concat(this._confidence&&this._confidence[0]?s.map(function(t){return t.lci}):[]).concat(this._confidence&&this._confidence[1]?s.map(function(t){return t.hci}):[]);var T=this._discrete==="y"?s.map(function(t){return t.y}):s.map(function(t){return t.y}).concat(this._confidence&&this._confidence[0]?s.map(function(t){return t.lci}):[]).concat(this._confidence&&this._confidence[1]?s.map(function(t){return t.hci}):[]);var B=this._discrete==="y"?s.map(function(t){return t.y2}):s.map(function(t){return t.y2}).concat(this._confidence&&this._confidence[0]?s.map(function(t){return t.lci}):[]).concat(this._confidence&&this._confidence[1]?s.map(function(t){return t.hci}):[]);if(this["_"+this._discrete+"Sort"]){s.sort(function(t,e){return A["_"+A._discrete+"Sort"](t.data,e.data)})}else{s.sort(function(t,e){return t[A._discrete]-e[A._discrete]})}x={x:this._xSort?Array.from(new Set(s.filter(function(t){return t.x}).sort(function(t,e){return A._xSort(t.data,e.data)}).map(function(t){return t.x}))):Ht(k,function(t){return t}),x2:this._x2Sort?Array.from(new Set(s.filter(function(t){return t.x2}).sort(function(t,e){return A._x2Sort(t.data,e.data)}).map(function(t){return t.x2}))):Ht(M,function(t){return t}),y:this._ySort?Array.from(new Set(s.filter(function(t){return t.y}).sort(function(t,e){return A._ySort(t.data,e.data)}).map(function(t){return t.y}))):Ht(T,function(t){return t}),y2:this._y2Sort?Array.from(new Set(s.filter(function(t){return t.y2}).sort(function(t,e){return A._y2Sort(t.data,e.data)}).map(function(t){return t.y2}))):Ht(B,function(t){return t})}}var D=this._xDomain?this._xDomain.slice():x.x,N=this._xSort?"Ordinal":"Linear";if(D[0]===void 0){D[0]=x.x[0]}if(D[1]===void 0){D[1]=x.x[1]}if(g){D=D.map(wd);N="Time"}else if(this._discrete==="x"){D=Array.from(new Set(s.filter(function(t){return t.x}).sort(function(t,e){return A._xSort?A._xSort(t.data,e.data):t.x-e.x}).map(function(t){return t.x})));N="Ordinal"}var P=this._x2Domain?this._x2Domain.slice():x.x2,z=this._x2Sort?"Ordinal":"Linear";if(P&&P[0]===void 0){P[0]=x.x2[0]}if(P&&P[1]===void 0){P[1]=x.x2[1]}if(p){P=P.map(wd);z="Time"}else if(this._discrete==="x"){P=Array.from(new Set(s.filter(function(t){return t.x2}).sort(function(t,e){return A._x2Sort?A._x2Sort(t.data,e.data):t.x2-e.x2}).map(function(t){return t.x2})));z="Ordinal"}var O=this._yDomain?this._yDomain.slice():x.y,F=this._ySort?"Ordinal":"Linear";if(O[0]===void 0){O[0]=x.y[0]}if(O[1]===void 0){O[1]=x.y[1]}var R=this._y2Domain?this._y2Domain.slice():x.y2,I=this._y2Sort?"Ordinal":"Linear";if(R&&R[0]===void 0){R[0]=x.y2[0]}if(R&&R[1]===void 0){R[1]=x.y2[1]}if(_){O=O.map(wd);F="Time"}else if(this._discrete==="y"){O=Array.from(new Set(s.sort(function(t,e){return A._ySort?A._ySort(t.data,e.data):t.y-e.y}).map(function(t){return t.y})));F="Ordinal";R=Array.from(new Set(s.sort(function(t,e){return A._y2Sort?A._y2Sort(t.data,e.data):t.y2-e.y2}).map(function(t){return t.y2})));I="Ordinal"}if(v){R=R.map(wd);I="Time"}x={x:D,x2:P||D,y:O,y2:R||O};l.forEach(function(t){if(t&&A._baseline!==void 0){var e=A._baseline;if(x[t]&&x[t][0]>e){x[t][0]=e}else if(x[t]&&x[t][1]<e){x[t][1]=e}}});var L=Zr["scale"+N]().domain(x.x).range(Vt(0,d+1,d/(x.x.length-1))),j=Zr["scale"+z]().domain(x.x2).range(Vt(0,d+1,d/(x.x2.length-1))),H=Zr["scale"+F]().domain(x.y.reverse()).range(Vt(0,o+1,o/(x.y.length-1))),V=Zr["scale"+I]().domain(x.y2.reverse()).range(Vt(0,o+1,o/(x.y2.length-1)));var U=Gt().key(function(t){return t.shape}).entries(s);var W=this._discrete==="x"?F:N;if(this._xConfig.scale!=="log"&&this._yConfig.scale!=="log"&&W!=="Ordinal"){U.forEach(function(t){if(A._buffer[t.key]){var e=A._buffer[t.key].bind(A)({data:t.values,x:L,y:H,config:A._shapeConfig[t.key]});if(A._xConfig.scale!=="log"){L=e[0]}if(A._yConfig.scale!=="log"){H=e[1]}var n=A._buffer[t.key].bind(A)({data:t.values,x:j,y:V,x2:true,y2:true,config:A._shapeConfig[t.key]});if(A._x2Config.scale!=="log"){j=n[0]}if(A._y2Config.scale!=="log"){V=n[1]}}})}D=L.domain();P=j.domain();O=H.domain();R=V.domain();this._xDomain=D;var q=Ku("g.d3plus-plot-test",{enter:{opacity:0},parent:this._select}),X=this._discrete==="x"&&!p?x.x2:undefined,G=this._discrete==="x"&&!g?x.x:undefined,Y=this._discrete==="y"&&!v?x.y2:undefined,$=this._discrete==="y"&&!_?x.y:undefined;var Q={gridConfig:{stroke:!this._discrete||this._discrete==="x"?this._yTest.gridConfig().stroke:"transparent"}};var Z={barConfig:{"stroke-width":0},gridSize:0,labels:[],title:false,tickSize:0};var K=i?{}:Z;var J=r?{}:Z;this._yTest.domain(O).height(o).maxSize(d/2).range([undefined,undefined]).scale(F.toLowerCase()).select(q.node()).ticks($).width(d).config(Q).config(this._yConfig).render();var tt=this._yTest.outerBounds();var et=tt.width?tt.width+this._yTest.padding():undefined;this._y2Test.domain(r?R:O).height(o).range([undefined,undefined]).scale(r?I.toLowerCase():F.toLowerCase()).select(q.node()).ticks(Y?Y:$).width(d).config(Q).config(J).config(this._y2Config).render();var nt=this._y2Test.outerBounds();var it=nt.width?nt.width+this._y2Test.padding():undefined;var rt={gridConfig:{stroke:!this._discrete||this._discrete==="y"?this._xTest.gridConfig().stroke:"transparent"}};this._xTest.domain(D).height(o).maxSize(o/2).range([undefined,undefined]).scale(N.toLowerCase()).select(q.node()).ticks(G).width(d).config(rt).config(this._xConfig).render();this._x2Test.domain(i?P:D).height(o).range([undefined,undefined]).scale(i?z.toLowerCase():N.toLowerCase()).select(q.node()).ticks(i?X:G).width(d).config(rt).tickSize(0).config(K).config(this._x2Config).render();var ot=this._x2Test.outerBounds();var at=ot.height+this._x2Test.padding();var st=Ut([et,this._xTest._getRange()[0],this._x2Test._getRange()[0]]);this._xTest.range([st,undefined]).render();var ut=F==="Ordinal";var ht=ut?this._yTest.shapeConfig().labelConfig.fontSize():this._yTest.shapeConfig().labelConfig.fontSize()/2;var lt=Ut([it,d-this._xTest._getRange()[1],d-this._x2Test._getRange()[1]]);var ft=d-this._xTest._getRange()[1];var ct=lt-ft+this._xTest.padding();var dt=d-this._x2Test._getRange()[1];var pt=lt-dt+this._x2Test.padding();var gt=this._xTest.outerBounds();var vt=gt.height+this._xTest.padding();var _t=Ut([vt,o-this._yTest._getRange()[1],o-this._y2Test._getRange()[1]]);var yt=o-this._yTest._getRange()[1];var mt=ut?_t-yt+this._yTest.padding():vt;var bt=o-this._y2Test._getRange()[1];var xt=ut?_t-bt+this._y2Test.padding():vt;this._padding.left+=st;this._padding.right+=Math.max(ct,pt);this._padding.bottom+=Math.max(mt,xt);this._padding.top+=at+ht;jt.prototype._draw.call(this,e);var wt=this._margin.left+this._margin.right;var Ct=this._margin.top+this._margin.bottom;this._yTest.domain(O).height(o).maxSize(d/2).range([at,o-(mt+ht+Ct)]).scale(F.toLowerCase()).select(q.node()).ticks($).width(d).config(Q).config(this._yConfig).render();tt=this._yTest.outerBounds();et=tt.width?tt.width+this._yTest.padding():undefined;st=Ut([et,this._xTest._getRange()[0],this._x2Test._getRange()[0]]);this._y2Test.config(Q).domain(r?R:O).gridSize(0).height(o).range([at,o-(xt+ht+Ct)]).scale(r?I.toLowerCase():F.toLowerCase()).select(q.node()).width(d-Ut([0,lt-it])).title(false).config(this._y2Config).config(J).render();nt=this._y2Test.outerBounds();it=nt.width?nt.width+this._y2Test.padding():undefined;lt=Ut([it,d-this._xTest._getRange()[1],d-this._x2Test._getRange()[1]]);var Et="translate("+this._margin.left+", "+(this._margin.top+at+ht)+")";var St="translate("+this._margin.left+", "+(this._margin.top+ht)+")";var At=Ku("g.d3plus-plot-x-axis",{parent:f,transition:c,enter:{transform:Et},update:{transform:Et}});var kt=Ku("g.d3plus-plot-x2-axis",{parent:f,transition:c,enter:{transform:St},update:{transform:St}});var Mt=st>et?st-et:0;var Tt="translate("+(this._margin.left+Mt)+", "+(this._margin.top+ht)+")";var Bt=Ku("g.d3plus-plot-y-axis",{parent:f,transition:c,enter:{transform:Tt},update:{transform:Tt}});var Dt="translate(-"+this._margin.right+", "+(this._margin.top+ht)+")";var Nt=Ku("g.d3plus-plot-y2-axis",{parent:f,transition:c,enter:{transform:Dt},update:{transform:Dt}});this._xAxis.domain(D).height(o-(at+ht+Ct)).maxSize(o/2).range([st,d-(ct+wt)]).scale(N.toLowerCase()).select(At.node()).ticks(G).width(d).config(rt).config(this._xConfig).render();this._x2Axis.domain(i?P:D).height(o-(vt+ht+Ct)).range([st,d-(pt+wt)]).scale(z.toLowerCase()).select(kt.node()).ticks(i?X:G).width(d).config(rt).config(K).config(this._x2Config).render();L=function(t,e){if(e==="x2"){if(A._x2Config.scale==="log"&&t===0){t=P[0]<0?-1:1}return A._x2Axis._getPosition.bind(A._x2Axis)(t)}else{if(A._xConfig.scale==="log"&&t===0){t=D[0]<0?-1:1}return A._xAxis._getPosition.bind(A._xAxis)(t)}};var Pt=this._xAxis._getRange();this._yAxis.domain(O).height(o).maxSize(d/2).range([this._xAxis.outerBounds().y+at,o-(mt+ht+Ct)]).scale(F.toLowerCase()).select(Bt.node()).ticks($).width(Pt[Pt.length-1]).config(Q).config(this._yConfig).render();this._y2Axis.config(Q).domain(r?R:O).gridSize(0).height(o).range([this._xAxis.outerBounds().y+at,o-(xt+ht+Ct)]).scale(r?I.toLowerCase():F.toLowerCase()).select(Nt.node()).width(d-Ut([0,lt-it])).title(false).config(this._y2Config).config(J).render();H=function(t,e){if(e==="y2"){if(A._y2Config.scale==="log"&&t===0){t=R[0]<0?-1:1}return A._y2Axis._getPosition.bind(A._y2Axis)(t)-at}else{if(A._yConfig.scale==="log"&&t===0){t=O[0]<0?-1:1}return A._yAxis._getPosition.bind(A._yAxis)(t)-at}};var zt=this._yAxis._getRange();var Ot=Ku("g.d3plus-plot-annotations",{parent:f,transition:c,enter:{transform:Et},update:{transform:Et}}).node();this._annotations.forEach(function(t){(new xd[t.shape]).config(t).config({x:function(t){return t.x2?L(t.x2,"x2"):L(t.x)},x0:A._discrete==="x"?function(t){return t.x2?L(t.x2,"x2"):L(t.x)}:L(0),x1:A._discrete==="x"?null:function(t){return t.x2?L(t.x2,"x2"):L(t.x)},y:function(t){return t.y2?H(t.y2,"y2"):H(t.y)},y0:A._discrete==="y"?function(t){return t.y2?H(t.y2,"y2"):H(t.y)}:H(0)-Ft,y1:A._discrete==="y"?null:function(t){return t.y2?H(t.y2,"y2"):H(t.y)-Ft}}).select(Ot).render()});var Ft=this._xAxis.barConfig()["stroke-width"];if(Ft){Ft/=2}var Rt={duration:this._duration,label:function(t){return A._drawLabel(t.data,t.i)},select:Ku("g.d3plus-plot-shapes",{parent:f,transition:c,enter:{transform:Et},update:{transform:Et}}).node(),x:function(t){return t.x2?L(t.x2,"x2"):L(t.x)},x0:this._discrete==="x"?function(t){return t.x2?L(t.x2,"x2"):L(t.x)}:L(0),x1:this._discrete==="x"?null:function(t){return t.x2?L(t.x2,"x2"):L(t.x)},y:function(t){return t.y2?H(t.y2,"y2"):H(t.y)},y0:this._discrete==="y"?function(t){return t.y2?H(t.y2,"y2"):H(t.y)}:H(0)-Ft,y1:this._discrete==="y"?null:function(t){return t.y2?H(t.y2,"y2"):H(t.y)-Ft}};if(this._stacked){var It=u==="x"?L:H;Rt[""+u]=Rt[u+"0"]=function(t){var e=C.indexOf(t.id),n=b.indexOf(t.discrete);return e>=0?It(w[e][n][0]):It(0)};Rt[u+"1"]=function(t){var e=C.indexOf(t.id),n=b.indexOf(t.discrete);return e>=0?It(w[e][n][1]):It(0)}}var Lt=Object.keys(this._on);U.forEach(function(e){var t=(new xd[e.key]).config(Rt).data(e.values);if(e.key==="Bar"){var n;var i=A._discrete==="x"?L:H;var r=(A._discrete==="x"?D:O).filter(function(t){return typeof t!=="string"||t.indexOf("d3plus-buffer-")<0});var o=A._discrete==="x"?Pt:zt;if(r.length>1){n=i(r[1])-i(r[0])}else{n=o[o.length-1]-o[0]}n-=A._groupPadding;var a=n;var s=Gt().key(function(t){return t[A._discrete]}).key(function(t){return t.group}).entries(e.values);var u=Wt(s.map(function(t){return t.values.map(function(t){return t.key})}));var h=Array.from(new Set(u));if(Ut(s.map(function(t){return t.values.length}))===1){t[A._discrete](function(t,e){return Rt[A._discrete](t,e)})}else{a=(a-A._barPadding*h.length-1)/h.length;var l=n/2-a/2;var f=vn().domain([0,h.length-1]).range([-l,l]);t[A._discrete](function(t,e){return Rt[A._discrete](t,e)+f(h.indexOf(t.group))})}t.width(a);t.height(a)}else if(e.key==="Line"&&A._confidence){var c=Object.assign({},Rt);var d=A._discrete==="x"?"y":"x";var p=A._discrete==="x"?H:L;c[d+"0"]=function(t){return p(A._confidence[0]?t.lci:t[d])};c[d+"1"]=function(t){return p(A._confidence[1]?t.hci:t[d])};var g=(new fd).config(c).data(e.values);var v=Object.assign(A._shapeConfig,A._confidenceConfig);g.config(Qu.bind(A)(v,"shape","Area")).render();A._shapes.push(g)}var _=Lt.filter(function(t){return t.includes("."+e.key)}),y=Lt.filter(function(t){return!t.includes(".")}),m=Lt.filter(function(t){return t.includes(".shape")});var b=function(e){t.on(y[e],function(t){return A._on[y[e]](t.data,t.i)})};for(var x=0;x<y.length;x++){b(x)}var w=function(e){t.on(m[e],function(t){return A._on[m[e]](t.data,t.i)})};for(var C=0;C<m.length;C++){w(C)}var E=function(e){t.on(_[e],function(t){return A._on[_[e]](t.data,t.i)})};for(var S=0;S<_.length;S++){E(S)}t.config(Qu.bind(A)(A._shapeConfig,"shape",e.key)).render();A._shapes.push(t)});return this};t.prototype.annotations=function t(e){return arguments.length?(this._annotations=e instanceof Array?e:[e],this):this._annotations};t.prototype.barPadding=function t(e){return arguments.length?(this._barPadding=e,this):this._barPadding};t.prototype.baseline=function t(e){return arguments.length?(this._baseline=e,this):this._baseline};t.prototype.confidence=function t(e){if(arguments.length){this._confidence=[];var n=e[0];this._confidence[0]=typeof n==="function"||!n?n:ju(n);var i=e[1];this._confidence[1]=typeof i==="function"||!i?i:ju(i);return this}else{return this._confidence}};t.prototype.confidenceConfig=function t(e){return arguments.length?(this._confidenceConfig=Vu(this._confidenceConfig,e),this):this._confidenceConfig};t.prototype.discrete=function t(e){return arguments.length?(this._discrete=e,this):this._discrete};t.prototype.groupPadding=function t(e){return arguments.length?(this._groupPadding=e,this):this._groupPadding};t.prototype.size=function t(e){return arguments.length?(this._size=typeof e==="function"||!e?e:ju(e),this):this._size};t.prototype.sizeMax=function t(e){return arguments.length?(this._sizeMax=e,this):this._sizeMax};t.prototype.sizeMin=function t(e){return arguments.length?(this._sizeMin=e,this):this._sizeMin};t.prototype.sizeScale=function t(e){return arguments.length?(this._sizeScale=e,this):this._sizeScale};t.prototype.stacked=function t(e){return arguments.length?(this._stacked=e,this):this._stacked};t.prototype.stackOffset=function t(e){return arguments.length?(this._stackOffset=typeof e==="function"?e:Xf["stackOffset"+(e.charAt(0).toUpperCase()+e.slice(1))],this):this._stackOffset};t.prototype.stackOrder=function t(e){return arguments.length?(this._stackOrder=typeof e==="string"?Xf["stackOrder"+(e.charAt(0).toUpperCase()+e.slice(1))]:e,this):this._stackOrder};t.prototype.x=function t(e){if(arguments.length){if(typeof e==="function"){this._x=e}else{this._x=ju(e);if(!this._aggs[e]&&this._discrete==="x"){this._aggs[e]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}}return this}else{return this._x}};t.prototype.x2=function t(e){if(arguments.length){if(typeof e==="function"){this._x2=e}else{this._x2=ju(e);if(!this._aggs[e]&&this._discrete==="x"){this._aggs[e]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}}return this}else{return this._x2}};t.prototype.xConfig=function t(e){return arguments.length?(this._xConfig=Vu(this._xConfig,e),this):this._xConfig};t.prototype.x2Config=function t(e){return arguments.length?(this._x2Config=Vu(this._x2Config,e),this):this._x2Config};t.prototype.xDomain=function t(e){return arguments.length?(this._xDomain=e,this):this._xDomain};t.prototype.x2Domain=function t(e){return arguments.length?(this._x2Domain=e,this):this._x2Domain};t.prototype.xSort=function t(e){return arguments.length?(this._xSort=e,this):this._xSort};t.prototype.x2Sort=function t(e){return arguments.length?(this._x2Sort=e,this):this._x2Sort};t.prototype.y=function t(e){if(arguments.length){if(typeof e==="function"){this._y=e}else{this._y=ju(e);if(!this._aggs[e]&&this._discrete==="y"){this._aggs[e]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}}return this}else{return this._y}};t.prototype.y2=function t(e){if(arguments.length){if(typeof e==="function"){this._y2=e}else{this._y2=ju(e);if(!this._aggs[e]&&this._discrete==="y2"){this._aggs[e]=function(t){var e=Array.from(new Set(t));return e.length===1?e[0]:e}}}return this}else{return this._y2}};t.prototype.yConfig=function t(e){if(arguments.length){if(e.domain){e.domain=e.domain.slice().reverse()}this._yConfig=Vu(this._yConfig,e);return this}return this._yConfig};t.prototype.y2Config=function t(e){return arguments.length?(this._y2Config=Vu(this._y2Config,e),this):this._y2Config};t.prototype.yDomain=function t(e){return arguments.length?(this._yDomain=e,this):this._yDomain};t.prototype.y2Domain=function t(e){return arguments.length?(this._y2Domain=e,this):this._y2Domain};t.prototype.ySort=function t(e){return arguments.length?(this._ySort=e,this):this._ySort};t.prototype.y2Sort=function t(e){return arguments.length?(this._y2Sort=e,this):this._y2Sort};return t}(LE);var HS=function(t){function e(){t.call(this);this._baseline=0;this._discrete="x";this._shape=Zu("Area");this.x("x")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(jS);var VS=function(t){function e(){t.call(this);this._baseline=0;this._discrete="x";this._shape=Zu("Bar");this.x("x")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(jS);var US=function(t){function e(){var o=this;t.call(this);this._discrete="x";this._shape=Zu("Line");this.x("x");this.y2(function(t){return o._y(t)});this.yConfig({tickFormat:function(e){var t=o._formattedData;var n=o._xDomain;var i=t.filter(function(t){return t.x===n[0]});var r=i.find(function(t){return t.y===e});return r?o._drawLabel(r,r.i):""}});this.y2Config({tickFormat:function(e){var t=o._formattedData;var n=o._xDomain;var i=t.filter(function(t){return t.x===n[n.length-1]});var r=i.find(function(t){return t.y===e});return r?o._drawLabel(r,r.i):""}});this.ySort(function(t,e){return o._y(e)-o._y(t)});this.y2Sort(function(t,e){return o._y(e)-o._y(t)})}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(jS);var WS=function(t){function e(){t.call(this);this._discrete="x";this._shape=Zu("Line");this.x("x")}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(jS);var qS=function(t){function e(){t.call(this);this._stacked=true}if(t){e.__proto__=t}e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;return e}(HS);var XS=function(g){function t(){g.call(this);this._axis=(new Cd).align("end").orient("bottom");this._axisConfig={scale:"time"};this._axisTest=(new Cd).align("end").gridSize(0).orient("bottom");this.end("end");this.start("start")}if(g){t.__proto__=g}t.prototype=Object.create(g&&g.prototype);t.prototype.constructor=t;t.prototype.render=function t(e){var n=this;g.prototype.render.call(this,e);if(!this._filteredData){return this}var i=this._filteredData.map(function(t,e){return{__d3plus__:true,data:t,end:n._axisConfig.scale==="time"?wd(n._end(t,e)):n._end(t,e),i:e,id:n._id(t,e),start:n._axisConfig.scale==="time"?wd(n._start(t,e)):n._start(t,e)}}).filter(function(t){return t.end-t.start>0}).sort(function(t,e){return t.start-e.start});var r;if(this._groupBy.length>1&&this._drawDepth>0){var o=Gt();var a=function(e){o.key(function(t){return n._groupBy[e](t.data,t.i)})};for(var s=0;s<this._drawDepth;s++){a(s)}r=o.entries(i)}else{r=[{values:i}]}var u=0;r.forEach(function(t){var n=[];t.values.forEach(function(e){n=n.map(function(t){return t<=e.start?false:t});var t=n.indexOf(false);if(t<0){e.lane=u+n.length;n.push(e.end)}else{n[t]=e.end;e.lane=u+t}});u+=n.length});var h={domain:[qt(i,function(t){return t.start})||0,Ut(i,function(t){return t.end})||0],height:this._height-this._margin.top-this._margin.bottom,width:this._width-this._margin.left-this._margin.right};var l="translate("+this._margin.left+", "+this._margin.top+")";this._axisTest.config(h).config(this._axisConfig).select(Ku("g.d3plus-priestley-axis-test",{parent:this._select,enter:{opacity:0}}).node()).render();this._axis.config(h).config(this._axisConfig).select(Ku("g.d3plus-priestley-axis",{parent:this._select,enter:{transform:l},update:{transform:l}}).node()).render();var f=this._axisTest._padding;var c=this._axis._d3Scale;var d=D().domain(Vt(0,u,1)).padding(.5).rangeRound([this._height-this._margin.bottom-this._axisTest.outerBounds().height-f,this._margin.top+f]);var p=d.step();this._shapes.push((new bd).data(i).duration(this._duration).height(p>=this._padding*2?p-this._padding:p>2?p-2:p).label(function(t,e){return n._drawLabel(t.data,e)}).select(Ku("g.d3plus-priestley-shapes",{parent:this._select}).node()).width(function(t){var e=Math.abs(c(t.end)-c(t.start));return e>2?e-2:e}).x(function(t){return c(t.start)+(c(t.end)-c(t.start))/2}).y(function(t){return d(t.lane)}).config(Qu.bind(this)(this._shapeConfig,"shape","Rect")).render());return this};t.prototype.axisConfig=function t(e){return arguments.length?(this._axisConfig=Vu(this._axisConfig,e),this):this._axisConfig};t.prototype.end=function t(e){if(arguments.length){if(typeof e==="function"){this._end=e}else{this._end=ju(e);if(!this._aggs[e]){this._aggs[e]=function(t){return Ut(t)}}}return this}else{return this._end}};t.prototype.start=function t(e){if(arguments.length){if(typeof e==="function"){this._start=e}else{this._start=ju(e);if(!this._aggs[e]){this._aggs[e]=function(t){return qt(t)}}}return this}else{return this._start}};return t}(LE);t.version=e;t.Axis=Cd;t.AxisBottom=Ed;t.AxisLeft=Sd;t.AxisRight=Ad;t.AxisTop=kd;t.date=wd;t.colorAdd=rh;t.colorAssign=mh;t.colorContrast=bh;t.colorDefaults=_h;t.colorLegible=xh;t.colorLighter=wh;t.colorSubtract=Ch;t.accessor=ju;t.assign=Vu;t.attrize=Uu;t.BaseClass=Yu;t.closest=$u;t.configPrep=Qu;t.constant=Zu;t.elem=Ku;t.isObject=Hu;t.merge=Ju;t.parseSides=th;t.prefix=eh;t.stylize=nh;t.uuid=qu;t.Geomap=HE;t.Donut=UE;t.Pie=VE;t.Tree=BS;t.Treemap=DS;t.ckmeans=yb;t.ColorScale=mb;t.Legend=bb;t.Network=NS;t.Rings=PS;t.AreaPlot=HS;t.BarChart=VS;t.LinePlot=WS;t.Plot=jS;t.StackedArea=qS;t.Priestley=XS;t.Area=fd;t.Bar=cd;t.Circle=dd;t.Image=ih;t.Line=pd;t.Path=md;t.largestRect=ld;t.lineIntersection=$c;t.path2polygon=yd;t.pointDistance=Dc;t.pointDistanceSquared=Bc;t.pointRotate=td;t.polygonInside=Kc;t.polygonRayCast=Jc;t.polygonRotate=ed;t.segmentBoxContains=Qc;t.segmentsIntersect=Zc;t.shapeEdgePoint=vd;t.simplify=ad;t.Rect=bd;t.Shape=Nc;t.fontExists=rc;t.rtl=oc;t.stringify=ac;t.strip=uc;t.TextBox=Ac;t.textSplit=Ec;t.textWidth=Gf;t.textWrap=Sc;t.titleCase=Tc;t.trim=Yf;t.trimLeft=$f;t.trimRight=Qf;t.Timeline=xb;t.Tooltip=Gx;t.dataFold=Ry;t.dataLoad=sm;t.Viz=LE;Object.defineProperty(t,"__esModule",{value:true})}); |