diff --git a/.gitignore b/.gitignore index 1c2653c..5bd695f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ /site /test_wagtail_ab_testing.db /node_modules +/.envrc .DS_Store diff --git a/wagtail_ab_testing/static/wagtail_ab_testing/js/.gitignore b/wagtail_ab_testing/static/wagtail_ab_testing/js/.gitignore deleted file mode 100644 index 9816ee3..0000000 --- a/wagtail_ab_testing/static/wagtail_ab_testing/js/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/wagtail-ab-testing.js diff --git a/wagtail_ab_testing/static/wagtail_ab_testing/js/tracker.js b/wagtail_ab_testing/static/wagtail_ab_testing/js/tracker.js index 03f6a29..18de738 100644 --- a/wagtail_ab_testing/static/wagtail_ab_testing/js/tracker.js +++ b/wagtail_ab_testing/static/wagtail_ab_testing/js/tracker.js @@ -1,7 +1,7 @@ (function() { // Check if Do Not Track is enabled - if (window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack || 'msTrackingProtectionEnabled' in window.external) { - if (window.doNotTrack == '1' || navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1' || 'msTrackingProtectionEnabled' in window.external && window.external.msTrackingProtectionEnabled()) { + if (window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack) { + if (window.doNotTrack == '1' || navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') { // Don't track this browser return; } diff --git a/wagtail_ab_testing/static/wagtail_ab_testing/js/wagtail-ab-testing.js b/wagtail_ab_testing/static/wagtail_ab_testing/js/wagtail-ab-testing.js new file mode 100644 index 0000000..f5ba793 --- /dev/null +++ b/wagtail_ab_testing/static/wagtail_ab_testing/js/wagtail-ab-testing.js @@ -0,0 +1,11 @@ +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=React},function(t,e,n){"use strict";t.exports=n(15)},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i=0&&f.splice(e,1)}function _(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return x(e,t.attrs),g(t,e),e}function x(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function v(t,e){var n,r,i,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var o=l++;n=c||(c=_(e)),r=w.bind(null,n,o,!1),i=w.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",x(e,t.attrs),g(t,e),e}(e),r=A.bind(null,n,e),i=function(){y(n),n.href&&URL.revokeObjectURL(n.href)}):(n=_(e),r=S.bind(null,n),i=function(){y(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=p(t,e);return d(n,e),function(t){for(var r=[],i=0;ir&&(r=(e=e.trim()).charCodeAt(0)),r){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:o=o.replace(u,"-webkit-"+u)+";"+o;break;case 207:case 102:o=o.replace(u,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0d)&&(z=(X=X.replace(" ",":")).length),0\n '+gettext("A/B testing")+"\n "),$("div.tab-content").append('\n
\n
\n ');var t=document.getElementById("tab-abtesting");t&&o.initPageEditorTab(t,abTestingTabProps)}}))},function(t,e,n){ +/* @license C3.js v0.7.20 | (c) C3 Team and other contributors | http://c3js.org/ */ +t.exports=function(){"use strict";function t(t){var e=this;e.d3=window.d3?window.d3:n(23),e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}function e(n){this.internal=new t(this),this.internal.loadConfig(n),this.internal.beforeInit(n),this.internal.init(),this.internal.afterInit(n),function t(e,n,r){Object.keys(e).forEach((function(i){n[i]=e[i].bind(r),Object.keys(e[i]).length>0&&t(e[i],n[i],r)}))}(e.prototype,this,this)}var r=function(t){return Math.ceil(t)+.5},i=function(t){return 10*Math.ceil(t/10)},a=function(t){return t[1]-t[0]},o=function(t,e,n){return l(t[e])?t[e]:n},s=function(t){var e=u(t),n=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)];return{x:n[0].x,y:Math.min(n[0].y,n[1].y),width:e.width,height:e.height}},u=function(t){try{return t.getBBox()}catch(t){return{x:0,y:0,width:0,height:0}}},c=function(t){return Array.isArray(t)},l=function(t){return void 0!==t},f=function(t){return null==t||p(t)&&0===t.length||"object"==typeof t&&0===Object.keys(t).length},h=function(t){return"function"==typeof t},d=function(t){return"number"==typeof t},p=function(t){return"string"==typeof t},g=function(t){return void 0===t},y=function(t){return t||0===t},_=function(t){return!f(t)},x=function(t){return"string"==typeof t?t.replace(//g,">"):t},v=function(t){var e=function(t){void 0===t&&(t=window.navigator.userAgent);var e=t.indexOf("MSIE ");return e>0?parseInt(t.substring(e+5,t.indexOf(".",e)),10):(e=t.indexOf("Trident/"))>0&&(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10))}();return void 0===t?!!e:t===e};function m(t,e){this.component=t,this.params=e||{},this.d3=t.d3,this.scale=this.d3.scaleLinear(),this.range,this.orient="bottom",this.innerTickSize=6,this.outerTickSize=this.params.withOuterTick?6:0,this.tickPadding=3,this.tickValues=null,this.tickFormat,this.tickArguments,this.tickOffset=0,this.tickCulling=!0,this.tickCentered,this.tickTextCharSize,this.tickTextRotate=this.params.tickTextRotate,this.tickLength,this.axis=this.generateAxis()}m.prototype.axisX=function(t,e,n){t.attr("transform",(function(t){return"translate("+Math.ceil(e(t)+n)+", 0)"}))},m.prototype.axisY=function(t,e){t.attr("transform",(function(t){return"translate(0,"+Math.ceil(e(t))+")"}))},m.prototype.scaleExtent=function(t){var e=t[0],n=t[t.length-1];return e0&&r[0]>0&&r.unshift(r[0]-(r[1]-r[0])),r},m.prototype.copyScale=function(){var t,e=this.scale.copy();return this.params.isCategory&&(t=this.scale.domain(),e.domain([t[0],t[1]-1])),e},m.prototype.textFormatted=function(t){var e=this.tickFormat?this.tickFormat(t):t;return void 0!==e?e:""},m.prototype.updateRange=function(){return this.range=this.scale.rangeExtent?this.scale.rangeExtent():this.scaleExtent(this.scale.range()),this.range},m.prototype.updateTickTextCharSize=function(t){var e=this;if(e.tickTextCharSize)return e.tickTextCharSize;var n={h:11.5,w:5.5};return t.select("text").text((function(t){return e.textFormatted(t)})).each((function(t){var r=u(this),i=e.textFormatted(t),a=r.height,o=i?r.width/i.length:void 0;a&&o&&(n.h=a,n.w=o)})).text(""),e.tickTextCharSize=n,n},m.prototype.isVertical=function(){return"left"===this.orient||"right"===this.orient},m.prototype.tspanData=function(t,e,n){var r=this.params.tickMultiline?this.splitTickText(t,n):[].concat(this.textFormatted(t));return this.params.tickMultiline&&this.params.tickMultilineMax>0&&(r=this.ellipsify(r,this.params.tickMultilineMax)),r.map((function(t){return{index:e,splitted:t,length:r.length}}))},m.prototype.splitTickText=function(t,e){var n,r,i,a=this,o=a.textFormatted(t),s=a.params.tickWidth;return"[object Array]"===Object.prototype.toString.call(o)?o:((!s||s<=0)&&(s=a.isVertical()?95:a.params.isCategory?Math.ceil(e(1)-e(0))-12:110),function t(e,o){r=void 0;for(var u=1;u=0;i--){var a=n[i].length;if(n[i]=n[i].substr(0,a-r).padEnd(a,"."),(r-=a)<=0)break}return n},m.prototype.updateTickLength=function(){this.tickLength=Math.max(this.innerTickSize,0)+this.tickPadding},m.prototype.lineY2=function(t){var e=this.scale(t)+(this.tickCentered?0:this.tickOffset);return this.range[0]0?1:-1):this.tickLength},m.prototype.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},m.prototype.textTextAnchor=function(){var t=this.tickTextRotate;return t?t>0?"start":"end":"middle"},m.prototype.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},m.prototype.tspanDy=function(t,e){var n=this.tickTextCharSize.h;return 0===e&&(n=this.isVertical()?-((t.length-1)*(this.tickTextCharSize.h/2)-3):".71em"),n},m.prototype.generateAxis=function(){var t=this,e=t.d3,n=t.params;function r(i,a){var o;return i.each((function(){var i,s,u,c=r.g=e.select(this),l=this.__chart__||t.scale,f=this.__chart__=t.copyScale(),h=t.tickValues?t.tickValues:t.generateTicks(f),d=c.selectAll(".tick").data(h,f),p=d.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),g=d.exit().remove(),y=d.merge(p);n.isCategory?(t.tickOffset=Math.ceil((f(1)-f(0))/2),s=t.tickCentered?0:t.tickOffset,u=t.tickCentered?t.tickOffset:0):t.tickOffset=s=0,t.updateRange(),t.updateTickLength(),t.updateTickTextCharSize(c.select(".tick"));var _=y.select("line").merge(p.append("line")),x=y.select("text").merge(p.append("text")),v=y.selectAll("text").selectAll("tspan").data((function(e,n){return t.tspanData(e,n,f)})),m=v.enter().append("tspan").merge(v).text((function(t){return t.splitted}));v.exit().remove();var b=c.selectAll(".domain").data([0]),w=b.enter().append("path").merge(b).attr("class","domain");switch(t.orient){case"bottom":i=t.axisX,_.attr("x1",s).attr("x2",s).attr("y2",(function(e,n){return t.lineY2(e,n)})),x.attr("x",0).attr("y",(function(e,n){return t.textY(e,n)})).attr("transform",(function(e,n){return t.textTransform(e,n)})).style("text-anchor",(function(e,n){return t.textTextAnchor(e,n)})),m.attr("x",0).attr("dy",(function(e,n){return t.tspanDy(e,n)})).attr("dx",(function(e,n){return t.tspanDx(e,n)})),w.attr("d","M"+t.range[0]+","+t.outerTickSize+"V0H"+t.range[1]+"V"+t.outerTickSize);break;case"top":i=t.axisX,_.attr("x1",s).attr("x2",s).attr("y2",(function(e,n){return-1*t.lineY2(e,n)})),x.attr("x",0).attr("y",(function(e,r){return-1*t.textY(e,r)-(n.isCategory?2:t.tickLength-2)})).attr("transform",(function(e,n){return t.textTransform(e,n)})).style("text-anchor",(function(e,n){return t.textTextAnchor(e,n)})),m.attr("x",0).attr("dy",(function(e,n){return t.tspanDy(e,n)})).attr("dx",(function(e,n){return t.tspanDx(e,n)})),w.attr("d","M"+t.range[0]+","+-t.outerTickSize+"V0H"+t.range[1]+"V"+-t.outerTickSize);break;case"left":i=t.axisY,_.attr("x2",-t.innerTickSize).attr("y1",u).attr("y2",u),x.attr("x",-t.tickLength).attr("y",t.tickOffset).style("text-anchor","end"),m.attr("x",-t.tickLength).attr("dy",(function(e,n){return t.tspanDy(e,n)})),w.attr("d","M"+-t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+-t.outerTickSize);break;case"right":i=t.axisY,_.attr("x2",t.innerTickSize).attr("y1",u).attr("y2",u),x.attr("x",t.tickLength).attr("y",t.tickOffset).style("text-anchor","start"),m.attr("x",t.tickLength).attr("dy",(function(e,n){return t.tspanDy(e,n)})),w.attr("d","M"+t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+t.outerTickSize)}if(f.rangeBand){var S=f,A=S.rangeBand()/2;l=f=function(t){return S(t)+A}}else l.rangeBand?l=f:g.call(i,f,t.tickOffset);p.call(i,l,t.tickOffset),o=(a?y.transition(a):y).style("opacity",1).call(i,f,t.tickOffset)})),o}return r.scale=function(e){return arguments.length?(t.scale=e,r):t.scale},r.orient=function(e){return arguments.length?(t.orient=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",r):t.orient},r.tickFormat=function(e){return arguments.length?(t.tickFormat=e,r):t.tickFormat},r.tickCentered=function(e){return arguments.length?(t.tickCentered=e,r):t.tickCentered},r.tickOffset=function(){return t.tickOffset},r.tickInterval=function(){var e;return(e=n.isCategory?2*t.tickOffset:(r.g.select("path.domain").node().getTotalLength()-2*t.outerTickSize)/r.g.selectAll("line").size())==1/0?0:e},r.ticks=function(){return arguments.length?(t.tickArguments=arguments,r):t.tickArguments},r.tickCulling=function(e){return arguments.length?(t.tickCulling=e,r):t.tickCulling},r.tickValues=function(e){if("function"==typeof e)t.tickValues=function(){return e(t.scale.domain())};else{if(!arguments.length)return t.tickValues;t.tickValues=e}return r},r};var b={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",dragZoom:"c3-drag-zoom",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcLabelLine:"c3-arc-label-line",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",colorScale:"c3-colorscale",stanfordElements:"c3-stanford-elements",stanfordLine:"c3-stanford-line",stanfordLines:"c3-stanford-lines",stanfordRegion:"c3-stanford-region",stanfordRegions:"c3-stanford-regions",stanfordText:"c3-stanford-text",stanfordTexts:"c3-stanford-texts",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},w=function(t){this.owner=t,this.d3=t.d3,this.internal=m},S=w;S.prototype.init=function(){var t=this.owner,e=t.config,n=t.main;t.axes.x=n.append("g").attr("class",b.axis+" "+b.axisX).attr("clip-path",e.axis_x_inner?"":t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",b.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=n.append("g").attr("class",b.axis+" "+b.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",b.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=n.append("g").attr("class",b.axis+" "+b.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",b.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},S.prototype.getXAxis=function(t,e,n,r,i,a,o){var s=this.owner,u=s.config,c={isCategory:s.isCategorized(),withOuterTick:i,tickMultiline:u.axis_x_tick_multiline,tickMultilineMax:u.axis_x_tick_multiline?Number(u.axis_x_tick_multilineMax):0,tickWidth:u.axis_x_tick_width,tickTextRotate:o?0:u.axis_x_tick_rotate,withoutTransition:a},l=new this.internal(this,c).axis.scale(t).orient(e);return s.isTimeSeries()&&r&&"function"!=typeof r&&(r=r.map((function(t){return s.parseDate(t)}))),l.tickFormat(n).tickValues(r),s.isCategorized()&&(l.tickCentered(u.axis_x_tick_centered),f(u.axis_x_tick_culling)&&(u.axis_x_tick_culling=!1)),l},S.prototype.updateXAxisTickValues=function(t,e){var n,r=this.owner,i=r.config;return(i.axis_x_tick_fit||i.axis_x_tick_count)&&(n=this.generateTickValues(r.mapTargetsToUniqueXs(t),i.axis_x_tick_count,r.isTimeSeries())),e?e.tickValues(n):(r.xAxis.tickValues(n),r.subXAxis.tickValues(n)),n},S.prototype.getYAxis=function(t,e,n,r,i,a,o){var s=this.owner,u=s.config,c=u["axis_"+t+"_tick_format"];!c&&s.isAxisNormalized(t)&&(c=function(t){return t+"%"});var l=new this.internal(this,{withOuterTick:i,withoutTransition:a,tickTextRotate:o?0:u.axis_y_tick_rotate}).axis.scale(e).orient(n);return c&&l.tickFormat(c),s.isTimeSeriesY()?l.ticks(u.axis_y_tick_time_type,u.axis_y_tick_time_interval):l.tickValues(r),l},S.prototype.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},S.prototype.getXAxisTickFormat=function(){var t=this.owner,e=t.config,n=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t};return e.axis_x_tick_format&&(h(e.axis_x_tick_format)?n=e.axis_x_tick_format:t.isTimeSeries()&&(n=function(n){return n?t.axisTimeFormat(e.axis_x_tick_format)(n):""})),h(n)?function(e){return n.call(t,e)}:n},S.prototype.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},S.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},S.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},S.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},S.prototype.getLabelOptionByAxisId=function(t){var e,n=this.owner.config;return"y"===t?e=n.axis_y_label:"y2"===t?e=n.axis_y2_label:"x"===t&&(e=n.axis_x_label),e},S.prototype.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return p(e)?e:e?e.text:null},S.prototype.setLabelText=function(t,e){var n=this.owner.config,r=this.getLabelOptionByAxisId(t);p(r)?"y"===t?n.axis_y_label=e:"y2"===t?n.axis_y2_label=e:"x"===t&&(n.axis_x_label=e):r&&(r.text=e)},S.prototype.getLabelPosition=function(t,e){var n=this.getLabelOptionByAxisId(t),r=n&&"object"==typeof n&&n.position?n.position:e;return{isInner:r.indexOf("inner")>=0,isOuter:r.indexOf("outer")>=0,isLeft:r.indexOf("left")>=0,isCenter:r.indexOf("center")>=0,isRight:r.indexOf("right")>=0,isTop:r.indexOf("top")>=0,isMiddle:r.indexOf("middle")>=0,isBottom:r.indexOf("bottom")>=0}},S.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},S.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},S.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},S.prototype.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},S.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},S.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},S.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},S.prototype.xForAxisLabel=function(t,e){var n=this.owner;return t?e.isLeft?0:e.isCenter?n.width/2:n.width:e.isBottom?-n.height:e.isMiddle?-n.height/2:0},S.prototype.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},S.prototype.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},S.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},S.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},S.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},S.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},S.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},S.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},S.prototype.dyForXAxisLabel=function(){var t=this.owner,e=t.config,n=this.getXAxisLabelPosition();return e.axis_rotated?n.isInner?"1.2em":-25-(t.config.axis_x_inner?0:this.getMaxTickWidth("x")):n.isInner?"-0.5em":t.getHorizontalAxisHeight("x")-10},S.prototype.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},S.prototype.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},S.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},S.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},S.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},S.prototype.getMaxTickWidth=function(t,e){var n,r,i,a,o=this.owner,s=0;return e&&o.currentMaxTickWidths[t]||(o.svg&&(n=o.filterTargetsToShow(o.data.targets),"y"===t?(r=o.y.copy().domain(o.getYDomain(n,"y")),i=this.getYAxis(t,r,o.yOrient,o.yAxisTickValues,!1,!0,!0)):"y2"===t?(r=o.y2.copy().domain(o.getYDomain(n,"y2")),i=this.getYAxis(t,r,o.y2Orient,o.y2AxisTickValues,!1,!0,!0)):(r=o.x.copy().domain(o.getXDomain(n)),i=this.getXAxis(r,o.xOrient,o.xAxisTickFormat,o.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(n,i)),(a=o.d3.select("body").append("div").classed("c3",!0)).append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0).append("g").call(i).each((function(){o.d3.select(this).selectAll("text").each((function(){var t=u(this);s2){for(o=r-2,i=t[0],s=((a=t[t.length-1])-i)/(o+1),l=[i],u=0;u=0&&N.select(this).style("display",e%k?"none":"block")}))}else R.svg.selectAll("."+b.axisX+" .tick text").style("display","block");y=R.generateDrawArea?R.generateDrawArea(z,!1):void 0,_=R.generateDrawBar?R.generateDrawBar(F):void 0,x=R.generateDrawLine?R.generateDrawLine(B,!1):void 0,v=R.generateXYForText(z,F,B,!0),m=R.generateXYForText(z,F,B,!1),R.updateCircleY(),G=(R.config.axis_rotated?R.circleY:R.circleX).bind(R),V=(R.config.axis_rotated?R.circleX:R.circleY).bind(R),n&&(R.subY.domain(R.getYDomain(j,"y")),R.subY2.domain(R.getYDomain(j,"y2"))),R.updateXgridFocus(),I.select("text."+b.text+"."+b.empty).attr("x",R.width/2).attr("y",R.height/2).text(D.data_empty_label_text).transition().style("opacity",j.length?0:1),d&&R.redrawEventRect(),R.updateGrid(w),R.updateStanfordElements(w),R.updateRegion(w),R.updateBar(S),R.updateLine(S),R.updateArea(S),R.updateCircle(G,V),R.hasDataLabel()&&R.updateText(v,m,S),R.redrawTitle&&R.redrawTitle(),R.redrawArc&&R.redrawArc(w,S,u),D.subchart_show&&R.redrawSubchart&&R.redrawSubchart(r,e,w,S,z,F,B),R.isStanfordGraphType()&&R.drawColorScale(),I.selectAll("."+b.selectedCircles).filter(R.isBarType.bind(R)).selectAll("circle").remove(),t.flow&&(P=R.generateFlow({targets:j,flow:t.flow,duration:t.flow.duration,drawBar:_,drawLine:x,drawArea:y,cx:G,cy:V,xv:H,xForText:v,yForText:m})),w&&R.isTabVisible()?(M=N.transition().duration(w),T=[],[R.redrawBar(_,!0,M),R.redrawLine(x,!0,M),R.redrawArea(y,!0,M),R.redrawCircle(G,V,!0,M),R.redrawText(v,m,t.flow,!0,M),R.redrawRegion(!0,M),R.redrawGrid(!0,M)].forEach((function(t){t.forEach((function(t){T.push(t)}))})),C=R.generateWait(),T.forEach((function(t){C.add(t)})),C((function(){P&&P(),D.onrendered&&D.onrendered.call(R)}))):(R.redrawBar(_),R.redrawLine(x),R.redrawArea(y),R.redrawCircle(G,V),R.redrawText(v,m,t.flow),R.redrawRegion(),R.redrawGrid(),P&&P(),D.onrendered&&D.onrendered.call(R)),R.mapToIds(R.data.targets).forEach((function(t){R.withoutFadeIn[t]=!0}))},t.prototype.updateAndRedraw=function(t){var e,n=this,r=n.config;(t=t||{}).withTransition=o(t,"withTransition",!0),t.withTransform=o(t,"withTransform",!1),t.withLegend=o(t,"withLegend",!1),t.withUpdateXDomain=o(t,"withUpdateXDomain",!0),t.withUpdateOrgXDomain=o(t,"withUpdateOrgXDomain",!0),t.withTransitionForExit=!1,t.withTransitionForTransform=o(t,"withTransitionForTransform",t.withTransition),n.updateSizes(),t.withLegend&&r.legend_show||(e=n.axis.generateTransitions(t.withTransitionForAxis?r.transition_duration:0),n.updateScales(),n.updateSvgSize(),n.transformAll(t.withTransitionForTransform,e)),n.redraw(t,e)},t.prototype.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},t.prototype.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},t.prototype.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},t.prototype.isCustomX=function(){var t=this.config;return!this.isTimeSeries()&&(t.data_x||_(t.data_xs))},t.prototype.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},t.prototype.getTranslate=function(t){var e,n,i=this,a=i.config;return"main"===t?(e=r(i.margin.left),n=r(i.margin.top)):"context"===t?(e=r(i.margin2.left),n=r(i.margin2.top)):"legend"===t?(e=i.margin3.left,n=i.margin3.top):"x"===t?(e=0,n=a.axis_rotated?0:i.height):"y"===t?(e=0,n=a.axis_rotated?i.height:0):"y2"===t?(e=a.axis_rotated?0:i.width,n=a.axis_rotated?1:0):"subx"===t?(e=0,n=a.axis_rotated?0:i.height2):"arc"===t&&(e=i.arcWidth/2,n=i.arcHeight/2-(i.hasType("gauge")?6:0)),"translate("+e+","+n+")"},t.prototype.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?1:0},t.prototype.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):0},t.prototype.opacityForCircle=function(t){var e=(h(this.config.point_show)?this.config.point_show(t):this.config.point_show)||this.isStanfordType(t)?1:0;return y(t.value)?this.isScatterType(t)?.5:e:0},t.prototype.opacityForText=function(){return this.hasDataLabel()?1:0},t.prototype.xx=function(t){return t?this.x(t.x):null},t.prototype.xvCustom=function(t,e){var n=this,r=e?t[e]:t.value;return n.isTimeSeries()?r=n.parseDate(t.value):n.isCategorized()&&"string"==typeof t.value&&(r=n.config.axis_x_categories.indexOf(t.value)),Math.ceil(n.x(r))},t.prototype.yvCustom=function(t,e){var n=t.axis&&"y2"===t.axis?this.y2:this.y,r=e?t[e]:t.value;return Math.ceil(n(r))},t.prototype.xv=function(t){var e=this,n=t.value;return e.isTimeSeries()?n=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(n=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(n))},t.prototype.yv=function(t){var e=t.axis&&"y2"===t.axis?this.y2:this.y;return Math.ceil(e(t.value))},t.prototype.subxx=function(t){return t?this.subX(t.x):null},t.prototype.transformMain=function(t,e){var n,r,i,a=this;e&&e.axisX?n=e.axisX:(n=a.main.select("."+b.axisX),t&&(n=n.transition())),e&&e.axisY?r=e.axisY:(r=a.main.select("."+b.axisY),t&&(r=r.transition())),e&&e.axisY2?i=e.axisY2:(i=a.main.select("."+b.axisY2),t&&(i=i.transition())),(t?a.main.transition():a.main).attr("transform",a.getTranslate("main")),n.attr("transform",a.getTranslate("x")),r.attr("transform",a.getTranslate("y")),i.attr("transform",a.getTranslate("y2")),a.main.select("."+b.chartArcs).attr("transform",a.getTranslate("arc"))},t.prototype.transformAll=function(t,e){var n=this;n.transformMain(t,e),n.config.subchart_show&&n.transformContext(t,e),n.legend&&n.transformLegend(t)},t.prototype.updateSvgSize=function(){var t=this,e=t.svg.select("."+b.brush+" .overlay");t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+t.clipIdForXAxis).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForYAxis).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",e.size()&&e.attr("height")||0),t.selectChart.style("max-height",t.currentHeight+"px")},t.prototype.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(),e.updateSvgSize(),e.transformAll(!1)},t.prototype.observeInserted=function(t){var e,n=this;"undefined"!=typeof MutationObserver?(e=new MutationObserver((function(r){r.forEach((function(r){"childList"===r.type&&r.previousSibling&&(e.disconnect(),n.intervalForObserveInserted=window.setInterval((function(){t.node().parentNode&&(window.clearInterval(n.intervalForObserveInserted),n.updateDimension(),n.brush&&n.brush.update(),n.config.oninit.call(n),n.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))}),10))}))}))).observe(t.node(),{attributes:!0,childList:!0,characterData:!0}):window.console.error("MutationObserver not defined.")},t.prototype.bindResize=function(){var t=this,e=t.config;t.resizeFunction=t.generateResize(),t.resizeFunction.add((function(){e.onresize.call(t)})),e.resize_auto&&t.resizeFunction.add((function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout((function(){delete t.resizeTimeout,t.updateAndRedraw({withUpdateXDomain:!1,withUpdateOrgXDomain:!1,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.brush&&t.brush.update()}),100)})),t.resizeFunction.add((function(){e.onresized.call(t)})),t.resizeIfElementDisplayed=function(){null!=t.api&&t.api.element.offsetParent&&t.resizeFunction()},window.addEventListener("resize",t.resizeIfElementDisplayed,!1)},t.prototype.bindWindowFocus=function(){var t=this;this.windowFocusHandler||(this.windowFocusHandler=function(){t.redraw()},window.addEventListener("focus",this.windowFocusHandler))},t.prototype.unbindWindowFocus=function(){window.removeEventListener("focus",this.windowFocusHandler),delete this.windowFocusHandler},t.prototype.generateResize=function(){var t=[];function e(){t.forEach((function(t){t()}))}return e.add=function(e){t.push(e)},e.remove=function(e){for(var n=0;ne.getTotalLength())break;n--}while(n>0);return n})),"SVGPathSegList"in window||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(this._pathElement){var e=!1;t.forEach((function(t){"d"==t.attributeName&&(e=!0)})),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(t){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach((function(t){t._owningPathSegList=null})),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){var e="",n=!0;return t.forEach((function(t){n?(n=!1,e+=t._asPathString()):e+=" "+t._asPathString()})),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t||0==t.length)return[];var e=this,n=function(){this.pathSegList=[]};n.prototype.appendSegment=function(t){this.pathSegList.push(t)};var r=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};r.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},r.prototype._skipOptionalSpaces=function(){for(;this._currentIndex="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},r.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},r.prototype._parseNumber=function(){var t=0,e=0,n=1,r=0,i=1,a=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex"9")&&"."!=this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=s)for(var u=this._currentIndex-1,c=1;u>=s;)e+=c*(this._string.charAt(u--)-"0"),c*=10;if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,r+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!=o&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var l=e+r;if(l*=i,t&&(l*=Math.pow(10,a*t)),o!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),l}},r.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}},r.prototype.parseSegment=function(){var t=this._string[this._currentIndex],n=this._pathSegTypeFromChar(t);if(n==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(e,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(e,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return r={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(e,r.x,r.y,r.x2,r.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return r={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(e,r.x,r.y,r.x2,r.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return r={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(e,r.x,r.y,r.x1,r.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return r={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(e,r.x,r.y,r.x1,r.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return r={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(e,r.x,r.y,r.x1,r.y1,r.arcAngle,r.arcLarge,r.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return r={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(e,r.x,r.y,r.x1,r.y1,r.arcAngle,r.arcLarge,r.arcSweep);default:throw"Unknown path seg type."}};var i=new n,a=new r(t);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){var o=a.parseSegment();if(!o)return[];i.appendSegment(o)}return i.pathSegList}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r1&&(r.axis_x_categories[t]=e,n.redraw()),r.axis_x_categories[t]},e.prototype.categories=function(t){var e=this.internal,n=e.config;return arguments.length?(n.axis_x_categories=t,e.redraw(),n.axis_x_categories):n.axis_x_categories},e.prototype.resize=function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},e.prototype.flush=function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},e.prototype.destroy=function(){var t=this.internal;return window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),window.removeEventListener("resize",t.resizeIfElementDisplayed),t.resizeFunction.remove(),t.unbindWindowFocus(),t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach((function(e){t[e]=null})),null},e.prototype.color=function(t){return this.internal.color(t)},e.prototype.data=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter((function(e){return[].concat(t).indexOf(e.id)>=0}))},e.prototype.data.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},e.prototype.data.values=function(t,e){void 0===e&&(e=!0);var n=null;if(t){var r=this.data(t);r&&c(r)&&(n=r.reduce((function(t,n){var r=n.values.map((function(t){return t.value}));return e?t=t.concat(r):t.push(r),t}),[]))}return n},e.prototype.data.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},e.prototype.data.colors=function(t){return this.internal.updateDataAttributes("colors",t)},e.prototype.data.axes=function(t){return this.internal.updateDataAttributes("axes",t)},e.prototype.data.stackNormalized=function(t){if(void 0===t)return this.internal.isStackNormalized();this.internal.config.data_stack_normalize=!!t,this.internal.redraw()},e.prototype.donut=function(){},e.prototype.donut.padAngle=function(t){if(void 0===t)return this.internal.config.donut_padAngle;this.internal.config.donut_padAngle=t,this.flush()},e.prototype.flow=function(t){var e,n,r,i,a,o,s,u=this.internal,c=[],f=u.getMaxDataCount(),h=0,d=0;if(t.json)n=u.convertJsonToData(t.json,t.keys);else if(t.rows)n=u.convertRowsToData(t.rows);else{if(!t.columns)return;n=u.convertColumnsToData(t.columns)}e=u.convertDataToTargets(n,!0),u.data.targets.forEach((function(t){var n,r,i=!1;for(n=0;n1?i.values[i.values.length-1].x-a.x:a.x-u.getXDomain(u.data.targets)[0]:1,r=[a.x-o,a.x],u.updateXDomain(null,!0,!0,!1,r)),u.updateTargets(u.data.targets),u.redraw({flow:{index:a.index,length:h,duration:y(t.duration)?t.duration:u.config.transition_duration,done:t.done,orgDataCount:f},withLegend:!0,withTransition:f>1,withTrimXDomain:!1,withUpdateXAxis:!0})},t.prototype.generateFlow=function(t){var e=this,n=e.config,r=e.d3;return function(){var i,o,s,u,c,l,f,h,d,p,g,y=t.targets,_=t.flow,x=t.drawBar,v=t.drawLine,m=t.drawArea,w=t.cx,S=t.cy,A=t.xv,T=t.xForText,C=t.yForText,P=t.duration,M=_.index,E=_.length,L=e.getValueOnIndex(e.data.targets[0].values,M),k=e.getValueOnIndex(e.data.targets[0].values,M+E),O=e.x.domain(),G=_.duration||P,V=_.done||function(){},R=e.generateWait();e.flowing=!0,e.data.targets.forEach((function(t){t.values.splice(0,E)})),s=e.updateXDomain(y,!0,!0),e.updateXGrid&&e.updateXGrid(!0),u=e.xgrid||r.selectAll([]),c=e.xgridLines||r.selectAll([]),l=e.mainRegion||r.selectAll([]),f=e.mainText||r.selectAll([]),h=e.mainBar||r.selectAll([]),d=e.mainLine||r.selectAll([]),p=e.mainArea||r.selectAll([]),g=e.mainCircle||r.selectAll([]),_.orgDataCount?i=1===_.orgDataCount||(L&&L.x)===(k&&k.x)||e.isTimeSeries()?e.x(O[0])-e.x(s[0]):e.x(L.x)-e.x(k.x):1!==e.data.targets[0].values.length?i=e.x(O[0])-e.x(s[0]):e.isTimeSeries()?(L=e.getValueOnIndex(e.data.targets[0].values,0),k=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),i=e.x(L.x)-e.x(k.x)):i=a(s)/2,o="translate("+i+",0) scale("+a(O)/a(s)+",1)",e.hideXGridFocus();var I=r.transition().ease(r.easeLinear).duration(G);R.add(e.xAxis(e.axes.x,I)),R.add(h.transition(I).attr("transform",o)),R.add(d.transition(I).attr("transform",o)),R.add(p.transition(I).attr("transform",o)),R.add(g.transition(I).attr("transform",o)),R.add(f.transition(I).attr("transform",o)),R.add(l.filter(e.isRegionOnX).transition(I).attr("transform",o)),R.add(u.transition(I).attr("transform",o)),R.add(c.transition(I).attr("transform",o)),R((function(){var t,r=[],i=[];if(E){for(t=0;t=0&&(e=!0)})),!e)})),a.regions},e.prototype.selected=function(t){var e=this.internal,n=e.d3;return e.main.selectAll("."+b.shapes+e.getTargetSelectorSuffix(t)).selectAll("."+b.shape).filter((function(){return n.select(this).classed(b.SELECTED)})).nodes().map((function(t){var e=t.__data__;return e.data?e.data:e}))},e.prototype.select=function(t,e,n){var r=this.internal,i=r.d3,a=r.config;a.data_selection_enabled&&r.main.selectAll("."+b.shapes).selectAll("."+b.shape).each((function(o,s){var u=i.select(this),c=o.data?o.data.id:o.id,f=r.getToggle(this,o).bind(r),h=a.data_selection_grouped||!t||t.indexOf(c)>=0,d=!e||e.indexOf(s)>=0,p=u.classed(b.SELECTED);u.classed(b.line)||u.classed(b.area)||(h&&d?a.data_selection_isselectable(o)&&!p&&f(!0,u.classed(b.SELECTED,!0),o,s):l(n)&&n&&p&&f(!1,u.classed(b.SELECTED,!1),o,s))}))},e.prototype.unselect=function(t,e){var n=this.internal,r=n.d3,i=n.config;i.data_selection_enabled&&n.main.selectAll("."+b.shapes).selectAll("."+b.shape).each((function(a,o){var s=r.select(this),u=a.data?a.data.id:a.id,c=n.getToggle(this,a).bind(n),l=i.data_selection_grouped||!t||t.indexOf(u)>=0,f=!e||e.indexOf(o)>=0,h=s.classed(b.SELECTED);s.classed(b.line)||s.classed(b.area)||l&&f&&i.data_selection_isselectable(a)&&h&&c(!1,s.classed(b.SELECTED,!1),a,o)}))},e.prototype.show=function(t,e){var n,r=this.internal;t=r.mapToTargetIds(t),e=e||{},r.removeHiddenTargetIds(t),(n=r.svg.selectAll(r.selectorTargets(t))).transition().style("display",v()?"block":"initial","important").style("opacity",1,"important").call(r.endall,(function(){n.style("opacity",null).style("opacity",1)})),e.withLegend&&r.showLegend(t),r.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.prototype.hide=function(t,e){var n,r=this.internal;t=r.mapToTargetIds(t),e=e||{},r.addHiddenTargetIds(t),(n=r.svg.selectAll(r.selectorTargets(t))).transition().style("opacity",0,"important").call(r.endall,(function(){n.style("opacity",null).style("opacity",0),n.style("display","none")})),e.withLegend&&r.hideLegend(t),r.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.prototype.toggle=function(t,e){var n=this,r=this.internal;r.mapToTargetIds(t).forEach((function(t){r.isTargetToShow(t)?n.hide(t,e):n.show(t,e)}))},e.prototype.subchart=function(){},e.prototype.subchart.isShown=function(){return this.internal.config.subchart_show},e.prototype.subchart.show=function(){var t=this.internal;t.config.subchart_show||(t.config.subchart_show=!0,t.initSubchart(),t.updateDimension(),t.initSubchartBrush(),t.updateTargetsForSubchart(t.getTargets()),t.mapToIds(t.data.targets).forEach((function(e){t.withoutFadeIn[e]=!1})),t.updateAndRedraw(),t.showTargets())},e.prototype.subchart.hide=function(){var t=this.internal;t.config.subchart_show&&(t.config.subchart_show=!1,t.removeSubchart(),t.redraw())},e.prototype.tooltip=function(){},e.prototype.tooltip.show=function(t){var e,n,r=this.internal,i={};t.mouse?i=t.mouse:(t.data?n=t.data:void 0!==t.x&&(e=t.id?r.data.targets.filter((function(e){return e.id===t.id})):r.data.targets,n=r.filterByX(e,t.x).slice(0,1)[0]),i=n?r.getMousePosition(n):null),r.dispatchEvent("mousemove",i),r.config.tooltip_onshow.call(r,n)},e.prototype.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},e.prototype.transform=function(t,e){var n=this.internal,r=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;n.transformTo(e,t,r)},t.prototype.transformTo=function(t,e,n){var r=this,i=!r.hasArcType(),a=n||{withTransitionForAxis:i};a.withTransitionForTransform=!1,r.transiting=!1,r.setTargetType(t,e),r.updateTargets(r.data.targets),r.updateAndRedraw(a)},e.prototype.x=function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},e.prototype.xs=function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},e.prototype.zoom=function(t){var e=this.internal;return t?(e.isTimeSeries()&&(t=t.map((function(t){return e.parseDate(t)}))),e.config.subchart_show?e.brush.selectionAsValue(t,!0):(e.updateXDomain(null,!0,!1,!1,t),e.redraw({withY:e.config.zoom_rescale,withSubchart:!1})),e.config.zoom_onzoom.call(this,e.x.orgDomain()),t):e.x.domain()},e.prototype.zoom.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},e.prototype.unzoom=function(){var t=this.internal;t.config.subchart_show?t.brush.clear():(t.updateXDomain(null,!0,!1,!1,t.subX.domain()),t.redraw({withY:t.config.zoom_rescale,withSubchart:!1}))},e.prototype.zoom.max=function(t){var e=this.internal,n=e.config,r=e.d3;if(0!==t&&!t)return n.zoom_x_max;n.zoom_x_max=r.max([e.orgXDomain[1],t])},e.prototype.zoom.min=function(t){var e=this.internal,n=e.config,r=e.d3;if(0!==t&&!t)return n.zoom_x_min;n.zoom_x_min=r.min([e.orgXDomain[0],t])},e.prototype.zoom.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};l(t.max)&&this.domain.max(t.max),l(t.min)&&this.domain.min(t.min)},t.prototype.initPie=function(){var t=this,e=t.d3;t.pie=e.pie().padAngle(this.getPadAngle.bind(this)).value((function(t){return t.values.reduce((function(t,e){return t+e.value}),0)}));var n=t.getOrderFunction();if(n&&(t.isOrderAsc()||t.isOrderDesc())){var r=n;n=function(t,e){return-1*r(t,e)}}t.pie.sort(n||null)},t.prototype.updateRadius=function(){var t=this,e=t.config,n=e.gauge_width||e.donut_width,r=t.filterTargetsToShow(t.data.targets).length*t.config.gauge_arcs_minWidth;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2*(t.hasType("gauge")?.85:1),t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=n?(t.radius-n)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0,t.gaugeArcWidth=n||(r<=t.radius-t.innerRadius?t.radius-t.innerRadius:r<=t.radius?r:t.radius)},t.prototype.getPadAngle=function(){return this.hasType("pie")?this.config.pie_padAngle||0:this.hasType("donut")&&this.config.donut_padAngle||0},t.prototype.updateArc=function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},t.prototype.updateAngle=function(t){var e,n,r,i,a=this,o=a.config,s=!1,u=0;return o?(a.pie(a.filterTargetsToShow(a.data.targets)).forEach((function(e){s||e.data.id!==t.data.id||(s=!0,(t=e).index=u),u++})),isNaN(t.startAngle)&&(t.startAngle=0),isNaN(t.endAngle)&&(t.endAngle=t.startAngle),a.isGaugeType(t.data)&&(e=o.gauge_min,n=o.gauge_max,r=Math.PI*(o.gauge_fullCircle?2:1)/(n-e),i=t.value.375?1.175-36/o.radius:.8)*o.radius/i:0)+","+r*a+")";else if(u&&l&&o.filterTargetsToShow(o.data.targets).length>1){var f=Math.sin(u.endAngle-Math.PI/2);c="translate("+(n=Math.cos(u.endAngle-Math.PI/2)*(o.radiusExpanded+25))+","+(r=f*(o.radiusExpanded+15-Math.abs(10*f))+3)+")"}return c},t.prototype.getArcRatio=function(t){return this.getRatio("arc",t)},t.prototype.convertToArcData=function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},t.prototype.textForArcLabel=function(t){var e,n,r,i,a,o=this;return o.shouldShowArcLabel()?(n=(e=o.updateAngle(t))?e.value:null,r=o.getRatio("arc",e),i=t.data.id,o.hasType("gauge")||o.meetsArcLabelThreshold(r)?(a=o.getArcLabelFormat())?a(n,r,i):o.defaultArcValueFormat(n,r):""):""},t.prototype.textForGaugeMinMax=function(t,e){var n=this.getGaugeLabelExtents();return n?n(t,e):t},t.prototype.expandArc=function(t){var e,n=this;n.transiting?e=window.setInterval((function(){n.transiting||(window.clearInterval(e),n.legend.selectAll(".c3-legend-item-focused").size()>0&&n.expandArc(t))}),10):(t=n.mapToTargetIds(t),n.svg.selectAll(n.selectorTargets(t,"."+b.chartArc)).each((function(t){n.shouldExpand(t.data.id)&&n.d3.select(this).selectAll("path").transition().duration(n.expandDuration(t.data.id)).attr("d",n.svgArcExpanded).transition().duration(2*n.expandDuration(t.data.id)).attr("d",n.svgArcExpandedSub).each((function(t){n.isDonutType(t.data)}))})))},t.prototype.unexpandArc=function(t){var e=this;e.transiting||(t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t,"."+b.chartArc)).selectAll("path").transition().duration((function(t){return e.expandDuration(t.data.id)})).attr("d",e.svgArc),e.svg.selectAll("."+b.arc))},t.prototype.expandDuration=function(t){var e=this.config;return this.isDonutType(t)?e.donut_expand_duration:this.isGaugeType(t)?e.gauge_expand_duration:this.isPieType(t)?e.pie_expand_duration:50},t.prototype.shouldExpand=function(t){var e=this.config;return this.isDonutType(t)&&e.donut_expand||this.isGaugeType(t)&&e.gauge_expand||this.isPieType(t)&&e.pie_expand},t.prototype.shouldShowArcLabel=function(){var t=this.config,e=!0;return this.hasType("donut")?e=t.donut_label_show:this.hasType("pie")&&(e=t.pie_label_show),e},t.prototype.meetsArcLabelThreshold=function(t){var e=this.config;return t>=(this.hasType("donut")?e.donut_label_threshold:e.pie_label_threshold)},t.prototype.getArcLabelFormat=function(){var t=this.config,e=t.pie_label_format;return this.hasType("gauge")?e=t.gauge_label_format:this.hasType("donut")&&(e=t.donut_label_format),e},t.prototype.getGaugeLabelExtents=function(){return this.config.gauge_label_extents},t.prototype.getArcTitle=function(){return this.hasType("donut")?this.config.donut_title:""},t.prototype.updateTargetsForArc=function(t){var e,n=this,r=n.main,i=n.classChartArc.bind(n),a=n.classArcs.bind(n),o=n.classFocus.bind(n);(e=r.select("."+b.chartArcs).selectAll("."+b.chartArc).data(n.pie(t)).attr("class",(function(t){return i(t)+o(t.data)})).enter().append("g").attr("class",i)).append("g").attr("class",a),e.append("text").attr("dy",n.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},t.prototype.initArc=function(){var t=this;t.arcs=t.main.select("."+b.chart).append("g").attr("class",b.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",b.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},t.prototype.redrawArc=function(t,e,n){var r,i,a,o,s=this,u=s.d3,c=s.config,l=s.main,f=s.hasType("gauge");if(i=(r=l.selectAll("."+b.arcs).selectAll("."+b.arc).data(s.arcData.bind(s))).enter().append("path").attr("class",s.classArc.bind(s)).style("fill",(function(t){return s.color(t.data)})).style("cursor",(function(t){return c.interaction_enabled&&c.data_selection_isselectable(t)?"pointer":null})).each((function(t){s.isGaugeType(t.data)&&(t.startAngle=t.endAngle=c.gauge_startingAngle),this._current=t})).merge(r),f&&(o=(a=l.selectAll("."+b.arcs).selectAll("."+b.arcLabelLine).data(s.arcData.bind(s))).enter().append("rect").attr("class",(function(t){return b.arcLabelLine+" "+b.target+" "+b.target+"-"+t.data.id})).merge(a),1===s.filterTargetsToShow(s.data.targets).length?o.style("display","none"):o.style("fill",(function(t){return s.levelColor?s.levelColor(t.data.values.reduce((function(t,e){return t+e.value}),0)):s.color(t.data)})).style("display",c.gauge_labelLine_show?"":"none").each((function(t){var e=0,n=0,r=0,i="";if(s.hiddenTargetIds.indexOf(t.data.id)<0){var a=s.updateAngle(t),o=s.gaugeArcWidth/s.filterTargetsToShow(s.data.targets).length*(a.index+1),c=a.endAngle-Math.PI/2,l=s.radius-o,f=c-(0===l?0:1/l);e=s.radiusExpanded-s.radius+o,n=Math.cos(f)*l,r=Math.sin(f)*l,i="rotate("+180*c/Math.PI+", "+n+", "+r+")"}u.select(this).attr("x",n).attr("y",r).attr("width",e).attr("height",2).attr("transform",i).style("stroke-dasharray","0, "+(e+2)+", 0")}))),i.attr("transform",(function(t){return!s.isGaugeType(t.data)&&n?"scale(0)":""})).on("mouseover",c.interaction_enabled?function(t){var e,n;s.transiting||(e=s.updateAngle(t))&&(n=s.convertToArcData(e),s.expandArc(e.data.id),s.api.focus(e.data.id),s.toggleFocusLegend(e.data.id,!0),s.config.data_onmouseover(n,this))}:null).on("mousemove",c.interaction_enabled?function(t){var e,n=s.updateAngle(t);n&&(e=[s.convertToArcData(n)],s.showTooltip(e,this))}:null).on("mouseout",c.interaction_enabled?function(t){var e,n;s.transiting||(e=s.updateAngle(t))&&(n=s.convertToArcData(e),s.unexpandArc(e.data.id),s.api.revert(),s.revertLegend(),s.hideTooltip(),s.config.data_onmouseout(n,this))}:null).on("click",c.interaction_enabled?function(t,e){var n,r=s.updateAngle(t);r&&(n=s.convertToArcData(r),s.toggleShape&&s.toggleShape(this,n,e),s.config.data_onclick.call(s.api,n,this))}:null).each((function(){s.transiting=!0})).transition().duration(t).attrTween("d",(function(t){var e,n=s.updateAngle(t);return n?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),e=u.interpolate(this._current,n),this._current=e(0),function(n){if(null===s.config)return"M 0 0";var r=e(n);return r.data=t.data,s.getArc(r,!0)}):function(){return"M 0 0"}})).attr("transform",n?"scale(1)":"").style("fill",(function(t){return s.levelColor?s.levelColor(t.data.values.reduce((function(t,e){return t+e.value}),0)):s.color(t.data.id)})).call(s.endall,(function(){s.transiting=!1})),r.exit().transition().duration(e).style("opacity",0).remove(),l.selectAll("."+b.chartArc).select("text").style("opacity",0).attr("class",(function(t){return s.isGaugeType(t.data)?b.gaugeValue:""})).text(s.textForArcLabel.bind(s)).attr("transform",s.transformForArcLabel.bind(s)).style("font-size",(function(t){return s.isGaugeType(t.data)&&1===s.filterTargetsToShow(s.data.targets).length?Math.round(s.radius/5)+"px":""})).transition().duration(t).style("opacity",(function(t){return s.isTargetToShow(t.data.id)&&s.isArcType(t.data)?1:0})),l.select("."+b.chartArcsTitle).style("opacity",s.hasType("donut")||f?1:0),f){var h=0,d=s.arcs.select("g."+b.chartArcsBackground).selectAll("path."+b.chartArcsBackground).data(s.data.targets);d.enter().append("path").attr("class",(function(t,e){return b.chartArcsBackground+" "+b.chartArcsBackground+"-"+e})).merge(d).attr("d",(function(t){if(s.hiddenTargetIds.indexOf(t.id)>=0)return"M 0 0";var e={data:[{value:c.gauge_max}],startAngle:c.gauge_startingAngle,endAngle:-1*c.gauge_startingAngle*(c.gauge_fullCircle?Math.PI:1),index:h++};return s.getArc(e,!0,!0)})),d.exit().remove(),s.arcs.select("."+b.chartArcsGaugeUnit).attr("dy",".75em").text(c.gauge_label_show?c.gauge_units:""),s.arcs.select("."+b.chartArcsGaugeMin).attr("dx",-1*(s.innerRadius+(s.radius-s.innerRadius)/(c.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(c.gauge_label_show?s.textForGaugeMinMax(c.gauge_min,!1):""),s.arcs.select("."+b.chartArcsGaugeMax).attr("dx",s.innerRadius+(s.radius-s.innerRadius)/(c.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(c.gauge_label_show?s.textForGaugeMinMax(c.gauge_max,!0):"")}},t.prototype.initGauge=function(){var t=this.arcs;this.hasType("gauge")&&(t.append("g").attr("class",b.chartArcsBackground),t.append("text").attr("class",b.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",b.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",b.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},t.prototype.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},t.prototype.addToCache=function(t,e){this.cache["$"+t]=e},t.prototype.getFromCache=function(t){return this.cache["$"+t]},t.prototype.resetCache=function(){var t=this;Object.keys(this.cache).filter((function(t){return/^\$/.test(t)})).forEach((function(e){delete t.cache[e]}))},t.prototype.hasCaches=function(t){for(var e=0;e=0?b.focused:"")},t.prototype.classDefocused=function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?b.defocused:"")},t.prototype.classChartText=function(t){return b.chartText+this.classTarget(t.id)},t.prototype.classChartLine=function(t){return b.chartLine+this.classTarget(t.id)},t.prototype.classChartBar=function(t){return b.chartBar+this.classTarget(t.id)},t.prototype.classChartArc=function(t){return b.chartArc+this.classTarget(t.data.id)},t.prototype.getTargetSelectorSuffix=function(t){var e=this.generateTargetClass(t);return window.CSS&&window.CSS.escape?window.CSS.escape(e):e.replace(/([?!@#$%^&*()=+,.<>'":;\[\]\/|~`{}\\])/g,"\\$1")},t.prototype.selectorTarget=function(t,e){return(e||"")+"."+b.target+this.getTargetSelectorSuffix(t)},t.prototype.selectorTargets=function(t,e){var n=this;return(t=t||[]).length?t.map((function(t){return n.selectorTarget(t,e)})):null},t.prototype.selectorLegend=function(t){return"."+b.legendItem+this.getTargetSelectorSuffix(t)},t.prototype.selectorLegends=function(t){var e=this;return t&&t.length?t.map((function(t){return e.selectorLegend(t)})):null},t.prototype.getClipPath=function(t){return"url("+(v(9)?"":document.URL.split("#")[0])+"#"+t+")"},t.prototype.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},t.prototype.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},t.prototype.getAxisClipY=function(t){return t?-20:-this.margin.top},t.prototype.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},t.prototype.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},t.prototype.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},t.prototype.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},t.prototype.getAxisClipWidth=function(t){var e=Math.max(30,this.margin.left),n=Math.max(30,this.margin.right);return t?this.width+2+e+n:this.margin.left+20},t.prototype.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},t.prototype.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},t.prototype.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},t.prototype.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},t.prototype.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},t.prototype.generateColor=function(){var t=this.config,e=this.d3,n=t.data_colors,r=_(t.color_pattern)?t.color_pattern:e.schemeCategory10,i=t.data_color,a=[];return function(t){var e,o=t.id||t.data&&t.data.id||t;return n[o]instanceof Function?e=n[o](t):n[o]?e=n[o]:(a.indexOf(o)<0&&a.push(o),e=r[a.indexOf(o)%r.length],n[o]=e),i instanceof Function?i(e,t):e}},t.prototype.generateLevelColor=function(){var t=this.config,e=t.color_pattern,n=t.color_threshold,r="value"===n.unit,i=n.values&&n.values.length?n.values:[],a=n.max||100;return _(n)&&_(e)?function(t){var n,o=e[e.length-1];for(n=0;n=0?s.data.xs[n]=(e&&s.data.xs[n]?s.data.xs[n]:[]).concat(t.map((function(t){return t[r]})).filter(y).map((function(t,e){return s.generateTargetX(t,n,e)}))):u.data_x?s.data.xs[n]=s.getOtherTargetXs():_(u.data_xs)&&(s.data.xs[n]=s.getXValuesOfXKey(r,s.data.targets)):s.data.xs[n]=t.map((function(t,e){return e}))})),r.forEach((function(t){if(!s.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')})),(n=r.map((function(e,n){var r=u.data_idConverter(e);return{id:r,id_org:e,values:t.map((function(t,i){var a,c,l=t[s.getXKey(e)],f=null===t[e]||isNaN(t[e])?null:+t[e];return s.isCustomX()&&s.isCategorized()&&!g(l)?(0===n&&0===i&&(u.axis_x_categories=[]),-1===(a=u.axis_x_categories.indexOf(l))&&(a=u.axis_x_categories.length,u.axis_x_categories.push(l))):a=s.generateTargetX(l,e,i),(g(t[e])||s.data.xs[e].length<=i)&&(a=void 0),c={x:a,value:f,id:r},s.isStanfordGraphType()&&(c.epochs=t[o]),c})).filter((function(t){return l(t.x)}))}}))).forEach((function(t){var e;u.data_xSort&&(t.values=t.values.sort((function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)}))),e=0,t.values.forEach((function(t){t.index=e++})),s.data.xs[t.id].sort((function(t,e){return t-e}))})),s.hasNegativeValue=s.hasNegativeValueInTargets(n),s.hasPositiveValue=s.hasPositiveValueInTargets(n),u.data_type&&s.setTargetType(s.mapToIds(n).filter((function(t){return!(t in u.data_types)})),u.data_type),n.forEach((function(t){s.addCache(t.id_org,t)})),n},t.prototype.isEpochs=function(t){var e=this.config;return e.data_epochs&&t===e.data_epochs},t.prototype.isX=function(t){var e,n,r,i=this.config;return i.data_x&&t===i.data_x||_(i.data_xs)&&(e=i.data_xs,n=t,r=!1,Object.keys(e).forEach((function(t){e[t]===n&&(r=!0)})),r)},t.prototype.isNotX=function(t){return!this.isX(t)},t.prototype.isNotXAndNotEpochs=function(t){return!this.isX(t)&&!this.isEpochs(t)},t.prototype.isStackNormalized=function(){return this.config.data_stack_normalize&&this.config.data_groups.length>0},t.prototype.isAxisNormalized=function(t){var e=this;return!!e.isStackNormalized()&&e.data.targets.filter((function(n){return e.axis.getId(n.id)===t})).some((function(t){return e.isTargetNormalized(t.id)}))},t.prototype.isTargetNormalized=function(t){return this.isStackNormalized()&&this.config.data_groups.some((function(e){return e.includes(t)}))},t.prototype.getXKey=function(t){var e=this.config;return e.data_x?e.data_x:_(e.data_xs)?e.data_xs[t]:null},t.prototype.getTotalPerIndex=function(t){var e=this;if(!e.isStackNormalized())return null;var n=e.getFromCache("getTotalPerIndex");if(void 0!==n)return n[t];var r={y:[],y2:[]};return e.data.targets.filter((function(t){return e.isTargetNormalized(t.id)})).filter((function(t){return e.isTargetToShow(t.id)})).forEach((function(t){var n=r[e.axis.getId(t.id)];t.values.forEach((function(t,e){n[e]||(n[e]=0),n[e]+=d(t.value)?t.value:0}))})),e.addToCache("getTotalPerIndex",r),r[t]},t.prototype.getTotalDataSum=function(){var t=this,e=t.getFromCache("getTotalDataSum");if(void 0!==e)return e;var n,r=(n=t.data.targets.filter((function(e){return t.isTargetToShow(e.id)})).map((function(t){return t.values})),Array.isArray(n)?[].concat.apply([],n):[]).map((function(t){return t.value})).reduce((function(t,e){return t+e}),0);return t.addToCache("getTotalDataSum",r),r},t.prototype.getXValuesOfXKey=function(t,e){var n,r=this;return(e&&_(e)?r.mapToIds(e):[]).forEach((function(e){r.getXKey(e)===t&&(n=r.data.xs[e])})),n},t.prototype.getXValue=function(t,e){return t in this.data.xs&&this.data.xs[t]&&y(this.data.xs[t][e])?this.data.xs[t][e]:e},t.prototype.getOtherTargetXs=function(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},t.prototype.getOtherTargetX=function(t){var e=this.getOtherTargetXs();return e&&te?1:t>=e?0:NaN}))},t.prototype.addHiddenTargetIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e0}))},t.prototype.isOrderDesc=function(){var t=this.config;return"string"==typeof t.data_order&&"desc"===t.data_order.toLowerCase()},t.prototype.isOrderAsc=function(){var t=this.config;return"string"==typeof t.data_order&&"asc"===t.data_order.toLowerCase()},t.prototype.getOrderFunction=function(){var t=this.config,e=this.isOrderAsc(),n=this.isOrderDesc();if(e||n){var r=function(t,e){return t+Math.abs(e.value)};return function(t,n){var i=t.values.reduce(r,0),a=n.values.reduce(r,0);return e?a-i:i-a}}if(h(t.data_order))return t.data_order;if(c(t.data_order)){var i=t.data_order;return function(t,e){return i.indexOf(t.id)-i.indexOf(e.id)}}},t.prototype.orderTargets=function(t){var e=this.getOrderFunction();return e&&t.sort(e),t},t.prototype.filterByIndex=function(t,e){return this.d3.merge(t.map((function(t){return t.values.filter((function(t){return t.index===e}))})))},t.prototype.filterByX=function(t,e){return this.d3.merge(t.map((function(t){return t.values}))).filter((function(t){return t.x-e==0}))},t.prototype.filterRemoveNull=function(t){return t.filter((function(t){return y(t.value)}))},t.prototype.filterByXDomain=function(t,e){return t.map((function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter((function(t){return e[0]<=t.x&&t.x<=e[1]}))}}))},t.prototype.hasDataLabel=function(){var t=this.config;return!("boolean"!=typeof t.data_labels||!t.data_labels)||!("object"!=typeof t.data_labels||!_(t.data_labels))},t.prototype.getDataLabelLength=function(t,e,n){var r=this,i=[0,0];return r.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text((function(t){return r.dataLabelFormat(t.id)(t)})).each((function(t,e){i[e]=1.3*u(this)[n]})).remove(),i},t.prototype.isNoneArc=function(t){return this.hasTarget(this.data.targets,t.id)},t.prototype.isArc=function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},t.prototype.findClosestFromTargets=function(t,e){var n=this,r=t.map((function(t){return n.findClosest(t.values,e,n.config.tooltip_horizontal?n.horizontalDistance.bind(n):n.dist.bind(n),n.config.point_sensitivity)})).filter((function(t){return t}));return 0===r.length?void 0:1===r.length?r[0]:n.findClosest(r,e,n.dist.bind(n))},t.prototype.findClosestFromTargetsByX=function(t,e){var n,r;return t.forEach((function(t){t.values.forEach((function(t){var i=Math.abs(e-t.x);(void 0===r||i0?e.value/o[e.index]:0,a=e.ratio);return n&&a?100*a:a},t.prototype.updateDataAttributes=function(t,e){var n=this.config["data_"+t];return void 0===e||(Object.keys(e).forEach((function(t){n[t]=e[t]})),this.redraw({withLegend:!0})),n},t.prototype.load=function(t,e){var n=this;t&&(e.filter&&(t=t.filter(e.filter)),(e.type||e.types)&&t.forEach((function(t){var r=e.types&&e.types[t.id]?e.types[t.id]:e.type;n.setTargetType(t.id,r)})),n.data.targets.forEach((function(e){for(var n=0;n0)for(o=s.hasNegativeValueInTargets(t),e=0;e=0}))).length)for(r=i[0],o&&l[r]&&l[r].forEach((function(t,e){l[r][e]=t<0?t:0})),n=1;n0||(l[r][e]+=+t)}));return s.d3.min(Object.keys(l).map((function(t){return s.d3.min(l[t])})))},t.prototype.getYDomainMax=function(t){var e,n,r,i,a,o,s=this,u=s.config,c=s.mapToIds(t),l=s.getValuesAsIdKeyed(t);if(u.data_groups.length>0)for(o=s.hasPositiveValueInTargets(t),e=0;e=0}))).length)for(r=i[0],o&&l[r]&&l[r].forEach((function(t,e){l[r][e]=t>0?t:0})),n=1;n=0&&S>=0,g=w<=0&&S<=0,(y(m)&&p||y(b)&&g)&&(T=!1),T&&(p&&(w=0),g&&(S=0)),u=c=.1*(s=Math.abs(S-w)),void 0!==A&&(S=A+(l=Math.max(Math.abs(w),Math.abs(S))),w=A-l),P)f=r.getDataLabelLength(w,S,"width"),h=a(r.y.range()),u+=s*((d=[f[0]/h,f[1]/h])[1]/(1-d[0]-d[1])),c+=s*(d[0]/(1-d[0]-d[1]));else if(M){f=r.getDataLabelLength(w,S,"height");var E=r.getY(i["axis_"+e+"_type"],[0,i.axis_rotated?r.width:r.height],[0,s]);u+=E(f[1]),c+=E(f[0])}return"y"===e&&_(i.axis_y_padding)&&(u=r.axis.getPadding(i.axis_y_padding,"top",u,s),c=r.axis.getPadding(i.axis_y_padding,"bottom",c,s)),"y2"===e&&_(i.axis_y2_padding)&&(u=r.axis.getPadding(i.axis_y2_padding,"top",u,s),c=r.axis.getPadding(i.axis_y2_padding,"bottom",c,s)),T&&(p&&(c=w),g&&(u=-S)),o=[w-c,S+u],C?o.reverse():o},t.prototype.getXDomainMin=function(t){var e=this,n=e.config;return l(n.axis_x_min)?e.isTimeSeries()?this.parseDate(n.axis_x_min):n.axis_x_min:e.d3.min(t,(function(t){return e.d3.min(t.values,(function(t){return t.x}))}))},t.prototype.getXDomainMax=function(t){var e=this,n=e.config;return l(n.axis_x_max)?e.isTimeSeries()?this.parseDate(n.axis_x_max):n.axis_x_max:e.d3.max(t,(function(t){return e.d3.max(t.values,(function(t){return t.x}))}))},t.prototype.getXDomainPadding=function(t){var e,n,r,i,a=this.config,o=t[1]-t[0];return n=this.isCategorized()?0:this.hasType("bar")?(e=this.getMaxDataCount())>1?o/(e-1)/2:.5:.01*o,"object"==typeof a.axis_x_padding&&_(a.axis_x_padding)?(r=y(a.axis_x_padding.left)?a.axis_x_padding.left:n,i=y(a.axis_x_padding.right)?a.axis_x_padding.right:n):r=i="number"==typeof a.axis_x_padding?a.axis_x_padding:n,{left:r,right:i}},t.prototype.getXDomain=function(t){var e=this,n=[e.getXDomainMin(t),e.getXDomainMax(t)],r=n[0],i=n[1],a=e.getXDomainPadding(n),o=0,s=0;return r-i!=0||e.isCategorized()||(e.isTimeSeries()?(r=new Date(.5*r.getTime()),i=new Date(1.5*i.getTime())):(r=0===r?1:.5*r,i=0===i?-1:1.5*i)),(r||0===r)&&(o=e.isTimeSeries()?new Date(r.getTime()-a.left):r-a.left),(i||0===i)&&(s=e.isTimeSeries()?new Date(i.getTime()+a.right):i+a.right),[o,s]},t.prototype.updateXDomain=function(t,e,n,r,i){var a=this,o=a.config;return n&&(a.x.domain(i||a.d3.extent(a.getXDomain(t))),a.orgXDomain=a.x.domain(),o.zoom_enabled&&a.zoom.update(),a.subX.domain(a.x.domain()),a.brush&&a.brush.updateScale(a.subX)),e&&a.x.domain(i||(!a.brush||a.brush.empty()?a.orgXDomain:a.brush.selectionAsValue())),r&&a.x.domain(a.trimXDomain(a.x.orgDomain())),a.x.domain()},t.prototype.trimXDomain=function(t){var e=this.getZoomDomain(),n=e[0],r=e[1];return t[0]<=n&&(t[1]=+t[1]+(n-t[0]),t[0]=n),r<=t[1]&&(t[0]=+t[0]-(t[1]-r),t[1]=r),t},t.prototype.drag=function(t){var e,n,r,i,a,o,u,c,l=this,f=l.config,h=l.main,d=l.d3;l.hasArcType()||f.data_selection_enabled&&f.data_selection_multiple&&(e=l.dragStart[0],n=l.dragStart[1],r=t[0],i=t[1],a=Math.min(e,r),o=Math.max(e,r),u=f.data_selection_grouped?l.margin.top:Math.min(n,i),c=f.data_selection_grouped?l.height:Math.max(n,i),h.select("."+b.dragarea).attr("x",a).attr("y",u).attr("width",o-a).attr("height",c-u),h.selectAll("."+b.shapes).selectAll("."+b.shape).each((function(t,e){if(f.data_selection_isselectable(t)){var n,r,i,h,p,g,y=d.select(this),_=y.classed(b.SELECTED),x=y.classed(b.INCLUDED),v=!1;if(y.classed(b.circle))n=1*y.attr("cx"),r=1*y.attr("cy"),p=l.togglePoint,v=as&&(o=o.filter((function(t){return(""+t).indexOf(".")<0})));return o},t.prototype.getGridFilterToRemove=function(t){return t?function(e){var n=!1;return[].concat(t).forEach((function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(n=!0)})),n}:function(){return!0}},t.prototype.removeGridLines=function(t,e){var n=this.config,r=this.getGridFilterToRemove(t),i=function(t){return!r(t)},a=e?b.xgridLines:b.ygridLines,o=e?b.xgridLine:b.ygridLine;this.main.select("."+a).selectAll("."+o).filter(r).transition().duration(n.transition_duration).style("opacity",0).remove(),e?n.grid_x_lines=n.grid_x_lines.filter(i):n.grid_y_lines=n.grid_y_lines.filter(i)},t.prototype.initEventRect=function(){var t=this,e=t.config;t.main.select("."+b.chart).append("g").attr("class",b.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+b.eventRects).append("rect").attr("class",b.eventRect),e.zoom_enabled&&t.zoom&&(t.eventRect.call(t.zoom).on("dblclick.zoom",null),e.zoom_initialRange&&t.eventRect.transition().duration(0).call(t.zoom.transform,t.zoomTransform(e.zoom_initialRange)))},t.prototype.redrawEventRect=function(){var t=this,e=t.d3,n=t.config;function r(){t.svg.select("."+b.eventRect).style("cursor",null),t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars()}var i=function(e,r){return r&&(t.isBarType(r.id)||t.dist(r,e)=0})).classed(b.legendItemFocused,e).transition().duration(100).style("opacity",(function(){return(e?n.opacityForLegend:n.opacityForUnfocusedLegend).call(n,n.d3.select(this))}))},t.prototype.revertLegend=function(){var t=this,e=t.d3;t.legend.selectAll("."+b.legendItem).classed(b.legendItemFocused,!1).transition().duration(100).style("opacity",(function(){return t.opacityForLegend(e.select(this))}))},t.prototype.showLegend=function(t){var e=this,n=e.config;n.legend_show||(n.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",(function(){return e.opacityForLegend(e.d3.select(this))}))},t.prototype.hideLegend=function(t){var e=this,n=e.config;n.legend_show&&f(t)&&(n.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity",0).style("visibility","hidden")},t.prototype.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},t.prototype.updateLegend=function(t,e,n){var r,i,a,s,u,c,f,h,d,p,g,y,_,x,v,m,w=this,S=w.config,A=0,T=0,C=S.legend_item_tile_width+5,P=0,M={},E={},L={},k=[0],O={},G=0;function V(e,n,r){var i,a,o=0===r,s=r===t.length-1,u=function(t,e){return w.legendItemTextBox[e]||(w.legendItemTextBox[e]=w.getTextRect(t.textContent,b.legendItem,t)),w.legendItemTextBox[e]}(e,n),c=u.width+C+(!s||w.isLegendRight||w.isLegendInset?10:0)+S.legend_padding,l=u.height+4,f=w.isLegendRight||w.isLegendInset?l:c,h=w.isLegendRight||w.isLegendInset?w.getLegendHeight():w.getLegendWidth();function d(t,e){e||(i=(h-P-f)/2)<10&&(i=(h-f)/2,P=0,G++),O[t]=G,k[G]=w.isLegendInset?10:i,M[t]=P,P+=f}o&&(P=0,G=0,A=0,T=0),!S.legend_show||w.isLegendToShow(n)?(E[n]=c,L[n]=l,(!A||c>=A)&&(A=c),(!T||l>=T)&&(T=l),a=w.isLegendRight||w.isLegendInset?T:A,S.legend_equally?(Object.keys(E).forEach((function(t){E[t]=A})),Object.keys(L).forEach((function(t){L[t]=T})),(i=(h-a*t.length)/2)<10?(P=0,G=0,t.forEach((function(t){d(t)}))):d(n,!0)):d(n)):E[n]=L[n]=O[n]=M[n]=0}t=t.filter((function(t){return!l(S.data_names[t])||null!==S.data_names[t]})),g=o(e=e||{},"withTransition",!0),y=o(e,"withTransitionForTransform",!0),w.isLegendInset&&(G=S.legend_inset_step?S.legend_inset_step:t.length,w.updateLegendStep(G)),w.isLegendRight?(r=function(t){return A*O[t]},s=function(t){return k[O[t]]+M[t]}):w.isLegendInset?(r=function(t){return A*O[t]+10},s=function(t){return k[O[t]]+M[t]}):(r=function(t){return k[O[t]]+M[t]},s=function(t){return T*O[t]}),i=function(t,e){return r(t,e)+4+S.legend_item_tile_width},u=function(t,e){return s(t,e)+9},a=function(t,e){return r(t,e)},c=function(t,e){return s(t,e)-5},f=function(t,e){return r(t,e)-2},h=function(t,e){return r(t,e)-2+S.legend_item_tile_width},d=function(t,e){return s(t,e)+4},(p=w.legend.selectAll("."+b.legendItem).data(t).enter().append("g").attr("class",(function(t){return w.generateClass(b.legendItem,t)})).style("visibility",(function(t){return w.isLegendToShow(t)?"visible":"hidden"})).style("cursor",(function(){return S.interaction_enabled?"pointer":"auto"})).on("click",S.interaction_enabled?function(t){S.legend_item_onclick?S.legend_item_onclick.call(w,t):w.d3.event.altKey?(w.api.hide(),w.api.show(t)):(w.api.toggle(t),w.isTargetToShow(t)?w.api.focus(t):w.api.revert())}:null).on("mouseover",S.interaction_enabled?function(t){S.legend_item_onmouseover?S.legend_item_onmouseover.call(w,t):(w.d3.select(this).classed(b.legendItemFocused,!0),!w.transiting&&w.isTargetToShow(t)&&w.api.focus(t))}:null).on("mouseout",S.interaction_enabled?function(t){S.legend_item_onmouseout?S.legend_item_onmouseout.call(w,t):(w.d3.select(this).classed(b.legendItemFocused,!1),w.api.revert())}:null)).append("text").text((function(t){return l(S.data_names[t])?S.data_names[t]:t})).each((function(t,e){V(this,t,e)})).style("pointer-events","none").attr("x",w.isLegendRight||w.isLegendInset?i:-200).attr("y",w.isLegendRight||w.isLegendInset?-200:u),p.append("rect").attr("class",b.legendItemEvent).style("fill-opacity",0).attr("x",w.isLegendRight||w.isLegendInset?a:-200).attr("y",w.isLegendRight||w.isLegendInset?-200:c),p.append("line").attr("class",b.legendItemTile).style("stroke",w.color).style("pointer-events","none").attr("x1",w.isLegendRight||w.isLegendInset?f:-200).attr("y1",w.isLegendRight||w.isLegendInset?-200:d).attr("x2",w.isLegendRight||w.isLegendInset?h:-200).attr("y2",w.isLegendRight||w.isLegendInset?-200:d).attr("stroke-width",S.legend_item_tile_height),m=w.legend.select("."+b.legendBackground+" rect"),w.isLegendInset&&A>0&&0===m.size()&&(m=w.legend.insert("g","."+b.legendItem).attr("class",b.legendBackground).append("rect")),_=w.legend.selectAll("text").data(t).text((function(t){return l(S.data_names[t])?S.data_names[t]:t})).each((function(t,e){V(this,t,e)})),(g?_.transition():_).attr("x",i).attr("y",u),x=w.legend.selectAll("rect."+b.legendItemEvent).data(t),(g?x.transition():x).attr("width",(function(t){return E[t]})).attr("height",(function(t){return L[t]})).attr("x",a).attr("y",c),v=w.legend.selectAll("line."+b.legendItemTile).data(t),(g?v.transition():v).style("stroke",w.levelColor?function(t){return w.levelColor(w.cache[t].values.reduce((function(t,e){return t+e.value}),0))}:w.color).attr("x1",f).attr("y1",d).attr("x2",h).attr("y2",d),m&&(g?m.transition():m).attr("height",w.getLegendHeight()-12).attr("width",A*(G+1)+10),w.legend.selectAll("."+b.legendItem).classed(b.legendItemHidden,(function(t){return!w.isTargetToShow(t)})),w.updateLegendItemWidth(A),w.updateLegendItemHeight(T),w.updateLegendStep(G),w.updateSizes(),w.updateScales(),w.updateSvgSize(),w.transformAll(y,n),w.legendHasRendered=!0},t.prototype.initRegion=function(){this.region=this.main.append("g").attr("clip-path",this.clipPath).attr("class",b.regions)},t.prototype.updateRegion=function(t){var e=this,n=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible");var r=e.main.select("."+b.regions).selectAll("."+b.region).data(n.regions),i=r.enter().append("g");i.append("rect").attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)).style("fill-opacity",(function(t){return y(t.opacity)?t.opacity:.1})),i.append("text").text(e.labelRegion.bind(e)),e.mainRegion=i.merge(r).attr("class",e.classRegion.bind(e)),r.exit().transition().duration(t).style("opacity",0).remove()},t.prototype.redrawRegion=function(t,e){var n=this,r=n.mainRegion,i=n.mainRegion.selectAll("text");return[(t?r.transition(e):r).attr("x",n.regionX.bind(n)).attr("y",n.regionY.bind(n)).attr("width",n.regionWidth.bind(n)).attr("height",n.regionHeight.bind(n)).style("fill-opacity",(function(t){return y(t.opacity)?t.opacity:.1})),(t?i.transition(e):i).attr("x",n.labelOffsetX.bind(n)).attr("y",n.labelOffsetY.bind(n)).attr("transform",n.labelTransform.bind(n)).attr("style","text-anchor: left;")]},t.prototype.regionX=function(t){var e=this,n=e.config,r="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?n.axis_rotated&&"start"in t?r(t.start):0:n.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},t.prototype.regionY=function(t){var e=this,n=e.config,r="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?n.axis_rotated?0:"end"in t?r(t.end):0:n.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},t.prototype.regionWidth=function(t){var e,n=this,r=n.config,i=n.regionX(t),a="y"===t.axis?n.y:n.y2;return(e="y"===t.axis||"y2"===t.axis?r.axis_rotated&&"end"in t?a(t.end):n.width:r.axis_rotated?n.width:"end"in t?n.x(n.isTimeSeries()?n.parseDate(t.end):t.end):n.width)n.bar_width_max?n.bar_width_max:r},t.prototype.getBars=function(t,e){return(e?this.main.selectAll("."+b.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+b.bar+(y(t)?"-"+t:""))},t.prototype.expandBars=function(t,e,n){n&&this.unexpandBars(),this.getBars(t,e).classed(b.EXPANDED,!0)},t.prototype.unexpandBars=function(t){this.getBars(t).classed(b.EXPANDED,!1)},t.prototype.generateDrawBar=function(t,e){var n=this.config,r=this.generateGetBarPoints(t,e);return function(t,e){var i=r(t,e),a=n.axis_rotated?1:0,o=n.axis_rotated?0:1;return"M "+i[0][a]+","+i[0][o]+" L"+i[1][a]+","+i[1][o]+" L"+i[2][a]+","+i[2][o]+" L"+i[3][a]+","+i[3][o]+" z"}},t.prototype.generateGetBarPoints=function(t,e){var n=this,r=e?n.subXAxis:n.xAxis,i=t.__max__+1,a=n.getBarW(r,i),o=n.getShapeX(a,i,t,!!e),s=n.getShapeY(!!e),u=n.getShapeOffset(n.isBarType,t,!!e),c=a*(n.config.bar_space/2),l=e?n.getSubYScale:n.getYScale;return function(t,e){var r=l.call(n,t.id)(0),i=u(t,e)||r,f=o(t),h=s(t);return n.config.axis_rotated&&(0=0&&(c+=s(f[o])-u))})),c}},t.prototype.isWithinShape=function(t,e){var n,r=this,i=r.d3.select(t);return r.isTargetToShow(e.id)?"circle"===t.nodeName?n=r.isStepType(e)?r.isWithinStep(t,r.getYScale(e.id)(e.value)):r.isWithinCircle(t,1.5*r.pointSelectR(e)):"path"===t.nodeName&&(n=!i.classed(b.bar)||r.isWithinBar(r.d3.mouse(t),t)):n=!1,n},t.prototype.getInterpolate=function(t){var e=this,n=e.d3,r={linear:n.curveLinear,"linear-closed":n.curveLinearClosed,basis:n.curveBasis,"basis-open":n.curveBasisOpen,"basis-closed":n.curveBasisClosed,bundle:n.curveBundle,cardinal:n.curveCardinal,"cardinal-open":n.curveCardinalOpen,"cardinal-closed":n.curveCardinalClosed,monotone:n.curveMonotoneX,step:n.curveStep,"step-before":n.curveStepBefore,"step-after":n.curveStepAfter};return e.isSplineType(t)?r[e.config.spline_interpolation_type]||r.cardinal:e.isStepType(t)?r[e.config.line_step_type]:r.linear},t.prototype.initLine=function(){this.main.select("."+b.chart).append("g").attr("class",b.chartLines)},t.prototype.updateTargetsForLine=function(t){var e,n=this,r=n.config,i=n.classChartLine.bind(n),a=n.classLines.bind(n),o=n.classAreas.bind(n),s=n.classCircles.bind(n),u=n.classFocus.bind(n);(e=n.main.select("."+b.chartLines).selectAll("."+b.chartLine).data(t).attr("class",(function(t){return i(t)+u(t)})).enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none")).append("g").attr("class",a),e.append("g").attr("class",o),e.append("g").attr("class",(function(t){return n.generateClass(b.selectedCircles,t.id)})),e.append("g").attr("class",s).style("cursor",(function(t){return r.data_selection_isselectable(t)?"pointer":null})),t.forEach((function(t){n.main.selectAll("."+b.selectedCircles+n.getTargetSelectorSuffix(t.id)).selectAll("."+b.selectedCircle).each((function(e){e.value=t.values[e.index].value}))}))},t.prototype.updateLine=function(t){var e=this,n=e.main.selectAll("."+b.lines).selectAll("."+b.line).data(e.lineData.bind(e)),r=n.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);e.mainLine=r.merge(n).style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",(function(t){return e.isStepType(t)?"crispEdges":""})).attr("transform",null),n.exit().transition().duration(t).style("opacity",0)},t.prototype.redrawLine=function(t,e,n){return[(e?this.mainLine.transition(n):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity",1)]},t.prototype.generateDrawLine=function(t,e){var n=this,r=n.config,i=n.d3.line(),a=n.generateGetLinePoints(t,e),o=e?n.getSubYScale:n.getYScale,s=function(t){return(e?n.subxx:n.xx).call(n,t)},u=function(t,e){return r.data_groups.length>0?a(t,e)[0][1]:o.call(n,t.id)(t.value)};return i=r.axis_rotated?i.x(u).y(s):i.x(s).y(u),r.line_connectNull||(i=i.defined((function(t){return null!=t.value}))),function(t){var a,s=r.line_connectNull?n.filterRemoveNull(t.values):t.values,u=e?n.subX:n.x,c=o.call(n,t.id),l=0,f=0;return n.isLineType(t)?r.data_regions[t.id]?a=n.lineWithRegions(s,u,c,r.data_regions[t.id]):(n.isStepType(t)&&(s=n.convertValuesToStep(s)),a=i.curve(n.getInterpolate(t))(s)):(s[0]&&(l=u(s[0].x),f=c(s[0].value)),a=r.axis_rotated?"M "+f+" "+l:"M "+l+" "+f),a||"M 0 0"}},t.prototype.generateGetLinePoints=function(t,e){var n=this,r=n.config,i=t.__max__+1,a=n.getShapeX(0,i,t,!!e),o=n.getShapeY(!!e),s=n.getShapeOffset(n.isLineType,t,!!e),u=e?n.getSubYScale:n.getYScale;return function(t,e){var i=u.call(n,t.id)(0),c=s(t,e)||i,l=a(t),f=o(t);return r.axis_rotated&&(00?a(t,e)[0][1]:o.call(n,t.id)(n.getAreaBaseValue(t.id))},c=function(t,e){return r.data_groups.length>0?a(t,e)[1][1]:o.call(n,t.id)(t.value)};return i=r.axis_rotated?i.x0(u).x1(c).y(s):i.x(s).y0(r.area_above?0:u).y1(c),r.line_connectNull||(i=i.defined((function(t){return null!==t.value}))),function(t){var e,a=r.line_connectNull?n.filterRemoveNull(t.values):t.values,o=0,s=0;return n.isAreaType(t)?(n.isStepType(t)&&(a=n.convertValuesToStep(a)),e=i.curve(n.getInterpolate(t))(a)):(a[0]&&(o=n.x(a[0].x),s=n.getYScale(t.id)(a[0].value)),e=r.axis_rotated?"M "+s+" "+o:"M "+o+" "+s),e||"M 0 0"}},t.prototype.getAreaBaseValue=function(){return 0},t.prototype.generateGetAreaPoints=function(t,e){var n=this,r=n.config,i=t.__max__+1,a=n.getShapeX(0,i,t,!!e),o=n.getShapeY(!!e),s=n.getShapeOffset(n.isAreaType,t,!!e),u=e?n.getSubYScale:n.getYScale;return function(t,e){var i=u.call(n,t.id)(0),c=s(t,e)||i,l=a(t),f=o(t);return r.axis_rotated&&(00?(t=n.getShapeIndices(n.isLineType),e=n.generateGetLinePoints(t),n.circleY=function(t,n){return e(t,n)[0][1]}):n.circleY=function(t){return n.getYScale(t.id)(t.value)}},t.prototype.getCircles=function(t,e){return(e?this.main.selectAll("."+b.circles+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+b.circle+(y(t)?"-"+t:""))},t.prototype.expandCircles=function(t,e,n){var r=this.pointExpandedR.bind(this);n&&this.unexpandCircles(),this.getCircles(t,e).classed(b.EXPANDED,!0).attr("r",r)},t.prototype.unexpandCircles=function(t){var e=this,n=e.pointR.bind(e);e.getCircles(t).filter((function(){return e.d3.select(this).classed(b.EXPANDED)})).classed(b.EXPANDED,!1).attr("r",n)},t.prototype.pointR=function(t){var e=this.config;return this.isStepType(t)?0:h(e.point_r)?e.point_r(t):e.point_r},t.prototype.pointExpandedR=function(t){var e=this.config;return e.point_focus_expand_enabled?h(e.point_focus_expand_r)?e.point_focus_expand_r(t):e.point_focus_expand_r?e.point_focus_expand_r:1.75*this.pointR(t):this.pointR(t)},t.prototype.pointSelectR=function(t){var e=this.config;return h(e.point_select_r)?e.point_select_r(t):e.point_select_r?e.point_select_r:4*this.pointR(t)},t.prototype.isWithinCircle=function(t,e){var n=this.d3,r=n.mouse(t),i=n.select(t),a=+i.attr("cx"),o=+i.attr("cy");return Math.sqrt(Math.pow(a-r[0],2)+Math.pow(o-r[1],2))0?e:320/(this.hasType("gauge")&&!t.gauge_fullCircle?2:1)},t.prototype.getCurrentPaddingTop=function(){var t=this.config,e=y(t.padding_top)?t.padding_top:0;return this.title&&this.title.node()&&(e+=this.getTitlePadding()),e},t.prototype.getCurrentPaddingBottom=function(){var t=this.config;return y(t.padding_bottom)?t.padding_bottom:0},t.prototype.getCurrentPaddingLeft=function(t){var e=this.config;return y(e.padding_left)?e.padding_left:e.axis_rotated?!e.axis_x_show||e.axis_x_inner?1:Math.max(i(this.getAxisWidthByAxisId("x",t)),40):!e.axis_y_show||e.axis_y_inner?this.axis.getYAxisLabelPosition().isOuter?30:1:i(this.getAxisWidthByAxisId("y",t))},t.prototype.getCurrentPaddingRight=function(){var t=this,e=t.config,n=0,r=t.isLegendRight?t.getLegendWidth()+20:0;return n=y(e.padding_right)?e.padding_right+1:e.axis_rotated?10+r:!e.axis_y2_show||e.axis_y2_inner?2+r+(t.axis.getY2AxisLabelPosition().isOuter?20:0):i(t.getAxisWidthByAxisId("y2"))+r,t.colorScale&&t.colorScale.node()&&(n+=t.getColorScalePadding()),n},t.prototype.getParentRectValue=function(t){for(var e,n=this.selectChart.node();n&&"BODY"!==n.tagName;){try{e=n.getBoundingClientRect()[t]}catch(r){"width"===t&&(e=n.offsetWidth)}if(e)break;n=n.parentNode}return e},t.prototype.getParentWidth=function(){return this.getParentRectValue("width")},t.prototype.getParentHeight=function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},t.prototype.getSvgLeft=function(t){var e=this,n=e.config,r=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,i=n.axis_rotated?b.axisX:b.axisY,a=e.main.select("."+i).node(),o=a&&r?a.getBoundingClientRect():{right:0},s=e.selectChart.node().getBoundingClientRect(),u=e.hasArcType(),c=o.right-s.left-(u?0:e.getCurrentPaddingLeft(t));return c>0?c:0},t.prototype.getAxisWidthByAxisId=function(t,e){var n=this.axis.getLabelPositionById(t);return this.axis.getMaxTickWidth(t,e)+(n.isInner?20:40)},t.prototype.getHorizontalAxisHeight=function(t,e){var n=this,r=n.config,i=30;return"x"!==t||(l(e)&&e?r.subchart_axis_x_show:r.axis_x_show)?"x"===t&&r.axis_x_height?r.axis_x_height:"y"!==t||r.axis_y_show?"y2"!==t||r.axis_y2_show?("x"===t&&!r.axis_rotated&&r.axis_x_tick_rotate&&(i=30+n.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(r.axis_x_tick_rotate))/180)),"y"===t&&r.axis_rotated&&r.axis_y_tick_rotate&&(i=30+n.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(r.axis_y_tick_rotate))/180)),i+(n.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):n.rotated_padding_top:!r.legend_show||n.isLegendRight||n.isLegendInset?1:10:8},t.prototype.initBrush=function(t){var e=this,n=e.d3;return e.brush=(e.config.axis_rotated?n.brushY():n.brushX()).on("brush",(function(){var t=n.event.sourceEvent;t&&"zoom"===t.type||e.redrawForBrush()})).on("end",(function(){var t=n.event.sourceEvent;t&&"zoom"===t.type||e.brush.empty()&&t&&"end"!==t.type&&e.brush.clear()})),e.brush.updateExtent=function(){var t,n=this.scale.range();return t=e.config.axis_rotated?[[0,n[0]],[e.width2,n[1]]]:[[n[0],0],[n[1],e.height2]],this.extent(t),this},e.brush.updateScale=function(t){return this.scale=t,this},e.brush.update=function(t){this.updateScale(t||e.subX).updateExtent(),e.context.select("."+b.brush).call(this)},e.brush.clear=function(){e.context.select("."+b.brush).call(e.brush.move,null)},e.brush.selection=function(){return n.brushSelection(e.context.select("."+b.brush).node())},e.brush.selectionAsValue=function(t,n){var r,i;return t?(e.context&&(r=[this.scale(t[0]),this.scale(t[1])],i=e.context.select("."+b.brush),n&&(i=i.transition()),e.brush.move(i,r)),[]):(r=e.brush.selection()||[0,0],[this.scale.invert(r[0]),this.scale.invert(r[1])])},e.brush.empty=function(){var t=e.brush.selection();return!t||t[0]===t[1]},e.brush.updateScale(t)},t.prototype.initSubchart=function(){var t=this,e=t.config,n=t.context=t.svg.append("g").attr("transform",t.getTranslate("context"));n.style("visibility","visible"),n.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",b.chart),n.select("."+b.chart).append("g").attr("class",b.chartBars),n.select("."+b.chart).append("g").attr("class",b.chartLines),n.append("g").attr("clip-path",t.clipPath).attr("class",b.brush),t.axes.subx=n.append("g").attr("class",b.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis).style("visibility",e.subchart_axis_x_show?"visible":"hidden")},t.prototype.initSubchartBrush=function(){this.initBrush(this.subX).updateExtent(),this.context.select("."+b.brush).call(this.brush)},t.prototype.updateTargetsForSubchart=function(t){var e,n,r,i,a=this,o=a.context,s=a.config,u=a.classChartBar.bind(a),c=a.classBars.bind(a),l=a.classChartLine.bind(a),f=a.classLines.bind(a),h=a.classAreas.bind(a);(r=(i=o.select("."+b.chartBars).selectAll("."+b.chartBar).data(t)).enter().append("g").style("opacity",0)).merge(i).attr("class",u),r.append("g").attr("class",c),(e=(n=o.select("."+b.chartLines).selectAll("."+b.chartLine).data(t)).enter().append("g").style("opacity",0)).merge(n).attr("class",l),e.append("g").attr("class",f),e.append("g").attr("class",h),o.selectAll("."+b.brush+" rect").attr(s.axis_rotated?"width":"height",s.axis_rotated?a.width2:a.height2)},t.prototype.updateBarForSubchart=function(t){var e=this,n=e.context.selectAll("."+b.bars).selectAll("."+b.bar).data(e.barData.bind(e)),r=n.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color);n.exit().transition().duration(t).style("opacity",0).remove(),e.contextBar=r.merge(n).style("opacity",e.initialOpacity.bind(e))},t.prototype.redrawBarForSubchart=function(t,e,n){(e?this.contextBar.transition(Math.random().toString()).duration(n):this.contextBar).attr("d",t).style("opacity",1)},t.prototype.updateLineForSubchart=function(t){var e=this,n=e.context.selectAll("."+b.lines).selectAll("."+b.line).data(e.lineData.bind(e)),r=n.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);n.exit().transition().duration(t).style("opacity",0).remove(),e.contextLine=r.merge(n).style("opacity",e.initialOpacity.bind(e))},t.prototype.redrawLineForSubchart=function(t,e,n){(e?this.contextLine.transition(Math.random().toString()).duration(n):this.contextLine).attr("d",t).style("opacity",1)},t.prototype.updateAreaForSubchart=function(t){var e=this,n=e.d3,r=e.context.selectAll("."+b.areas).selectAll("."+b.area).data(e.lineData.bind(e)),i=r.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",(function(){return e.orgAreaOpacity=+n.select(this).style("opacity"),0}));r.exit().transition().duration(t).style("opacity",0).remove(),e.contextArea=i.merge(r).style("opacity",0)},t.prototype.redrawAreaForSubchart=function(t,e,n){(e?this.contextArea.transition(Math.random().toString()).duration(n):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},t.prototype.redrawSubchart=function(t,e,n,r,i,a,o){var s,u,c,l=this,f=l.d3;f.event&&"zoom"===f.event.type&&l.brush.selectionAsValue(l.x.orgDomain()),t&&(l.brush.empty()||l.brush.selectionAsValue(l.x.orgDomain()),s=l.generateDrawArea(i,!0),u=l.generateDrawBar(a,!0),c=l.generateDrawLine(o,!0),l.updateBarForSubchart(n),l.updateLineForSubchart(n),l.updateAreaForSubchart(n),l.redrawBarForSubchart(u,n,n),l.redrawLineForSubchart(c,n,n),l.redrawAreaForSubchart(s,n,n))},t.prototype.redrawForBrush=function(){var t,e=this,n=e.x,r=e.d3;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withEventRect:!1,withDimension:!1}),t=r.event.selection||e.brush.scale.range(),e.main.select("."+b.eventRect).call(e.zoom.transform,r.zoomIdentity.scale(e.width/(t[1]-t[0])).translate(-t[0],0)),e.config.subchart_onbrush.call(e.api,n.orgDomain())},t.prototype.transformContext=function(t,e){var n;e&&e.axisSubX?n=e.axisSubX:(n=this.context.select("."+b.axisX),t&&(n=n.transition())),this.context.attr("transform",this.getTranslate("context")),n.attr("transform",this.getTranslate("subx"))},t.prototype.getDefaultSelection=function(){var t=this,e=t.config,n=h(e.axis_x_selection)?e.axis_x_selection(t.getXDomain(t.data.targets)):e.axis_x_selection;return t.isTimeSeries()&&(n=[t.parseDate(n[0]),t.parseDate(n[1])]),n},t.prototype.removeSubchart=function(){this.brush=null,this.context.remove(),this.context=null},t.prototype.initText=function(){this.main.select("."+b.chart).append("g").attr("class",b.chartTexts),this.mainText=this.d3.selectAll([])},t.prototype.updateTargetsForText=function(t){var e=this,n=e.classChartText.bind(e),r=e.classTexts.bind(e),i=e.classFocus.bind(e),a=e.main.select("."+b.chartTexts).selectAll("."+b.chartText).data(t),o=a.enter().append("g").attr("class",n).style("opacity",0).style("pointer-events","none");o.append("g").attr("class",r),o.merge(a).attr("class",(function(t){return n(t)+i(t)}))},t.prototype.updateText=function(t,e,n){var r=this,i=r.config,a=r.barOrLineData.bind(r),o=r.classText.bind(r),s=r.main.selectAll("."+b.texts).selectAll("."+b.text).data(a),u=s.enter().append("text").attr("class",o).attr("text-anchor",(function(t){return i.axis_rotated?t.value<0?"end":"start":"middle"})).style("stroke","none").attr("x",t).attr("y",e).style("fill",(function(t){return r.color(t)})).style("fill-opacity",0);r.mainText=u.merge(s).text((function(t,e,n){return r.dataLabelFormat(t.id)(t.value,t.id,e,n)})),s.exit().transition().duration(n).style("fill-opacity",0).remove()},t.prototype.redrawText=function(t,e,n,r,i){return[(r?this.mainText.transition(i):this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",n?0:this.opacityForText.bind(this))]},t.prototype.getTextRect=function(t,e,n){var r,i=this.d3.select("body").append("div").classed("c3",!0),a=i.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),o=this.d3.select(n).style("font");return a.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",o).text(t).each((function(){r=u(this)})),i.remove(),r},t.prototype.generateXYForText=function(t,e,n,r){var i=this,a=i.generateGetAreaPoints(t,!1),o=i.generateGetBarPoints(e,!1),s=i.generateGetLinePoints(n,!1),u=r?i.getXForText:i.getYForText;return function(t,e){var n=i.isAreaType(t)?a:i.isBarType(t)?o:s;return u.call(i,n(t,e),t,this)}},t.prototype.getXForText=function(t,e,n){var r,i,a=this,o=u(n);return a.config.axis_rotated?(i=a.isBarType(e)?4:6,r=t[2][1]+i*(e.value<0?-1:1)):r=a.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(r>a.width?r=a.width-o.width:r<0&&(r=4)),r},t.prototype.getYForText=function(t,e,n){var r,i=this,a=u(n);return i.config.axis_rotated?r=(t[0][0]+t[2][0]+.6*a.height)/2:(r=t[2][1],e.value<0||0===e.value&&!i.hasPositiveValue?(r+=a.height,i.isBarType(e)&&i.isSafari()?r-=3:!i.isBarType(e)&&i.isChrome()&&(r+=3)):r+=i.isBarType(e)?-3:-6),null!==e.value||i.config.axis_rotated||(rthis.height&&(r=this.height-4)),r},t.prototype.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},t.prototype.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},t.prototype.xForTitle=function(){var t=this,e=t.config,n=e.title_position||"left";return n.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:n.indexOf("center")>=0?Math.max((t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2,0):e.title_padding.left},t.prototype.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},t.prototype.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},t.prototype.drawColorScale=function(){var t,e,n,r,i,a,o,s=this,u=s.d3,c=s.config,l=s.data.targets[0];if((t=isNaN(c.stanford_scaleWidth)?20:c.stanford_scaleWidth)<0)throw Error("Colorscale's barheight and barwidth must be greater than 0.");o=s.height-c.stanford_padding.bottom-c.stanford_padding.top,n=u.range(c.stanford_padding.bottom,o,5),a=u.scaleSequential(l.colors).domain([n[n.length-1],n[0]]),s.colorScale&&s.colorScale.remove(),s.colorScale=s.svg.append("g").attr("width",50).attr("height",o).attr("class",b.colorScale),s.colorScale.append("g").attr("transform","translate(0, "+c.stanford_padding.top+")").selectAll("bars").data(n).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",t).attr("height",5).attr("fill",(function(t){return a(t)})),i=u.scaleLog().domain([l.minEpochs,l.maxEpochs]).range([n[0]+c.stanford_padding.top+n[n.length-1]+5-1,n[0]+c.stanford_padding.top]),r=u.axisRight(i),"pow10"===c.stanford_scaleFormat?r.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):h(c.stanford_scaleFormat)?r.tickFormat(c.stanford_scaleFormat):r.tickFormat(u.format("d")),h(c.stanford_scaleValues)&&r.tickValues(c.stanford_scaleValues(l.minEpochs,l.maxEpochs)),e=s.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+t+",0)").call(r),"pow10"===c.stanford_scaleFormat&&e.selectAll(".tick text").text(null).filter(C).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),s.colorScale.attr("transform","translate("+(s.currentWidth-s.xForColorScale())+", 0)")},t.prototype.xForColorScale=function(){return this.config.stanford_padding.right+u(this.colorScale.node()).width},t.prototype.getColorScalePadding=function(){return this.xForColorScale()+this.config.stanford_padding.left+20},t.prototype.isStanfordGraphType=function(){return"stanford"===this.config.data_type},t.prototype.initStanfordData=function(){var t,e,n,r=this.d3,i=this.config,a=this.data.targets[0];if(a.values.sort(E),t=a.values.map((function(t){return t.epochs})),(n=isNaN(i.stanford_scaleMin)?r.min(t):i.stanford_scaleMin)>(e=isNaN(i.stanford_scaleMax)?r.max(t):i.stanford_scaleMax))throw Error("Number of minEpochs has to be smaller than maxEpochs");a.colors=h(i.stanford_colors)?i.stanford_colors:r.interpolateHslLong(r.hsl(250,1,.5),r.hsl(0,1,.5)),a.colorscale=r.scaleSequentialLog(a.colors).domain([n,e]),a.minEpochs=n,a.maxEpochs=e},t.prototype.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},t.prototype.getCentroid=function(t){var e,n,r,i,a,o=P(t),s=0,u=0;for(e=0,n=t.length-1;e"+(e?x(e):"x")+""+t.x+"\n "+(n?x(n):"y")+""+t.value+"\n "},t.prototype.countEpochsInRegion=function(t){var e,n,r=this.data.targets[0];return e=r.values.reduce((function(t,e){return t+Number(e.epochs)}),0),{value:n=r.values.reduce((function(e,n){return M(n,t)?e+Number(n.epochs):e}),0),percentage:0!==n?(n/e*100).toFixed(1):0}};var P=function(t){var e,n,r,i,a=0;for(e=0,n=t.length-1;es!=(i=e[l].y)>s&&o<(a-n)*(s-r)/(i-r)+n&&(u=!u);return u},E=function(t,e){return t.epochse.epochs?1:0};return t.prototype.initStanfordElements=function(){var t=this;t.stanfordElements=t.main.select("."+b.chart).append("g").attr("class",b.stanfordElements),t.stanfordElements.append("g").attr("class",b.stanfordLines),t.stanfordElements.append("g").attr("class",b.stanfordTexts),t.stanfordElements.append("g").attr("class",b.stanfordRegions)},t.prototype.updateStanfordElements=function(t){var e,n,r,i,a,o,s=this,u=s.main,c=s.config,l=s.xvCustom.bind(s),f=s.yvCustom.bind(s),h=s.countEpochsInRegion.bind(s);(n=(e=u.select("."+b.stanfordLines).style("shape-rendering","geometricprecision").selectAll("."+b.stanfordLine).data(c.stanford_lines)).enter().append("g").attr("class",(function(t){return b.stanfordLine+(t.class?" "+t.class:"")}))).append("line").attr("x1",(function(t){return c.axis_rotated?f(t,"value_y1"):l(t,"value_x1")})).attr("x2",(function(t){return c.axis_rotated?f(t,"value_y2"):l(t,"value_x2")})).attr("y1",(function(t){return c.axis_rotated?l(t,"value_x1"):f(t,"value_y1")})).attr("y2",(function(t){return c.axis_rotated?l(t,"value_x2"):f(t,"value_y2")})).style("opacity",0),s.stanfordLines=n.merge(e),s.stanfordLines.select("line").transition().duration(t).attr("x1",(function(t){return c.axis_rotated?f(t,"value_y1"):l(t,"value_x1")})).attr("x2",(function(t){return c.axis_rotated?f(t,"value_y2"):l(t,"value_x2")})).attr("y1",(function(t){return c.axis_rotated?l(t,"value_x1"):f(t,"value_y1")})).attr("y2",(function(t){return c.axis_rotated?l(t,"value_x2"):f(t,"value_y2")})).style("opacity",1),e.exit().transition().duration(t).style("opacity",0).remove(),(o=(a=u.select("."+b.stanfordTexts).selectAll("."+b.stanfordText).data(c.stanford_texts)).enter().append("g").attr("class",(function(t){return b.stanfordText+(t.class?" "+t.class:"")}))).append("text").attr("x",(function(t){return c.axis_rotated?f(t,"y"):l(t,"x")})).attr("y",(function(t){return c.axis_rotated?l(t,"x"):f(t,"y")})).style("opacity",0),s.stanfordTexts=o.merge(a),s.stanfordTexts.select("text").transition().duration(t).attr("x",(function(t){return c.axis_rotated?f(t,"y"):l(t,"x")})).attr("y",(function(t){return c.axis_rotated?l(t,"x"):f(t,"y")})).text((function(t){return t.content})).style("opacity",1),a.exit().transition().duration(t).style("opacity",0).remove(),(i=(r=u.select("."+b.stanfordRegions).selectAll("."+b.stanfordRegion).data(c.stanford_regions)).enter().append("g").attr("class",(function(t){return b.stanfordRegion+(t.class?" "+t.class:"")}))).append("polygon").attr("points",(function(t){return t.points.map((function(t){return[c.axis_rotated?f(t,"y"):l(t,"x"),c.axis_rotated?l(t,"x"):f(t,"y")].join(",")})).join(" ")})).style("opacity",0),i.append("text").attr("x",(function(t){return s.getCentroid(t.points).x})).attr("y",(function(t){return s.getCentroid(t.points).y})).style("opacity",0),s.stanfordRegions=i.merge(r),s.stanfordRegions.select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[c.axis_rotated?f(t,"y"):l(t,"x"),c.axis_rotated?l(t,"x"):f(t,"y")].join(",")})).join(" ")})).style("opacity",(function(t){return t.opacity?t.opacity:.2})),s.stanfordRegions.select("text").transition().duration(t).attr("x",(function(t){return c.axis_rotated?f(s.getCentroid(t.points),"y"):l(s.getCentroid(t.points),"x")})).attr("y",(function(t){return c.axis_rotated?l(s.getCentroid(t.points),"x"):f(s.getCentroid(t.points),"y")})).text((function(t){var e,n,r;return t.text?(s.isStanfordGraphType()&&(e=(r=h(t.points)).value,n=r.percentage),t.text(e,n)):""})).attr("text-anchor","middle").attr("dominant-baseline","middle").style("opacity",1),r.exit().transition().duration(t).style("opacity",0).remove()},t.prototype.initTooltip=function(){var t,e=this,n=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",b.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),n.tooltip_init_show){if(e.isTimeSeries()&&p(n.tooltip_init_x)){for(n.tooltip_init_x=e.parseDate(n.tooltip_init_x),t=0;t"+o),c=l.getStanfordPointColor(t[a]),u=x(f.data_epochs),s=t[a].epochs;else if(i||(o=x(h?h(t[a].x,t[a].index):t[a].x),i=""+(o||0===o?"":"")),void 0!==(s=x(p(t[a].value,t[a].ratio,t[a].id,t[a].index,t)))){if(null===t[a].name)continue;u=x(d(t[a].name,t[a].ratio,t[a].id,t[a].index)),c=l.levelColor?l.levelColor(t[a].value):r(t[a].id)}void 0!==s&&(i+="",i+="",i+="",i+="")}return i+"
"+o+"
"+u+""+s+"
"},t.prototype.tooltipPosition=function(t,e,n,r){var i,a,o,s,u,c=this,l=c.config,f=c.d3,h=c.hasArcType(),d=f.mouse(r);return h?(a=(c.width-(c.isLegendRight?c.getLegendWidth():0))/2+d[0],s=(c.hasType("gauge")?c.height:c.height/2)+d[1]+20):(i=c.getSvgLeft(!0),l.axis_rotated?(o=(a=i+d[0]+100)+e,u=c.currentWidth-c.getCurrentPaddingRight(),s=c.x(t[0].x)+20):(o=(a=i+c.getCurrentPaddingLeft(!0)+c.x(t[0].x)+20)+e,u=i+c.currentWidth-c.getCurrentPaddingRight(),s=d[1]+15),o>u&&(a-=o-u+20),s+n>c.currentHeight&&(s-=n+30)),s<0&&(s=0),{top:s,left:a}},t.prototype.showTooltip=function(e,n){var r,i,a,o=this,s=o.config,u=o.hasArcType(),c=e.filter((function(t){return t&&y(t.value)})),l=s.tooltip_position||t.prototype.tooltipPosition;0!==c.length&&s.tooltip_show?(o.tooltip.html(s.tooltip_contents.call(o,e,o.axis.getXAxisTickFormat(),o.getYFormat(u),o.color)).style("display","block"),r=o.tooltip.property("offsetWidth"),i=o.tooltip.property("offsetHeight"),a=l.call(this,c,r,i,n),o.tooltip.style("top",a.top+"px").style("left",a.left+"px")):o.hideTooltip()},t.prototype.hideTooltip=function(){this.tooltip.style("display","none")},t.prototype.setTargetType=function(t,e){var n=this,r=n.config;n.mapToTargetIds(t).forEach((function(t){n.withoutFadeIn[t]=e===r.data_types[t],r.data_types[t]=e})),t||(r.data_type=e)},t.prototype.hasType=function(t,e){var n=this.config.data_types,r=!1;return(e=e||this.data.targets)&&e.length?e.forEach((function(e){var i=n[e.id];(i&&i.indexOf(t)>=0||!i&&"line"===t)&&(r=!0)})):Object.keys(n).length?Object.keys(n).forEach((function(e){n[e]===t&&(r=!0)})):r=this.config.data_type===t,r},t.prototype.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},t.prototype.isLineType=function(t){var e=this.config,n=p(t)?t:t.id;return!e.data_types[n]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[n])>=0},t.prototype.isStepType=function(t){var e=p(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},t.prototype.isSplineType=function(t){var e=p(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},t.prototype.isAreaType=function(t){var e=p(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},t.prototype.isBarType=function(t){var e=p(t)?t:t.id;return"bar"===this.config.data_types[e]},t.prototype.isScatterType=function(t){var e=p(t)?t:t.id;return"scatter"===this.config.data_types[e]},t.prototype.isStanfordType=function(t){var e=p(t)?t:t.id;return"stanford"===this.config.data_types[e]},t.prototype.isPieType=function(t){var e=p(t)?t:t.id;return"pie"===this.config.data_types[e]},t.prototype.isGaugeType=function(t){var e=p(t)?t:t.id;return"gauge"===this.config.data_types[e]},t.prototype.isDonutType=function(t){var e=p(t)?t:t.id;return"donut"===this.config.data_types[e]},t.prototype.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},t.prototype.lineData=function(t){return this.isLineType(t)?[t]:[]},t.prototype.arcData=function(t){return this.isArcType(t.data)?[t]:[]},t.prototype.barData=function(t){return this.isBarType(t)?t.values:[]},t.prototype.lineOrScatterOrStanfordData=function(t){return this.isLineType(t)||this.isScatterType(t)||this.isStanfordType(t)?t.values:[]},t.prototype.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},t.prototype.isSafari=function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},t.prototype.isChrome=function(){return window.navigator.userAgent.indexOf("Chrome")>=0},t.prototype.initZoom=function(){var t,e=this,n=e.d3,r=e.config;return e.zoom=n.zoom().on("start",(function(){if("scroll"===r.zoom_type){var i=n.event.sourceEvent;i&&"brush"===i.type||(t=i,r.zoom_onzoomstart.call(e.api,i))}})).on("zoom",(function(){if("scroll"===r.zoom_type){var t=n.event.sourceEvent;t&&"brush"===t.type||(e.redrawForZoom(),r.zoom_onzoom.call(e.api,e.x.orgDomain()))}})).on("end",(function(){if("scroll"===r.zoom_type){var i=n.event.sourceEvent;i&&"brush"===i.type||i&&t.clientX===i.clientX&&t.clientY===i.clientY||r.zoom_onzoomend.call(e.api,e.x.orgDomain())}})),e.zoom.updateDomain=function(){return n.event&&n.event.transform&&(r.axis_rotated&&"scroll"===r.zoom_type&&"mousemove"===n.event.sourceEvent.type?e.x.domain(n.event.transform.rescaleY(e.subX).domain()):e.x.domain(n.event.transform.rescaleX(e.subX).domain())),this},e.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[e.width,e.height]]).extent([[0,0],[e.width,e.height]]),this},e.zoom.update=function(){return this.updateExtent().updateDomain()},e.zoom.updateExtent()},t.prototype.zoomTransform=function(t){var e=[this.x(t[0]),this.x(t[1])];return this.d3.zoomIdentity.scale(this.width/(e[1]-e[0])).translate(-e[0],0)},t.prototype.initDragZoom=function(){var t=this,e=t.d3,n=t.config,r=t.context=t.svg,i=t.margin.left+20.5,a=t.margin.top+.5;if("drag"===n.zoom_type&&n.zoom_enabled){var o=function(e){return e&&e.map((function(e){return t.x.invert(e)}))},s=t.dragZoomBrush=e.brushX().on("start",(function(){t.api.unzoom(),t.svg.select("."+b.dragZoom).classed("disabled",!1),n.zoom_onzoomstart.call(t.api,e.event.sourceEvent)})).on("brush",(function(){n.zoom_onzoom.call(t.api,o(e.event.selection))})).on("end",(function(){if(null!=e.event.selection){var r=o(e.event.selection);n.zoom_disableDefaultBehavior||t.api.zoom(r),t.svg.select("."+b.dragZoom).classed("disabled",!0),n.zoom_onzoomend.call(t.api,r)}}));r.append("g").classed(b.dragZoom,!0).attr("clip-path",t.clipPath).attr("transform","translate("+i+","+a+")").call(s)}},t.prototype.getZoomDomain=function(){var t=this.config,e=this.d3;return[e.min([this.orgXDomain[0],t.zoom_x_min]),e.max([this.orgXDomain[1],t.zoom_x_max])]},t.prototype.redrawForZoom=function(){var t=this,e=t.d3,n=t.config,r=t.zoom,i=t.x;n.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length&&(r.update(),n.zoom_disableDefaultBehavior||(t.isCategorized()&&i.orgDomain()[0]===t.orgXDomain[0]&&i.domain([t.orgXDomain[0]-1e-10,i.orgDomain()[1]]),t.redraw({withTransition:!1,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),e.event.sourceEvent&&"mousemove"===e.event.sourceEvent.type&&(t.cancelClick=!0)))},A}()},function(t,e,n){"use strict";var r=this&&this.__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1?e-1:0),r=1;r0?" Args: "+n.join(", "):""))}var P=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}var e=t.prototype;return e.indexOfGroup=function(t){for(var e=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;t>=i;)(i<<=1)<0&&C(16,""+t);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var a=r;a=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n,a=r;a=0;n--){var r=e[n];if(r&&1===r.nodeType&&r.hasAttribute(b))return r}}(n),a=void 0!==i?i.nextSibling:null;r.setAttribute(b,"active"),r.setAttribute("data-styled-version","5.2.1");var o=D();return o&&r.setAttribute("nonce",o),n.insertBefore(r,a),r},F=function(){function t(t){var e=this.element=z(t);e.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,r=e.length;n=0){var n=document.createTextNode(e),r=this.nodes[t];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},e.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.getRule=function(t){return t0&&(c+=t+",")})),r+=""+s+u+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},t}(),U=/(a)(d)/gi,W=function(t){return String.fromCharCode(t+(t>25?39:97))};function q(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=W(e%52)+n;return(W(e%52)+n).replace(U,"$1-$2")}var $=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},Q=function(t){return $(5381,t)};function Z(t){for(var e=0;e>>0);if(!e.hasNameForId(r,o)){var s=n(a,"."+o,void 0,r);e.insertRules(r,o,s)}i.push(o),this.staticRulesId=o}else{for(var u=this.rules.length,c=$(this.baseHash,n.hash),l="",f=0;f>>0);if(!e.hasNameForId(r,g)){var y=n(l,"."+g,void 0,r);e.insertRules(r,g,y)}i.push(g)}}return i.join(" ")},t}(),tt=/^\s*\/\/.*$/gm,et=[":","[",".","#"];function nt(t){var e,n,r,i,a=void 0===t?_:t,o=a.options,s=void 0===o?_:o,c=a.plugins,l=void 0===c?y:c,f=new u.a(s),h=[],d=function(t){function e(e){if(e)try{t(e+"}")}catch(t){}}return function(n,r,i,a,o,s,u,c,l,f){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return t(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return t(i[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(e)}}}((function(t){h.push(t)})),p=function(t,r,a){return 0===r&&et.includes(a[n.length])||a.match(i)?t:"."+e};function g(t,a,o,s){void 0===s&&(s="&");var u=t.replace(tt,""),c=a&&o?o+" "+a+" { "+u+" }":u;return e=s,n=a,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),f(o||!a?"":a,c)}return f.use([].concat(l,[function(t,e,i){2===t&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,p))},d,function(t){if(-2===t){var e=h;return h=[],e}}])),g.hash=l.length?l.reduce((function(t,e){return e.name||C(15),$(t,e.name)}),5381).toString():"",g}var rt=a.a.createContext(),it=rt.Consumer,at=a.a.createContext(),ot=(at.Consumer,new Y),st=nt();function ut(){return Object(i.useContext)(rt)||ot}function ct(){return Object(i.useContext)(at)||st}function lt(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],r=e[1],o=ut(),u=Object(i.useMemo)((function(){var e=o;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target]),c=Object(i.useMemo)((function(){return nt({options:{prefix:!t.disableVendorPrefixes},plugins:n})}),[t.disableVendorPrefixes,n]);return Object(i.useEffect)((function(){s()(n,t.stylisPlugins)||r(t.stylisPlugins)}),[t.stylisPlugins]),a.a.createElement(rt.Provider,{value:u},a.a.createElement(at.Provider,{value:c},t.children))}var ft=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=st);var r=n.name+e.hash;t.hasNameForId(n.id,r)||t.insertRules(n.id,r,e(n.rules,r,"@keyframes"))},this.toString=function(){return C(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=e}return t.prototype.getName=function(t){return void 0===t&&(t=st),this.name+t.hash},t}(),ht=/([A-Z])/,dt=/([A-Z])/g,pt=/^ms-/,gt=function(t){return"-"+t.toLowerCase()};function yt(t){return ht.test(t)?t.replace(dt,gt).replace(pt,"-ms-"):t}var _t=function(t){return null==t||!1===t||""===t};function xt(t,e,n,r){if(Array.isArray(t)){for(var i,a=[],o=0,s=t.length;o1?e-1:0),r=1;r?@[\\\]^`{|}~-]+/g,wt=/(^-|-$)/g;function St(t){return t.replace(bt,"-").replace(wt,"")}var At=function(t){return q(Q(t)>>>0)};function Tt(t){return"string"==typeof t&&!0}var Ct=function(t){return"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)},Pt=function(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t};function Mt(t,e,n){var r=t[n];Ct(e)&&Ct(r)?Et(r,e):t[n]=e}function Et(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r=0||(i[n]=t[n]);return i}(e,["componentId"]),a=r&&r+"-"+(Tt(t)?t:St(v(t)));return Vt(t,d({},i,{attrs:w,componentId:a}),n)},Object.defineProperty(A,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?Et({},t.defaultProps,e):e}}),A.toString=function(){return"."+A.styledComponentId},o&&h()(A,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),A}var Rt=function(t){return function t(e,n,i){if(void 0===i&&(i=_),!Object(r.isValidElementType)(n))return C(1,String(n));var a=function(){return e(n,i,vt.apply(void 0,arguments))};return a.withConfig=function(r){return t(e,n,d({},i,{},r))},a.attrs=function(r){return t(e,n,d({},i,{attrs:Array.prototype.concat(i.attrs,r).filter(Boolean)}))},a}(Vt,t)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(t){Rt[t]=Rt(t)}));var It=function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Z(t),Y.registerId(this.componentId+1)}var e=t.prototype;return e.createStyles=function(t,e,n,r){var i=r(xt(this.rules,e,n,r).join(""),""),a=this.componentId+t;n.insertRules(a,a,i)},e.removeStyles=function(t,e){e.clearRules(this.componentId+t)},e.renderStyles=function(t,e,n,r){t>2&&Y.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,r)},t}();function Nt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r"+e+""},this.getStyleTags=function(){return t.sealed?C(2):t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)return C(2);var n=((e={})[b]="",e["data-styled-version"]="5.2.1",e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=D();return r&&(n.nonce=r),[a.a.createElement("style",d({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new Y({isServer:!0}),this.sealed=!1}var e=t.prototype;return e.collectStyles=function(t){return this.sealed?C(2):a.a.createElement(lt,{sheet:this.instance},t)},e.interleaveWithNodeStream=function(t){return C(3)},t}(),Ft=function(t){var e=a.a.forwardRef((function(e,n){var r=Object(i.useContext)(Lt),o=t.defaultProps,s=mt(e,r,o);return a.a.createElement(t,d({},e,{theme:s,ref:n}))}));return h()(e,t),e.displayName="WithTheme("+v(t)+")",e},Bt=function(){return Object(i.useContext)(Lt)},Xt={StyleSheet:Y,masterSheet:ot};e.default=Rt}.call(this,n(14))},function(t,e){var n,r,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=s(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f1)for(var n=1;n0?a.default.createElement("div",{className:"nice-padding"},!n&&r,a.default.createElement("table",{className:"listing"},a.default.createElement("thead",null,a.default.createElement("tr",null,a.default.createElement("th",{className:"title"},gettext("Started at")),a.default.createElement("th",null,gettext("Test name")),a.default.createElement("th",null,gettext("Status")))),a.default.createElement("tbody",null,e.map((function(t){return a.default.createElement("tr",{key:t.id},a.default.createElement("td",{className:"title"},t.started_at),a.default.createElement("td",null,a.default.createElement("a",{href:t.results_url},t.name)),a.default.createElement("td",null,a.default.createElement("span",{className:"status-tag primary"},t.status)))}))))):n?a.default.createElement("div",{className:"nice-padding"},a.default.createElement("p",{className:"help-block help-info"},gettext("To create an A/B test:"),a.default.createElement("ol",null,a.default.createElement("li",{style:{listStyleType:"decimal"}},gettext('Ensure you have a published version of the page (this will act as the "Control" in your test)')),a.default.createElement("li",{style:{listStyleType:"decimal"}},gettext('Make changes to the page content (this will act as the "Variant" in your test) and choose "SAVE AND CREATE A/B TEST"')),a.default.createElement("li",{style:{listStyleType:"decimal"}},gettext("Choose your goal")),a.default.createElement("li",{style:{listStyleType:"decimal"}},gettext("Watch your test results come in"))))):a.default.createElement("div",{className:"nice-padding"},r)};e.initPageEditorTab=function(t,e){o.default.render(a.default.createElement(s,r({},e)),t)}},function(t,e,n){var r=n(18);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(6)(r,i);r.locals&&(t.exports=r.locals)},function(t,e,n){(e=t.exports=n(2)(!1)).i(n(19),""),e.push([t.i,".abtest-progressbar{position:relative}.abtest-progressbar__sample-size{width:100%;height:160px}.abtest-progressbar__sample-size line{stroke:black;stroke-width:2px}.abtest-progressbar__sample-size-bg{fill:#e1f0f0}.abtest-progressbar__sample-size-bar{fill:#007273}.abtest-progressbar__sample-size-percentage{font-weight:bold;font-size:40px;fill:white}.abtest-progressbar__sample-size-complete{font-size:17px;fill:white}.abtest-results{margin-bottom:20px;overflow:auto}.abtest-results__version{float:left;width:50%;box-sizing:border-box}.abtest-results__version--control{padding-right:10px;color:#0c0073}.abtest-results__version--control a{color:#0c0073 !important}.abtest-results__version--control a:hover{color:#070040 !important}.abtest-results__version--variant{right:0;padding-left:10px;color:#ef746f}.abtest-results__version--variant a{color:#ef746f !important}.abtest-results__version--variant a:hover{color:#ea4841 !important}.abtest-results__version h3 .icon{width:20px;height:20px}.abtest-results__version-heading{height:30px;border-bottom-width:5px;border-bottom-style:solid;color:white;text-transform:uppercase;text-align:center;font-size:15px;font-weight:bold;line-height:30px}.abtest-results__version-heading .icon-crown{margin-top:4px;margin-right:1px;width:22px;height:22px;vertical-align:-11%}.abtest-results__version--control .abtest-results__version-heading{border-bottom-color:#0c0073}.abtest-results__version--variant .abtest-results__version-heading{border-bottom-color:#ef746f}.abtest-results__version--control .abtest-results__version-heading--winner{background-color:#0c0073}.abtest-results__version--variant .abtest-results__version-heading--winner{background-color:#ef746f}.abtest-results__version-inner{border:1px solid #eeeeee;border-top:none;box-sizing:border-box;padding:20px}.abtest-results__version-inner h3{text-transform:uppercase;margin-top:0;font-weight:bold;font-size:20px}.abtest-results__version-inner .button span{font-weight:bold}.abtest-results__version-stats{list-style-type:none;margin:0;padding:0;margin-bottom:30px}.abtest-results__version-stats:after{content:' ';clear:both;display:block}.abtest-results__version-stats>li{float:left;padding-right:30px;margin-top:30px}.abtest-results__version-stat{font-weight:bold;font-size:50px}.abtest-results__version-stat-name{text-transform:uppercase;font-size:20px;color:#333;margin-top:20px}.abtest-results__version-stat-name span{text-transform:none}.abtest-chart{padding-top:20px}\n",""])},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,".c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc rect{stroke:#fff;stroke-width:1}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:grey;font-size:2em}.c3-line{stroke-width:1px}.c3-circle{fill:currentColor}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:1;fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-region text{fill-opacity:1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-title{font:14px sans-serif}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #ccc}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip .value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max{fill:#777}.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}.c3-chart-arc.c3-target g path{opacity:1}.c3-chart-arc.c3-target.c3-focused g path{opacity:1}.c3-drag-zoom.enabled{pointer-events:all!important;visibility:visible}.c3-drag-zoom.disabled{pointer-events:none!important;visibility:hidden}.c3-drag-zoom .extent{fill-opacity:.1}\n",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(t,e,n){var r=n(22);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(6)(r,i);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(2)(!1)).push([t.i,".section__title{box-sizing:border-box;height:40px;-webkit-font-smoothing:auto;background:#fcf2f2;color:#200200;text-transform:uppercase;padding:0.9em 0 0.9em 5em;font-size:0.95em;margin:0;line-height:1.5em;font-weight:400;overflow:hidden;position:relative}.section__title>h3{display:inline;text-transform:inherit;font-weight:inherit;float:none;color:inherit;font-size:inherit}.section__title::before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-shadow:none;font-family:wagtail;text-transform:none;content:'';text-align:center;display:block;position:absolute;z-index:2;font-size:2em;top:0;line-height:1.8em;left:0;width:50px;color:#fff;padding:0;margin:0;background-color:#f37e77}.section__content{margin-top:20px;margin-bottom:20px}\n",""])},function(t,e,n){"use strict";n.r(e),n.d(e,"version",(function(){return r})),n.d(e,"bisect",(function(){return c})),n.d(e,"bisectRight",(function(){return s})),n.d(e,"bisectLeft",(function(){return u})),n.d(e,"ascending",(function(){return i})),n.d(e,"bisector",(function(){return a})),n.d(e,"cross",(function(){return h})),n.d(e,"descending",(function(){return d})),n.d(e,"deviation",(function(){return y})),n.d(e,"extent",(function(){return _})),n.d(e,"histogram",(function(){return k})),n.d(e,"thresholdFreedmanDiaconis",(function(){return G})),n.d(e,"thresholdScott",(function(){return V})),n.d(e,"thresholdSturges",(function(){return L})),n.d(e,"max",(function(){return R})),n.d(e,"mean",(function(){return I})),n.d(e,"median",(function(){return N})),n.d(e,"merge",(function(){return D})),n.d(e,"min",(function(){return z})),n.d(e,"pairs",(function(){return l})),n.d(e,"permute",(function(){return F})),n.d(e,"quantile",(function(){return O})),n.d(e,"range",(function(){return S})),n.d(e,"scan",(function(){return B})),n.d(e,"shuffle",(function(){return X})),n.d(e,"sum",(function(){return j})),n.d(e,"ticks",(function(){return P})),n.d(e,"tickIncrement",(function(){return M})),n.d(e,"tickStep",(function(){return E})),n.d(e,"transpose",(function(){return H})),n.d(e,"variance",(function(){return g})),n.d(e,"zip",(function(){return U})),n.d(e,"axisTop",(function(){return et})),n.d(e,"axisRight",(function(){return nt})),n.d(e,"axisBottom",(function(){return rt})),n.d(e,"axisLeft",(function(){return it})),n.d(e,"brush",(function(){return Ci})),n.d(e,"brushX",(function(){return Ai})),n.d(e,"brushY",(function(){return Ti})),n.d(e,"brushSelection",(function(){return Si})),n.d(e,"chord",(function(){return Ri})),n.d(e,"ribbon",(function(){return $i})),n.d(e,"nest",(function(){return Ji})),n.d(e,"set",(function(){return sa})),n.d(e,"map",(function(){return Ki})),n.d(e,"keys",(function(){return ua})),n.d(e,"values",(function(){return ca})),n.d(e,"entries",(function(){return la})),n.d(e,"color",(function(){return He})),n.d(e,"rgb",(function(){return qe})),n.d(e,"hsl",(function(){return en})),n.d(e,"lab",(function(){return ga})),n.d(e,"hcl",(function(){return Sa})),n.d(e,"lch",(function(){return wa})),n.d(e,"gray",(function(){return pa})),n.d(e,"cubehelix",(function(){return ka})),n.d(e,"contours",(function(){return Ba})),n.d(e,"contourDensity",(function(){return Wa})),n.d(e,"dispatch",(function(){return ft})),n.d(e,"drag",(function(){return to})),n.d(e,"dragDisable",(function(){return Ce})),n.d(e,"dragEnable",(function(){return Pe})),n.d(e,"dsvFormat",(function(){return so})),n.d(e,"csvParse",(function(){return co})),n.d(e,"csvParseRows",(function(){return lo})),n.d(e,"csvFormat",(function(){return fo})),n.d(e,"csvFormatBody",(function(){return ho})),n.d(e,"csvFormatRows",(function(){return po})),n.d(e,"csvFormatRow",(function(){return go})),n.d(e,"csvFormatValue",(function(){return yo})),n.d(e,"tsvParse",(function(){return xo})),n.d(e,"tsvParseRows",(function(){return vo})),n.d(e,"tsvFormat",(function(){return mo})),n.d(e,"tsvFormatBody",(function(){return bo})),n.d(e,"tsvFormatRows",(function(){return wo})),n.d(e,"tsvFormatRow",(function(){return So})),n.d(e,"tsvFormatValue",(function(){return Ao})),n.d(e,"autoType",(function(){return To})),n.d(e,"easeLinear",(function(){return Po})),n.d(e,"easeQuad",(function(){return Lo})),n.d(e,"easeQuadIn",(function(){return Mo})),n.d(e,"easeQuadOut",(function(){return Eo})),n.d(e,"easeQuadInOut",(function(){return Lo})),n.d(e,"easeCubic",(function(){return Wr})),n.d(e,"easeCubicIn",(function(){return Yr})),n.d(e,"easeCubicOut",(function(){return Ur})),n.d(e,"easeCubicInOut",(function(){return Wr})),n.d(e,"easePoly",(function(){return Go})),n.d(e,"easePolyIn",(function(){return ko})),n.d(e,"easePolyOut",(function(){return Oo})),n.d(e,"easePolyInOut",(function(){return Go})),n.d(e,"easeSin",(function(){return Do})),n.d(e,"easeSinIn",(function(){return Io})),n.d(e,"easeSinOut",(function(){return No})),n.d(e,"easeSinInOut",(function(){return Do})),n.d(e,"easeExp",(function(){return Xo})),n.d(e,"easeExpIn",(function(){return Fo})),n.d(e,"easeExpOut",(function(){return Bo})),n.d(e,"easeExpInOut",(function(){return Xo})),n.d(e,"easeCircle",(function(){return Yo})),n.d(e,"easeCircleIn",(function(){return jo})),n.d(e,"easeCircleOut",(function(){return Ho})),n.d(e,"easeCircleInOut",(function(){return Yo})),n.d(e,"easeBounce",(function(){return Wo})),n.d(e,"easeBounceIn",(function(){return Uo})),n.d(e,"easeBounceOut",(function(){return Wo})),n.d(e,"easeBounceInOut",(function(){return qo})),n.d(e,"easeBack",(function(){return Zo})),n.d(e,"easeBackIn",(function(){return $o})),n.d(e,"easeBackOut",(function(){return Qo})),n.d(e,"easeBackInOut",(function(){return Zo})),n.d(e,"easeElastic",(function(){return ts})),n.d(e,"easeElasticIn",(function(){return Jo})),n.d(e,"easeElasticOut",(function(){return ts})),n.d(e,"easeElasticInOut",(function(){return es})),n.d(e,"blob",(function(){return rs})),n.d(e,"buffer",(function(){return as})),n.d(e,"dsv",(function(){return cs})),n.d(e,"csv",(function(){return ls})),n.d(e,"tsv",(function(){return fs})),n.d(e,"image",(function(){return hs})),n.d(e,"json",(function(){return ps})),n.d(e,"text",(function(){return ss})),n.d(e,"xml",(function(){return ys})),n.d(e,"html",(function(){return _s})),n.d(e,"svg",(function(){return xs})),n.d(e,"forceCenter",(function(){return vs})),n.d(e,"forceCollide",(function(){return Os})),n.d(e,"forceLink",(function(){return Rs})),n.d(e,"forceManyBody",(function(){return Fs})),n.d(e,"forceRadial",(function(){return Bs})),n.d(e,"forceSimulation",(function(){return zs})),n.d(e,"forceX",(function(){return Xs})),n.d(e,"forceY",(function(){return js})),n.d(e,"formatDefaultLocale",(function(){return au})),n.d(e,"format",(function(){return Zs})),n.d(e,"formatPrefix",(function(){return Ks})),n.d(e,"formatLocale",(function(){return iu})),n.d(e,"formatSpecifier",(function(){return Ws})),n.d(e,"FormatSpecifier",(function(){return qs})),n.d(e,"precisionFixed",(function(){return ou})),n.d(e,"precisionPrefix",(function(){return su})),n.d(e,"precisionRound",(function(){return uu})),n.d(e,"geoArea",(function(){return Ju})),n.d(e,"geoBounds",(function(){return Yc})),n.d(e,"geoCentroid",(function(){return rl})),n.d(e,"geoCircle",(function(){return pl})),n.d(e,"geoClipAntimeridian",(function(){return Cl})),n.d(e,"geoClipCircle",(function(){return Pl})),n.d(e,"geoClipExtent",(function(){return Ol})),n.d(e,"geoClipRectangle",(function(){return Ml})),n.d(e,"geoContains",(function(){return Ql})),n.d(e,"geoDistance",(function(){return Bl})),n.d(e,"geoGraticule",(function(){return Jl})),n.d(e,"geoGraticule10",(function(){return tf})),n.d(e,"geoInterpolate",(function(){return of})),n.d(e,"geoLength",(function(){return Dl})),n.d(e,"geoPath",(function(){return ih})),n.d(e,"geoAlbers",(function(){return Sh})),n.d(e,"geoAlbersUsa",(function(){return Ah})),n.d(e,"geoAzimuthalEqualArea",(function(){return Mh})),n.d(e,"geoAzimuthalEqualAreaRaw",(function(){return Ph})),n.d(e,"geoAzimuthalEquidistant",(function(){return Lh})),n.d(e,"geoAzimuthalEquidistantRaw",(function(){return Eh})),n.d(e,"geoConicConformal",(function(){return Ih})),n.d(e,"geoConicConformalRaw",(function(){return Rh})),n.d(e,"geoConicEqualArea",(function(){return wh})),n.d(e,"geoConicEqualAreaRaw",(function(){return bh})),n.d(e,"geoConicEquidistant",(function(){return Fh})),n.d(e,"geoConicEquidistantRaw",(function(){return zh})),n.d(e,"geoEqualEarth",(function(){return Wh})),n.d(e,"geoEqualEarthRaw",(function(){return Uh})),n.d(e,"geoEquirectangular",(function(){return Dh})),n.d(e,"geoEquirectangularRaw",(function(){return Nh})),n.d(e,"geoGnomonic",(function(){return $h})),n.d(e,"geoGnomonicRaw",(function(){return qh})),n.d(e,"geoIdentity",(function(){return Qh})),n.d(e,"geoProjection",(function(){return xh})),n.d(e,"geoProjectionMutator",(function(){return vh})),n.d(e,"geoMercator",(function(){return Oh})),n.d(e,"geoMercatorRaw",(function(){return kh})),n.d(e,"geoNaturalEarth1",(function(){return Kh})),n.d(e,"geoNaturalEarth1Raw",(function(){return Zh})),n.d(e,"geoOrthographic",(function(){return td})),n.d(e,"geoOrthographicRaw",(function(){return Jh})),n.d(e,"geoStereographic",(function(){return nd})),n.d(e,"geoStereographicRaw",(function(){return ed})),n.d(e,"geoTransverseMercator",(function(){return id})),n.d(e,"geoTransverseMercatorRaw",(function(){return rd})),n.d(e,"geoRotation",(function(){return fl})),n.d(e,"geoStream",(function(){return Yu})),n.d(e,"geoTransform",(function(){return ah})),n.d(e,"cluster",(function(){return ud})),n.d(e,"hierarchy",(function(){return ld})),n.d(e,"pack",(function(){return Rd})),n.d(e,"packSiblings",(function(){return Ed})),n.d(e,"packEnclose",(function(){return yd})),n.d(e,"partition",(function(){return Bd})),n.d(e,"stratify",(function(){return Ud})),n.d(e,"tree",(function(){return Jd})),n.d(e,"treemap",(function(){return ip})),n.d(e,"treemapBinary",(function(){return ap})),n.d(e,"treemapDice",(function(){return Fd})),n.d(e,"treemapSlice",(function(){return tp})),n.d(e,"treemapSliceDice",(function(){return op})),n.d(e,"treemapSquarify",(function(){return rp})),n.d(e,"treemapResquarify",(function(){return sp})),n.d(e,"interpolate",(function(){return En})),n.d(e,"interpolateArray",(function(){return vn})),n.d(e,"interpolateBasis",(function(){return on})),n.d(e,"interpolateBasisClosed",(function(){return sn})),n.d(e,"interpolateDate",(function(){return bn})),n.d(e,"interpolateDiscrete",(function(){return up})),n.d(e,"interpolateHue",(function(){return cp})),n.d(e,"interpolateNumber",(function(){return wn})),n.d(e,"interpolateNumberArray",(function(){return _n})),n.d(e,"interpolateObject",(function(){return Sn})),n.d(e,"interpolateRound",(function(){return lp})),n.d(e,"interpolateString",(function(){return Mn})),n.d(e,"interpolateTransformCss",(function(){return hr})),n.d(e,"interpolateTransformSvg",(function(){return dr})),n.d(e,"interpolateZoom",(function(){return dp})),n.d(e,"interpolateRgb",(function(){return dn})),n.d(e,"interpolateRgbBasis",(function(){return gn})),n.d(e,"interpolateRgbBasisClosed",(function(){return yn})),n.d(e,"interpolateHsl",(function(){return gp})),n.d(e,"interpolateHslLong",(function(){return yp})),n.d(e,"interpolateLab",(function(){return _p})),n.d(e,"interpolateHcl",(function(){return vp})),n.d(e,"interpolateHclLong",(function(){return mp})),n.d(e,"interpolateCubehelix",(function(){return wp})),n.d(e,"interpolateCubehelixLong",(function(){return Sp})),n.d(e,"piecewise",(function(){return Ap})),n.d(e,"quantize",(function(){return Tp})),n.d(e,"path",(function(){return ji})),n.d(e,"polygonArea",(function(){return Cp})),n.d(e,"polygonCentroid",(function(){return Pp})),n.d(e,"polygonHull",(function(){return Lp})),n.d(e,"polygonContains",(function(){return kp})),n.d(e,"polygonLength",(function(){return Op})),n.d(e,"quadtree",(function(){return Cs})),n.d(e,"randomUniform",(function(){return Vp})),n.d(e,"randomNormal",(function(){return Rp})),n.d(e,"randomLogNormal",(function(){return Ip})),n.d(e,"randomBates",(function(){return Dp})),n.d(e,"randomIrwinHall",(function(){return Np})),n.d(e,"randomExponential",(function(){return zp})),n.d(e,"scaleBand",(function(){return Wp})),n.d(e,"scalePoint",(function(){return $p})),n.d(e,"scaleIdentity",(function(){return cg})),n.d(e,"scaleLinear",(function(){return ug})),n.d(e,"scaleLog",(function(){return xg})),n.d(e,"scaleSymlog",(function(){return wg})),n.d(e,"scaleOrdinal",(function(){return Up})),n.d(e,"scaleImplicit",(function(){return Yp})),n.d(e,"scalePow",(function(){return Pg})),n.d(e,"scaleSqrt",(function(){return Mg})),n.d(e,"scaleQuantile",(function(){return Eg})),n.d(e,"scaleQuantize",(function(){return Lg})),n.d(e,"scaleThreshold",(function(){return kg})),n.d(e,"scaleTime",(function(){return px})),n.d(e,"scaleUtc",(function(){return Ax})),n.d(e,"scaleSequential",(function(){return Px})),n.d(e,"scaleSequentialLog",(function(){return Mx})),n.d(e,"scaleSequentialPow",(function(){return Lx})),n.d(e,"scaleSequentialSqrt",(function(){return kx})),n.d(e,"scaleSequentialSymlog",(function(){return Ex})),n.d(e,"scaleSequentialQuantile",(function(){return Ox})),n.d(e,"scaleDiverging",(function(){return Vx})),n.d(e,"scaleDivergingLog",(function(){return Rx})),n.d(e,"scaleDivergingPow",(function(){return Nx})),n.d(e,"scaleDivergingSqrt",(function(){return Dx})),n.d(e,"scaleDivergingSymlog",(function(){return Ix})),n.d(e,"tickFormat",(function(){return og})),n.d(e,"schemeCategory10",(function(){return Fx})),n.d(e,"schemeAccent",(function(){return Bx})),n.d(e,"schemeDark2",(function(){return Xx})),n.d(e,"schemePaired",(function(){return jx})),n.d(e,"schemePastel1",(function(){return Hx})),n.d(e,"schemePastel2",(function(){return Yx})),n.d(e,"schemeSet1",(function(){return Ux})),n.d(e,"schemeSet2",(function(){return Wx})),n.d(e,"schemeSet3",(function(){return qx})),n.d(e,"schemeTableau10",(function(){return $x})),n.d(e,"interpolateBrBG",(function(){return Kx})),n.d(e,"schemeBrBG",(function(){return Zx})),n.d(e,"interpolatePRGn",(function(){return tv})),n.d(e,"schemePRGn",(function(){return Jx})),n.d(e,"interpolatePiYG",(function(){return nv})),n.d(e,"schemePiYG",(function(){return ev})),n.d(e,"interpolatePuOr",(function(){return iv})),n.d(e,"schemePuOr",(function(){return rv})),n.d(e,"interpolateRdBu",(function(){return ov})),n.d(e,"schemeRdBu",(function(){return av})),n.d(e,"interpolateRdGy",(function(){return uv})),n.d(e,"schemeRdGy",(function(){return sv})),n.d(e,"interpolateRdYlBu",(function(){return lv})),n.d(e,"schemeRdYlBu",(function(){return cv})),n.d(e,"interpolateRdYlGn",(function(){return hv})),n.d(e,"schemeRdYlGn",(function(){return fv})),n.d(e,"interpolateSpectral",(function(){return pv})),n.d(e,"schemeSpectral",(function(){return dv})),n.d(e,"interpolateBuGn",(function(){return yv})),n.d(e,"schemeBuGn",(function(){return gv})),n.d(e,"interpolateBuPu",(function(){return xv})),n.d(e,"schemeBuPu",(function(){return _v})),n.d(e,"interpolateGnBu",(function(){return mv})),n.d(e,"schemeGnBu",(function(){return vv})),n.d(e,"interpolateOrRd",(function(){return wv})),n.d(e,"schemeOrRd",(function(){return bv})),n.d(e,"interpolatePuBuGn",(function(){return Av})),n.d(e,"schemePuBuGn",(function(){return Sv})),n.d(e,"interpolatePuBu",(function(){return Cv})),n.d(e,"schemePuBu",(function(){return Tv})),n.d(e,"interpolatePuRd",(function(){return Mv})),n.d(e,"schemePuRd",(function(){return Pv})),n.d(e,"interpolateRdPu",(function(){return Lv})),n.d(e,"schemeRdPu",(function(){return Ev})),n.d(e,"interpolateYlGnBu",(function(){return Ov})),n.d(e,"schemeYlGnBu",(function(){return kv})),n.d(e,"interpolateYlGn",(function(){return Vv})),n.d(e,"schemeYlGn",(function(){return Gv})),n.d(e,"interpolateYlOrBr",(function(){return Iv})),n.d(e,"schemeYlOrBr",(function(){return Rv})),n.d(e,"interpolateYlOrRd",(function(){return Dv})),n.d(e,"schemeYlOrRd",(function(){return Nv})),n.d(e,"interpolateBlues",(function(){return Fv})),n.d(e,"schemeBlues",(function(){return zv})),n.d(e,"interpolateGreens",(function(){return Xv})),n.d(e,"schemeGreens",(function(){return Bv})),n.d(e,"interpolateGreys",(function(){return Hv})),n.d(e,"schemeGreys",(function(){return jv})),n.d(e,"interpolatePurples",(function(){return Uv})),n.d(e,"schemePurples",(function(){return Yv})),n.d(e,"interpolateReds",(function(){return qv})),n.d(e,"schemeReds",(function(){return Wv})),n.d(e,"interpolateOranges",(function(){return Qv})),n.d(e,"schemeOranges",(function(){return $v})),n.d(e,"interpolateCividis",(function(){return Zv})),n.d(e,"interpolateCubehelixDefault",(function(){return Kv})),n.d(e,"interpolateRainbow",(function(){return nm})),n.d(e,"interpolateWarm",(function(){return Jv})),n.d(e,"interpolateCool",(function(){return tm})),n.d(e,"interpolateSinebow",(function(){return om})),n.d(e,"interpolateTurbo",(function(){return sm})),n.d(e,"interpolateViridis",(function(){return cm})),n.d(e,"interpolateMagma",(function(){return lm})),n.d(e,"interpolateInferno",(function(){return fm})),n.d(e,"interpolatePlasma",(function(){return hm})),n.d(e,"create",(function(){return dm})),n.d(e,"creator",(function(){return re})),n.d(e,"local",(function(){return gm})),n.d(e,"matcher",(function(){return yt})),n.d(e,"mouse",(function(){return Gn})),n.d(e,"namespace",(function(){return At})),n.d(e,"namespaces",(function(){return St})),n.d(e,"clientPoint",(function(){return kn})),n.d(e,"select",(function(){return Se})),n.d(e,"selectAll",(function(){return _m})),n.d(e,"selection",(function(){return we})),n.d(e,"selector",(function(){return dt})),n.d(e,"selectorAll",(function(){return gt})),n.d(e,"style",(function(){return Rt})),n.d(e,"touch",(function(){return On})),n.d(e,"touches",(function(){return xm})),n.d(e,"window",(function(){return kt})),n.d(e,"event",(function(){return ce})),n.d(e,"customEvent",(function(){return ge})),n.d(e,"arc",(function(){return zm})),n.d(e,"area",(function(){return Ym})),n.d(e,"line",(function(){return Hm})),n.d(e,"pie",(function(){return qm})),n.d(e,"areaRadial",(function(){return tb})),n.d(e,"radialArea",(function(){return tb})),n.d(e,"lineRadial",(function(){return Jm})),n.d(e,"radialLine",(function(){return Jm})),n.d(e,"pointRadial",(function(){return eb})),n.d(e,"linkHorizontal",(function(){return cb})),n.d(e,"linkVertical",(function(){return lb})),n.d(e,"linkRadial",(function(){return fb})),n.d(e,"symbol",(function(){return Eb})),n.d(e,"symbols",(function(){return Mb})),n.d(e,"symbolCircle",(function(){return hb})),n.d(e,"symbolCross",(function(){return db})),n.d(e,"symbolDiamond",(function(){return yb})),n.d(e,"symbolSquare",(function(){return bb})),n.d(e,"symbolStar",(function(){return mb})),n.d(e,"symbolTriangle",(function(){return Sb})),n.d(e,"symbolWye",(function(){return Pb})),n.d(e,"curveBasisClosed",(function(){return Rb})),n.d(e,"curveBasisOpen",(function(){return Nb})),n.d(e,"curveBasis",(function(){return Gb})),n.d(e,"curveBundle",(function(){return zb})),n.d(e,"curveCardinalClosed",(function(){return Hb})),n.d(e,"curveCardinalOpen",(function(){return Ub})),n.d(e,"curveCardinal",(function(){return Xb})),n.d(e,"curveCatmullRomClosed",(function(){return Zb})),n.d(e,"curveCatmullRomOpen",(function(){return Jb})),n.d(e,"curveCatmullRom",(function(){return $b})),n.d(e,"curveLinearClosed",(function(){return ew})),n.d(e,"curveLinear",(function(){return Bm})),n.d(e,"curveMonotoneX",(function(){return cw})),n.d(e,"curveMonotoneY",(function(){return lw})),n.d(e,"curveNatural",(function(){return dw})),n.d(e,"curveStep",(function(){return gw})),n.d(e,"curveStepAfter",(function(){return _w})),n.d(e,"curveStepBefore",(function(){return yw})),n.d(e,"stack",(function(){return bw})),n.d(e,"stackOffsetExpand",(function(){return ww})),n.d(e,"stackOffsetDiverging",(function(){return Sw})),n.d(e,"stackOffsetNone",(function(){return xw})),n.d(e,"stackOffsetSilhouette",(function(){return Aw})),n.d(e,"stackOffsetWiggle",(function(){return Tw})),n.d(e,"stackOrderAppearance",(function(){return Cw})),n.d(e,"stackOrderAscending",(function(){return Mw})),n.d(e,"stackOrderDescending",(function(){return Lw})),n.d(e,"stackOrderInsideOut",(function(){return kw})),n.d(e,"stackOrderNone",(function(){return vw})),n.d(e,"stackOrderReverse",(function(){return Ow})),n.d(e,"timeInterval",(function(){return Vg})),n.d(e,"timeMillisecond",(function(){return gy})),n.d(e,"timeMilliseconds",(function(){return yy})),n.d(e,"utcMillisecond",(function(){return gy})),n.d(e,"utcMilliseconds",(function(){return yy})),n.d(e,"timeSecond",(function(){return hy})),n.d(e,"timeSeconds",(function(){return dy})),n.d(e,"utcSecond",(function(){return hy})),n.d(e,"utcSeconds",(function(){return dy})),n.d(e,"timeMinute",(function(){return cy})),n.d(e,"timeMinutes",(function(){return ly})),n.d(e,"timeHour",(function(){return oy})),n.d(e,"timeHours",(function(){return sy})),n.d(e,"timeDay",(function(){return ry})),n.d(e,"timeDays",(function(){return iy})),n.d(e,"timeWeek",(function(){return Xg})),n.d(e,"timeWeeks",(function(){return $g})),n.d(e,"timeSunday",(function(){return Xg})),n.d(e,"timeSundays",(function(){return $g})),n.d(e,"timeMonday",(function(){return jg})),n.d(e,"timeMondays",(function(){return Qg})),n.d(e,"timeTuesday",(function(){return Hg})),n.d(e,"timeTuesdays",(function(){return Zg})),n.d(e,"timeWednesday",(function(){return Yg})),n.d(e,"timeWednesdays",(function(){return Kg})),n.d(e,"timeThursday",(function(){return Ug})),n.d(e,"timeThursdays",(function(){return Jg})),n.d(e,"timeFriday",(function(){return Wg})),n.d(e,"timeFridays",(function(){return ty})),n.d(e,"timeSaturday",(function(){return qg})),n.d(e,"timeSaturdays",(function(){return ey})),n.d(e,"timeMonth",(function(){return zg})),n.d(e,"timeMonths",(function(){return Fg})),n.d(e,"timeYear",(function(){return Ig})),n.d(e,"timeYears",(function(){return Ng})),n.d(e,"utcMinute",(function(){return wx})),n.d(e,"utcMinutes",(function(){return Sx})),n.d(e,"utcHour",(function(){return vx})),n.d(e,"utcHours",(function(){return mx})),n.d(e,"utcDay",(function(){return Gy})),n.d(e,"utcDays",(function(){return Vy})),n.d(e,"utcWeek",(function(){return xy})),n.d(e,"utcWeeks",(function(){return Ty})),n.d(e,"utcSunday",(function(){return xy})),n.d(e,"utcSundays",(function(){return Ty})),n.d(e,"utcMonday",(function(){return vy})),n.d(e,"utcMondays",(function(){return Cy})),n.d(e,"utcTuesday",(function(){return my})),n.d(e,"utcTuesdays",(function(){return Py})),n.d(e,"utcWednesday",(function(){return by})),n.d(e,"utcWednesdays",(function(){return My})),n.d(e,"utcThursday",(function(){return wy})),n.d(e,"utcThursdays",(function(){return Ey})),n.d(e,"utcFriday",(function(){return Sy})),n.d(e,"utcFridays",(function(){return Ly})),n.d(e,"utcSaturday",(function(){return Ay})),n.d(e,"utcSaturdays",(function(){return ky})),n.d(e,"utcMonth",(function(){return yx})),n.d(e,"utcMonths",(function(){return _x})),n.d(e,"utcYear",(function(){return Iy})),n.d(e,"utcYears",(function(){return Ny})),n.d(e,"timeFormatDefaultLocale",(function(){return lx})),n.d(e,"timeFormat",(function(){return jy})),n.d(e,"timeParse",(function(){return Hy})),n.d(e,"utcFormat",(function(){return Yy})),n.d(e,"utcParse",(function(){return Uy})),n.d(e,"timeFormatLocale",(function(){return By})),n.d(e,"isoFormat",(function(){return Gw})),n.d(e,"isoParse",(function(){return Vw})),n.d(e,"now",(function(){return Xn})),n.d(e,"timer",(function(){return Yn})),n.d(e,"timerFlush",(function(){return Un})),n.d(e,"timeout",(function(){return Qn})),n.d(e,"interval",(function(){return Rw})),n.d(e,"transition",(function(){return Xr})),n.d(e,"active",(function(){return Zr})),n.d(e,"interrupt",(function(){return sr})),n.d(e,"voronoi",(function(){return mS})),n.d(e,"zoom",(function(){return VS})),n.d(e,"zoomTransform",(function(){return TS})),n.d(e,"zoomIdentity",(function(){return AS}));var r="5.16.0",i=function(t,e){return te?1:t>=e?0:NaN},a=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return i(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}};var o=a(i),s=o.right,u=o.left,c=s,l=function(t,e){null==e&&(e=f);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);nt?1:e>=t?0:NaN},p=function(t){return null===t?NaN:+t},g=function(t,e){var n,r,i=t.length,a=0,o=-1,s=0,u=0;if(null==e)for(;++o1)return u/(a-1)},y=function(t,e){var n=g(t,e);return n?Math.sqrt(n):n},_=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i0)return[t];if((r=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=0?(a>=A?10:a>=T?5:a>=C?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=A?10:a>=T?5:a>=C?2:1)}function E(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=A?i*=10:a>=T?i*=5:a>=C&&(i*=2),ef;)h.pop(),--d;var p,g=new Array(d+1);for(i=0;i<=d;++i)(p=g[i]=[]).x0=i>0?h[i-1]:l,p.x1=i=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}},G=function(t,e,n){return t=m.call(t,p).sort(i),Math.ceil((n-e)/(2*(O(t,.75)-O(t,.25))*Math.pow(t.length,-1/3)))},V=function(t,e,n){return Math.ceil((n-e)/(3.5*y(t)*Math.pow(t.length,-1/3)))},R=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r},I=function(t,e){var n,r=t.length,i=r,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n},z=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r},F=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},B=function(t,e){if(n=t.length){var n,r,a=0,o=0,s=t[o];for(null==e&&(e=i);++a=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function ct(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),a=0;ae?1:t>=e?0:NaN}var wt="http://www.w3.org/1999/xhtml",St={svg:"http://www.w3.org/2000/svg",xhtml:wt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},At=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),St.hasOwnProperty(e)?{space:St[e],local:t}:t};function Tt(t){return function(){this.removeAttribute(t)}}function Ct(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Pt(t,e){return function(){this.setAttribute(t,e)}}function Mt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Et(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Lt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var kt=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Ot(t){return function(){this.style.removeProperty(t)}}function Gt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Vt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Rt(t,e){return t.style.getPropertyValue(e)||kt(t).getComputedStyle(t,null).getPropertyValue(e)}function It(t){return function(){delete this[t]}}function Nt(t,e){return function(){this[t]=e}}function Dt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function zt(t){return t.trim().split(/^|\s+/)}function Ft(t){return t.classList||new Bt(t)}function Bt(t){this._node=t,this._names=zt(t.getAttribute("class")||"")}function Xt(t,e){for(var n=Ft(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Wt(){this.textContent=""}function qt(t){return function(){this.textContent=t}}function $t(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Qt(){this.innerHTML=""}function Zt(t){return function(){this.innerHTML=t}}function Kt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Jt(){this.nextSibling&&this.parentNode.appendChild(this)}function te(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ee(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===wt&&e.documentElement.namespaceURI===wt?e.createElement(t):e.createElementNS(n,t)}}function ne(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var re=function(t){var e=At(t);return(e.local?ne:ee)(e)};function ie(){return null}function ae(){var t=this.parentNode;t&&t.removeChild(this)}function oe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function se(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var ue={},ce=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ue={mouseenter:"mouseover",mouseleave:"mouseout"}));function le(t,e,n){return t=fe(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function fe(t,e,n){return function(r){var i=ce;ce=r;try{t.call(this,this.__data__,e,n)}finally{ce=i}}}function he(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function de(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=b&&(b=m+1);!(v=_[b])&&++b=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=bt);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?Ot:"function"==typeof e?Vt:Gt)(t,e,null==n?"":n)):Rt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?It:"function"==typeof e?Dt:Nt)(t,e)):this.node()[t]},classed:function(t,e){var n=zt(t+"");if(arguments.length<2){for(var r=Ft(this.node()),i=-1,a=n.length;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ue(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ue(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Re.exec(t))?new $e(e[1],e[2],e[3],1):(e=Ie.exec(t))?new $e(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ne.exec(t))?Ue(e[1],e[2],e[3],e[4]):(e=De.exec(t))?Ue(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ze.exec(t))?Je(e[1],e[2]/100,e[3]/100,1):(e=Fe.exec(t))?Je(e[1],e[2]/100,e[3]/100,e[4]):Be.hasOwnProperty(t)?Ye(Be[t]):"transparent"===t?new $e(NaN,NaN,NaN,0):null}function Ye(t){return new $e(t>>16&255,t>>8&255,255&t,1)}function Ue(t,e,n,r){return r<=0&&(t=e=n=NaN),new $e(t,e,n,r)}function We(t){return t instanceof Le||(t=He(t)),t?new $e((t=t.rgb()).r,t.g,t.b,t.opacity):new $e}function qe(t,e,n,r){return 1===arguments.length?We(t):new $e(t,e,n,null==r?1:r)}function $e(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Qe(){return"#"+Ke(this.r)+Ke(this.g)+Ke(this.b)}function Ze(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ke(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Je(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new nn(t,e,n,r)}function tn(t){if(t instanceof nn)return new nn(t.h,t.s,t.l,t.opacity);if(t instanceof Le||(t=He(t)),!t)return new nn;if(t instanceof nn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n0&&u<1?0:o,new nn(o,s,u,t.opacity)}function en(t,e,n,r){return 1===arguments.length?tn(t):new nn(t,e,n,null==r?1:r)}function nn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function rn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function an(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}Me(Le,He,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Xe,formatHex:Xe,formatHsl:function(){return tn(this).formatHsl()},formatRgb:je,toString:je}),Me($e,qe,Ee(Le,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $e(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $e(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Qe,formatHex:Qe,formatRgb:Ze,toString:Ze})),Me(nn,en,Ee(Le,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new nn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new nn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new $e(rn(t>=240?t-240:t+120,i,r),rn(t,i,r),rn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var on=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r180||n<-180?n-360*Math.round(n/360):n):un(isNaN(t)?e:t)}function fn(t){return 1==(t=+t)?hn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):un(isNaN(e)?n:e)}}function hn(t,e){var n=e-t;return n?cn(t,n):un(isNaN(t)?e:t)}var dn=function t(e){var n=fn(e);function r(t,e){var r=n((t=qe(t)).r,(e=qe(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=hn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function pn(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:wn(n,r)})),a=Tn.lastIndex;return a=0&&e._call.call(null,t),e=e._next;--Vn}function Wn(){Dn=(Nn=Fn.now())+zn,Vn=Rn=0;try{Un()}finally{Vn=0,function(){var t,e,n=Cn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Cn=e);Pn=t,$n(r)}(),Dn=0}}function qn(){var t=Fn.now(),e=t-Nn;e>1e3&&(zn-=e,Nn=t)}function $n(t){Vn||(Rn&&(Rn=clearTimeout(Rn)),t-Dn>24?(t<1/0&&(Rn=setTimeout(Wn,t-Fn.now()-zn)),In&&(In=clearInterval(In))):(In||(Nn=Fn.now(),In=setInterval(qn,1e3)),Vn=1,Bn(Wn)))}Hn.prototype=Yn.prototype={constructor:Hn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Xn():+n)+(null==e?0:+e),this._next||Pn===this||(Pn?Pn._next=this:Cn=this,Pn=this),this._call=t,this._time=n,$n()},stop:function(){this._call&&(this._call=null,this._time=1/0,$n())}};var Qn=function(t,e,n){var r=new Hn;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},Zn=ft("start","end","cancel","interrupt"),Kn=[],Jn=function(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(u){var c,l,f,h;if(1!==n.state)return s();for(c in i)if((h=i[c]).name===n.name){if(3===h.state)return Qn(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function er(t,e){var n=nr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function nr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var rr,ir,ar,or,sr=function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}},ur=180/Math.PI,cr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},lr=function(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:wn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,u),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:wn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,u),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:wn(t,n)},{i:s-2,x:wn(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,u),a=o=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?tr:er;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}var Vr=we.prototype.constructor;function Rr(t){return function(){this.style.removeProperty(t)}}function Ir(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Nr(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&Ir(t,a,n)),r}return a._value=e,a}function Dr(t){return function(e){this.textContent=t.call(this,e)}}function zr(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Dr(r)),e}return r._value=t,r}var Fr=0;function Br(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Xr(t){return we().transition(t)}function jr(){return++Fr}var Hr=we.prototype;function Yr(t){return t*t*t}function Ur(t){return--t*t*t+1}function Wr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Br.prototype=Xr.prototype={constructor:Br,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=dt(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o1&&n.name===e)return new Br([[t]],Qr,e,+r);return null},Kr=function(t){return function(){return t}},Jr=function(t,e,n){this.target=t,this.type=e,this.selection=n};function ti(){ce.stopImmediatePropagation()}var ei=function(){ce.preventDefault(),ce.stopImmediatePropagation()},ni={name:"drag"},ri={name:"space"},ii={name:"handle"},ai={name:"center"};function oi(t){return[+t[0],+t[1]]}function si(t){return[oi(t[0]),oi(t[1])]}function ui(t){return function(e){return On(e,ce.touches,t)}}var ci={name:"x",handles:["w","e"].map(_i),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},li={name:"y",handles:["n","s"].map(_i),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},fi={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(_i),input:function(t){return null==t?null:si(t)},output:function(t){return t}},hi={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"},di={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},pi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},gi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},yi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function _i(t){return{type:t}}function xi(){return!ce.ctrlKey&&!ce.button}function vi(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function mi(){return navigator.maxTouchPoints||"ontouchstart"in this}function bi(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function wi(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Si(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Ai(){return Pi(ci)}function Ti(){return Pi(li)}var Ci=function(){return Pi(fi)};function Pi(t){var e,n=vi,r=xi,i=mi,a=!0,o=ft("start","brush","end"),s=6;function u(e){var n=e.property("__brush",g).selectAll(".overlay").data([_i("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",hi.overlay).merge(n).each((function(){var t=bi(this).extent;Se(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])})),e.selectAll(".selection").data([_i("selection")]).enter().append("rect").attr("class","selection").attr("cursor",hi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return hi[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=Se(this),e=bi(this).selection;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"e"===t.type[t.type.length-1]?e[1][0]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new f(t,e,n):r}function f(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(){if((!e||ce.touches)&&r.apply(this,arguments)){var n,i,o,s,u,f,h,d,p,g,y,_=this,x=ce.target.__data__.type,v="selection"===(a&&ce.metaKey?x="overlay":x)?ni:a&&ce.altKey?ai:ii,m=t===li?null:gi[x],b=t===ci?null:yi[x],w=bi(_),S=w.extent,A=w.selection,T=S[0][0],C=S[0][1],P=S[1][0],M=S[1][1],E=0,L=0,k=m&&b&&a&&ce.shiftKey,O=ce.touches?ui(ce.changedTouches[0].identifier):Gn,G=O(_),V=G,R=l(_,arguments,!0).beforestart();"overlay"===x?(A&&(p=!0),w.selection=A=[[n=t===li?T:G[0],o=t===ci?C:G[1]],[u=t===li?P:n,h=t===ci?M:o]]):(n=A[0][0],o=A[0][1],u=A[1][0],h=A[1][1]),i=n,s=o,f=u,d=h;var I=Se(_).attr("pointer-events","none"),N=I.selectAll(".overlay").attr("cursor",hi[x]);if(ce.touches)R.moved=z,R.ended=B;else{var D=Se(ce.view).on("mousemove.brush",z,!0).on("mouseup.brush",B,!0);a&&D.on("keydown.brush",X,!0).on("keyup.brush",j,!0),Ce(ce.view)}ti(),sr(_),c.call(_),R.start()}function z(){var t=O(_);!k||g||y||(Math.abs(t[0]-V[0])>Math.abs(t[1]-V[1])?y=!0:g=!0),V=t,p=!0,ei(),F()}function F(){var t;switch(E=V[0]-G[0],L=V[1]-G[1],v){case ri:case ni:m&&(E=Math.max(T-n,Math.min(P-u,E)),i=n+E,f=u+E),b&&(L=Math.max(C-o,Math.min(M-h,L)),s=o+L,d=h+L);break;case ii:m<0?(E=Math.max(T-n,Math.min(P-n,E)),i=n+E,f=u):m>0&&(E=Math.max(T-u,Math.min(P-u,E)),i=n,f=u+E),b<0?(L=Math.max(C-o,Math.min(M-o,L)),s=o+L,d=h):b>0&&(L=Math.max(C-h,Math.min(M-h,L)),s=o,d=h+L);break;case ai:m&&(i=Math.max(T,Math.min(P,n-E*m)),f=Math.max(T,Math.min(P,u+E*m))),b&&(s=Math.max(C,Math.min(M,o-L*b)),d=Math.max(C,Math.min(M,h+L*b)))}f0&&(n=i-E),b<0?h=d-L:b>0&&(o=s-L),v=ri,N.attr("cursor",hi.selection),F());break;default:return}ei()}function j(){switch(ce.keyCode){case 16:k&&(g=y=k=!1,F());break;case 18:v===ai&&(m<0?u=f:m>0&&(n=i),b<0?h=d:b>0&&(o=s),v=ii,F());break;case 32:v===ri&&(ce.altKey?(m&&(u=f-E*m,n=i+E*m),b&&(h=d-L*b,o=s+L*b),v=ai):(m<0?u=f:m>0&&(n=i),b<0?h=d:b>0&&(o=s),v=ii),N.attr("cursor",hi[x]),F());break;default:return}ei()}}function d(){l(this,arguments).moved()}function p(){l(this,arguments).ended()}function g(){var e=this.__brush||{selection:null};return e.extent=si(n.apply(this,arguments)),e.dim=t,e}return u.move=function(e,n){e.selection?e.on("start.brush",(function(){l(this,arguments).beforestart().start()})).on("interrupt.brush end.brush",(function(){l(this,arguments).end()})).tween("brush",(function(){var e=this,r=e.__brush,i=l(e,arguments),a=r.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,r.extent),s=En(a,o);function u(t){r.selection=1===t&&null===o?null:s(t),c.call(e),i.brush()}return null!==a&&null!==o?u:u(1)})):e.each((function(){var e=this,r=arguments,i=e.__brush,a=t.input("function"==typeof n?n.apply(e,r):n,i.extent),o=l(e,r).beforestart();sr(e),i.selection=null===a?null:a,c.call(e),o.start().brush().end()}))},u.clear=function(t){u.move(t,null)},f.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){ge(new Jr(u,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},u.extent=function(t){return arguments.length?(n="function"==typeof t?t:Kr(si(t)),u):n},u.filter=function(t){return arguments.length?(r="function"==typeof t?t:Kr(!!t),u):r},u.touchable=function(t){return arguments.length?(i="function"==typeof t?t:Kr(!!t),u):i},u.handleSize=function(t){return arguments.length?(s=+t,u):s},u.keyModifiers=function(t){return arguments.length?(a=!!t,u):a},u.on=function(){var t=o.on.apply(o,arguments);return t===o?u:t},u}var Mi=Math.cos,Ei=Math.sin,Li=Math.PI,ki=Li/2,Oi=2*Li,Gi=Math.max;function Vi(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}var Ri=function(){var t=0,e=null,n=null,r=null;function i(i){var a,o,s,u,c,l,f=i.length,h=[],d=S(f),p=[],g=[],y=g.groups=new Array(f),_=new Array(f*f);for(a=0,c=-1;++c1e-6)if(Math.abs(l*s-u*c)>1e-6&&i){var h=n-a,d=r-o,p=s*s+u*u,g=h*h+d*d,y=Math.sqrt(p),_=Math.sqrt(f),x=i*Math.tan((Di-Math.acos((p+f-g)/(2*y*_)))/2),v=x/_,m=x/y;Math.abs(v-1)>1e-6&&(this._+="L"+(t+v*c)+","+(e+v*l)),this._+="A"+i+","+i+",0,0,"+ +(l*h>c*d)+","+(this._x1=t+m*s)+","+(this._y1=e+m*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+o,c=e+s,l=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),n&&(f<0&&(f=f%zi+zi),f>Fi?this._+="A"+n+","+n+",0,1,"+l+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Di)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ji=Xi;function Hi(t){return t.source}function Yi(t){return t.target}function Ui(t){return t.radius}function Wi(t){return t.startAngle}function qi(t){return t.endAngle}var $i=function(){var t=Hi,e=Yi,n=Ui,r=Wi,i=qi,a=null;function o(){var o,s=Ii.call(arguments),u=t.apply(this,s),c=e.apply(this,s),l=+n.apply(this,(s[0]=u,s)),f=r.apply(this,s)-ki,h=i.apply(this,s)-ki,d=l*Mi(f),p=l*Ei(f),g=+n.apply(this,(s[0]=c,s)),y=r.apply(this,s)-ki,_=i.apply(this,s)-ki;if(a||(a=o=ji()),a.moveTo(d,p),a.arc(0,0,l,f,h),f===y&&h===_||(a.quadraticCurveTo(0,0,g*Mi(y),g*Ei(y)),a.arc(0,0,g,y,_)),a.quadraticCurveTo(0,0,d,p),a.closePath(),o)return a=null,o+""||null}return o.radius=function(t){return arguments.length?(n="function"==typeof t?t:Ni(+t),o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ni(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ni(+t),o):i},o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(t){return arguments.length?(e=t,o):e},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o};function Qi(){}function Zi(t,e){var n=new Qi;if(t instanceof Qi)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i=r.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var u,c,l,f=-1,h=n.length,d=r[i++],p=Ki(),g=o();++fr.length)return n;var o,s=i[a-1];return null!=e&&a>=r.length?o=n.entries():(o=[],n.each((function(e,n){o.push({key:n,values:t(e,a)})}))),null!=s?o.sort((function(t,e){return s(t.key,e.key)})):o}(a(t,0,na,ra),0)},key:function(t){return r.push(t),n},sortKeys:function(t){return i[r.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}};function ta(){return{}}function ea(t,e,n){t[e]=n}function na(){return Ki()}function ra(t,e,n){t.set(e,n)}function ia(){}var aa=Ki.prototype;function oa(t,e){var n=new ia;if(t instanceof ia)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function xa(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function va(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ma(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ba(t){if(t instanceof Aa)return new Aa(t.h,t.c,t.l,t.opacity);if(t instanceof ya||(t=da(t)),0===t.a&&0===t.b)return new Aa(NaN,0r!=d>r&&n<(h-c)*(r-l)/(d-l)+c&&(i=-i)}return i}function Da(t,e,n){var r,i,a,o;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],a=n[r],o=e[r],i<=a&&a<=o||o<=a&&a<=i)}var za=function(){},Fa=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Ba=function(){var t=1,e=1,n=L,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Va);else{var r=_(t),i=r[0],o=r[1];e=E(i,o,e),e=S(Math.floor(i/e)*e,Math.floor(o/e)*e,e)}return e.map((function(e){return a(t,e)}))}function a(n,i){var a=[],s=[];return function(n,r,i){var a,s,u,c,l,f,h=new Array,d=new Array;a=s=-1,c=n[0]>=r,Fa[c<<1].forEach(p);for(;++a=r,Fa[u|c<<1].forEach(p);Fa[c<<0].forEach(p);for(;++s=r,l=n[s*t]>=r,Fa[c<<1|l<<2].forEach(p);++a=r,f=l,l=n[s*t+a+1]>=r,Fa[u|c<<1|l<<2|f<<3].forEach(p);Fa[c|l<<3].forEach(p)}a=-1,l=n[s*t]>=r,Fa[l<<2].forEach(p);for(;++a=r,Fa[l<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],c=o(r),l=o(u);(e=d[c])?(n=h[l])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(u),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(u),d[e.end=l]=e):(e=h[l])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(u),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=c]=e):h[c]=d[l]={start:c,end:l,ring:[r,u]}}Fa[l<<3].forEach(p)}(n,i,(function(t){r(t,n,i),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?a.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=a.length;n0&&o0&&s0&&a>0))throw new Error("invalid size");return t=r,e=a,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Ra(Ga.call(t)):Ra(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:za,i):r===s},i};function Xa(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(u-=t.data[s-a+o*r]),e.data[s-n+o*r]=u/Math.min(s+1,r-1+a-s,a))}function ja(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(u-=t.data[o+(s-a)*r]),e.data[o+(s-n)*r]=u/Math.min(s+1,i-1+a-s,a))}function Ha(t){return t[0]}function Ya(t){return t[1]}function Ua(){return 1}var Wa=function(){var t=Ha,e=Ya,n=Ua,r=960,i=500,a=20,o=2,s=3*a,u=r+2*s>>o,c=i+2*s>>o,l=Ra(20);function f(r){var i=new Float32Array(u*c),f=new Float32Array(u*c);r.forEach((function(r,a,l){var f=+t(r,a,l)+s>>o,h=+e(r,a,l)+s>>o,d=+n(r,a,l);f>=0&&f=0&&h>o),ja({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o),Xa({width:u,height:c,data:i},{width:u,height:c,data:f},a>>o),ja({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o),Xa({width:u,height:c,data:i},{width:u,height:c,data:f},a>>o),ja({width:u,height:c,data:f},{width:u,height:c,data:i},a>>o);var d=l(i);if(!Array.isArray(d)){var p=R(i);d=E(0,p,d),(d=S(0,Math.floor(p/d)*d,d)).shift()}return Ba().thresholds(d).size([u,c])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,o)-s,t[1]=t[1]*Math.pow(2,o)-s}function y(){return u=r+2*(s=3*a)>>o,c=i+2*s>>o,f}return f.x=function(e){return arguments.length?(t="function"==typeof e?e:Ra(+e),f):t},f.y=function(t){return arguments.length?(e="function"==typeof t?t:Ra(+t),f):e},f.weight=function(t){return arguments.length?(n="function"==typeof t?t:Ra(+t),f):n},f.size=function(t){if(!arguments.length)return[r,i];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return r=e,i=n,y()},f.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),y()},f.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Ra(Ga.call(t)):Ra(t),f):l},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},f},qa=function(t){return function(){return t}};function $a(t,e,n,r,i,a,o,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=u,this._=c}function Qa(){return!ce.ctrlKey&&!ce.button}function Za(){return this.parentNode}function Ka(t){return null==t?{x:ce.x,y:ce.y}:t}function Ja(){return navigator.maxTouchPoints||"ontouchstart"in this}$a.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var to=function(){var t,e,n,r,i=Qa,a=Za,o=Ka,s=Ja,u={},c=ft("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=v("mouse",a.apply(this,arguments),Gn,this,arguments);o&&(Se(ce.view).on("mousemove.drag",p,!0).on("mouseup.drag",g,!0),Ce(ce.view),Ae(),n=!1,t=ce.clientX,e=ce.clientY,o("start"))}}function p(){if(Te(),!n){var r=ce.clientX-t,i=ce.clientY-e;n=r*r+i*i>f}u.mouse("drag")}function g(){Se(ce.view).on("mousemove.drag mouseup.drag",null),Pe(ce.view,n),Te(),u.mouse("end")}function y(){if(i.apply(this,arguments)){var t,e,n=ce.changedTouches,r=a.apply(this,arguments),o=n.length;for(t=0;t9999?"+"+ao(e,6):ao(e,4))+"-"+ao(t.getUTCMonth()+1,2)+"-"+ao(t.getUTCDate(),2)+(a?"T"+ao(n,2)+":"+ao(r,2)+":"+ao(i,2)+"."+ao(a,3)+"Z":i?"T"+ao(n,2)+":"+ao(r,2)+":"+ao(i,2)+"Z":r||n?"T"+ao(n,2)+":"+ao(r,2)+"Z":"")}var so=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,u=a<=0,c=!1;function l(){if(u)return no;if(c)return c=!1,eo;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++=a?u=!0:10===(r=t.charCodeAt(o++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o=(a=(g+_)/2))?g=a:_=a,(l=n>=(o=(y+x)/2))?y=o:x=o,i=d,!(d=d[f=l<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+_)/2))?g=a:_=a,(l=n>=(o=(y+x)/2))?y=o:x=o}while((f=l<<1|c)==(h=(u>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}var Ss=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function As(t){return t[0]}function Ts(t){return t[1]}function Cs(t,e,n){var r=new Ps(null==e?As:e,null==n?Ts:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ps(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Ms(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Es=Cs.prototype=Ps.prototype;function Ls(t){return t.x+t.vx}function ks(t){return t.y+t.vy}Es.copy=function(){var t,e,n=new Ps(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Ms(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Ms(e));return n},Es.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return ws(this.cover(e,n),e,n,t)},Es.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),u=1/0,c=1/0,l=-1/0,f=-1/0;for(n=0;nl&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=a;)switch(s=(eh||(a=u.y0)>d||(o=u.x1)=_)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var x=t-+this._x.call(null,g.data),v=e-+this._y.call(null,g.data),m=x*x+v*v;if(m=(s=(p+y)/2))?p=s:y=s,(l=o>=(u=(g+_)/2))?g=u:_=u,e=d,!(d=d[f=l<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},Es.removeAll=function(t){for(var e=0,n=t.length;eu+d||ic+d||as.index){var p=u-o.x-o.vx,g=c-o.y-o.vy,y=p*p+g*g;yt.r&&(t.r=t[e].r)}function s(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r1?(null==n?s.remove(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}},Fs=function(){var t,e,n,r,i=ms(-30),a=1,o=1/0,s=.81;function u(r){var i,a=t.length,o=Cs(t,Is,Ns).visitAfter(l);for(n=r,i=0;i=o)){(t.data!==e||t.next)&&(0===l&&(d+=(l=bs())*l),0===f&&(d+=(f=bs())*f),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}var Ys=function(t){return(t=Hs(Math.abs(t)))?t[1]:NaN},Us=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ws(t){if(!(e=Us.exec(t)))throw new Error("invalid format: "+t);var e;return new qs({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function qs(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Ws.prototype=qs.prototype,qs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var $s,Qs,Zs,Ks,Js=function(t,e){var n=Hs(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},tu={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Js(100*t,e)},r:Js,s:function(t,e){var n=Hs(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-($s=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Hs(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},eu=function(t){return t},nu=Array.prototype.map,ru=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],iu=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?eu:(e=nu.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),a.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?eu:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(nu.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Ws(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,_=t.trim,x=t.type;"n"===x?(g=!0,x="g"):tu[x]||(void 0===y&&(y=12),_=!0,x="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var v="$"===h?i:"#"===h&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",m="$"===h?a:/[%p]/.test(x)?u:"",b=tu[x],w=/[defgprs%]/.test(x);function S(t){var i,a,u,h=v,S=m;if("c"===x)S=b(t)+S,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:b(Math.abs(t),y),_&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==f&&(A=!1),h=(A?"("===f?f:c:"-"===f||"("===f?"":f)+h,S=("s"===x?ru[8+$s/3]:"")+S+(A&&"("===f?")":""),w)for(i=-1,a=t.length;++i(u=t.charCodeAt(i))||u>57){S=(46===u?o+t.slice(i+1):t.slice(i))+S,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=h.length+t.length+S.length,C=T>1)+h+t+S+C.slice(T);break;default:t=C+h+t+S}return s(t)}return y=void 0===y?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),S.toString=function(){return t+""},S}return{format:f,formatPrefix:function(t,e){var n=f(((t=Ws(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Ys(e)/3))),i=Math.pow(10,-r),a=ru[8+r/3];return function(t){return n(i*t)+a}}}};function au(t){return Qs=iu(t),Zs=Qs.format,Ks=Qs.formatPrefix,Qs}au({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var ou=function(t){return Math.max(0,-Ys(Math.abs(t)))},su=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ys(e)/3)))-Ys(Math.abs(t)))},uu=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ys(e)-Ys(t))+1},cu=function(){return new lu};function lu(){this.reset()}lu.prototype={constructor:lu,reset:function(){this.s=this.t=0},add:function(t){hu(fu,t,this.t),hu(this,fu.s,this.s),this.s?this.t+=fu.t:this.s=fu.t},valueOf:function(){return this.s}};var fu=new lu;function hu(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var du=Math.PI,pu=du/2,gu=du/4,yu=2*du,_u=180/du,xu=du/180,vu=Math.abs,mu=Math.atan,bu=Math.atan2,wu=Math.cos,Su=Math.ceil,Au=Math.exp,Tu=(Math.floor,Math.log),Cu=Math.pow,Pu=Math.sin,Mu=Math.sign||function(t){return t>0?1:t<0?-1:0},Eu=Math.sqrt,Lu=Math.tan;function ku(t){return t>1?0:t<-1?du:Math.acos(t)}function Ou(t){return t>1?pu:t<-1?-pu:Math.asin(t)}function Gu(t){return(t=Pu(t/2))*t}function Vu(){}function Ru(t,e){t&&Nu.hasOwnProperty(t.type)&&Nu[t.type](t,e)}var Iu={Feature:function(t,e){Ru(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,a=wu(e=(e*=xu)/2+gu),o=Pu(e),s=Hu*o,u=ju*a+s*wu(i),c=s*r*Pu(i);Uu.add(bu(c,u)),Xu=t,ju=a,Hu=o}var Ju=function(t){return Wu.reset(),Yu(t,qu),2*Wu};function tc(t){return[bu(t[1],t[0]),Ou(t[2])]}function ec(t){var e=t[0],n=t[1],r=wu(n);return[r*wu(e),r*Pu(e),Pu(n)]}function nc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function rc(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 ic(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ac(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function oc(t){var e=Eu(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var sc,uc,cc,lc,fc,hc,dc,pc,gc,yc,_c=cu(),xc={point:vc,lineStart:bc,lineEnd:wc,polygonStart:function(){xc.point=Sc,xc.lineStart=Ac,xc.lineEnd=Tc,_c.reset(),qu.polygonStart()},polygonEnd:function(){qu.polygonEnd(),xc.point=vc,xc.lineStart=bc,xc.lineEnd=wc,Uu<0?(sc=-(cc=180),uc=-(lc=90)):_c>1e-6?lc=90:_c<-1e-6&&(uc=-90),yc[0]=sc,yc[1]=cc},sphere:function(){sc=-(cc=180),uc=-(lc=90)}};function vc(t,e){gc.push(yc=[sc=t,cc=t]),elc&&(lc=e)}function mc(t,e){var n=ec([t*xu,e*xu]);if(pc){var r=rc(pc,n),i=rc([r[1],-r[0],0],r);oc(i),i=tc(i);var a,o=t-fc,s=o>0?1:-1,u=i[0]*_u*s,c=vu(o)>180;c^(s*fclc&&(lc=a):c^(s*fc<(u=(u+360)%360-180)&&ulc&&(lc=e)),c?tCc(sc,cc)&&(cc=t):Cc(t,cc)>Cc(sc,cc)&&(sc=t):cc>=sc?(tcc&&(cc=t)):t>fc?Cc(sc,t)>Cc(sc,cc)&&(cc=t):Cc(t,cc)>Cc(sc,cc)&&(sc=t)}else gc.push(yc=[sc=t,cc=t]);elc&&(lc=e),pc=n,fc=t}function bc(){xc.point=mc}function wc(){yc[0]=sc,yc[1]=cc,xc.point=vc,pc=null}function Sc(t,e){if(pc){var n=t-fc;_c.add(vu(n)>180?n+(n>0?360:-360):n)}else hc=t,dc=e;qu.point(t,e),mc(t,e)}function Ac(){qu.lineStart()}function Tc(){Sc(hc,dc),qu.lineEnd(),vu(_c)>1e-6&&(sc=-(cc=180)),yc[0]=sc,yc[1]=cc,pc=null}function Cc(t,e){return(e-=t)<0?e+360:e}function Pc(t,e){return t[0]-e[0]}function Mc(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eCc(r[0],r[1])&&(r[1]=i[1]),Cc(i[0],r[1])>Cc(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=Cc(r[1],i[0]))>o&&(o=s,sc=i[0],cc=r[1])}return gc=yc=null,sc===1/0||uc===1/0?[[NaN,NaN],[NaN,NaN]]:[[sc,uc],[cc,lc]]},Uc={sphere:Vu,point:Wc,lineStart:$c,lineEnd:Kc,polygonStart:function(){Uc.lineStart=Jc,Uc.lineEnd=tl},polygonEnd:function(){Uc.lineStart=$c,Uc.lineEnd=Kc}};function Wc(t,e){t*=xu;var n=wu(e*=xu);qc(n*wu(t),n*Pu(t),Pu(e))}function qc(t,e,n){++Ec,kc+=(t-kc)/Ec,Oc+=(e-Oc)/Ec,Gc+=(n-Gc)/Ec}function $c(){Uc.point=Qc}function Qc(t,e){t*=xu;var n=wu(e*=xu);Xc=n*wu(t),jc=n*Pu(t),Hc=Pu(e),Uc.point=Zc,qc(Xc,jc,Hc)}function Zc(t,e){t*=xu;var n=wu(e*=xu),r=n*wu(t),i=n*Pu(t),a=Pu(e),o=bu(Eu((o=jc*a-Hc*i)*o+(o=Hc*r-Xc*a)*o+(o=Xc*i-jc*r)*o),Xc*r+jc*i+Hc*a);Lc+=o,Vc+=o*(Xc+(Xc=r)),Rc+=o*(jc+(jc=i)),Ic+=o*(Hc+(Hc=a)),qc(Xc,jc,Hc)}function Kc(){Uc.point=Wc}function Jc(){Uc.point=el}function tl(){nl(Fc,Bc),Uc.point=Wc}function el(t,e){Fc=t,Bc=e,t*=xu,e*=xu,Uc.point=nl;var n=wu(e);Xc=n*wu(t),jc=n*Pu(t),Hc=Pu(e),qc(Xc,jc,Hc)}function nl(t,e){t*=xu;var n=wu(e*=xu),r=n*wu(t),i=n*Pu(t),a=Pu(e),o=jc*a-Hc*i,s=Hc*r-Xc*a,u=Xc*i-jc*r,c=Eu(o*o+s*s+u*u),l=Ou(c),f=c&&-l/c;Nc+=f*o,Dc+=f*s,zc+=f*u,Lc+=l,Vc+=l*(Xc+(Xc=r)),Rc+=l*(jc+(jc=i)),Ic+=l*(Hc+(Hc=a)),qc(Xc,jc,Hc)}var rl=function(t){Ec=Lc=kc=Oc=Gc=Vc=Rc=Ic=Nc=Dc=zc=0,Yu(t,Uc);var e=Nc,n=Dc,r=zc,i=e*e+n*n+r*r;return i<1e-12&&(e=Vc,n=Rc,r=Ic,Lc<1e-6&&(e=kc,n=Oc,r=Gc),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[bu(n,e)*_u,Ou(r/Eu(i))*_u]},il=function(t){return function(){return t}},al=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function ol(t,e){return[vu(t)>du?t+Math.round(-t/yu)*yu:t,e]}function sl(t,e,n){return(t%=yu)?e||n?al(cl(t),ll(e,n)):cl(t):e||n?ll(e,n):ol}function ul(t){return function(e,n){return[(e+=t)>du?e-yu:e<-du?e+yu:e,n]}}function cl(t){var e=ul(t);return e.invert=ul(-t),e}function ll(t,e){var n=wu(t),r=Pu(t),i=wu(e),a=Pu(e);function o(t,e){var o=wu(e),s=wu(t)*o,u=Pu(t)*o,c=Pu(e),l=c*n+s*r;return[bu(u*i-l*a,s*n-c*r),Ou(l*i+u*a)]}return o.invert=function(t,e){var o=wu(e),s=wu(t)*o,u=Pu(t)*o,c=Pu(e),l=c*i-u*a;return[bu(u*i+c*a,s*n+l*r),Ou(l*n-s*r)]},o}ol.invert=ol;var fl=function(t){function e(e){return(e=t(e[0]*xu,e[1]*xu))[0]*=_u,e[1]*=_u,e}return t=sl(t[0]*xu,t[1]*xu,t.length>2?t[2]*xu:0),e.invert=function(e){return(e=t.invert(e[0]*xu,e[1]*xu))[0]*=_u,e[1]*=_u,e},e};function hl(t,e,n,r,i,a){if(n){var o=wu(e),s=Pu(e),u=r*n;null==i?(i=e+r*yu,a=e-u/2):(i=dl(o,i),a=dl(o,a),(r>0?ia)&&(i+=r*yu));for(var c,l=i;r>0?l>a:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},yl=function(t,e){return vu(t[0]-e[0])<1e-6&&vu(t[1]-e[1])<1e-6};function _l(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var xl=function(t,e,n,r,i){var a,o,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(yl(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a=0;--a)i.point((l=c[a])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function vl(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,T=A*S,C=T>du,P=g*b;if(ml.add(bu(P*A*Pu(T),y*w+P*wu(T))),o+=C?S+A*yu:S,C^d>=n^v>=n){var M=rc(ec(h),ec(x));oc(M);var E=rc(a,M);oc(E);var L=(C^S>=0?-1:1)*Ou(E[2]);(r>L||r===L&&(M[0]||M[1]))&&(s+=C^S>=0?1:-1)}}return(o<-1e-6||o<1e-6&&ml<-1e-6)^1&s},Sl=function(t,e,n,r){return function(i){var a,o,s,u=e(i),c=gl(),l=e(c),f=!1,h={point:d,lineStart:g,lineEnd:y,polygonStart:function(){h.point=_,h.lineStart=x,h.lineEnd=v,o=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=y,o=D(o);var t=wl(a,r);o.length?(f||(i.polygonStart(),f=!0),xl(o,Tl,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function g(){h.point=p,u.lineStart()}function y(){h.point=d,u.lineEnd()}function _(t,e){s.push([t,e]),l.point(t,e)}function x(){l.lineStart(),s=[]}function v(){_(s[0][0],s[0][1]),l.lineEnd();var t,e,n,r,u=l.clean(),h=c.result(),d=h.length;if(s.pop(),a.push(s),s=null,d)if(1&u){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Al))}return h}};function Al(t){return t.length>1}function Tl(t,e){return((t=t.x)[0]<0?t[1]-pu-1e-6:pu-t[1])-((e=e.x)[0]<0?e[1]-pu-1e-6:pu-e[1])}var Cl=Sl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?du:-du,u=vu(a-n);vu(u-du)<1e-6?(t.point(n,r=(r+o)/2>0?pu:-pu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&u>=du&&(vu(n-i)<1e-6&&(n-=1e-6*i),vu(a-s)<1e-6&&(a-=1e-6*s),r=function(t,e,n,r){var i,a,o=Pu(t-n);return vu(o)>1e-6?mu((Pu(e)*(a=wu(r))*Pu(n)-Pu(r)*(i=wu(e))*Pu(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*pu,r.point(-du,i),r.point(0,i),r.point(du,i),r.point(du,0),r.point(du,-i),r.point(0,-i),r.point(-du,-i),r.point(-du,0),r.point(-du,i);else if(vu(t[0]-e[0])>1e-6){var a=t[0]0,i=vu(e)>1e-6;function a(t,n){return wu(t)*wu(n)>e}function o(t,n,r){var i=[1,0,0],a=rc(ec(t),ec(n)),o=nc(a,a),s=a[0],u=o-s*s;if(!u)return!r&&t;var c=e*o/u,l=-e*s/u,f=rc(i,a),h=ac(i,c);ic(h,ac(a,l));var d=f,p=nc(h,d),g=nc(d,d),y=p*p-g*(nc(h,h)-1);if(!(y<0)){var _=Eu(y),x=ac(d,(-p-_)/g);if(ic(x,h),x=tc(x),!r)return x;var v,m=t[0],b=n[0],w=t[1],S=n[1];b0^x[1]<(vu(x[0]-m)<1e-6?w:S):w<=x[1]&&x[1]<=S:A>du^(m<=x[0]&&x[0]<=b)){var C=ac(d,(-p+_)/g);return ic(C,h),[x,tc(C)]}}}function s(e,n){var i=r?t:du-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return Sl(a,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var d,p=[f,h],g=a(f,h),y=r?g?0:s(f,h):g?s(f+(f<0?du:-du),h):0;if(!e&&(c=u=g)&&t.lineStart(),g!==u&&(!(d=o(e,p))||yl(e,d)||yl(p,d))&&(p[2]=1),g!==u)l=0,g?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var _;y&n||!(_=o(p,e,!0))||(l=0,r?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1],3)))}!g||e&&yl(e,p)||t.point(p[0],p[1]),e=p,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,a){hl(a,t,n,i,e,r)}),r?[0,-t]:[-du,t-du])};function Ml(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,c){var l=0,f=0;if(null==i||(l=o(i,s))!==(f=o(a,s))||u(i,a)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(a[0],a[1])}function o(r,i){return vu(r[0]-t)<1e-6?i>0?0:3:vu(r[0]-n)<1e-6?i>0?2:1:vu(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var u,c,l,f,h,d,p,g,y,_,x,v=o,m=gl(),b={point:w,lineStart:function(){b.point=S,c&&c.push(l=[]);_=!0,y=!1,p=g=NaN},lineEnd:function(){u&&(S(f,h),d&&y&&m.rejoin(),u.push(m.result()));b.point=w,y&&v.lineEnd()},polygonStart:function(){v=m,u=[],c=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(h-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(h-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=x&&e,i=(u=D(u)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&xl(u,s,e,a,o),o.polygonEnd());v=o,u=c=l=null}};function w(t,e){i(t,e)&&v.point(t,e)}function S(a,o){var s=i(a,o);if(c&&l.push([a,o]),_)f=a,h=o,d=s,_=!1,s&&(v.lineStart(),v.point(a,o));else if(s&&y)v.point(a,o);else{var u=[p=Math.max(-1e9,Math.min(1e9,p)),g=Math.max(-1e9,Math.min(1e9,g))],m=[a=Math.max(-1e9,Math.min(1e9,a)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,n,r,i,a){var o,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(o=n-s,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>l)return;o>c&&(c=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=h,h<0){if(o0){if(o>l)return;o>c&&(c=o)}if(o=a-u,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>c&&(c=o)}else if(h>0){if(o0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,m,t,e,n,r)?s&&(v.lineStart(),v.point(a,o),x=!1):(y||(v.lineStart(),v.point(u[0],u[1])),v.point(m[0],m[1]),s||v.lineEnd(),x=!1)}p=a,g=o,y=s}return b}}var El,Ll,kl,Ol=function(){var t,e,n,r=0,i=0,a=960,o=500;return n={stream:function(n){return t&&e===n?t:t=Ml(r,i,a,o)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,n):[[r,i],[a,o]]}}},Gl=cu(),Vl={sphere:Vu,point:Vu,lineStart:function(){Vl.point=Il,Vl.lineEnd=Rl},lineEnd:Vu,polygonStart:Vu,polygonEnd:Vu};function Rl(){Vl.point=Vl.lineEnd=Vu}function Il(t,e){El=t*=xu,Ll=Pu(e*=xu),kl=wu(e),Vl.point=Nl}function Nl(t,e){t*=xu;var n=Pu(e*=xu),r=wu(e),i=vu(t-El),a=wu(i),o=r*Pu(i),s=kl*n-Ll*r*a,u=Ll*n+kl*r*a;Gl.add(bu(Eu(o*o+s*s),u)),El=t,Ll=n,kl=r}var Dl=function(t){return Gl.reset(),Yu(t,Vl),+Gl},zl=[null,null],Fl={type:"LineString",coordinates:zl},Bl=function(t,e){return zl[0]=t,zl[1]=e,Dl(Fl)},Xl={Feature:function(t,e){return Hl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Bl(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<1e-12*i)return!0;n=r}return!1}function Wl(t,e){return!!wl(t.map(ql),$l(e))}function ql(t){return(t=t.map($l)).pop(),t}function $l(t){return[t[0]*xu,t[1]*xu]}var Ql=function(t,e){return(t&&Xl.hasOwnProperty(t.type)?Xl[t.type]:Hl)(t,e)};function Zl(t,e,n){var r=S(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Kl(t,e,n){var r=S(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function Jl(){var t,e,n,r,i,a,o,s,u,c,l,f,h=10,d=h,p=90,g=360,y=2.5;function _(){return{type:"MultiLineString",coordinates:x()}}function x(){return S(Su(r/p)*p,n,p).map(l).concat(S(Su(s/g)*g,o,g).map(f)).concat(S(Su(e/h)*h,t,h).filter((function(t){return vu(t%p)>1e-6})).map(u)).concat(S(Su(a/d)*d,i,d).filter((function(t){return vu(t%g)>1e-6})).map(c))}return _.lines=function(){return x().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(o).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),_.precision(y)):[[r,s],[n,o]]},_.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),_.precision(y)):[[e,a],[t,i]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],_):[p,g]},_.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],_):[h,d]},_.precision=function(h){return arguments.length?(y=+h,u=Zl(a,i,90),c=Kl(e,t,y),l=Zl(s,o,90),f=Kl(r,n,y),_):y},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function tf(){return Jl()()}var ef,nf,rf,af,of=function(t,e){var n=t[0]*xu,r=t[1]*xu,i=e[0]*xu,a=e[1]*xu,o=wu(r),s=Pu(r),u=wu(a),c=Pu(a),l=o*wu(n),f=o*Pu(n),h=u*wu(i),d=u*Pu(i),p=2*Ou(Eu(Gu(a-r)+o*u*Gu(i-n))),g=Pu(p),y=p?function(t){var e=Pu(t*=p)/g,n=Pu(p-t)/g,r=n*l+e*h,i=n*f+e*d,a=n*s+e*c;return[bu(i,r)*_u,bu(a,Eu(r*r+i*i))*_u]}:function(){return[n*_u,r*_u]};return y.distance=p,y},sf=function(t){return t},uf=cu(),cf=cu(),lf={point:Vu,lineStart:Vu,lineEnd:Vu,polygonStart:function(){lf.lineStart=ff,lf.lineEnd=pf},polygonEnd:function(){lf.lineStart=lf.lineEnd=lf.point=Vu,uf.add(vu(cf)),cf.reset()},result:function(){var t=uf/2;return uf.reset(),t}};function ff(){lf.point=hf}function hf(t,e){lf.point=df,ef=rf=t,nf=af=e}function df(t,e){cf.add(af*t-rf*e),rf=t,af=e}function pf(){df(ef,nf)}var gf=lf,yf=1/0,_f=yf,xf=-yf,vf=xf;var mf,bf,wf,Sf,Af={point:function(t,e){txf&&(xf=t);e<_f&&(_f=e);e>vf&&(vf=e)},lineStart:Vu,lineEnd:Vu,polygonStart:Vu,polygonEnd:Vu,result:function(){var t=[[yf,_f],[xf,vf]];return xf=vf=-(_f=yf=1/0),t}},Tf=0,Cf=0,Pf=0,Mf=0,Ef=0,Lf=0,kf=0,Of=0,Gf=0,Vf={point:Rf,lineStart:If,lineEnd:zf,polygonStart:function(){Vf.lineStart=Ff,Vf.lineEnd=Bf},polygonEnd:function(){Vf.point=Rf,Vf.lineStart=If,Vf.lineEnd=zf},result:function(){var t=Gf?[kf/Gf,Of/Gf]:Lf?[Mf/Lf,Ef/Lf]:Pf?[Tf/Pf,Cf/Pf]:[NaN,NaN];return Tf=Cf=Pf=Mf=Ef=Lf=kf=Of=Gf=0,t}};function Rf(t,e){Tf+=t,Cf+=e,++Pf}function If(){Vf.point=Nf}function Nf(t,e){Vf.point=Df,Rf(wf=t,Sf=e)}function Df(t,e){var n=t-wf,r=e-Sf,i=Eu(n*n+r*r);Mf+=i*(wf+t)/2,Ef+=i*(Sf+e)/2,Lf+=i,Rf(wf=t,Sf=e)}function zf(){Vf.point=Rf}function Ff(){Vf.point=Xf}function Bf(){jf(mf,bf)}function Xf(t,e){Vf.point=jf,Rf(mf=wf=t,bf=Sf=e)}function jf(t,e){var n=t-wf,r=e-Sf,i=Eu(n*n+r*r);Mf+=i*(wf+t)/2,Ef+=i*(Sf+e)/2,Lf+=i,kf+=(i=Sf*t-wf*e)*(wf+t),Of+=i*(Sf+e),Gf+=3*i,Rf(wf=t,Sf=e)}var Hf=Vf;function Yf(t){this._context=t}Yf.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(){0===this._line&&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,yu)}},result:Vu};var Uf,Wf,qf,$f,Qf,Zf=cu(),Kf={point:Vu,lineStart:function(){Kf.point=Jf},lineEnd:function(){Uf&&th(Wf,qf),Kf.point=Vu},polygonStart:function(){Uf=!0},polygonEnd:function(){Uf=null},result:function(){var t=+Zf;return Zf.reset(),t}};function Jf(t,e){Kf.point=th,Wf=$f=t,qf=Qf=e}function th(t,e){$f-=t,Qf-=e,Zf.add(Eu($f*$f+Qf*Qf)),$f=t,Qf=e}var eh=Kf;function nh(){this._string=[]}function rh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}nh.prototype={_radius:4.5,_circle:rh(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&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:null==this._circle&&(this._circle=rh(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ih=function(t,e){var n,r,i=4.5;function a(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Yu(t,n(r))),r.result()}return a.area=function(t){return Yu(t,n(gf)),gf.result()},a.measure=function(t){return Yu(t,n(eh)),eh.result()},a.bounds=function(t){return Yu(t,n(Af)),Af.result()},a.centroid=function(t){return Yu(t,n(Hf)),Hf.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,sf):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new nh):new Yf(e=t),"function"!=typeof i&&r.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),a):i},a.projection(t).context(e)},ah=function(t){return{stream:oh(t)}};function oh(t){return function(e){var n=new sh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function sh(){}function uh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Yu(n,t.stream(Af)),e(Af.result()),null!=r&&t.clipExtent(r),t}function ch(t,e,n){return uh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function lh(t,e,n){return ch(t,[[0,0],e],n)}function fh(t,e,n){return uh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}function hh(t,e,n){return uh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}sh.prototype={constructor:sh,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()}};var dh=wu(30*xu),ph=function(t,e){return+e?function(t,e){function n(r,i,a,o,s,u,c,l,f,h,d,p,g,y){var _=c-r,x=l-i,v=_*_+x*x;if(v>4*e&&g--){var m=o+h,b=s+d,w=u+p,S=Eu(m*m+b*b+w*w),A=Ou(w/=S),T=vu(vu(w)-1)<1e-6||vu(a-f)<1e-6?(a+f)/2:bu(b,m),C=t(T,A),P=C[0],M=C[1],E=P-r,L=M-i,k=x*E-_*L;(k*k/v>e||vu((_*E+x*L)/v-.5)>.3||o*h+s*d+u*p2?t[2]%360*xu:0,E()):[y*_u,_*_u,x*_u]},P.angle=function(t){return arguments.length?(v=t%360*xu,E()):v*_u},P.reflectX=function(t){return arguments.length?(m=t?-1:1,E()):m<0},P.reflectY=function(t){return arguments.length?(b=t?-1:1,E()):b<0},P.precision=function(t){return arguments.length?(o=ph(s,C=t*t),L()):Eu(C)},P.fitExtent=function(t,e){return ch(P,t,e)},P.fitSize=function(t,e){return lh(P,t,e)},P.fitWidth=function(t,e){return fh(P,t,e)},P.fitHeight=function(t,e){return hh(P,t,e)},function(){return e=t.apply(this,arguments),P.invert=e.invert&&M,E()}}function mh(t){var e=0,n=du/3,r=vh(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*xu,n=t[1]*xu):[e*_u,n*_u]},i}function bh(t,e){var n=Pu(t),r=(n+Pu(e))/2;if(vu(r)<1e-6)return function(t){var e=wu(t);function n(t,n){return[t*e,Pu(n)/e]}return n.invert=function(t,n){return[t/e,Ou(n*e)]},n}(t);var i=1+n*(2*r-n),a=Eu(i)/r;function o(t,e){var n=Eu(i-2*r*Pu(e))/r;return[n*Pu(t*=r),a-n*wu(t)]}return o.invert=function(t,e){var n=a-e,o=bu(t,vu(n))*Mu(n);return n*r<0&&(o-=du*Mu(t)*Mu(n)),[o/r,Ou((i-(t*t+n*n)*r*r)/(2*r))]},o}var wh=function(){return mh(bh).scale(155.424).center([0,33.6442])},Sh=function(){return wh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};var Ah=function(){var t,e,n,r,i,a,o=Sh(),s=wh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=wh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){a=[t,e]}};function l(t){var e=t[0],o=t[1];return a=null,n.point(e,o),a||(r.point(e,o),a)||(i.point(e,o),a)}function f(){return t=e=null,l}return l.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:o).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[o.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<1e-6-pu&&(e=1e-6-pu):e>pu-1e-6&&(e=pu-1e-6);var n=i/Cu(Vh(e),r);return[n*Pu(r*t),i-n*wu(r*t)]}return a.invert=function(t,e){var n=i-e,a=Mu(r)*Eu(t*t+n*n),o=bu(t,vu(n))*Mu(n);return n*r<0&&(o-=du*Mu(t)*Mu(n)),[o/r,2*mu(Cu(i/a,1/r))-pu]},a}var Ih=function(){return mh(Rh).scale(109.5).parallels([30,30])};function Nh(t,e){return[t,e]}Nh.invert=Nh;var Dh=function(){return xh(Nh).scale(152.63)};function zh(t,e){var n=wu(t),r=t===e?Pu(t):(n-wu(e))/(e-t),i=n/r+t;if(vu(r)<1e-6)return Nh;function a(t,e){var n=i-e,a=r*t;return[n*Pu(a),i-n*wu(a)]}return a.invert=function(t,e){var n=i-e,a=bu(t,vu(n))*Mu(n);return n*r<0&&(a-=du*Mu(t)*Mu(n)),[a/r,i-Mu(r)*Eu(t*t+n*n)]},a}var Fh=function(){return mh(zh).scale(131.154).center([0,13.9389])},Bh=1.340264,Xh=-.081106,jh=893e-6,Hh=.003796,Yh=Eu(3)/2;function Uh(t,e){var n=Ou(Yh*Pu(e)),r=n*n,i=r*r*r;return[t*wu(n)/(Yh*(Bh+3*Xh*r+i*(7*jh+9*Hh*r))),n*(Bh+Xh*r+i*(jh+Hh*r))]}Uh.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(Bh+Xh*i+a*(jh+Hh*i))-e)/(Bh+3*Xh*i+a*(7*jh+9*Hh*i)))*r)*i*i,!(vu(n)<1e-12));++o);return[Yh*t*(Bh+3*Xh*i+a*(7*jh+9*Hh*i))/wu(r),Ou(Pu(r)/Yh)]};var Wh=function(){return xh(Uh).scale(177.158)};function qh(t,e){var n=wu(e),r=wu(t)*n;return[n*Pu(t)/r,Pu(e)/r]}qh.invert=Ch(mu);var $h=function(){return xh(qh).scale(144.049).clipAngle(60)},Qh=function(){var t,e,n,r,i,a,o,s=1,u=0,c=0,l=1,f=1,h=0,d=null,p=1,g=1,y=oh({point:function(t,e){var n=v([t,e]);this.stream.point(n[0],n[1])}}),_=sf;function x(){return p=s*l,g=s*f,a=o=null,v}function v(n){var r=n[0]*p,i=n[1]*g;if(h){var a=i*t-r*e;r=r*t+i*e,i=a}return[r+u,i+c]}return v.invert=function(n){var r=n[0]-u,i=n[1]-c;if(h){var a=i*t+r*e;r=r*t-i*e,i=a}return[r/p,i/g]},v.stream=function(t){return a&&o===t?a:a=y(_(o=t))},v.postclip=function(t){return arguments.length?(_=t,d=n=r=i=null,x()):_},v.clipExtent=function(t){return arguments.length?(_=null==t?(d=n=r=i=null,sf):Ml(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),x()):null==d?null:[[d,n],[r,i]]},v.scale=function(t){return arguments.length?(s=+t,x()):s},v.translate=function(t){return arguments.length?(u=+t[0],c=+t[1],x()):[u,c]},v.angle=function(n){return arguments.length?(e=Pu(h=n%360*xu),t=wu(h),x()):h*_u},v.reflectX=function(t){return arguments.length?(l=t?-1:1,x()):l<0},v.reflectY=function(t){return arguments.length?(f=t?-1:1,x()):f<0},v.fitExtent=function(t,e){return ch(v,t,e)},v.fitSize=function(t,e){return lh(v,t,e)},v.fitWidth=function(t,e){return fh(v,t,e)},v.fitHeight=function(t,e){return hh(v,t,e)},v};function Zh(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Zh.invert=function(t,e){var n,r=e,i=25;do{var a=r*r,o=a*a;r-=n=(r*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(vu(n)>1e-6&&--i>0);return[t/(.8707+(a=r*r)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),r]};var Kh=function(){return xh(Zh).scale(175.295)};function Jh(t,e){return[wu(e)*Pu(t),Pu(e)]}Jh.invert=Ch(Ou);var td=function(){return xh(Jh).scale(249.5).clipAngle(90.000001)};function ed(t,e){var n=wu(e),r=1+wu(t)*n;return[n*Pu(t)/r,Pu(e)/r]}ed.invert=Ch((function(t){return 2*mu(t)}));var nd=function(){return xh(ed).scale(250).clipAngle(142)};function rd(t,e){return[Tu(Lu((pu+e)/2)),-t]}rd.invert=function(t,e){return[-e,2*mu(Au(t))-pu]};var id=function(){var t=Gh(rd),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function ad(t,e){return t.parent===e.parent?1:2}function od(t,e){return t+e.x}function sd(t,e){return Math.max(t,e.y)}var ud=function(){var t=ad,e=1,n=1,r=!1;function i(i){var a,o=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(od,0)/t.length}(n),e.y=function(t){return 1+t.reduce(sd,0)}(n)):(e.x=a?o+=t(e,a):0,e.y=0,a=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i};function cd(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function ld(t,e){var n,r,i,a,o,s=new pd(t),u=+t.value&&(s.value=t.value),c=[s];for(null==e&&(e=fd);n=c.pop();)if(u&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)c.push(r=n.children[a]=new pd(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(dd)}function fd(t){return t.children}function hd(t){t.data=t.data.data}function dd(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function pd(t){this.data=t,this.depth=this.height=0,this.parent=null}pd.prototype=ld.prototype={constructor:pd,count:function(){return this.eachAfter(cd)},each:function(t){var e,n,r,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return ld(this).eachBefore(hd)}};var gd=Array.prototype.slice;var yd=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(gd.call(t))).length,a=[];r0&&n*n>r*r+i*i}function md(t,e){for(var n=0;n(o*=o)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*u,n.y=t.y-r*u+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*u,n.y=e.y+r*u+a*s)):(n.x=e.x+n.r,n.y=e.y)}function Td(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Cd(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function Pd(t){this._=t,this.next=null,this.previous=null}function Md(t){if(!(i=t.length))return 0;var e,n,r,i,a,o,s,u,c,l,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;Ad(n,e,r=t[2]),e=new Pd(e),n=new Pd(n),r=new Pd(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(s=3;s0)throw new Error("cycle");return a}return n.id=function(e){return arguments.length?(t=kd(e),n):t},n.parentId=function(t){return arguments.length?(e=kd(t),n):e},n};function Wd(t,e){return t.parent===e.parent?1:2}function qd(t){var e=t.children;return e?e[0]:t.t}function $d(t){var e=t.children;return e?e[e.length-1]:t.t}function Qd(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Zd(t,e,n){return t.a.parent===e.parent?t.a:n}function Kd(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}Kd.prototype=Object.create(pd.prototype);var Jd=function(){var t=Wd,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,a,o=new Kd(t,0),s=[o];e=s.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;i>=0;--i)s.push(n=e.children[i]=new Kd(r[i],i)),n.parent=e;return(o.parent=new Kd(null,0)).children=[o],o}(i);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(o),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,d=h-c.x,p=e/(l.x+h+d),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var a=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,a=e,o=e,s=n,u=a.parent.children[0],c=a.m,l=o.m,f=s.m,h=u.m;s=$d(s),a=qd(a),s&&a;)u=qd(u),(o=$d(o)).a=e,(i=s.z+f-a.z-c+t(s._,a._))>0&&(Qd(Zd(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=a.m,h+=u.m,l+=o.m;s&&!$d(o)&&(o.t=s,o.m+=f-l),a&&!qd(u)&&(u.t=a,u.m+=c-h,r=e)}return r}(e,i,e.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},tp=function(t,e,n,r,i){for(var a,o=t.children,s=-1,u=o.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),y=l*l*g,(d=Math.max(h/y,y/f))>p){l-=s;break}p=d}_.push(o={value:l,dice:u1?e:1)},n}(ep),ip=function(){var t=rp,e=!1,n=1,r=1,i=[0],a=Od,o=Od,s=Od,u=Od,c=Od;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(zd),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=s[e];return l.x0=i,l.y0=a,l.x1=o,void(l.y1=u)}var f=c[e],h=r/2+f,d=e+1,p=n-1;for(;d>>1;c[g]u-a){var x=(i*_+o*y)/r;t(e,d,y,i,a,x,u),t(d,n,_,x,a,o,u)}else{var v=(a*_+u*y)/r;t(e,d,y,i,a,o,v),t(d,n,_,i,v,o,u)}}(0,u,t.value,e,n,r,i)},op=function(t,e,n,r,i){(1&t.depth?tp:Fd)(t,e,n,r,i)},sp=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,u,c,l,f=-1,h=o.length,d=t.value;++f1?e:1)},n}(ep),up=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},cp=function(t,e){var n=ln(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},lp=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},fp=Math.SQRT2;function hp(t){return((t=Math.exp(t))+1/t)/2}var dp=function(t,e){var n,r,i=t[0],a=t[1],o=t[2],s=e[0],u=e[1],c=e[2],l=s-i,f=u-a,h=l*l+f*f;if(h<1e-12)r=Math.log(c/o)/fp,n=function(t){return[i+t*l,a+t*f,o*Math.exp(fp*t*r)]};else{var d=Math.sqrt(h),p=(c*c-o*o+4*h)/(2*o*2*d),g=(c*c-o*o-4*h)/(2*c*2*d),y=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(g*g+1)-g);r=(_-y)/fp,n=function(t){var e,n=t*r,s=hp(y),u=o/(2*d)*(s*(e=fp*n+y,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[i+u*l,a+u*f,o*s/hp(fp*n+y)]}}return n.duration=1e3*r,n};function pp(t){return function(e,n){var r=t((e=en(e)).h,(n=en(n)).h),i=hn(e.s,n.s),a=hn(e.l,n.l),o=hn(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var gp=pp(ln),yp=pp(hn);function _p(t,e){var n=hn((t=ga(t)).l,(e=ga(e)).l),r=hn(t.a,e.a),i=hn(t.b,e.b),a=hn(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}}function xp(t){return function(e,n){var r=t((e=Sa(e)).h,(n=Sa(n)).h),i=hn(e.c,n.c),a=hn(e.l,n.l),o=hn(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var vp=xp(ln),mp=xp(hn);function bp(t){return function e(n){function r(e,r){var i=t((e=ka(e)).h,(r=ka(r)).h),a=hn(e.s,r.s),o=hn(e.l,r.l),s=hn(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}var wp=bp(ln),Sp=bp(hn);function Ap(t,e){for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n1&&(e=t[a[o-2]],n=t[a[o-1]],r=t[s],(n[0]-e[0])*(r[1]-e[1])-(n[1]-e[1])*(r[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}var Lp=function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)c.push(t[r[a[e]][2]]);for(e=+s;es!=c>s&&o<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l},Op=function(t){for(var e,n,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],u=0;++r1);return t+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(Gp),Ip=function t(e){function n(){var t=Rp.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(Gp),Np=function t(e){function n(t){return function(){for(var n=0,r=0;rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function eg(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?ng:eg,i=a=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(o.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((a||(a=r(s,o.map(t),wn)))(n)))},f.domain=function(t){return arguments.length?(o=jp.call(t,Qp),c===Kp||(c=tg(o)),l()):o.slice()},f.range=function(t){return arguments.length?(s=Hp.call(t),l()):s.slice()},f.rangeRound=function(t){return s=Hp.call(t),u=lp,l()},f.clamp=function(t){return arguments.length?(c=t?tg(o):Kp,f):c!==Kp},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function ag(t,e){return ig()(t,e)}var og=function(t,e,n,r){var i,a=E(t,e,n);switch((r=Ws(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=su(a,o))||(r.precision=i),Ks(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=uu(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=ou(a))||(r.precision=i-2*("%"===r.type))}return Zs(r)};function sg(t){var e=t.domain;return t.ticks=function(t){var n=e();return P(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return og(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,o=i.length-1,s=i[a],u=i[o];return u0?r=M(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=M(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(u/r)*r,e(i)):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(u*r)/r,e(i)),t},t}function ug(){var t=ag(Kp,Kp);return t.copy=function(){return rg(t,ug())},Fp.apply(t,arguments),sg(t)}function cg(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=jp.call(e,Qp),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return cg(t).unknown(e)},t=arguments.length?jp.call(t,Qp):[0,1],sg(n)}var lg=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o0){for(;hu)break;g.push(f)}}else for(;h=1;--l)if(!((f=c*l)u)break;g.push(f)}}else g=P(h,d,Math.min(d-h,p)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===a?".0e":","),"function"!=typeof i&&(i=Zs(i)),t===1/0)return i;null==t&&(t=10);var o=Math.max(1,a*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*a0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[o-1],i[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return Lg().domain([e,n]).range(a).unknown(t)},Fp.apply(sg(o),arguments)}function kg(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[c(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Hp.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Hp.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return kg().domain(e).range(n).unknown(t)},Fp.apply(i,arguments)}var Og=new Date,Gg=new Date;function Vg(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return s;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Og.setTime(+e),Gg.setTime(+r),t(Og),t(Gg),Math.floor(n(Og,Gg))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Rg=Vg((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()}));Rg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Vg((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Ig=Rg,Ng=Rg.range,Dg=Vg((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),zg=Dg,Fg=Dg.range;function Bg(t){return Vg((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var Xg=Bg(0),jg=Bg(1),Hg=Bg(2),Yg=Bg(3),Ug=Bg(4),Wg=Bg(5),qg=Bg(6),$g=Xg.range,Qg=jg.range,Zg=Hg.range,Kg=Yg.range,Jg=Ug.range,ty=Wg.range,ey=qg.range,ny=Vg((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),ry=ny,iy=ny.range,ay=Vg((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),oy=ay,sy=ay.range,uy=Vg((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),cy=uy,ly=uy.range,fy=Vg((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),hy=fy,dy=fy.range,py=Vg((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));py.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Vg((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):py:null};var gy=py,yy=py.range;function _y(t){return Vg((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var xy=_y(0),vy=_y(1),my=_y(2),by=_y(3),wy=_y(4),Sy=_y(5),Ay=_y(6),Ty=xy.range,Cy=vy.range,Py=my.range,My=by.range,Ey=wy.range,Ly=Sy.range,ky=Ay.range,Oy=Vg((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),Gy=Oy,Vy=Oy.range,Ry=Vg((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()}));Ry.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Vg((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Iy=Ry,Ny=Ry.range;function Dy(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function zy(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Fy(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function By(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,u=t.shortMonths,c=Jy(i),l=t_(i),f=Jy(a),h=t_(a),d=Jy(o),p=t_(o),g=Jy(s),y=t_(s),_=Jy(u),x=t_(u),v={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:b_,e:b_,f:C_,g:N_,G:z_,H:w_,I:S_,j:A_,L:T_,m:P_,M:M_,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ux,s:cx,S:E_,u:L_,U:k_,V:G_,w:V_,W:R_,x:null,X:null,y:I_,Y:D_,Z:F_,"%":sx},m={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:B_,e:B_,f:U_,g:rx,G:ax,H:X_,I:j_,j:H_,L:Y_,m:W_,M:q_,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ux,s:cx,S:$_,u:Q_,U:Z_,V:J_,w:tx,W:ex,x:null,X:null,y:nx,Y:ix,Z:ox,"%":sx},b={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=_.exec(e.slice(n));return r?(t.m=x[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return A(t,e,n,r)},d:f_,e:f_,f:__,g:s_,G:o_,H:d_,I:d_,j:h_,L:y_,m:l_,M:p_,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:c_,Q:v_,s:m_,S:g_,u:n_,U:r_,V:i_,w:e_,W:a_,x:function(t,e,r){return A(t,n,e,r)},X:function(t,e,n){return A(t,r,e,n)},y:s_,Y:o_,Z:u_,"%":x_};function w(t,e){return function(n){var r,i,a,o=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=zy(Fy(a.y,0,1))).getUTCDay(),r=i>4||0===i?vy.ceil(r):vy(r),r=Gy.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Dy(Fy(a.y,0,1))).getDay(),r=i>4||0===i?jg.ceil(r):jg(r),r=ry.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?zy(Fy(a.y,0,1)).getUTCDay():Dy(Fy(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,zy(a)):Dy(a)}}function A(t,e,n,r){for(var i,a,o=0,s=e.length,u=n.length;o=u)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=b[i in Wy?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=w(n,v),v.X=w(r,v),v.c=w(e,v),m.x=w(n,m),m.X=w(r,m),m.c=w(e,m),{format:function(t){var e=w(t+="",v);return e.toString=function(){return t},e},parse:function(t){var e=S(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",m);return e.toString=function(){return t},e},utcParse:function(t){var e=S(t+="",!0);return e.toString=function(){return t},e}}}var Xy,jy,Hy,Yy,Uy,Wy={"-":"",_:" ",0:"0"},qy=/^\s*\d+/,$y=/^%/,Qy=/[\\^$*+?|[\]().{}]/g;function Zy(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function u_(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function c_(t,e,n){var r=qy.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function l_(t,e,n){var r=qy.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function f_(t,e,n){var r=qy.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function h_(t,e,n){var r=qy.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function d_(t,e,n){var r=qy.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function p_(t,e,n){var r=qy.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function g_(t,e,n){var r=qy.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function y_(t,e,n){var r=qy.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function __(t,e,n){var r=qy.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function x_(t,e,n){var r=$y.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function v_(t,e,n){var r=qy.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function m_(t,e,n){var r=qy.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function b_(t,e){return Zy(t.getDate(),e,2)}function w_(t,e){return Zy(t.getHours(),e,2)}function S_(t,e){return Zy(t.getHours()%12||12,e,2)}function A_(t,e){return Zy(1+ry.count(Ig(t),t),e,3)}function T_(t,e){return Zy(t.getMilliseconds(),e,3)}function C_(t,e){return T_(t,e)+"000"}function P_(t,e){return Zy(t.getMonth()+1,e,2)}function M_(t,e){return Zy(t.getMinutes(),e,2)}function E_(t,e){return Zy(t.getSeconds(),e,2)}function L_(t){var e=t.getDay();return 0===e?7:e}function k_(t,e){return Zy(Xg.count(Ig(t)-1,t),e,2)}function O_(t){var e=t.getDay();return e>=4||0===e?Ug(t):Ug.ceil(t)}function G_(t,e){return t=O_(t),Zy(Ug.count(Ig(t),t)+(4===Ig(t).getDay()),e,2)}function V_(t){return t.getDay()}function R_(t,e){return Zy(jg.count(Ig(t)-1,t),e,2)}function I_(t,e){return Zy(t.getFullYear()%100,e,2)}function N_(t,e){return Zy((t=O_(t)).getFullYear()%100,e,2)}function D_(t,e){return Zy(t.getFullYear()%1e4,e,4)}function z_(t,e){var n=t.getDay();return Zy((t=n>=4||0===n?Ug(t):Ug.ceil(t)).getFullYear()%1e4,e,4)}function F_(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Zy(e/60|0,"0",2)+Zy(e%60,"0",2)}function B_(t,e){return Zy(t.getUTCDate(),e,2)}function X_(t,e){return Zy(t.getUTCHours(),e,2)}function j_(t,e){return Zy(t.getUTCHours()%12||12,e,2)}function H_(t,e){return Zy(1+Gy.count(Iy(t),t),e,3)}function Y_(t,e){return Zy(t.getUTCMilliseconds(),e,3)}function U_(t,e){return Y_(t,e)+"000"}function W_(t,e){return Zy(t.getUTCMonth()+1,e,2)}function q_(t,e){return Zy(t.getUTCMinutes(),e,2)}function $_(t,e){return Zy(t.getUTCSeconds(),e,2)}function Q_(t){var e=t.getUTCDay();return 0===e?7:e}function Z_(t,e){return Zy(xy.count(Iy(t)-1,t),e,2)}function K_(t){var e=t.getUTCDay();return e>=4||0===e?wy(t):wy.ceil(t)}function J_(t,e){return t=K_(t),Zy(wy.count(Iy(t),t)+(4===Iy(t).getUTCDay()),e,2)}function tx(t){return t.getUTCDay()}function ex(t,e){return Zy(vy.count(Iy(t)-1,t),e,2)}function nx(t,e){return Zy(t.getUTCFullYear()%100,e,2)}function rx(t,e){return Zy((t=K_(t)).getUTCFullYear()%100,e,2)}function ix(t,e){return Zy(t.getUTCFullYear()%1e4,e,4)}function ax(t,e){var n=t.getUTCDay();return Zy((t=n>=4||0===n?wy(t):wy.ceil(t)).getUTCFullYear()%1e4,e,4)}function ox(){return"+0000"}function sx(){return"%"}function ux(t){return+t}function cx(t){return Math.floor(+t/1e3)}function lx(t){return Xy=By(t),jy=Xy.format,Hy=Xy.parse,Yy=Xy.utcFormat,Uy=Xy.utcParse,Xy}lx({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 fx(t){return new Date(t)}function hx(t){return t instanceof Date?+t:+new Date(+t)}function dx(t,e,n,r,i,o,s,u,c){var l=ag(Kp,Kp),f=l.invert,h=l.domain,d=c(".%L"),p=c(":%S"),g=c("%I:%M"),y=c("%I %p"),_=c("%a %d"),x=c("%b %d"),v=c("%B"),m=c("%Y"),b=[[s,1,1e3],[s,5,5e3],[s,15,15e3],[s,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function w(a){return(s(a)1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return em.h=360*t-100,em.s=1.5-1.5*e,em.l=.8-.9*e,em+""},rm=qe(),im=Math.PI/3,am=2*Math.PI/3,om=function(t){var e;return t=(.5-t)*Math.PI,rm.r=255*(e=Math.sin(t))*e,rm.g=255*(e=Math.sin(t+im))*e,rm.b=255*(e=Math.sin(t+am))*e,rm+""},sm=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function um(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var cm=um(zx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),lm=um(zx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),fm=um(zx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),hm=um(zx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),dm=function(t){return Se(re(t).call(document.documentElement))},pm=0;function gm(){return new ym}function ym(){this._="@"+(++pm).toString(36)}ym.prototype=gm.prototype={constructor:ym,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var _m=function(t){return"string"==typeof t?new me([document.querySelectorAll(t)],[document.documentElement]):new me([null==t?[]:t],ve)},xm=function(t,e){null==e&&(e=Ln().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n1?0:t<-1?Pm:Math.acos(t)}function km(t){return t>=1?Mm:t<=-1?-Mm:Math.asin(t)}function Om(t){return t.innerRadius}function Gm(t){return t.outerRadius}function Vm(t){return t.startAngle}function Rm(t){return t.endAngle}function Im(t){return t&&t.padAngle}function Nm(t,e,n,r,i,a,o,s){var u=n-t,c=r-e,l=o-i,f=s-a,h=f*u-l*c;if(!(h*h<1e-12))return[t+(h=(l*(e-a)-f*(t-i))/h)*u,e+h*c]}function Dm(t,e,n,r,i,a,o){var s=t-n,u=e-r,c=(o?a:-a)/Cm(s*s+u*u),l=c*u,f=-c*s,h=t+l,d=e+f,p=n+l,g=r+f,y=(h+p)/2,_=(d+g)/2,x=p-h,v=g-d,m=x*x+v*v,b=i-a,w=h*g-p*d,S=(v<0?-1:1)*Cm(Sm(0,b*b*m-w*w)),A=(w*v-x*S)/m,T=(-w*x-v*S)/m,C=(w*v+x*S)/m,P=(-w*x+v*S)/m,M=A-y,E=T-_,L=C-y,k=P-_;return M*M+E*E>L*L+k*k&&(A=C,T=P),{cx:A,cy:T,x01:-l,y01:-f,x11:A*(i/b-1),y11:T*(i/b-1)}}var zm=function(){var t=Om,e=Gm,n=vm(0),r=null,i=Vm,a=Rm,o=Im,s=null;function u(){var u,c,l=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-Mm,d=a.apply(this,arguments)-Mm,p=mm(d-h),g=d>h;if(s||(s=u=ji()),f1e-12)if(p>Em-1e-12)s.moveTo(f*wm(h),f*Tm(h)),s.arc(0,0,f,h,d,!g),l>1e-12&&(s.moveTo(l*wm(d),l*Tm(d)),s.arc(0,0,l,d,h,g));else{var y,_,x=h,v=d,m=h,b=d,w=p,S=p,A=o.apply(this,arguments)/2,T=A>1e-12&&(r?+r.apply(this,arguments):Cm(l*l+f*f)),C=Am(mm(f-l)/2,+n.apply(this,arguments)),P=C,M=C;if(T>1e-12){var E=km(T/l*Tm(A)),L=km(T/f*Tm(A));(w-=2*E)>1e-12?(m+=E*=g?1:-1,b-=E):(w=0,m=b=(h+d)/2),(S-=2*L)>1e-12?(x+=L*=g?1:-1,v-=L):(S=0,x=v=(h+d)/2)}var k=f*wm(x),O=f*Tm(x),G=l*wm(b),V=l*Tm(b);if(C>1e-12){var R,I=f*wm(v),N=f*Tm(v),D=l*wm(m),z=l*Tm(m);if(p1e-12?M>1e-12?(y=Dm(D,z,k,O,f,M,g),_=Dm(I,N,G,V,f,M,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),M1e-12&&w>1e-12?P>1e-12?(y=Dm(G,V,I,N,l,-P,g),_=Dm(k,O,D,z,l,-P,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),P=l;--f)s.point(y[f],_[f]);s.lineEnd(),s.areaEnd()}g&&(y[c]=+t(h,c,u),_[c]=+n(h,c,u),s.point(e?+e(h,c,u):y[c],r?+r(h,c,u):_[c]))}if(d)return s=null,d+""||null}function c(){return Hm().defined(i).curve(o).context(a)}return u.x=function(n){return arguments.length?(t="function"==typeof n?n:vm(+n),e=null,u):t},u.x0=function(e){return arguments.length?(t="function"==typeof e?e:vm(+e),u):t},u.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:vm(+t),u):e},u.y=function(t){return arguments.length?(n="function"==typeof t?t:vm(+t),r=null,u):n},u.y0=function(t){return arguments.length?(n="function"==typeof t?t:vm(+t),u):n},u.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:vm(+t),u):r},u.lineX0=u.lineY0=function(){return c().x(t).y(n)},u.lineY1=function(){return c().x(t).y(r)},u.lineX1=function(){return c().x(e).y(n)},u.defined=function(t){return arguments.length?(i="function"==typeof t?t:vm(!!t),u):i},u.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),u):o},u.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),u):a},u},Um=function(t,e){return et?1:e>=t?0:NaN},Wm=function(t){return t},qm=function(){var t=Wm,e=Um,n=null,r=vm(0),i=vm(Em),a=vm(0);function o(o){var s,u,c,l,f,h=o.length,d=0,p=new Array(h),g=new Array(h),y=+r.apply(this,arguments),_=Math.min(Em,Math.max(-Em,i.apply(this,arguments)-y)),x=Math.min(Math.abs(_)/h,a.apply(this,arguments)),v=x*(_<0?-1:1);for(s=0;s0&&(d+=f);for(null!=e?p.sort((function(t,n){return e(g[t],g[n])})):null!=n&&p.sort((function(t,e){return n(o[t],o[e])})),s=0,c=d?(_-h*v)/d:0;s0?f*c:0)+v,g[u]={data:o[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:x};return g}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:vm(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:vm(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:vm(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:vm(+t),o):a},o},$m=Zm(Bm);function Qm(t){this._curve=t}function Zm(t){function e(e){return new Qm(t(e))}return e._curve=t,e}function Km(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Zm(t)):e()._curve},t}Qm.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))}};var Jm=function(){return Km(Hm().curve($m))},tb=function(){var t=Ym().curve($m),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return 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 Km(n())},delete t.lineX0,t.lineEndAngle=function(){return Km(r())},delete t.lineX1,t.lineInnerRadius=function(){return Km(i())},delete t.lineY0,t.lineOuterRadius=function(){return Km(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Zm(t)):e()._curve},t},eb=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},nb=Array.prototype.slice;function rb(t){return t.source}function ib(t){return t.target}function ab(t){var e=rb,n=ib,r=Xm,i=jm,a=null;function o(){var o,s=nb.call(arguments),u=e.apply(this,s),c=n.apply(this,s);if(a||(a=o=ji()),t(a,+r.apply(this,(s[0]=u,s)),+i.apply(this,s),+r.apply(this,(s[0]=c,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(r="function"==typeof t?t:vm(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:vm(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}function ob(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function sb(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function ub(t,e,n,r,i){var a=eb(e,n),o=eb(e,n=(n+i)/2),s=eb(r,n),u=eb(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],u[0],u[1])}function cb(){return ab(ob)}function lb(){return ab(sb)}function fb(){var t=ab(ub);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var hb={draw:function(t,e){var n=Math.sqrt(e/Pm);t.moveTo(n,0),t.arc(0,0,n,0,Em)}},db={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()}},pb=Math.sqrt(1/3),gb=2*pb,yb={draw:function(t,e){var n=Math.sqrt(e/gb),r=n*pb;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},_b=Math.sin(Pm/10)/Math.sin(7*Pm/10),xb=Math.sin(Em/10)*_b,vb=-Math.cos(Em/10)*_b,mb={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=xb*n,i=vb*n;t.moveTo(0,-n),t.lineTo(r,i);for(var a=1;a<5;++a){var o=Em*a/5,s=Math.cos(o),u=Math.sin(o);t.lineTo(u*n,-s*n),t.lineTo(s*r-u*i,u*r+s*i)}t.closePath()}},bb={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},wb=Math.sqrt(3),Sb={draw:function(t,e){var n=-Math.sqrt(e/(3*wb));t.moveTo(0,2*n),t.lineTo(-wb*n,-n),t.lineTo(wb*n,-n),t.closePath()}},Ab=Math.sqrt(3)/2,Tb=1/Math.sqrt(12),Cb=3*(Tb/2+1),Pb={draw:function(t,e){var n=Math.sqrt(e/Cb),r=n/2,i=n*Tb,a=r,o=n*Tb+n,s=-a,u=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,u),t.lineTo(-.5*r-Ab*i,Ab*r+-.5*i),t.lineTo(-.5*a-Ab*o,Ab*a+-.5*o),t.lineTo(-.5*s-Ab*u,Ab*s+-.5*u),t.lineTo(-.5*r+Ab*i,-.5*i-Ab*r),t.lineTo(-.5*a+Ab*o,-.5*o-Ab*a),t.lineTo(-.5*s+Ab*u,-.5*u-Ab*s),t.closePath()}},Mb=[hb,db,yb,bb,mb,Sb,Pb],Eb=function(){var t=vm(hb),e=vm(64),n=null;function r(){var r;if(n||(n=r=ji()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:vm(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:vm(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r},Lb=function(){};function kb(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 Ob(t){this._context=t}Ob.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:kb(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:kb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Gb=function(t){return new Ob(t)};function Vb(t){this._context=t}Vb.prototype={areaStart:Lb,areaEnd:Lb,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)}},point:function(t,e){switch(t=+t,e=+e,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:kb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Rb=function(t){return new Vb(t)};function Ib(t){this._context=t}Ib.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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:kb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Nb=function(t){return new Ib(t)};function Db(t,e){this._basis=new Ob(t),this._beta=e}Db.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,s=e[n]-a,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*o),this._beta*e[u]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var zb=function t(e){function n(t){return 1===e?new Ob(t):new Db(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Fb(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 Bb(t,e){this._context=t,this._k=(1-e)/6}Bb.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:Fb(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Fb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Xb=function t(e){function n(t){return new Bb(t,e)}return n.tension=function(e){return t(+e)},n}(0);function jb(t,e){this._context=t,this._k=(1-e)/6}jb.prototype={areaStart:Lb,areaEnd:Lb,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)}},point:function(t,e){switch(t=+t,e=+e,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:Fb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Hb=function t(e){function n(t){return new jb(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Yb(t,e){this._context=t,this._k=(1-e)/6}Yb.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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Fb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ub=function t(e){function n(t){return new Yb(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Wb(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){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);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>1e-12){var c=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);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function qb(t,e){this._context=t,this._alpha=e}qb.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)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Wb(this,t,e)}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 $b=function t(e){function n(t){return e?new qb(t,e):new Bb(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Qb(t,e){this._context=t,this._alpha=e}Qb.prototype={areaStart:Lb,areaEnd:Lb,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)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Wb(this,t,e)}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 Zb=function t(e){function n(t){return e?new Qb(t,e):new jb(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Kb(t,e){this._context=t,this._alpha=e}Kb.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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:Wb(this,t,e)}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 Jb=function t(e){function n(t){return e?new Kb(t,e):new Yb(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function tw(t){this._context=t}tw.prototype={areaStart:Lb,areaEnd:Lb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var ew=function(t){return new tw(t)};function nw(t){return t<0?-1:1}function rw(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(nw(a)+nw(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function iw(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function aw(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function ow(t){this._context=t}function sw(t){this._context=new uw(t)}function uw(t){this._context=t}function cw(t){return new ow(t)}function lw(t){return new sw(t)}function fw(t){this._context=t}function hw(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,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)}}this._x=t,this._y=e}};var gw=function(t){return new pw(t,.5)};function yw(t){return new pw(t,0)}function _w(t){return new pw(t,1)}var xw=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],s=o.length;a=0;)n[e]=e;return n};function mw(t,e){return t[e]}var bw=function(){var t=vm([]),e=vw,n=xw,r=mw;function i(i){var a,o,s=t.apply(this,arguments),u=i.length,c=s.length,l=new Array(c);for(a=0;a0){for(var n,r,i,a=0,o=t[0].length;a0)for(var n,r,i,a,o,s,u=0,c=t[e[0]].length;u0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)},Aw=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],a=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,a=0,o=1;oa&&(a=e,r=n);return r}var Mw=function(t){var e=t.map(Ew);return vw(t).sort((function(t,n){return e[t]-e[n]}))};function Ew(t){for(var e,n=0,r=-1,i=t.length;++r0)){if(a/=h,h<0){if(a0){if(a>f)return;a>l&&(l=a)}if(a=r-u,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>l&&(l=a)}if(a=i-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>l&&(l=a)}else if(d>0){if(a0||f<1)||(l>0&&(t[0]=[u+l*h,c+l*d]),f<1&&(t[1]=[u+f*h,c+f*d]),!0)}}}}}function $w(t,e,n,r,i){var a=t[1];if(a)return!0;var o,s,u=t[0],c=t.left,l=t.right,f=c[0],h=c[1],d=l[0],p=l[1],g=(f+d)/2,y=(h+p)/2;if(p===h){if(g=r)return;if(f>d){if(u){if(u[1]>=i)return}else u=[g,n];a=[g,i]}else{if(u){if(u[1]1)if(f>d){if(u){if(u[1]>=i)return}else u=[(n-s)/o,n];a=[(i-s)/o,i]}else{if(u){if(u[1]=r)return}else u=[e,o*e+s];a=[r,o*r+s]}else{if(u){if(u[0]=-_S)){var d=u*u+c*c,p=l*l+f*f,g=(f*d-c*p)/h,y=(u*p-l*d)/h,_=tS.pop()||new eS;_.arc=t,_.site=i,_.x=g+o,_.y=(_.cy=y+s)+Math.sqrt(g*g+y*y),t.circle=_;for(var x=null,v=pS._;v;)if(_.yyS)s=s.L;else{if(!((i=a-fS(s,o))>yS)){r>-yS?(e=s.P,n=s):i>-yS?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){dS[t.index]={site:t,halfedges:[]}}(t);var u=oS(t);if(hS.insert(e,u),e||n){if(e===n)return rS(e),n=oS(e.site),hS.insert(u,n),u.edge=n.edge=Yw(e.site,u.site),nS(e),void nS(n);if(n){rS(e),rS(n);var c=e.site,l=c[0],f=c[1],h=t[0]-l,d=t[1]-f,p=n.site,g=p[0]-l,y=p[1]-f,_=2*(h*y-d*g),x=h*h+d*d,v=g*g+y*y,m=[(y*x-d*v)/_+l,(h*v-g*x)/_+f];Ww(n.edge,c,p,m),u.edge=Yw(c,t,null,m),n.edge=Yw(t,p,null,m),nS(e),nS(n)}else u.edge=Yw(e.site,u.site)}}function lS(t,e){var n=t.site,r=n[0],i=n[1],a=i-e;if(!a)return r;var o=t.P;if(!o)return-1/0;var s=(n=o.site)[0],u=n[1],c=u-e;if(!c)return s;var l=s-r,f=1/a-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-u+c/2+i-a/2)))/f+r:(r+s)/2}function fS(t,e){var n=t.N;if(n)return lS(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var hS,dS,pS,gS,yS=1e-6,_S=1e-12;function xS(t,e){return e[1]-t[1]||e[0]-t[0]}function vS(t,e){var n,r,i,a=t.sort(xS).pop();for(gS=[],dS=new Array(t.length),hS=new Hw,pS=new Hw;;)if(i=Jw,a&&(!i||a[1]yS||Math.abs(i[0][1]-i[1][1])>yS)||delete gS[a]}(o,s,u,c),function(t,e,n,r){var i,a,o,s,u,c,l,f,h,d,p,g,y=dS.length,_=!0;for(i=0;iyS||Math.abs(g-h)>yS)&&(u.splice(s,0,gS.push(Uw(o,d,Math.abs(p-t)yS?[t,Math.abs(f-t)yS?[Math.abs(h-r)yS?[n,Math.abs(f-n)yS?[Math.abs(h-e)=s)return null;var u=t-i.site[0],c=e-i.site[1],l=u*u+c*c;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],c=e-s[1],f=u*u+c*c;fr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}var VS=function(){var t,e,n=MS,r=ES,i=GS,a=kS,o=OS,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,l=dp,f=ft("start","zoom","end"),h=0;function d(t){t.property("__zoom",LS).on("wheel.zoom",m).on("mousedown.zoom",b).on("dblclick.zoom",w).filter(o).on("touchstart.zoom",S).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new SS(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new SS(t.k,r,i)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n){t.on("start.zoom",(function(){x(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,a=x(t,i),o=r.apply(t,i),s=null==n?y(o):"function"==typeof n?n.apply(t,i):n,u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,i):e,h=l(c.invert(s).concat(u/c.k),f.invert(s).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=h(t),n=u/e[2];t=new SS(n,s[0]-e[0]*n,s[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new v(t,e)}function v(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function m(){if(n.apply(this,arguments)){var t=x(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,a.apply(this,arguments)))),o=Gn(this);if(t.wheel)t.mouse[0][0]===o[0]&&t.mouse[0][1]===o[1]||(t.mouse[1]=e.invert(t.mouse[0]=o)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[o,e.invert(o)],sr(this),t.start()}PS(),t.wheel=setTimeout(c,150),t.zoom("mouse",i(g(p(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function c(){t.wheel=null,t.end()}}function b(){if(!e&&n.apply(this,arguments)){var t=x(this,arguments,!0),r=Se(ce.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",l,!0),a=Gn(this),o=ce.clientX,s=ce.clientY;Ce(ce.view),CS(),t.mouse=[a,this.__zoom.invert(a)],sr(this),t.start()}function c(){if(PS(),!t.moved){var e=ce.clientX-o,n=ce.clientY-s;t.moved=e*e+n*n>h}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=Gn(t.that),t.mouse[1]),t.extent,u))}function l(){r.on("mousemove.zoom mouseup.zoom",null),Pe(ce.view,t.moved),PS(),t.end()}}function w(){if(n.apply(this,arguments)){var t=this.__zoom,e=Gn(this),a=t.invert(e),o=t.k*(ce.shiftKey?.5:2),s=i(g(p(t,o),e,a),r.apply(this,arguments),u);PS(),c>0?Se(this).transition().duration(c).call(_,s,e):Se(this).call(d.transform,s)}}function S(){if(n.apply(this,arguments)){var e,r,i,a,o=ce.touches,s=o.length,u=x(this,arguments,ce.changedTouches.length===s);for(CS(),r=0;r{% trans "Sample size" %}
-

{% trans "A/B tests are calculated using Pearson's chi squared test and are set at 95% confidence level." %}

{% trans "Traffic is split evenly between each version." %}

{% trans 'Users with "Do Not Track" enabled are not counted.' %}