webapp.dist.plan.js Maven / Gradle / Ivy
/*! For license information please see plan.js.LICENSE.txt */
(()=>{var t={6774:(t,n,e)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LivePlan=void 0;var r=function(){function t(t,n){for(var e=0;e"+this.props.name+""+e},i.default.createElement("strong",null,this.props.name+t),i.default.createElement("div",null,(0,c.truncateString)(e,35)))}}]),n}(i.default.Component);n.LivePlan=function(t){function n(t){h(this,n);var e=d(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return e.state={initialized:!1,ended:!1,query:null,graph:(0,c.initializeGraph)(),svg:null,render:new a.render},e}return p(n,t),r(n,[{key:"resetTimer",value:function(){clearTimeout(this.timeoutId),null!==this.state.query&&this.state.ended||(this.timeoutId=setTimeout(this.refreshLoop.bind(this),1e3))}},{key:"refreshLoop",value:function(){var t=this;clearTimeout(this.timeoutId),fetch("/ui/api/query/"+this.props.queryId).then((function(t){return t.json()})).then((function(n){t.setState({query:n,initialized:!0,ended:n.finalQueryInfo}),t.resetTimer()})).catch((function(){t.setState({initialized:!0}),t.resetTimer()}))}},{key:"componentDidMount",value:function(){this.refreshLoop.bind(this)(),new window.ClipboardJS(".copy-button")}},{key:"updateD3Stage",value:function(t,n,e){var r=t.stageId,a="stage-"+t.id+"-root",u=(0,c.getStageStateColor)(t);n.setNode(r,{style:"fill: "+u,labelStyle:"fill: #fff"});var l=o.default.renderToString(i.default.createElement(g,{key:t.id,stage:t}));n.setNode(a,{class:"stage-stats",label:l,labelType:"html"}),n.setParent(a,r),n.setEdge("node-"+t.root,a,{style:"visibility: hidden"}),t.nodes.forEach((function(t){var a="node-"+t.id,u=o.default.renderToString(i.default.createElement(v,t));n.setNode(a,{label:u,style:"fill: #fff",labelType:"html"}),n.setParent(a,r),t.sources.forEach((function(t){n.setEdge("node-"+t,a,{class:"plan-edge",arrowheadClass:"plan-arrowhead"})}));var l=t.descriptor.sourceFragmentIds;if(l){var s=l.replace("[","").replace("]","").split(", ");s.length>0&&(n.setNode(a,{label:"",shape:"circle"}),s.forEach((function(t){var r=e.get(t);if(r){var i=r.stageStats;n.setEdge("stage-"+t+"-root",a,{class:"plan-edge",style:"stroke-width: 4px",arrowheadClass:"plan-arrowhead",label:(0,c.parseAndFormatDataSize)(i.outputDataSize)+" / "+(0,c.formatRows)(i.outputPositions),labelStyle:"color: #fff; font-weight: bold; font-size: 24px;",labelType:"html"})}})))}}))}},{key:"updateD3Graph",value:function(){var t=this;if(this.state.svg){if(this.state.query){var e=this.state.graph,r=g.getStages(this.state.query);r.forEach((function(n){t.updateD3Stage(n,e,r)}));var i=u.select("#plan-canvas g");this.state.render(i,e);var o=this.state.svg;o.selectAll("g.cluster").on("click",n.handleStageClick);var a=parseInt(window.getComputedStyle(document.getElementById("live-plan"),null).getPropertyValue("width").replace(/px/,""))-50,l=parseInt(window.getComputedStyle(document.getElementById("live-plan"),null).getPropertyValue("height").replace(/px/,""))-50,s=e.graph().height+100,f=e.graph().width+100;if(this.state.ended){var h=Math.min(a/f,l/s),d=u.zoom().scaleExtent([h,1]).on("zoom",(function(){i.attr("transform",u.event.transform)}));o.call(d),o.call(d.transform,u.zoomIdentity.translate((a-e.graph().width*h)/2,20).scale(h)),o.attr("height",l),o.attr("width",a)}else o.attr("height",s),o.attr("width",f)}}else this.setState({svg:(0,c.initializeSvg)("#plan-canvas")})}},{key:"componentDidUpdate",value:function(){this.updateD3Graph(),$('[data-toggle="tooltip"]').tooltip()}},{key:"render",value:function(){var t=this.state.query;if(null===t||!1===this.state.initialized){var n=i.default.createElement("div",{className:"loader"},"Loading...");return this.state.initialized&&(n="Query not found"),i.default.createElement("div",{className:"row error-message"},i.default.createElement("div",{className:"col-xs-12"},i.default.createElement("h4",null,n)))}var e=null;t&&!t.outputStage&&(e=i.default.createElement("div",{className:"row error-message"},i.default.createElement("div",{className:"col-xs-12"},i.default.createElement("h4",null,"Live plan graph will appear automatically when query starts running."),i.default.createElement("div",{className:"loader"},"Loading..."))));var r=this.props.isEmbedded?null:i.default.createElement(l.QueryHeader,{query:t});return i.default.createElement("div",null,r,i.default.createElement("div",{className:"row"},i.default.createElement("div",{className:"col-xs-12"},e,i.default.createElement("div",{id:"live-plan",className:"graph-container"},i.default.createElement("div",{className:"pull-right"},this.state.ended?"Scroll to zoom.":"Zoom disabled while query is running."," Click stage to view additional statistics"),i.default.createElement("svg",{id:"plan-canvas"})))))}}],[{key:"handleStageClick",value:function(t){window.open("stage.html?"+t,"_blank")}}]),n}(i.default.Component)},5150:(t,n,e)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PageTitle=void 0;var r,i=function(){function t(t,n){for(var e=0;e3e4)&&($("#no-connection-modal").modal(),t.setState({modalShown:!0}))}))}},{key:"resetTimer",value:function(){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(this.refreshLoop.bind(this),1e3)}},{key:"componentDidMount",value:function(){this.refreshLoop.bind(this)()}},{key:"renderStatusLight",value:function(){return this.state.noConnection?this.state.lightShown?o.default.createElement("span",{className:"status-light status-light-red",id:"status-indicator"}):o.default.createElement("span",{className:"status-light",id:"status-indicator"}):o.default.createElement("span",{className:"status-light status-light-green",id:"status-indicator"})}},{key:"render",value:function(){var t=this.state.info;return t?o.default.createElement("div",null,o.default.createElement("nav",{className:"navbar"},o.default.createElement("div",{className:"container-fluid"},o.default.createElement("div",{className:"navbar-header"},o.default.createElement("table",null,o.default.createElement("tbody",null,o.default.createElement("tr",null,o.default.createElement("td",null,o.default.createElement("a",{href:"/ui/"},o.default.createElement("img",{src:"assets/logo.png"}))),o.default.createElement("td",null,o.default.createElement("span",{className:"navbar-brand"},this.props.title)))))),o.default.createElement("div",{id:"navbar",className:"navbar-collapse collapse"},o.default.createElement("ul",{className:"nav navbar-nav navbar-right"},o.default.createElement("li",null,o.default.createElement("span",{className:"navbar-cluster-info"},o.default.createElement("span",{className:"uppercase"},"Version"),o.default.createElement("br",null),o.default.createElement("span",{className:"text uppercase",id:"version-number"},t.nodeVersion.version))),o.default.createElement("li",null,o.default.createElement("span",{className:"navbar-cluster-info"},o.default.createElement("span",{className:"uppercase"},"Environment"),o.default.createElement("br",null),o.default.createElement("span",{className:"text uppercase",id:"environment"},t.environment))),o.default.createElement("li",null,o.default.createElement("span",{className:"navbar-cluster-info"},o.default.createElement("span",{className:"uppercase"},"Uptime"),o.default.createElement("br",null),o.default.createElement("span",{"data-toggle":"tooltip","data-placement":"bottom",title:"Connection status"},this.renderStatusLight())," ",o.default.createElement("span",{className:"text",id:"uptime"},t.uptime))),o.default.createElement("li",null,o.default.createElement("span",{className:"navbar-cluster-info"},o.default.createElement("span",{className:"text",id:"logout"},o.default.createElement("a",{className:"btn btn-logout",href:"logout"},"Log Out")))))))),o.default.createElement("div",{id:"no-connection-modal",className:"modal",tabIndex:"-1",role:"dialog"},o.default.createElement("div",{className:"modal-dialog modal-sm",role:"document"},o.default.createElement("div",{className:"modal-content"},o.default.createElement("div",{className:"row error-message"},o.default.createElement("div",{className:"col-xs-12"},o.default.createElement("br",null),o.default.createElement("h4",null,"Unable to connect to server"),o.default.createElement("p",null,this.state.errorText?"Error: "+this.state.errorText:null))))))):null}}]),n}(o.default.Component)},8685:(t,n,e)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.QueryHeader=void 0;var r,i=function(){function t(t,n){for(var e=0;e{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.GLYPHICON_HIGHLIGHT=n.GLYPHICON_DEFAULT=void 0,n.getQueryStateColor=function(t){switch(t.state){case"QUEUED":return u.QUEUED;case"PLANNING":return u.PLANNING;case"STARTING":case"FINISHING":case"RUNNING":return t.queryStats&&t.queryStats.fullyBlocked?u.BLOCKED:u.RUNNING;case"FAILED":switch(t.errorType){case"USER_ERROR":return"USER_CANCELED"===t.errorCode.name?u.CANCELED:u.USER_ERROR;case"EXTERNAL":return u.EXTERNAL_ERROR;case"INSUFFICIENT_RESOURCES":return u.INSUFFICIENT_RESOURCES;default:return u.UNKNOWN_ERROR}case"FINISHED":return u.FINISHED;default:return u.QUEUED}},n.getStageStateColor=function(t){switch(t.state){case"PLANNED":return u.QUEUED;case"SCHEDULING":case"SCHEDULING_SPLITS":case"SCHEDULED":return u.PLANNING;case"RUNNING":return t.stageStats&&t.stageStats.fullyBlocked?u.BLOCKED:u.RUNNING;case"FINISHED":return u.FINISHED;case"CANCELED":case"ABORTED":return u.CANCELED;case"FAILED":return u.UNKNOWN_ERROR;default:return"#b5b5b5"}},n.getHumanReadableState=c,n.getProgressBarPercentage=l,n.getProgressBarTitle=function(t,n){return t.queryStats.progressPercentage&&"RUNNING"===t.state?c(t,n)+" ("+l(t)+"%)":c(t,n)},n.isQueryEnded=function(t){return["FINISHED","FAILED","CANCELED"].indexOf(t.state)>-1},n.addToHistory=function(t,n){return 0===n.length?n.concat([t]):n.concat([t]).slice(Math.max(n.length-s,0))},n.addExponentiallyWeightedToHistory=function(t,n){if(0===n.length)return n.concat([t]);var e=t*f+n[n.length-1]*(1-f);return t<1&&(e=0),n.concat([e]).slice(Math.max(n.length-s,0))},n.initializeGraph=function(){return new r.graphlib.Graph({compound:!0}).setGraph({rankdir:"BT"}).setDefaultEdgeLabel((function(){return{}}))},n.initializeSvg=function(t){var n=i.select(t);return n.append("g"),n},n.getChildren=function(t){switch(t["@type"]){case"output":case"explainAnalyze":case"project":case"filter":case"aggregation":case"sort":case"markDistinct":case"window":case"rowNumber":case"topnRanking":case"limit":case"distinctlimit":case"topn":case"sample":case"tablewriter":case"delete":case"tableDelete":case"tablecommit":case"groupid":case"unnest":case"scalar":return[t.source];case"join":case"spatialjoin":return[t.left,t.right];case"semijoin":return[t.source,t.filteringSource];case"indexjoin":return[t.probeSource,t.indexSource];case"union":case"exchange":return t.sources;case"remoteSource":case"tablescan":case"values":case"indexsource":break;default:console.log("NOTE: Unhandled PlanNode: "+t["@type"])}return[]},n.truncateString=function(t,n){return t&&t.length>n?t.substring(0,n)+"...":t},n.getStageNumber=function(t){return Number.parseInt(t.slice(t.indexOf(".")+1,t.length))},n.getTaskIdSuffix=h,n.getTaskNumber=function(t){return Number.parseInt(h(h(t)))},n.getFirstParameter=function(t){var n=t.substring(1);return-1!==n.indexOf("&")?n.substring(0,n.indexOf("&")):n},n.getHostname=function(t){var n=new URL(t).hostname;return"["===n.charAt(0)&&"]"===n.charAt(n.length-1)&&(n=n.substr(1,n.length-2)),n},n.getPort=function(t){return new URL(t).port},n.getHostAndPort=function(t){var n=new URL(t);return n.hostname+":"+n.port},n.computeRate=function(t,n){return 0===n?0:t/n*1e3},n.precisionRound=d,n.formatDuration=function(t){var n="ms";return t>1e3&&(t/=1e3,n="s"),"s"===n&&t>60&&(t/=60,n="m"),"m"===n&&t>60&&(t/=60,n="h"),"h"===n&&t>24&&(t/=24,n="d"),"d"===n&&t>7&&(t/=7,n="w"),d(t)+n},n.formatRows=function(t){return 1===t?"1 row":p(t)+" rows"},n.formatCount=p,n.formatDataSizeBytes=function(t){return v(t,"")},n.formatDataSize=g,n.parseDataSize=y,n.parseAndFormatDataSize=function(t){var n=y(t);return null==n?"":g(n)},n.parseDuration=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*([a-zA-Z]+)\s*$/.exec(t);if(null===n)return null;var e=parseFloat(n[1]);switch(n[2]){case"ns":return e/1e6;case"us":return e/1e3;case"ms":return e;case"s":return 1e3*e;case"m":return 1e3*e*60;case"h":return 1e3*e*60*60;case"d":return 1e3*e*60*60*24;default:return null}},n.formatShortTime=m,n.formatShortDateTime=function(t){var n=t.getFullYear(),e=""+(t.getMonth()+1),r=""+t.getDate();return n+"-"+(e[1]?e:"0"+e[0])+"-"+(r[1]?r:"0"+r[0])+" "+m(t)};var r=o(e(4949)),i=o(e(9808));function o(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}n.GLYPHICON_DEFAULT={color:"#1edcff"},n.GLYPHICON_HIGHLIGHT={color:"#999999"};var a="—",u={QUEUED:"#1b8f72",RUNNING:"#19874e",PLANNING:"#674f98",FINISHED:"#1a4629",BLOCKED:"#61003b",USER_ERROR:"#9a7d66",CANCELED:"#858959",INSUFFICIENT_RESOURCES:"#7f5b72",EXTERNAL_ERROR:"#ca7640",UNKNOWN_ERROR:"#943524"};function c(t,n){if("RUNNING"===t.state){var e="RUNNING";if(t.scheduled&&t.queryStats.totalDrivers>0&&t.queryStats.runningDrivers>=0)return t.queryStats.fullyBlocked&&(e="BLOCKED",t.queryStats.blockedReasons&&t.queryStats.blockedReasons.length>0&&(e+=" ("+t.queryStats.blockedReasons.join(", ")+")")),"reserved"===t.memoryPool&&(e+=" (RESERVED)"),e}if("FAILED"===t.state){var r="";switch(t.errorType){case"USER_ERROR":r="USER ERROR","USER_CANCELED"===t.errorCode.name&&(r="USER CANCELED");break;case"INTERNAL_ERROR":r="INTERNAL ERROR";break;case"INSUFFICIENT_RESOURCES":r="INSUFFICIENT RESOURCES";break;case"EXTERNAL":r="EXTERNAL ERROR"}return n&&t.errorCode&&t.errorCode.name&&(r+=" "+a+" "+t.errorCode.name),r}return t.state}function l(t){var n=t.queryStats.progressPercentage;return n&&"RUNNING"===t.state?Math.round(n):100}var s=300,f=.2;function h(t){return t.slice(t.indexOf(".")+1,t.length)}function d(t){return t<10?t.toFixed(2):t<100?t.toFixed(1):Math.round(t).toString()}function p(t){var n="";return t>1e3&&(t/=1e3,n="K"),t>1e3&&(t/=1e3,n="M"),t>1e3&&(t/=1e3,n="B"),t>1e3&&(t/=1e3,n="T"),t>1e3&&(t/=1e3,n="Q"),d(t)+n}function g(t){return v(t,"B")}function v(t,n){var e=n;return 0===t?"0"+e:(t>=1024&&(t/=1024,e="K"+n),t>=1024&&(t/=1024,e="M"+n),t>=1024&&(t/=1024,e="G"+n),t>=1024&&(t/=1024,e="T"+n),t>=1024&&(t/=1024,e="P"+n),d(t)+e)}function y(t){var n=/^\s*(\d+(?:\.\d+)?)\s*([a-zA-Z]+)\s*$/.exec(t);if(null===n)return null;var e=parseFloat(n[1]);switch(n[2]){case"B":return e;case"kB":return e*Math.pow(2,10);case"MB":return e*Math.pow(2,20);case"GB":return e*Math.pow(2,30);case"TB":return e*Math.pow(2,40);case"PB":return e*Math.pow(2,50);default:return null}}function m(t){return(t.getHours()%12||12)+":"+(t.getMinutes()<10?"0":"")+t.getMinutes()+(t.getHours()>=12?"pm":"am")}},8949:(t,n,e)=>{"use strict";e.d(n,{qh:()=>m,XP:()=>v,UI:()=>a,b1:()=>u,t8:()=>g,VO:()=>y});var r="$";function i(){}function o(t,n){var e=new i;if(t instanceof i)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,o=-1,a=t.length;if(null==n)for(;++o=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var l,s,f,h=-1,d=e.length,p=r[i++],g=a(),v=u();++hr.length)return t;var o,a=i[e-1];return null!=n&&e>=r.length?o=t.entries():(o=[],t.each((function(t,n){o.push({key:n,values:u(t,e)})}))),null!=a?o.sort((function(t,n){return a(t.key,n.key)})):o}return e={object:function(t){return o(t,0,c,l)},map:function(t){return o(t,0,s,f)},entries:function(t){return u(o(t,0,s,f),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}}function c(){return{}}function l(t,n,e){t[n]=e}function s(){return a()}function f(t,n,e){t.set(n,e)}function h(){}var d=a.prototype;function p(t,n){var e=new h;if(t instanceof h)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r{"use strict";e.d(n,{W:()=>c});var r={value:function(){}};function i(){for(var t,n=0,e=arguments.length,r={};n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),c=-1,l=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++c0)for(var e,r,i=new Array(e),o=0;o{"use strict";e.d(n,{Sf:()=>d,Jb:()=>p,ue:()=>f,Bj:()=>h,yv:()=>l,vP:()=>m,n5:()=>_,tJ:()=>v,E0:()=>y});var r={},i={},o=34,a=10,u=13;function c(t){return new Function("d","return {"+t.map((function(t,n){return JSON.stringify(t)+": d["+n+"]"})).join(",")+"}")}function l(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function l(t,n){var c,l=[],s=t.length,f=0,h=0,d=s<=0,p=!1;function g(){if(d)return i;if(p)return p=!1,r;var n,c,l=f;if(t.charCodeAt(l)===o){for(;f++=s?d=!0:(c=t.charCodeAt(f++))===a?p=!0:c===u&&(p=!0,t.charCodeAt(f)===a&&++f),t.slice(l+1,n-1).replace(/""/g,'"')}for(;f{"use strict";e.r(n),e.d(n,{active:()=>Ho,arc:()=>rb,area:()=>lb,areaRadial:()=>mb,ascending:()=>i,axisBottom:()=>ct,axisLeft:()=>lt,axisRight:()=>ut,axisTop:()=>at,bisect:()=>l,bisectLeft:()=>c,bisectRight:()=>u,bisector:()=>o,blob:()=>ru,brush:()=>ga,brushSelection:()=>ha,brushX:()=>da,brushY:()=>pa,buffer:()=>ou,chord:()=>Ma,clientPoint:()=>Rn,cluster:()=>pd,color:()=>fe,contourDensity:()=>tu,contours:()=>$a,create:()=>Sn,creator:()=>vt,cross:()=>h,csv:()=>su,csvFormat:()=>nu.Sf,csvFormatRows:()=>nu.Jb,csvParse:()=>nu.ue,csvParseRows:()=>nu.Bj,cubehelix:()=>Ze,curveBasis:()=>Kb,curveBasisClosed:()=>tw,curveBasisOpen:()=>ew,curveBundle:()=>iw,curveCardinal:()=>uw,curveCardinalClosed:()=>lw,curveCardinalOpen:()=>fw,curveCatmullRom:()=>pw,curveCatmullRomClosed:()=>vw,curveCatmullRomOpen:()=>mw,curveLinear:()=>ob,curveLinearClosed:()=>bw,curveMonotoneX:()=>Tw,curveMonotoneY:()=>Cw,curveNatural:()=>Rw,curveStep:()=>Ow,curveStepAfter:()=>Dw,curveStepBefore:()=>Uw,customEvent:()=>mn,descending:()=>d,deviation:()=>v,dispatch:()=>st.W,drag:()=>Xn,dragDisable:()=>Fn,dragEnable:()=>qn,dsv:()=>lu,dsvFormat:()=>nu.yv,easeBack:()=>Do,easeBackIn:()=>Oo,easeBackInOut:()=>Do,easeBackOut:()=>Uo,easeBounce:()=>Po,easeBounceIn:()=>Ao,easeBounceInOut:()=>Ro,easeBounceOut:()=>Po,easeCircle:()=>_o,easeCircleIn:()=>yo,easeCircleInOut:()=>_o,easeCircleOut:()=>mo,easeCubic:()=>io,easeCubicIn:()=>eo,easeCubicInOut:()=>io,easeCubicOut:()=>ro,easeElastic:()=>Fo,easeElasticIn:()=>zo,easeElasticInOut:()=>qo,easeElasticOut:()=>Fo,easeExp:()=>vo,easeExpIn:()=>po,easeExpInOut:()=>vo,easeExpOut:()=>go,easeLinear:()=>Ki,easePoly:()=>uo,easePolyIn:()=>oo,easePolyInOut:()=>uo,easePolyOut:()=>ao,easeQuad:()=>no,easeQuadIn:()=>Ji,easeQuadInOut:()=>no,easeQuadOut:()=>to,easeSin:()=>ho,easeSinIn:()=>so,easeSinInOut:()=>ho,easeSinOut:()=>fo,entries:()=>Fa.qh,event:()=>dn,extent:()=>y,forceCenter:()=>_u,forceCollide:()=>Ru,forceLink:()=>Uu,forceManyBody:()=>ju,forceRadial:()=>Bu,forceSimulation:()=>qu,forceX:()=>Yu,forceY:()=>Hu,format:()=>nc,formatDefaultLocale:()=>oc,formatLocale:()=>ic,formatPrefix:()=>ec,formatSpecifier:()=>Gu,geoAlbers:()=>Th,geoAlbersUsa:()=>Ch,geoArea:()=>nl,geoAzimuthalEqualArea:()=>Ih,geoAzimuthalEqualAreaRaw:()=>Rh,geoAzimuthalEquidistant:()=>Uh,geoAzimuthalEquidistantRaw:()=>Oh,geoBounds:()=>Xl,geoCentroid:()=>os,geoCircle:()=>vs,geoClipAntimeridian:()=>Ss,geoClipCircle:()=>Ts,geoClipExtent:()=>Rs,geoClipRectangle:()=>Ps,geoConicConformal:()=>jh,geoConicConformalRaw:()=>qh,geoConicEqualArea:()=>Sh,geoConicEqualAreaRaw:()=>Nh,geoConicEquidistant:()=>Vh,geoConicEquidistantRaw:()=>Hh,geoContains:()=>Js,geoDistance:()=>Hs,geoEqualEarth:()=>Kh,geoEqualEarthRaw:()=>Zh,geoEquirectangular:()=>Yh,geoEquirectangularRaw:()=>Bh,geoGnomonic:()=>td,geoGnomonicRaw:()=>Jh,geoGraticule:()=>ef,geoGraticule10:()=>rf,geoIdentity:()=>ed,geoInterpolate:()=>of,geoLength:()=>js,geoMercator:()=>Lh,geoMercatorRaw:()=>Dh,geoNaturalEarth1:()=>id,geoNaturalEarth1Raw:()=>rd,geoOrthographic:()=>ad,geoOrthographicRaw:()=>od,geoPath:()=>ch,geoProjection:()=>Mh,geoProjectionMutator:()=>Eh,geoRotation:()=>ds,geoStereographic:()=>cd,geoStereographicRaw:()=>ud,geoStream:()=>Bc,geoTransform:()=>lh,geoTransverseMercator:()=>sd,geoTransverseMercatorRaw:()=>ld,gray:()=>Re,hcl:()=>je,hierarchy:()=>vd,histogram:()=>P,hsl:()=>_e,html:()=>yu,image:()=>hu,interpolate:()=>yr,interpolateArray:()=>sr,interpolateBasis:()=>tr,interpolateBasisClosed:()=>nr,interpolateBlues:()=>d_,interpolateBrBG:()=>km,interpolateBuGn:()=>Ym,interpolateBuPu:()=>Vm,interpolateCool:()=>N_,interpolateCubehelix:()=>Vr,interpolateCubehelixDefault:()=>E_,interpolateCubehelixLong:()=>Wr,interpolateDate:()=>fr,interpolateDiscrete:()=>mr,interpolateGnBu:()=>Xm,interpolateGreens:()=>g_,interpolateGreys:()=>y_,interpolateHcl:()=>Br,interpolateHclLong:()=>Yr,interpolateHsl:()=>zr,interpolateHslLong:()=>Fr,interpolateHue:()=>_r,interpolateInferno:()=>D_,interpolateLab:()=>qr,interpolateMagma:()=>U_,interpolateNumber:()=>hr,interpolateObject:()=>dr,interpolateOrRd:()=>Gm,interpolateOranges:()=>M_,interpolatePRGn:()=>Sm,interpolatePiYG:()=>Cm,interpolatePlasma:()=>L_,interpolatePuBu:()=>Jm,interpolatePuBuGn:()=>Zm,interpolatePuOr:()=>Pm,interpolatePuRd:()=>n_,interpolatePurples:()=>__,interpolateRainbow:()=>T_,interpolateRdBu:()=>Im,interpolateRdGy:()=>Um,interpolateRdPu:()=>r_,interpolateRdYlBu:()=>Lm,interpolateRdYlGn:()=>Fm,interpolateReds:()=>w_,interpolateRgb:()=>ar,interpolateRgbBasis:()=>cr,interpolateRgbBasisClosed:()=>lr,interpolateRound:()=>br,interpolateSinebow:()=>R_,interpolateSpectral:()=>jm,interpolateString:()=>vr,interpolateTransformCss:()=>Cr,interpolateTransformSvg:()=>Ar,interpolateViridis:()=>O_,interpolateWarm:()=>k_,interpolateYlGn:()=>u_,interpolateYlGnBu:()=>o_,interpolateYlOrBr:()=>l_,interpolateYlOrRd:()=>f_,interpolateZoom:()=>Dr,interrupt:()=>Ci,interval:()=>gi,isoFormat:()=>Qy,isoParse:()=>Ky,json:()=>pu,keys:()=>Fa.XP,lab:()=>Ie,lch:()=>qe,line:()=>cb,lineRadial:()=>yb,linkHorizontal:()=>Sb,linkRadial:()=>Cb,linkVertical:()=>Tb,local:()=>Cn,map:()=>Fa.UI,matcher:()=>Et,max:()=>U,mean:()=>D,median:()=>L,merge:()=>z,min:()=>F,mouse:()=>In,namespace:()=>dt,namespaces:()=>ht,nest:()=>Fa.b1,now:()=>ai,pack:()=>qd,packEnclose:()=>xd,packSiblings:()=>Ud,pairs:()=>s,partition:()=>Wd,path:()=>Ra,permute:()=>q,pie:()=>hb,piecewise:()=>Xr,pointRadial:()=>_b,polygonArea:()=>pp,polygonCentroid:()=>gp,polygonContains:()=>bp,polygonHull:()=>_p,polygonLength:()=>wp,precisionFixed:()=>ac,precisionPrefix:()=>uc,precisionRound:()=>cc,quadtree:()=>Nu,quantile:()=>R,quantize:()=>$r,radialArea:()=>mb,radialLine:()=>yb,randomBates:()=>Sp,randomExponential:()=>Tp,randomIrwinHall:()=>Np,randomLogNormal:()=>kp,randomNormal:()=>Ep,randomUniform:()=>Mp,range:()=>M,rgb:()=>ge,ribbon:()=>za,scaleBand:()=>Op,scaleDiverging:()=>hm,scaleIdentity:()=>Xp,scaleImplicit:()=>Rp,scaleLinear:()=>Wp,scaleLog:()=>ng,scaleOrdinal:()=>Ip,scalePoint:()=>Dp,scalePow:()=>rg,scaleQuantile:()=>og,scaleQuantize:()=>ag,scaleSequential:()=>fm,scaleSqrt:()=>ig,scaleThreshold:()=>ug,scaleTime:()=>lm,scaleUtc:()=>sm,scan:()=>j,schemeAccent:()=>gm,schemeBlues:()=>h_,schemeBrBG:()=>Em,schemeBuGn:()=>Bm,schemeBuPu:()=>Hm,schemeCategory10:()=>pm,schemeDark2:()=>vm,schemeGnBu:()=>Wm,schemeGreens:()=>p_,schemeGreys:()=>v_,schemeOrRd:()=>$m,schemeOranges:()=>x_,schemePRGn:()=>Nm,schemePaired:()=>ym,schemePastel1:()=>mm,schemePastel2:()=>_m,schemePiYG:()=>Tm,schemePuBu:()=>Km,schemePuBuGn:()=>Qm,schemePuOr:()=>Am,schemePuRd:()=>t_,schemePurples:()=>m_,schemeRdBu:()=>Rm,schemeRdGy:()=>Om,schemeRdPu:()=>e_,schemeRdYlBu:()=>Dm,schemeRdYlGn:()=>zm,schemeReds:()=>b_,schemeSet1:()=>bm,schemeSet2:()=>wm,schemeSet3:()=>xm,schemeSpectral:()=>qm,schemeYlGn:()=>a_,schemeYlGnBu:()=>i_,schemeYlOrBr:()=>c_,schemeYlOrRd:()=>s_,select:()=>Nn,selectAll:()=>On,selection:()=>kn,selector:()=>mt,selectorAll:()=>bt,set:()=>Fa.t8,shuffle:()=>B,stack:()=>qw,stackOffsetDiverging:()=>Bw,stackOffsetExpand:()=>jw,stackOffsetNone:()=>Lw,stackOffsetSilhouette:()=>Yw,stackOffsetWiggle:()=>Hw,stackOrderAscending:()=>Vw,stackOrderDescending:()=>Xw,stackOrderInsideOut:()=>$w,stackOrderNone:()=>zw,stackOrderReverse:()=>Gw,stratify:()=>Kd,style:()=>jt,sum:()=>Y,svg:()=>mu,symbol:()=>$b,symbolCircle:()=>Ab,symbolCross:()=>Pb,symbolDiamond:()=>Ob,symbolSquare:()=>Fb,symbolStar:()=>zb,symbolTriangle:()=>jb,symbolWye:()=>Wb,symbols:()=>Xb,text:()=>uu,thresholdFreedmanDiaconis:()=>I,thresholdScott:()=>O,thresholdSturges:()=>A,tickIncrement:()=>T,tickStep:()=>C,ticks:()=>S,timeDay:()=>Cg,timeDays:()=>Ag,timeFormat:()=>Iv,timeFormatDefaultLocale:()=>Xy,timeFormatLocale:()=>Pv,timeFriday:()=>Lg,timeFridays:()=>Hg,timeHour:()=>Ng,timeHours:()=>Sg,timeInterval:()=>sg,timeMillisecond:()=>hg,timeMilliseconds:()=>dg,timeMinute:()=>Mg,timeMinutes:()=>Eg,timeMonday:()=>Ig,timeMondays:()=>qg,timeMonth:()=>Xg,timeMonths:()=>$g,timeParse:()=>Ov,timeSaturday:()=>zg,timeSaturdays:()=>Vg,timeSecond:()=>bg,timeSeconds:()=>wg,timeSunday:()=>Rg,timeSundays:()=>Fg,timeThursday:()=>Dg,timeThursdays:()=>Yg,timeTuesday:()=>Og,timeTuesdays:()=>jg,timeWednesday:()=>Ug,timeWednesdays:()=>Bg,timeWeek:()=>Rg,timeWeeks:()=>Fg,timeYear:()=>Qg,timeYears:()=>Zg,timeout:()=>pi,timer:()=>li,timerFlush:()=>si,touch:()=>Un,touches:()=>Dn,transition:()=>Gi,transpose:()=>H,tree:()=>op,treemap:()=>sp,treemapBinary:()=>fp,treemapDice:()=>Vd,treemapResquarify:()=>dp,treemapSlice:()=>ap,treemapSliceDice:()=>hp,treemapSquarify:()=>lp,tsv:()=>fu,tsvFormat:()=>nu.vP,tsvFormatRows:()=>nu.n5,tsvParse:()=>nu.tJ,tsvParseRows:()=>nu.E0,utcDay:()=>ov,utcDays:()=>av,utcFormat:()=>Uv,utcFriday:()=>dv,utcFridays:()=>bv,utcHour:()=>ev,utcHours:()=>rv,utcMillisecond:()=>hg,utcMilliseconds:()=>dg,utcMinute:()=>Jg,utcMinutes:()=>tv,utcMonday:()=>lv,utcMondays:()=>vv,utcMonth:()=>Mv,utcMonths:()=>Ev,utcParse:()=>Dv,utcSaturday:()=>pv,utcSaturdays:()=>wv,utcSecond:()=>bg,utcSeconds:()=>wg,utcSunday:()=>cv,utcSundays:()=>gv,utcThursday:()=>hv,utcThursdays:()=>_v,utcTuesday:()=>sv,utcTuesdays:()=>yv,utcWednesday:()=>fv,utcWednesdays:()=>mv,utcWeek:()=>cv,utcWeeks:()=>gv,utcYear:()=>Nv,utcYears:()=>Sv,values:()=>Fa.VO,variance:()=>g,version:()=>r,voronoi:()=>Ux,window:()=>Lt,xml:()=>vu,zip:()=>W,zoom:()=>Gx,zoomIdentity:()=>Fx,zoomTransform:()=>qx});var r="5.7.0";function i(t,n){return tn?1:t>=n?0:NaN}function o(t){var n;return 1===t.length&&(n=t,t=function(t,e){return i(n(t),e)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}var a=o(i),u=a.right,c=a.left;const l=u;function s(t,n){null==n&&(n=f);for(var e=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);et?1:n>=t?0:NaN}function p(t){return null===t?NaN:+t}function g(t,n){var e,r,i=t.length,o=0,a=-1,u=0,c=0;if(null==n)for(;++a1)return c/(o-1)}function v(t,n){var e=g(t,n);return e?Math.sqrt(e):e}function y(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a=e)for(r=i=e;++ae&&(r=e),i=e)for(r=i=e;++ae&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=E?10:o>=k?5:o>=N?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=E?10:o>=k?5:o>=N?2:1)}function C(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=E?i*=10:o>=k?i*=5:o>=N&&(i*=2),nf;)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]:s,p.x1=i=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}}function I(t,n,e){return t=b.call(t,p).sort(i),Math.ceil((e-n)/(2*(R(t,.75)-R(t,.25))*Math.pow(t.length,-1/3)))}function O(t,n,e){return Math.ceil((e-n)/(3.5*v(t)*Math.pow(t.length,-1/3)))}function U(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++or&&(r=e)}else for(;++o=e)for(r=e;++or&&(r=e);return r}function D(t,n){var e,r=t.length,i=r,o=-1,a=0;if(null==n)for(;++o=0;)for(n=(r=t[i]).length;--n>=0;)e[--a]=r[n];return e}function F(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++oe&&(r=e)}else for(;++o=e)for(r=e;++oe&&(r=e);return r}function q(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r}function j(t,n){if(e=t.length){var e,r,o=0,a=0,u=t[a];for(null==n&&(n=i);++o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),ht.hasOwnProperty(n)?{space:ht[n],local:t}:t}function pt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===ft&&n.documentElement.namespaceURI===ft?n.createElement(t):n.createElementNS(e,t)}}function gt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vt(t){var n=dt(t);return(n.local?gt:pt)(n)}function yt(){}function mt(t){return null==t?yt:function(){return this.querySelector(t)}}function _t(){return[]}function bt(t){return null==t?_t:function(){return this.querySelectorAll(t)}}var wt=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var xt=document.documentElement;if(!xt.matches){var Mt=xt.webkitMatchesSelector||xt.msMatchesSelector||xt.mozMatchesSelector||xt.oMatchesSelector;wt=function(t){return function(){return Mt.call(this,t)}}}}const Et=wt;function kt(t){return new Array(t.length)}function Nt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Nt.prototype={constructor:Nt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var St="$";function Tt(t,n,e,r,i,o){for(var a,u=0,c=n.length,l=o.length;un?1:t>=n?0:NaN}function Pt(t){return function(){this.removeAttribute(t)}}function Rt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function It(t,n){return function(){this.setAttribute(t,n)}}function Ot(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Ut(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Dt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Lt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function zt(t){return function(){this.style.removeProperty(t)}}function Ft(t,n,e){return function(){this.style.setProperty(t,n,e)}}function qt(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function jt(t,n){return t.style.getPropertyValue(n)||Lt(t).getComputedStyle(t,null).getPropertyValue(n)}function Bt(t){return function(){delete this[t]}}function Yt(t,n){return function(){this[t]=n}}function Ht(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Vt(t){return t.trim().split(/^|\s+/)}function Wt(t){return t.classList||new Xt(t)}function Xt(t){this._node=t,this._names=Vt(t.getAttribute("class")||"")}function $t(t,n){for(var e=Wt(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var hn={},dn=null;function pn(t,n,e){return t=gn(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function gn(t,n,e){return function(r){var i=dn;dn=r;try{t.call(this,this.__data__,n,e)}finally{dn=i}}}function vn(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=w&&(w=b+1);!(_=y[w])&&++w=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=At);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?zt:"function"==typeof n?qt:Ft)(t,n,null==e?"":e)):jt(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Bt:"function"==typeof n?Ht:Yt)(t,n)):this.node()[t]},classed:function(t,n){var e=Vt(t+"");if(arguments.length<2){for(var r=Wt(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?yn:vn,null==e&&(e=!1),r=0;rf}c.mouse("drag")}function g(){Nn(dn.view).on("mousemove.drag mouseup.drag",null),qn(dn.view,e),zn(),c.mouse("end")}function v(){if(i.apply(this,arguments)){var t,n,e=dn.changedTouches,r=o.apply(this,arguments),a=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=re.exec(t))?he(parseInt(n[1],16)):(n=ie.exec(t))?new ve(n[1],n[2],n[3],1):(n=oe.exec(t))?new ve(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ae.exec(t))?de(n[1],n[2],n[3],n[4]):(n=ue.exec(t))?de(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=ce.exec(t))?me(n[1],n[2]/100,n[3]/100,1):(n=le.exec(t))?me(n[1],n[2]/100,n[3]/100,n[4]):se.hasOwnProperty(t)?he(se[t]):"transparent"===t?new ve(NaN,NaN,NaN,0):null}function he(t){return new ve(t>>16&255,t>>8&255,255&t,1)}function de(t,n,e,r){return r<=0&&(t=n=e=NaN),new ve(t,n,e,r)}function pe(t){return t instanceof Qn||(t=fe(t)),t?new ve((t=t.rgb()).r,t.g,t.b,t.opacity):new ve}function ge(t,n,e,r){return 1===arguments.length?pe(t):new ve(t,n,e,null==r?1:r)}function ve(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function ye(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function me(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new be(t,n,e,r)}function _e(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof be)return new be(t.h,t.s,t.l,t.opacity);if(t instanceof Qn||(t=fe(t)),!t)return new be;if(t instanceof be)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new be(a,u,c,t.opacity)}(t):new be(t,n,e,null==r?1:r)}function be(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function we(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}$n(Qn,fe,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),$n(ve,ge,Gn(Qn,{brighter:function(t){return t=null==t?Kn:Math.pow(Kn,t),new ve(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new ve(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+ye(this.r)+ye(this.g)+ye(this.b)},toString:function(){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+")")}})),$n(be,_e,Gn(Qn,{brighter:function(t){return t=null==t?Kn:Math.pow(Kn,t),new be(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new be(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new ve(we(t>=240?t-240:t+120,i,r),we(t,i,r),we(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}}));var xe=Math.PI/180,Me=180/Math.PI,Ee=.96422,ke=1,Ne=.82521,Se=4/29,Te=6/29,Ce=3*Te*Te,Ae=Te*Te*Te;function Pe(t){if(t instanceof Oe)return new Oe(t.l,t.a,t.b,t.opacity);if(t instanceof Be){if(isNaN(t.h))return new Oe(t.l,0,0,t.opacity);var n=t.h*xe;return new Oe(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof ve||(t=pe(t));var e,r,i=ze(t.r),o=ze(t.g),a=ze(t.b),u=Ue((.2225045*i+.7168786*o+.0606169*a)/ke);return i===o&&o===a?e=r=u:(e=Ue((.4360747*i+.3850649*o+.1430804*a)/Ee),r=Ue((.0139322*i+.0971045*o+.7141733*a)/Ne)),new Oe(116*u-16,500*(e-u),200*(u-r),t.opacity)}function Re(t,n){return new Oe(t,0,0,null==n?1:n)}function Ie(t,n,e,r){return 1===arguments.length?Pe(t):new Oe(t,n,e,null==r?1:r)}function Oe(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Ue(t){return t>Ae?Math.pow(t,1/3):t/Ce+Se}function De(t){return t>Te?t*t*t:Ce*(t-Se)}function Le(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ze(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Fe(t){if(t instanceof Be)return new Be(t.h,t.c,t.l,t.opacity);if(t instanceof Oe||(t=Pe(t)),0===t.a&&0===t.b)return new Be(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Me;return new Be(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function qe(t,n,e,r){return 1===arguments.length?Fe(t):new Be(e,n,t,null==r?1:r)}function je(t,n,e,r){return 1===arguments.length?Fe(t):new Be(t,n,e,null==r?1:r)}function Be(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}$n(Oe,Ie,Gn(Qn,{brighter:function(t){return new Oe(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Oe(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new ve(Le(3.1338561*(n=Ee*De(n))-1.6168667*(t=ke*De(t))-.4906146*(e=Ne*De(e))),Le(-.9787684*n+1.9161415*t+.033454*e),Le(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),$n(Be,je,Gn(Qn,{brighter:function(t){return new Be(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Be(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Pe(this).rgb()}}));var Ye=-.14861,He=1.78277,Ve=-.29227,We=-.90649,Xe=1.97294,$e=Xe*We,Ge=Xe*He,Qe=He*Ve-We*Ye;function Ze(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ke)return new Ke(t.h,t.s,t.l,t.opacity);t instanceof ve||(t=pe(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Qe*r+$e*n-Ge*e)/(Qe+$e-Ge),o=r-i,a=(Xe*(e-i)-Ve*o)/We,u=Math.sqrt(a*a+o*o)/(Xe*i*(1-i)),c=u?Math.atan2(a,o)*Me-120:NaN;return new Ke(c<0?c+360:c,u,i,t.opacity)}(t):new Ke(t,n,e,null==r?1:r)}function Ke(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Je(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function tr(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r180||e<-180?e-360*Math.round(e/360):e):er(isNaN(t)?n:t)}function or(t,n){var e=n-t;return e?rr(t,e):er(isNaN(t)?n:t)}$n(Ke,Ze,Gn(Qn,{brighter:function(t){return t=null==t?Kn:Math.pow(Kn,t),new Ke(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new Ke(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*xe,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new ve(255*(n+e*(Ye*r+He*i)),255*(n+e*(Ve*r+We*i)),255*(n+e*(Xe*r)),this.opacity)}}));const ar=function t(n){var e=function(t){return 1==(t=+t)?or:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):er(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=ge(t)).r,(n=ge(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=or(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function ur(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:hr(e,r)})),o=gr.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:hr(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:hr(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:hr(t,e)},{i:u-2,x:hr(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Zr}function fi(){ei=(ni=ii.now())+ri,Zr=Kr=0;try{si()}finally{Zr=0,function(){for(var t,n,e=Gr,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Gr=n);Qr=t,di(r)}(),ei=0}}function hi(){var t=ii.now(),n=t-ni;n>ti&&(ri-=n,ni=t)}function di(t){Zr||(Kr&&(Kr=clearTimeout(Kr)),t-ei>24?(t<1/0&&(Kr=setTimeout(fi,t-ii.now()-ri)),Jr&&(Jr=clearInterval(Jr))):(Jr||(ni=ii.now(),Jr=setInterval(hi,ti)),Zr=1,oi(fi)))}function pi(t,n,e){var r=new ci;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}function gi(t,n,e){var r=new ci,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?ai():+e,r.restart((function o(a){a+=i,r.restart(o,i+=n,e),t(a)}),n,e),r)}ci.prototype=li.prototype={constructor:ci,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?ai():+e)+(null==n?0:+n),this._next||Qr===this||(Qr?Qr._next=this:Gr=this,Qr=this),this._call=t,this._time=e,di()},stop:function(){this._call&&(this._call=null,this._time=1/0,di())}};var vi=(0,st.W)("start","end","interrupt"),yi=[],mi=0,_i=1,bi=2,wi=3,xi=4,Mi=5,Ei=6;function ki(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var l,s,f,h;if(e.state!==_i)return u();for(l in i)if((h=i[l]).name===e.name){if(h.state===wi)return pi(o);h.state===xi?(h.state=Ei,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+lmi)throw new Error("too late; already scheduled");return e}function Si(t,n){var e=Ti(t,n);if(e.state>bi)throw new Error("too late; already started");return e}function Ti(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ci(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>bi&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Ni:Si;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=dt(t),r="transform"===e?Ar:Ii;return this.attrTween(t,"function"==typeof n?(e.local?Fi:zi)(e,r,Ri(this,"attr."+t,n)):null==n?(e.local?Ui:Oi)(e):(e.local?Li:Di)(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=dt(t);return this.tween(e,(r.local?qi:ji)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Cr:Ii;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=jt(this,t),a=(this.style.removeProperty(t),jt(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,o;return function(){var a=jt(this,t),u=e(this);return null==u&&(this.style.removeProperty(t),u=jt(this,t)),a===u?null:a===r&&u===i?o:o=n(r=a,i=u)}}(t,r,Ri(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var o=jt(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ri(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Ti(this.node(),e).tween,o=0,a=i.length;o_i&&e.name===n)return new $i([[t]],Yo,n,+r);return null}function Vo(t){return function(){return t}}function Wo(t,n,e){this.target=t,this.type=n,this.selection=e}function Xo(){dn.stopImmediatePropagation()}function $o(){dn.preventDefault(),dn.stopImmediatePropagation()}var Go={name:"drag"},Qo={name:"space"},Zo={name:"handle"},Ko={name:"center"},Jo={name:"x",handles:["e","w"].map(ua),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ta={name:"y",handles:["n","s"].map(ua),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},na={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(ua),input:function(t){return t},output:function(t){return t}},ea={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"},ra={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},ia={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},oa={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},aa={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ua(t){return{type:t}}function ca(){return!dn.button}function la(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function sa(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function fa(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function ha(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function da(){return va(Jo)}function pa(){return va(ta)}function ga(){return va(na)}function va(t){var n,e=la,r=ca,i=(0,st.W)(a,"start","brush","end"),o=6;function a(n){var e=n.property("__brush",f).selectAll(".overlay").data([ua("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ea.overlay).merge(e).each((function(){var t=sa(this).extent;Nn(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])})),n.selectAll(".selection").data([ua("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ea.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.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 ea[t.type]})),n.each(u).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function u(){var t=Nn(this),n=sa(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-o/2:n[0][0]-o/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-o/2:n[0][1]-o/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+o:o})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+o:o}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new l(t,n)}function l(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(dn.touches){if(dn.changedTouches.length0&&(e=i-d),x<0?f=h-p:x>0&&(o=a-p),b=Qo,U.attr("cursor",ea.selection),z());break;default:return}$o()}),!0).on("keyup.brush",(function(){switch(dn.keyCode){case 16:A&&(v=y=A=!1,z());break;case 18:b===Ko&&(w<0?l=s:w>0&&(e=i),x<0?f=h:x>0&&(o=a),b=Zo,z());break;case 32:b===Qo&&(dn.altKey?(w&&(l=s-d*w,e=i+d*w),x&&(f=h-p*x,o=a+p*x),b=Ko):(w<0?l=s:w>0&&(e=i),x<0?f=h:x>0&&(o=a),b=Zo),U.attr("cursor",ea[_]),z());break;default:return}$o()}),!0).on("mousemove.brush",L,!0).on("mouseup.brush",F,!0);Fn(dn.view)}Xo(),Ci(m),u.call(m),I.start()}function L(){var t=In(m);!A||v||y||(Math.abs(t[0]-R[0])>Math.abs(t[1]-R[1])?y=!0:v=!0),R=t,g=!0,$o(),z()}function z(){var t;switch(d=R[0]-P[0],p=R[1]-P[1],b){case Qo:case Go:w&&(d=Math.max(N-e,Math.min(T-l,d)),i=e+d,s=l+d),x&&(p=Math.max(S-o,Math.min(C-f,p)),a=o+p,h=f+p);break;case Zo:w<0?(d=Math.max(N-e,Math.min(T-e,d)),i=e+d,s=l):w>0&&(d=Math.max(N-l,Math.min(T-l,d)),i=e,s=l+d),x<0?(p=Math.max(S-o,Math.min(C-o,p)),a=o+p,h=f):x>0&&(p=Math.max(S-f,Math.min(C-f,p)),a=o,h=f+p);break;case Ko:w&&(i=Math.max(N,Math.min(T,e-d*w)),s=Math.max(N,Math.min(T,l+d*w))),x&&(a=Math.max(S,Math.min(C,o-p*x)),h=Math.max(S,Math.min(C,f+p*x)))}sTa)if(Math.abs(s*u-c*l)>Ta&&i){var h=e-o,d=r-a,p=u*u+c*c,g=h*h+d*d,v=Math.sqrt(p),y=Math.sqrt(f),m=i*Math.tan((Na-Math.acos((p+f-g)/(2*v*y)))/2),_=m/y,b=m/v;Math.abs(_-1)>Ta&&(this._+="L"+(t+_*l)+","+(n+_*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>l*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,r,i,o){t=+t,n=+n;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,l=n+u,s=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>Ta||Math.abs(this._y1-l)>Ta)&&(this._+="L"+c+","+l),e&&(f<0&&(f=f%Sa+Sa),f>Ca?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=l):f>Ta&&(this._+="A"+e+","+e+",0,"+ +(f>=Na)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};const Ra=Pa;function Ia(t){return t.source}function Oa(t){return t.target}function Ua(t){return t.radius}function Da(t){return t.startAngle}function La(t){return t.endAngle}function za(){var t=Ia,n=Oa,e=Ua,r=Da,i=La,o=null;function a(){var a,u=Ea.call(arguments),c=t.apply(this,u),l=n.apply(this,u),s=+e.apply(this,(u[0]=c,u)),f=r.apply(this,u)-ba,h=i.apply(this,u)-ba,d=s*ya(f),p=s*ma(f),g=+e.apply(this,(u[0]=l,u)),v=r.apply(this,u)-ba,y=i.apply(this,u)-ba;if(o||(o=a=Ra()),o.moveTo(d,p),o.arc(0,0,s,f,h),f===v&&h===y||(o.quadraticCurveTo(0,0,g*ya(v),g*ma(v)),o.arc(0,0,g,v,y)),o.quadraticCurveTo(0,0,d,p),o.closePath(),a)return o=null,a+""||null}return a.radius=function(t){return arguments.length?(e="function"==typeof t?t:ka(+t),a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:ka(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:ka(+t),a):i},a.source=function(n){return arguments.length?(t=n,a):t},a.target=function(t){return arguments.length?(n=t,a):n},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}var Fa=e(8949),qa=Array.prototype.slice;function ja(t,n){return t-n}function Ba(t){return function(){return t}}function Ya(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-l)*(r-s)/(d-s)+l&&(i=-i)}return i}function Va(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function Wa(){}var Xa=[[],[[[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]]],[]];function $a(){var t=1,n=1,e=A,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(ja);else{var r=y(t),i=r[0],a=r[1];n=C(i,a,n),n=M(Math.floor(i/n)*n,Math.floor(a/n)*n,n)}return n.map((function(n){return o(t,n)}))}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,c,l,s,f,h=new Array,d=new Array;for(o=u=-1,l=e[0]>=r,Xa[l<<1].forEach(p);++o=r,Xa[c|l<<1].forEach(p);for(Xa[l<<0].forEach(p);++u=r,s=e[u*t]>=r,Xa[l<<1|s<<2].forEach(p);++o=r,f=s,s=e[u*t+o+1]>=r,Xa[c|l<<1|s<<2|f<<3].forEach(p);Xa[l|s<<3].forEach(p)}for(o=-1,s=e[u*t]>=r,Xa[s<<2].forEach(p);++o=r,Xa[s<<2|f<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],c=[t[1][0]+o,t[1][1]+u],l=a(r),s=a(c);(n=d[l])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[l])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=l]=n):h[l]=d[s]={start:l,end:s,ring:[r,c]}}Xa[s<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var n,e=0,r=o.length;e0&&a0&&u0&&o>0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?Ba(qa.call(t)):Ba(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:Wa,i):r===u},i}function Ga(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[u-o+a*r]),n.data[u-e+a*r]=c/Math.min(u+1,r-1+o-u,o))}function Qa(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=c/Math.min(u+1,i-1+o-u,o))}function Za(t){return t[0]}function Ka(t){return t[1]}function Ja(){return 1}function tu(){var t=Za,n=Ka,e=Ja,r=960,i=500,o=20,a=2,u=3*o,c=r+2*u>>a,l=i+2*u>>a,s=Ba(20);function f(r){var i=new Float32Array(c*l),f=new Float32Array(c*l);r.forEach((function(r,o,s){var f=+t(r,o,s)+u>>a,h=+n(r,o,s)+u>>a,d=+e(r,o,s);f>=0&&f=0&&h>a),Qa({width:c,height:l,data:f},{width:c,height:l,data:i},o>>a),Ga({width:c,height:l,data:i},{width:c,height:l,data:f},o>>a),Qa({width:c,height:l,data:f},{width:c,height:l,data:i},o>>a),Ga({width:c,height:l,data:i},{width:c,height:l,data:f},o>>a),Qa({width:c,height:l,data:f},{width:c,height:l,data:i},o>>a);var d=s(i);if(!Array.isArray(d)){var p=U(i);d=C(0,p,d),(d=M(0,Math.floor(p/d)*d,d)).shift()}return $a().thresholds(d).size([c,l])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),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,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function v(){return c=r+2*(u=3*o)>>a,l=i+2*u>>a,f}return f.x=function(n){return arguments.length?(t="function"==typeof n?n:Ba(+n),f):t},f.y=function(t){return arguments.length?(n="function"==typeof t?t:Ba(+t),f):n},f.weight=function(t){return arguments.length?(e="function"==typeof t?t:Ba(+t),f):e},f.size=function(t){if(!arguments.length)return[r,i];var n=Math.ceil(t[0]),e=Math.ceil(t[1]);if(!(n>=0||n>=0))throw new Error("invalid size");return r=n,i=e,v()},f.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),v()},f.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?Ba(qa.call(t)):Ba(t),f):s},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),v()},f}var nu=e(2279);function eu(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function ru(t,n){return fetch(t,n).then(eu)}function iu(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function ou(t,n){return fetch(t,n).then(iu)}function au(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function uu(t,n){return fetch(t,n).then(au)}function cu(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),uu(n,e).then((function(n){return t(n,r)}))}}function lu(t,n,e,r){3===arguments.length&&"function"==typeof e&&(r=e,e=void 0);var i=(0,nu.yv)(t);return uu(n,e).then((function(t){return i.parse(t,r)}))}var su=cu(nu.ue),fu=cu(nu.tJ);function hu(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))}function du(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}function pu(t,n){return fetch(t,n).then(du)}function gu(t){return function(n,e){return uu(n,e).then((function(n){return(new DOMParser).parseFromString(n,t)}))}}const vu=gu("application/xml");var yu=gu("text/html"),mu=gu("image/svg+xml");function _u(t,n){var e;function r(){var r,i,o=e.length,a=0,u=0;for(r=0;r=(o=(g+y)/2))?g=o:y=o,(s=e>=(a=(v+m)/2))?v=a:m=a,i=d,!(d=d[f=s<<1|l]))return i[f]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)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),(l=n>=(o=(g+y)/2))?g=o:y=o,(s=e>=(a=(v+m)/2))?v=a:m=a}while((f=s<<1|l)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[f]=p,t}function Mu(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Eu(t){return t[0]}function ku(t){return t[1]}function Nu(t,n,e){var r=new Su(null==n?Eu:n,null==e?ku:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Su(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Tu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Cu=Nu.prototype=Su.prototype;function Au(t){return t.x+t.vx}function Pu(t){return t.y+t.vy}function Ru(t){var n,e,r=1,i=1;function o(){for(var t,o,u,c,l,s,f,h=n.length,d=0;dc+d||il+d||ou.index){var p=c-a.x-a.vx,g=l-a.y-a.vy,v=p*p+g*g;vt.r&&(t.r=t[n].r)}function u(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;rs&&(s=r),if&&(f=i));for(st||t>i||r>n||n>o))return this;var a,u,c=i-e,l=this._root;switch(u=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{(a=new Array(4))[u]=l,l=a}while(o=r+(c*=2),t>(i=e+c)||n>o);break;case 1:do{(a=new Array(4))[u]=l,l=a}while(o=r+(c*=2),(e=i-c)>t||n>o);break;case 2:do{(a=new Array(4))[u]=l,l=a}while(r=o-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(a=new Array(4))[u]=l,l=a}while(r=o-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=l)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},Cu.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},Cu.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Cu.find=function(t,n,e){var r,i,o,a,u,c,l,s=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new Mu(g,s,f,h,d)),null==e?e=1/0:(s=t-e,f=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(g=c.node)||(i=c.x0)>h||(o=c.y0)>d||(a=c.x1)=y)<<1|t>=v)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var m=t-+this._x.call(null,g.data),_=n-+this._y.call(null,g.data),b=m*m+_*_;if(b=(u=(p+v)/2))?p=u:v=u,(s=a>=(c=(g+y)/2))?g=c:y=c,n=d,!(d=d[f=s<<1|l]))return this;if(!d.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,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):n?(i?n[f]=i:delete n[f],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Cu.removeAll=function(t){for(var n=0,e=t.length;n1?(null==e?u.remove(t):u.set(t,d(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,c,l=0,s=t.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(t,e),n):l.on(t)}}}function ju(){var t,n,e,r,i=bu(-30),o=1,a=1/0,u=.81;function c(r){var i,o=t.length,a=Nu(t,Du,Lu).visitAfter(s);for(e=r,i=0;i=a)){(t.data!==n||t.next)&&(0===s&&(d+=(s=wu())*s),0===f&&(d+=(f=wu())*f),d1?r[0]+r.slice(2):r,+t.slice(e+1)]}function Wu(t){return(t=Vu(Math.abs(t)))?t[1]:NaN}var Xu,$u=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gu(t){return new Qu(t)}function Qu(t){if(!(n=$u.exec(t)))throw new Error("invalid format: "+t);var n;this.fill=n[1]||" ",this.align=n[2]||">",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}function Zu(t,n){var e=Vu(t,n);if(!e)return t+"";var r=e[0],i=e[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")}Gu.prototype=Qu.prototype,Qu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ku={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Zu(100*t,n)},r:Zu,s:function(t,n){var e=Vu(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Xu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Vu(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Ju(t){return t}var tc,nc,ec,rc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ic(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}):Ju,i=t.currency,o=t.decimal,a=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):Ju,u=t.percent||"%";function c(t){var n=(t=Gu(t)).fill,e=t.align,c=t.sign,l=t.symbol,s=t.zero,f=t.width,h=t.comma,d=t.precision,p=t.trim,g=t.type;"n"===g?(h=!0,g="g"):Ku[g]||(null==d&&(d=12),p=!0,g="g"),(s||"0"===n&&"="===e)&&(s=!0,n="0",e="=");var v="$"===l?i[0]:"#"===l&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",y="$"===l?i[1]:/[%p]/.test(g)?u:"",m=Ku[g],_=/[defgprs%]/.test(g);function b(t){var i,u,l,b=v,w=y;if("c"===g)w=m(t)+w,t="";else{var x=(t=+t)<0;if(t=m(Math.abs(t),d),p&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),x&&0==+t&&(x=!1),b=(x?"("===c?c:"-":"-"===c||"("===c?"":c)+b,w=("s"===g?rc[8+Xu/3]:"")+w+(x&&"("===c?")":""),_)for(i=-1,u=t.length;++i(l=t.charCodeAt(i))||l>57){w=(46===l?o+t.slice(i+1):t.slice(i))+w,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var M=b.length+t.length+w.length,E=M>1)+b+t+w+E.slice(M);break;default:t=E+b+t+w}return a(t)}return d=null==d?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),b.toString=function(){return t+""},b}return{format:c,formatPrefix:function(t,n){var e=c(((t=Gu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Wu(n)/3))),i=Math.pow(10,-r),o=rc[8+r/3];return function(t){return e(i*t)+o}}}}function oc(t){return tc=ic(t),nc=tc.format,ec=tc.formatPrefix,tc}function ac(t){return Math.max(0,-Wu(Math.abs(t)))}function uc(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Wu(n)/3)))-Wu(Math.abs(t)))}function cc(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Wu(n)-Wu(t))+1}function lc(){return new sc}function sc(){this.reset()}oc({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),sc.prototype={constructor:sc,reset:function(){this.s=this.t=0},add:function(t){hc(fc,t,this.t),hc(this,fc.s,this.s),this.s?this.t+=fc.t:this.s=fc.t},valueOf:function(){return this.s}};var fc=new sc;function hc(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}var dc=1e-6,pc=1e-12,gc=Math.PI,vc=gc/2,yc=gc/4,mc=2*gc,_c=180/gc,bc=gc/180,wc=Math.abs,xc=Math.atan,Mc=Math.atan2,Ec=Math.cos,kc=Math.ceil,Nc=Math.exp,Sc=(Math.floor,Math.log),Tc=Math.pow,Cc=Math.sin,Ac=Math.sign||function(t){return t>0?1:t<0?-1:0},Pc=Math.sqrt,Rc=Math.tan;function Ic(t){return t>1?0:t<-1?gc:Math.acos(t)}function Oc(t){return t>1?vc:t<-1?-vc:Math.asin(t)}function Uc(t){return(t=Cc(t/2))*t}function Dc(){}function Lc(t,n){t&&Fc.hasOwnProperty(t.type)&&Fc[t.type](t,n)}var zc={Feature:function(t,n){Lc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Ec(n=(n*=bc)/2+yc),a=Cc(n),u=Xc*a,c=Wc*o+u*Ec(i),l=u*r*Cc(i);$c.add(Mc(l,c)),Vc=t,Wc=o,Xc=a}function nl(t){return Gc.reset(),Bc(t,Qc),2*Gc}function el(t){return[Mc(t[1],t[0]),Oc(t[2])]}function rl(t){var n=t[0],e=t[1],r=Ec(e);return[r*Ec(n),r*Cc(n),Cc(e)]}function il(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ol(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function al(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ul(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function cl(t){var n=Pc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var ll,sl,fl,hl,dl,pl,gl,vl,yl,ml,_l,bl,wl,xl,Ml,El,kl,Nl,Sl,Tl,Cl,Al,Pl,Rl,Il,Ol,Ul=lc(),Dl={point:Ll,lineStart:Fl,lineEnd:ql,polygonStart:function(){Dl.point=jl,Dl.lineStart=Bl,Dl.lineEnd=Yl,Ul.reset(),Qc.polygonStart()},polygonEnd:function(){Qc.polygonEnd(),Dl.point=Ll,Dl.lineStart=Fl,Dl.lineEnd=ql,$c<0?(ll=-(fl=180),sl=-(hl=90)):Ul>dc?hl=90:Ul<-dc&&(sl=-90),ml[0]=ll,ml[1]=fl}};function Ll(t,n){yl.push(ml=[ll=t,fl=t]),nhl&&(hl=n)}function zl(t,n){var e=rl([t*bc,n*bc]);if(vl){var r=ol(vl,e),i=ol([r[1],-r[0],0],r);cl(i),i=el(i);var o,a=t-dl,u=a>0?1:-1,c=i[0]*_c*u,l=wc(a)>180;l^(u*dlhl&&(hl=o):l^(u*dl<(c=(c+360)%360-180)&&chl&&(hl=n)),l?tHl(ll,fl)&&(fl=t):Hl(t,fl)>Hl(ll,fl)&&(ll=t):fl>=ll?(tfl&&(fl=t)):t>dl?Hl(ll,t)>Hl(ll,fl)&&(fl=t):Hl(t,fl)>Hl(ll,fl)&&(ll=t)}else yl.push(ml=[ll=t,fl=t]);nhl&&(hl=n),vl=e,dl=t}function Fl(){Dl.point=zl}function ql(){ml[0]=ll,ml[1]=fl,Dl.point=Ll,vl=null}function jl(t,n){if(vl){var e=t-dl;Ul.add(wc(e)>180?e+(e>0?360:-360):e)}else pl=t,gl=n;Qc.point(t,n),zl(t,n)}function Bl(){Qc.lineStart()}function Yl(){jl(pl,gl),Qc.lineEnd(),wc(Ul)>dc&&(ll=-(fl=180)),ml[0]=ll,ml[1]=fl,vl=null}function Hl(t,n){return(n-=t)<0?n+360:n}function Vl(t,n){return t[0]-n[0]}function Wl(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nHl(r[0],r[1])&&(r[1]=i[1]),Hl(i[0],r[1])>Hl(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Hl(r[1],i[0]))>a&&(a=u,ll=i[0],fl=r[1])}return yl=ml=null,ll===1/0||sl===1/0?[[NaN,NaN],[NaN,NaN]]:[[ll,sl],[fl,hl]]}var $l={sphere:Dc,point:Gl,lineStart:Zl,lineEnd:ts,polygonStart:function(){$l.lineStart=ns,$l.lineEnd=es},polygonEnd:function(){$l.lineStart=Zl,$l.lineEnd=ts}};function Gl(t,n){t*=bc;var e=Ec(n*=bc);Ql(e*Ec(t),e*Cc(t),Cc(n))}function Ql(t,n,e){++_l,wl+=(t-wl)/_l,xl+=(n-xl)/_l,Ml+=(e-Ml)/_l}function Zl(){$l.point=Kl}function Kl(t,n){t*=bc;var e=Ec(n*=bc);Rl=e*Ec(t),Il=e*Cc(t),Ol=Cc(n),$l.point=Jl,Ql(Rl,Il,Ol)}function Jl(t,n){t*=bc;var e=Ec(n*=bc),r=e*Ec(t),i=e*Cc(t),o=Cc(n),a=Mc(Pc((a=Il*o-Ol*i)*a+(a=Ol*r-Rl*o)*a+(a=Rl*i-Il*r)*a),Rl*r+Il*i+Ol*o);bl+=a,El+=a*(Rl+(Rl=r)),kl+=a*(Il+(Il=i)),Nl+=a*(Ol+(Ol=o)),Ql(Rl,Il,Ol)}function ts(){$l.point=Gl}function ns(){$l.point=rs}function es(){is(Al,Pl),$l.point=Gl}function rs(t,n){Al=t,Pl=n,t*=bc,n*=bc,$l.point=is;var e=Ec(n);Rl=e*Ec(t),Il=e*Cc(t),Ol=Cc(n),Ql(Rl,Il,Ol)}function is(t,n){t*=bc;var e=Ec(n*=bc),r=e*Ec(t),i=e*Cc(t),o=Cc(n),a=Il*o-Ol*i,u=Ol*r-Rl*o,c=Rl*i-Il*r,l=Pc(a*a+u*u+c*c),s=Oc(l),f=l&&-s/l;Sl+=f*a,Tl+=f*u,Cl+=f*c,bl+=s,El+=s*(Rl+(Rl=r)),kl+=s*(Il+(Il=i)),Nl+=s*(Ol+(Ol=o)),Ql(Rl,Il,Ol)}function os(t){_l=bl=wl=xl=Ml=El=kl=Nl=Sl=Tl=Cl=0,Bc(t,$l);var n=Sl,e=Tl,r=Cl,i=n*n+e*e+r*r;return igc?t-mc:t<-gc?t+mc:t,n]}function ls(t,n,e){return(t%=mc)?n||e?us(fs(t),hs(n,e)):fs(t):n||e?hs(n,e):cs}function ss(t){return function(n,e){return[(n+=t)>gc?n-mc:n<-gc?n+mc:n,e]}}function fs(t){var n=ss(t);return n.invert=ss(-t),n}function hs(t,n){var e=Ec(t),r=Cc(t),i=Ec(n),o=Cc(n);function a(t,n){var a=Ec(n),u=Ec(t)*a,c=Cc(t)*a,l=Cc(n),s=l*e+u*r;return[Mc(c*i-s*o,u*e-l*r),Oc(s*i+c*o)]}return a.invert=function(t,n){var a=Ec(n),u=Ec(t)*a,c=Cc(t)*a,l=Cc(n),s=l*i-c*o;return[Mc(c*i+l*o,u*e+s*r),Oc(s*e-u*r)]},a}function ds(t){function n(n){return(n=t(n[0]*bc,n[1]*bc))[0]*=_c,n[1]*=_c,n}return t=ls(t[0]*bc,t[1]*bc,t.length>2?t[2]*bc:0),n.invert=function(n){return(n=t.invert(n[0]*bc,n[1]*bc))[0]*=_c,n[1]*=_c,n},n}function ps(t,n,e,r,i,o){if(e){var a=Ec(n),u=Cc(n),c=r*e;null==i?(i=n+r*mc,o=n-c/2):(i=gs(a,i),o=gs(a,o),(r>0?io)&&(i+=r*mc));for(var l,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function ms(t,n){return wc(t[0]-n[0])=0;--o)i.point((s=l[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function ws(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,k=E*M,N=k>gc,S=g*w;if(xs.add(Mc(S*E*Cc(k),v*x+S*Ec(k))),a+=N?M+E*mc:M,N^d>=e^_>=e){var T=ol(rl(h),rl(m));cl(T);var C=ol(o,T);cl(C);var A=(N^M>=0?-1:1)*Oc(C[2]);(r>A||r===A&&(T[0]||T[1]))&&(u+=N^M>=0?1:-1)}}return(a<-dc||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(ks))}return h}}function ks(t){return t.length>1}function Ns(t,n){return((t=t.x)[0]<0?t[1]-vc-dc:vc-t[1])-((n=n.x)[0]<0?n[1]-vc-dc:vc-n[1])}const Ss=Es((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?gc:-gc,c=wc(o-e);wc(c-gc)0?vc:-vc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=gc&&(wc(e-i)dc?xc((Cc(n)*(o=Ec(r))*Cc(e)-Cc(r)*(i=Ec(n))*Cc(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*vc,r.point(-gc,i),r.point(0,i),r.point(gc,i),r.point(gc,0),r.point(gc,-i),r.point(0,-i),r.point(-gc,-i),r.point(-gc,0),r.point(-gc,i);else if(wc(t[0]-n[0])>dc){var o=t[0]0,i=wc(n)>dc;function o(t,e){return Ec(t)*Ec(e)>n}function a(t,e,r){var i=[1,0,0],o=ol(rl(t),rl(e)),a=il(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var l=n*a/c,s=-n*u/c,f=ol(i,o),h=ul(i,l);al(h,ul(o,s));var d=f,p=il(h,d),g=il(d,d),v=p*p-g*(il(h,h)-1);if(!(v<0)){var y=Pc(v),m=ul(d,(-p-y)/g);if(al(m,h),m=el(m),!r)return m;var _,b=t[0],w=e[0],x=t[1],M=e[1];w0^m[1]<(wc(m[0]-b)gc^(b<=m[0]&&m[0]<=w)){var N=ul(d,(-p+y)/g);return al(N,h),[m,el(N)]}}}function u(n,e){var i=r?t:gc-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return Es(o,(function(t){var n,e,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var d,p=[f,h],g=o(f,h),v=r?g?0:u(f,h):g?u(f+(f<0?gc:-gc),h):0;if(!n&&(l=c=g)&&t.lineStart(),g!==c&&(!(d=a(n,p))||ms(n,d)||ms(p,d))&&(p[0]+=dc,p[1]+=dc,g=o(p[0],p[1])),g!==c)s=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^g){var y;v&e||!(y=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||n&&ms(n,p)||t.point(p[0],p[1]),n=p,c=g,e=v},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(l&&c)<<1}}}),(function(n,r,i,o){ps(o,t,e,i,n,r)}),r?[0,-t]:[-gc,t-gc])}var Cs=1e9,As=-Cs;function Ps(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,l){var s=0,f=0;if(null==i||(s=a(i,u))!==(f=a(o,u))||c(i,o)<0^u>0)do{l.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return wc(r[0]-t)0?0:3:wc(r[0]-e)0?2:1:wc(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,l,s,f,h,d,p,g,v,y,m,_=a,b=ys(),w={point:x,lineStart:function(){w.point=M,l&&l.push(s=[]),y=!0,v=!1,p=g=NaN},lineEnd:function(){c&&(M(f,h),d&&v&&b.rejoin(),c.push(b.result())),w.point=x,v&&_.lineEnd()},polygonStart:function(){_=b,c=[],l=[],m=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=l.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=m&&n,i=(c=z(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&bs(c,u,n,o,a),a.polygonEnd()),_=a,c=l=s=null}};function x(t,n){i(t,n)&&_.point(t,n)}function M(o,a){var u=i(o,a);if(l&&s.push([o,a]),y)f=o,h=a,d=u,y=!1,u&&(_.lineStart(),_.point(o,a));else if(u&&v)_.point(o,a);else{var c=[p=Math.max(As,Math.min(Cs,p)),g=Math.max(As,Math.min(Cs,g))],b=[o=Math.max(As,Math.min(Cs,o)),a=Math.max(As,Math.min(Cs,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],l=0,s=1,f=n[0]-u,h=n[1]-c;if(a=e-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>s)return;a>l&&(l=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>s)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>l&&(l=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>l&&(l=a)}else if(h>0){if(a0&&(t[0]=u+l*f,t[1]=c+l*h),s<1&&(n[0]=u+s*f,n[1]=c+s*h),!0}}}}}(c,b,t,n,e,r)?u&&(_.lineStart(),_.point(o,a),m=!1):(v||(_.lineStart(),_.point(c[0],c[1])),_.point(b[0],b[1]),u||_.lineEnd(),m=!1)}p=o,g=a,v=u}return w}}function Rs(){var t,n,e,r=0,i=0,o=960,a=500;return e={stream:function(e){return t&&n===e?t:t=Ps(r,i,o,a)(n=e)},extent:function(u){return arguments.length?(r=+u[0][0],i=+u[0][1],o=+u[1][0],a=+u[1][1],t=n=null,e):[[r,i],[o,a]]}}}var Is,Os,Us,Ds=lc(),Ls={sphere:Dc,point:Dc,lineStart:function(){Ls.point=Fs,Ls.lineEnd=zs},lineEnd:Dc,polygonStart:Dc,polygonEnd:Dc};function zs(){Ls.point=Ls.lineEnd=Dc}function Fs(t,n){Is=t*=bc,Os=Cc(n*=bc),Us=Ec(n),Ls.point=qs}function qs(t,n){t*=bc;var e=Cc(n*=bc),r=Ec(n),i=wc(t-Is),o=Ec(i),a=r*Cc(i),u=Us*e-Os*r*o,c=Os*e+Us*r*o;Ds.add(Mc(Pc(a*a+u*u),c)),Is=t,Os=e,Us=r}function js(t){return Ds.reset(),Bc(t,Ls),+Ds}var Bs=[null,null],Ys={type:"LineString",coordinates:Bs};function Hs(t,n){return Bs[0]=t,Bs[1]=n,js(Ys)}var Vs={Feature:function(t,n){return Xs(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rdc})).map(c)).concat(M(kc(o/d)*d,i,d).filter((function(t){return wc(t%g)>dc})).map(l))}return y.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(f(a).slice(1),s(e).reverse().slice(1),f(u).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),y.precision(v)):[[r,u],[e,a]]},y.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),y.precision(v)):[[n,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(v=+h,c=tf(o,i,90),l=nf(n,t,v),s=tf(u,a,90),f=nf(r,e,v),y):v},y.extentMajor([[-180,-90+dc],[180,90-dc]]).extentMinor([[-180,-80-dc],[180,80+dc]])}function rf(){return ef()()}function of(t,n){var e=t[0]*bc,r=t[1]*bc,i=n[0]*bc,o=n[1]*bc,a=Ec(r),u=Cc(r),c=Ec(o),l=Cc(o),s=a*Ec(e),f=a*Cc(e),h=c*Ec(i),d=c*Cc(i),p=2*Oc(Pc(Uc(o-r)+a*c*Uc(i-e))),g=Cc(p),v=p?function(t){var n=Cc(t*=p)/g,e=Cc(p-t)/g,r=e*s+n*h,i=e*f+n*d,o=e*u+n*l;return[Mc(i,r)*_c,Mc(o,Pc(r*r+i*i))*_c]}:function(){return[e*_c,r*_c]};return v.distance=p,v}function af(t){return t}var uf,cf,lf,sf,ff=lc(),hf=lc(),df={point:Dc,lineStart:Dc,lineEnd:Dc,polygonStart:function(){df.lineStart=pf,df.lineEnd=yf},polygonEnd:function(){df.lineStart=df.lineEnd=df.point=Dc,ff.add(wc(hf)),hf.reset()},result:function(){var t=ff/2;return ff.reset(),t}};function pf(){df.point=gf}function gf(t,n){df.point=vf,uf=lf=t,cf=sf=n}function vf(t,n){hf.add(sf*t-lf*n),lf=t,sf=n}function yf(){vf(uf,cf)}const mf=df;var _f=1/0,bf=_f,wf=-_f,xf=wf,Mf={point:function(t,n){t<_f&&(_f=t),t>wf&&(wf=t),nxf&&(xf=n)},lineStart:Dc,lineEnd:Dc,polygonStart:Dc,polygonEnd:Dc,result:function(){var t=[[_f,bf],[wf,xf]];return wf=xf=-(bf=_f=1/0),t}};const Ef=Mf;var kf,Nf,Sf,Tf,Cf=0,Af=0,Pf=0,Rf=0,If=0,Of=0,Uf=0,Df=0,Lf=0,zf={point:Ff,lineStart:qf,lineEnd:Yf,polygonStart:function(){zf.lineStart=Hf,zf.lineEnd=Vf},polygonEnd:function(){zf.point=Ff,zf.lineStart=qf,zf.lineEnd=Yf},result:function(){var t=Lf?[Uf/Lf,Df/Lf]:Of?[Rf/Of,If/Of]:Pf?[Cf/Pf,Af/Pf]:[NaN,NaN];return Cf=Af=Pf=Rf=If=Of=Uf=Df=Lf=0,t}};function Ff(t,n){Cf+=t,Af+=n,++Pf}function qf(){zf.point=jf}function jf(t,n){zf.point=Bf,Ff(Sf=t,Tf=n)}function Bf(t,n){var e=t-Sf,r=n-Tf,i=Pc(e*e+r*r);Rf+=i*(Sf+t)/2,If+=i*(Tf+n)/2,Of+=i,Ff(Sf=t,Tf=n)}function Yf(){zf.point=Ff}function Hf(){zf.point=Wf}function Vf(){Xf(kf,Nf)}function Wf(t,n){zf.point=Xf,Ff(kf=Sf=t,Nf=Tf=n)}function Xf(t,n){var e=t-Sf,r=n-Tf,i=Pc(e*e+r*r);Rf+=i*(Sf+t)/2,If+=i*(Tf+n)/2,Of+=i,Uf+=(i=Tf*t-Sf*n)*(Sf+t),Df+=i*(Tf+n),Lf+=3*i,Ff(Sf=t,Tf=n)}const $f=zf;function Gf(t){this._context=t}Gf.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,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,mc)}},result:Dc};var Qf,Zf,Kf,Jf,th,nh=lc(),eh={point:Dc,lineStart:function(){eh.point=rh},lineEnd:function(){Qf&&ih(Zf,Kf),eh.point=Dc},polygonStart:function(){Qf=!0},polygonEnd:function(){Qf=null},result:function(){var t=+nh;return nh.reset(),t}};function rh(t,n){eh.point=ih,Zf=Jf=t,Kf=th=n}function ih(t,n){Jf-=t,th-=n,nh.add(Pc(Jf*Jf+th*th)),Jf=t,th=n}const oh=eh;function ah(){this._string=[]}function uh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ch(t,n){var e,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Bc(t,e(r))),r.result()}return o.area=function(t){return Bc(t,e(mf)),mf.result()},o.measure=function(t){return Bc(t,e(oh)),oh.result()},o.bounds=function(t){return Bc(t,e(Ef)),Ef.result()},o.centroid=function(t){return Bc(t,e($f)),$f.result()},o.projection=function(n){return arguments.length?(e=null==n?(t=null,af):(t=n).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(n=null,new ah):new Gf(n=t),"function"!=typeof i&&r.pointRadius(i),o):n},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(n)}function lh(t){return{stream:sh(t)}}function sh(t){return function(n){var e=new fh;for(var r in t)e[r]=t[r];return e.stream=n,e}}function fh(){}function hh(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Bc(e,t.stream(Ef)),n(Ef.result()),null!=r&&t.clipExtent(r),t}function dh(t,n,e){return hh(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])}),e)}function ph(t,n,e){return dh(t,[[0,0],n],e)}function gh(t,n,e){return hh(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])}),e)}function vh(t,n,e){return hh(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])}),e)}ah.prototype={_radius:4.5,_circle:uh(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,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=uh(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},fh.prototype={constructor:fh,point:function(t,n){this.stream.point(t,n)},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 yh=16,mh=Ec(30*bc);function _h(t,n){return+n?function(t,n){function e(r,i,o,a,u,c,l,s,f,h,d,p,g,v){var y=l-r,m=s-i,_=y*y+m*m;if(_>4*n&&g--){var b=a+h,w=u+d,x=c+p,M=Pc(b*b+w*w+x*x),E=Oc(x/=M),k=wc(wc(x)-1)n||wc((y*C+m*A)/_-.5)>.3||a*h+u*d+c*p2?t[2]%360*bc:0,S()):[v*_c,y*_c,m*_c]},k.angle=function(t){return arguments.length?(_=t%360*bc,S()):_*_c},k.precision=function(t){return arguments.length?(a=_h(u,E=t*t),T()):Pc(E)},k.fitExtent=function(t,n){return dh(k,t,n)},k.fitSize=function(t,n){return ph(k,t,n)},k.fitWidth=function(t,n){return gh(k,t,n)},k.fitHeight=function(t,n){return vh(k,t,n)},function(){return n=t.apply(this,arguments),k.invert=n.invert&&N,S()}}function kh(t){var n=0,e=gc/3,r=Eh(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*bc,e=t[1]*bc):[n*_c,e*_c]},i}function Nh(t,n){var e=Cc(t),r=(e+Cc(n))/2;if(wc(r)=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-vc+dc&&(n=-vc+dc):n>vc-dc&&(n=vc-dc);var e=i/Tc(Fh(n),r);return[e*Cc(r*t),i-e*Ec(r*t)]}return o.invert=function(t,n){var e=i-n,o=Ac(r)*Pc(t*t+e*e);return[Mc(t,wc(e))/r*Ac(e),2*xc(Tc(i/o,1/r))-vc]},o}function jh(){return kh(qh).scale(109.5).parallels([30,30])}function Bh(t,n){return[t,n]}function Yh(){return Mh(Bh).scale(152.63)}function Hh(t,n){var e=Ec(t),r=t===n?Cc(t):(e-Ec(n))/(n-t),i=e/r+t;if(wc(r)2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)}function fd(t,n){return t.parent===n.parent?1:2}function hd(t,n){return t+n.x}function dd(t,n){return Math.max(t,n.y)}function pd(){var t=fd,n=1,e=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(hd,0)/t.length}(e),n.y=function(t){return 1+t.reduce(dd,0)}(e)):(n.x=o?a+=t(n,o):0,n.y=0,o=n)}));var u=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),l=u.x-t(u,c)/2,s=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-l)/(s-l)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i}function gd(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function vd(t,n){var e,r,i,o,a,u=new bd(t),c=+t.value&&(u.value=t.value),l=[u];for(null==n&&(n=yd);e=l.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)l.push(r=e.children[o]=new bd(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(_d)}function yd(t){return t.children}function md(t){t.data=t.data.data}function _d(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function bd(t){this.data=t,this.depth=this.height=0,this.parent=null}Zh.invert=function(t,n){for(var e,r=n,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=e=(r*(Wh+Xh*i+o*($h+Gh*i))-n)/(Wh+3*Xh*i+o*(7*$h+9*Gh*i)))*r)*i*i,!(wc(e)dc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},od.invert=Ph(Oc),ud.invert=Ph((function(t){return 2*xc(t)})),ld.invert=function(t,n){return[-n,2*xc(Nc(t))-vc]},bd.prototype=vd.prototype={constructor:bd,count:function(){return this.eachAfter(gd)},each:function(t){var n,e,r,i,o=this,a=[o];do{for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return vd(this).eachBefore(md)}};var wd=Array.prototype.slice;function xd(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(wd.call(t))).length,o=[];r0&&e*e>r*r+i*i}function Nd(t,n){for(var e=0;e(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Pd(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function Rd(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Id(t){this._=t,this.next=null,this.previous=null}function Od(t){if(!(i=t.length))return 0;var n,e,r,i,o,a,u,c,l,s,f;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Ad(e,n,r=t[2]),n=new Id(n),e=new Id(e),r=new Id(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;u0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=Dd(n),e):t},e.parentId=function(t){return arguments.length?(n=Dd(t),e):n},e}function Jd(t,n){return t.parent===n.parent?1:2}function tp(t){var n=t.children;return n?n[0]:t.t}function np(t){var n=t.children;return n?n[n.length-1]:t.t}function ep(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function rp(t,n,e){return t.a.parent===n.parent?t.a:e}function ip(t,n){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=n}function op(){var t=Jd,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,a=new ip(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new ip(r[i],i)),e.parent=n;return(a.parent=new ip(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var l=i,s=i,f=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>f.depth&&(f=t)}));var h=l===s?1:t(l,s)/2,d=h-l.x,p=n/(s.x+h+d),g=e/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,c=o.parent.children[0],l=o.m,s=a.m,f=u.m,h=c.m;u=np(u),o=tp(o),u&&o;)c=tp(c),(a=np(a)).a=n,(i=u.z+f-o.z-l+t(u._,o._))>0&&(ep(rp(u,n,r),n,i),l+=i,s+=i),f+=u.m,l+=o.m,h+=c.m,s+=a.m;u&&!np(a)&&(a.t=u,a.m+=f-s),o&&!tp(c)&&(c.t=o,c.m+=l-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i}function ap(t,n,e,r,i){for(var o,a=t.children,u=-1,c=a.length,l=t.value&&(i-e)/t.value;++uh&&(h=u),v=s*s*g,(d=Math.max(h/v,v/f))>p){s-=u;break}p=d}y.push(a={value:s,dice:c1?n:1)},e}(up);function sp(){var t=lp,n=!1,e=1,r=1,i=[0],o=Ld,a=Ld,u=Ld,c=Ld,l=Ld;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(f),i=[0],n&&t.eachBefore(Hd),t}function f(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,f=n.x1-e,h=n.y1-e;f=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}for(var f=l[n],h=r/2+f,d=n+1,p=e-1;d>>1;l[g]c-o){var m=(i*y+a*v)/r;t(n,d,v,i,o,m,c),t(d,e,y,m,o,a,c)}else{var _=(o*y+c*v)/r;t(n,d,v,i,o,a,_),t(d,e,y,i,_,a,c)}}(0,c,t.value,n,e,r,i)}function hp(t,n,e,r,i){(1&t.depth?ap:Vd)(t,n,e,r,i)}const dp=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,l,s,f=-1,h=a.length,d=t.value;++f1?n:1)},e}(up);function pp(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e1&&vp(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function _p(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)l.push(t[r[o[n]][2]]);for(n=+u;nu!=l>u&&a<(c-e)*(u-r)/(l-r)+e&&(s=!s),c=e,l=r;return s}function wp(t){for(var n,e,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],c=0;++r1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(xp),kp=function t(n){function e(){var t=Ep.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(xp),Np=function t(n){function e(t){return function(){for(var e=0,r=0;r2?Bp:jp,r=i=null,s}function s(n){return(r||(r=e(o,a,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,u)))(+n)}return s.invert=function(t){return(i||(i=e(a,o,qp,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(o=Ap.call(t,zp),l()):o.slice()},s.range=function(t){return arguments.length?(a=Pp.call(t),l()):a.slice()},s.rangeRound=function(t){return a=Pp.call(t),u=br,l()},s.clamp=function(t){return arguments.length?(c=!!t,l()):c},s.interpolate=function(t){return arguments.length?(u=t,l()):u},l()}function Vp(t){var n=t.domain;return t.ticks=function(t){var e=n();return S(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return function(t,n,e){var r,i=t[0],o=t[t.length-1],a=C(i,o,null==n?10:n);switch((e=Gu(null==e?",f":e)).type){case"s":var u=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=uc(a,u))||(e.precision=r),ec(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=cc(a,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=ac(a))||(e.precision=r-2*("%"===e.type))}return nc(e)}(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],c=i[a];return c0?r=T(u=Math.floor(u/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=T(u=Math.ceil(u*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(c*r)/r,n(i)),t},t}function Wp(){var t=Hp(qp,hr);return t.copy=function(){return Yp(t,Wp())},Vp(t)}function Xp(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Ap.call(e,zp),n):t.slice()},n.copy=function(){return Xp().domain(t)},Vp(n)}function $p(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;hc)break;g.push(f)}}else for(;h=1;--s)if(!((f=l*s)c)break;g.push(f)}}else g=S(h,d,Math.min(d-h,p)).map(i);return o?g.reverse():g},t.tickFormat=function(n,o){if(null==o&&(o=10===e?".0e":","),"function"!=typeof o&&(o=nc(o)),n===1/0)return o;null==n&&(n=10);var a=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/i(Math.round(r(t)));return n*e0?e[i-1]:t[0],i=e?[r[e-1],n]:[r[a-1],r[a]]},o.copy=function(){return ag().domain([t,n]).range(i)},Vp(o)}function ug(){var t=[.5],n=[0,1],e=1;function r(r){if(r<=r)return n[l(t,r,0,e)]}return r.domain=function(i){return arguments.length?(t=Pp.call(i),e=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(i){return arguments.length?(n=Pp.call(i),e=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},r.copy=function(){return ug().domain(t).range(n)},r}var cg=new Date,lg=new Date;function sg(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return cg.setTime(+n),lg.setTime(+r),t(cg),t(lg),Math.floor(e(cg,lg))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var fg=sg((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));fg.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?sg((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):fg:null};const hg=fg;var dg=fg.range,pg=1e3,gg=6e4,vg=36e5,yg=864e5,mg=6048e5,_g=sg((function(t){t.setTime(Math.floor(t/pg)*pg)}),(function(t,n){t.setTime(+t+n*pg)}),(function(t,n){return(n-t)/pg}),(function(t){return t.getUTCSeconds()}));const bg=_g;var wg=_g.range,xg=sg((function(t){t.setTime(Math.floor(t/gg)*gg)}),(function(t,n){t.setTime(+t+n*gg)}),(function(t,n){return(n-t)/gg}),(function(t){return t.getMinutes()}));const Mg=xg;var Eg=xg.range,kg=sg((function(t){var n=t.getTimezoneOffset()*gg%vg;n<0&&(n+=vg),t.setTime(Math.floor((+t-n)/vg)*vg+n)}),(function(t,n){t.setTime(+t+n*vg)}),(function(t,n){return(n-t)/vg}),(function(t){return t.getHours()}));const Ng=kg;var Sg=kg.range,Tg=sg((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*gg)/yg}),(function(t){return t.getDate()-1}));const Cg=Tg;var Ag=Tg.range;function Pg(t){return sg((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*gg)/mg}))}var Rg=Pg(0),Ig=Pg(1),Og=Pg(2),Ug=Pg(3),Dg=Pg(4),Lg=Pg(5),zg=Pg(6),Fg=Rg.range,qg=Ig.range,jg=Og.range,Bg=Ug.range,Yg=Dg.range,Hg=Lg.range,Vg=zg.range,Wg=sg((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}));const Xg=Wg;var $g=Wg.range,Gg=sg((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Gg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?sg((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};const Qg=Gg;var Zg=Gg.range,Kg=sg((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*gg)}),(function(t,n){return(n-t)/gg}),(function(t){return t.getUTCMinutes()}));const Jg=Kg;var tv=Kg.range,nv=sg((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+n*vg)}),(function(t,n){return(n-t)/vg}),(function(t){return t.getUTCHours()}));const ev=nv;var rv=nv.range,iv=sg((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/yg}),(function(t){return t.getUTCDate()-1}));const ov=iv;var av=iv.range;function uv(t){return sg((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/mg}))}var cv=uv(0),lv=uv(1),sv=uv(2),fv=uv(3),hv=uv(4),dv=uv(5),pv=uv(6),gv=cv.range,vv=lv.range,yv=sv.range,mv=fv.range,_v=hv.range,bv=dv.range,wv=pv.range,xv=sg((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}));const Mv=xv;var Ev=xv.range,kv=sg((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));kv.every=function(t){return isFinite(t=Math.floor(t))&&t>0?sg((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};const Nv=kv;var Sv=kv.range;function Tv(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Cv(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Av(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Pv(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,l=Yv(i),s=Hv(i),f=Yv(o),h=Hv(o),d=Yv(a),p=Hv(a),g=Yv(u),v=Hv(u),y=Yv(c),m=Hv(c),_={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:sy,e:sy,f:gy,H:fy,I:hy,j:dy,L:py,m:vy,M:yy,p:function(t){return i[+(t.getHours()>=12)]},Q:Vy,s:Wy,S:my,u:_y,U:by,V:wy,w:xy,W:My,x:null,X:null,y:Ey,Y:ky,Z:Ny,"%":Hy},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Sy,e:Sy,f:Ry,H:Ty,I:Cy,j:Ay,L:Py,m:Iy,M:Oy,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Vy,s:Wy,S:Uy,u:Dy,U:Ly,V:zy,w:Fy,W:qy,x:null,X:null,y:jy,Y:By,Z:Yy,"%":Hy},w={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=m[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=v[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return E(t,n,e,r)},d:ty,e:ty,f:ay,H:ey,I:ey,j:ny,L:oy,m:Jv,M:ry,p:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:cy,s:ly,S:iy,u:Wv,U:Xv,V:$v,w:Vv,W:Gv,x:function(t,n,r){return E(t,e,n,r)},X:function(t,n,e){return E(t,r,n,e)},y:Zv,Y:Qv,Z:Kv,"%":uy};function x(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,l=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Cv(Av(o.y))).getUTCDay(),r=i>4||0===i?lv.ceil(r):lv(r),r=ov.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=n(Av(o.y))).getDay(),r=i>4||0===i?Ig.ceil(r):Ig(r),r=Cg.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Cv(Av(o.y)).getUTCDay():n(Av(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Cv(o)):n(o)}}function E(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=w[i in Lv?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return _.x=x(e,_),_.X=x(r,_),_.c=x(n,_),b.x=x(e,b),b.X=x(r,b),b.c=x(n,b),{format:function(t){var n=x(t+="",_);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",Tv);return n.toString=function(){return t},n},utcFormat:function(t){var n=x(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Cv);return n.toString=function(){return t},n}}}var Rv,Iv,Ov,Uv,Dv,Lv={"-":"",_:" ",0:"0"},zv=/^\s*\d+/,Fv=/^%/,qv=/[\\^$*+?|[\]().{}]/g;function jv(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function Kv(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Jv(t,n,e){var r=zv.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function ty(t,n,e){var r=zv.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function ny(t,n,e){var r=zv.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function ey(t,n,e){var r=zv.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function ry(t,n,e){var r=zv.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function iy(t,n,e){var r=zv.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function oy(t,n,e){var r=zv.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function ay(t,n,e){var r=zv.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function uy(t,n,e){var r=Fv.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function cy(t,n,e){var r=zv.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function ly(t,n,e){var r=zv.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function sy(t,n){return jv(t.getDate(),n,2)}function fy(t,n){return jv(t.getHours(),n,2)}function hy(t,n){return jv(t.getHours()%12||12,n,2)}function dy(t,n){return jv(1+Cg.count(Qg(t),t),n,3)}function py(t,n){return jv(t.getMilliseconds(),n,3)}function gy(t,n){return py(t,n)+"000"}function vy(t,n){return jv(t.getMonth()+1,n,2)}function yy(t,n){return jv(t.getMinutes(),n,2)}function my(t,n){return jv(t.getSeconds(),n,2)}function _y(t){var n=t.getDay();return 0===n?7:n}function by(t,n){return jv(Rg.count(Qg(t),t),n,2)}function wy(t,n){var e=t.getDay();return t=e>=4||0===e?Dg(t):Dg.ceil(t),jv(Dg.count(Qg(t),t)+(4===Qg(t).getDay()),n,2)}function xy(t){return t.getDay()}function My(t,n){return jv(Ig.count(Qg(t),t),n,2)}function Ey(t,n){return jv(t.getFullYear()%100,n,2)}function ky(t,n){return jv(t.getFullYear()%1e4,n,4)}function Ny(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+jv(n/60|0,"0",2)+jv(n%60,"0",2)}function Sy(t,n){return jv(t.getUTCDate(),n,2)}function Ty(t,n){return jv(t.getUTCHours(),n,2)}function Cy(t,n){return jv(t.getUTCHours()%12||12,n,2)}function Ay(t,n){return jv(1+ov.count(Nv(t),t),n,3)}function Py(t,n){return jv(t.getUTCMilliseconds(),n,3)}function Ry(t,n){return Py(t,n)+"000"}function Iy(t,n){return jv(t.getUTCMonth()+1,n,2)}function Oy(t,n){return jv(t.getUTCMinutes(),n,2)}function Uy(t,n){return jv(t.getUTCSeconds(),n,2)}function Dy(t){var n=t.getUTCDay();return 0===n?7:n}function Ly(t,n){return jv(cv.count(Nv(t),t),n,2)}function zy(t,n){var e=t.getUTCDay();return t=e>=4||0===e?hv(t):hv.ceil(t),jv(hv.count(Nv(t),t)+(4===Nv(t).getUTCDay()),n,2)}function Fy(t){return t.getUTCDay()}function qy(t,n){return jv(lv.count(Nv(t),t),n,2)}function jy(t,n){return jv(t.getUTCFullYear()%100,n,2)}function By(t,n){return jv(t.getUTCFullYear()%1e4,n,4)}function Yy(){return"+0000"}function Hy(){return"%"}function Vy(t){return+t}function Wy(t){return Math.floor(+t/1e3)}function Xy(t){return Rv=Pv(t),Iv=Rv.format,Ov=Rv.parse,Uv=Rv.utcFormat,Dv=Rv.utcParse,Rv}Xy({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"]});var $y="%Y-%m-%dT%H:%M:%S.%LZ",Gy=Date.prototype.toISOString?function(t){return t.toISOString()}:Uv($y);const Qy=Gy;var Zy=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Dv($y);const Ky=Zy;var Jy=1e3,tm=60*Jy,nm=60*tm,em=24*nm,rm=7*em,im=30*em,om=365*em;function am(t){return new Date(t)}function um(t){return t instanceof Date?+t:+new Date(+t)}function cm(t,n,e,r,i,a,u,c,l){var s=Hp(qp,hr),f=s.invert,h=s.domain,d=l(".%L"),p=l(":%S"),g=l("%I:%M"),v=l("%I %p"),y=l("%a %d"),m=l("%b %d"),_=l("%B"),b=l("%Y"),w=[[u,1,Jy],[u,5,5*Jy],[u,15,15*Jy],[u,30,30*Jy],[a,1,tm],[a,5,5*tm],[a,15,15*tm],[a,30,30*tm],[i,1,nm],[i,3,3*nm],[i,6,6*nm],[i,12,12*nm],[r,1,em],[r,2,2*em],[e,1,rm],[n,1,im],[n,3,3*im],[t,1,om]];function x(o){return(u(o)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return S_.h=360*t-100,S_.s=1.5-1.5*n,S_.l=.8-.9*n,S_+""}var C_=ge(),A_=Math.PI/3,P_=2*Math.PI/3;function R_(t){var n;return t=(.5-t)*Math.PI,C_.r=255*(n=Math.sin(t))*n,C_.g=255*(n=Math.sin(t+A_))*n,C_.b=255*(n=Math.sin(t+P_))*n,C_+""}function I_(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}const O_=I_(dm("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var U_=I_(dm("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),D_=I_(dm("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),L_=I_(dm("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function z_(t){return function(){return t}}var F_=Math.abs,q_=Math.atan2,j_=Math.cos,B_=Math.max,Y_=Math.min,H_=Math.sin,V_=Math.sqrt,W_=1e-12,X_=Math.PI,$_=X_/2,G_=2*X_;function Q_(t){return t>=1?$_:t<=-1?-$_:Math.asin(t)}function Z_(t){return t.innerRadius}function K_(t){return t.outerRadius}function J_(t){return t.startAngle}function tb(t){return t.endAngle}function nb(t){return t&&t.padAngle}function eb(t,n,e,r,i,o,a){var u=t-e,c=n-r,l=(a?o:-o)/V_(u*u+c*c),s=l*c,f=-l*u,h=t+s,d=n+f,p=e+s,g=r+f,v=(h+p)/2,y=(d+g)/2,m=p-h,_=g-d,b=m*m+_*_,w=i-o,x=h*g-p*d,M=(_<0?-1:1)*V_(B_(0,w*w*b-x*x)),E=(x*_-m*M)/b,k=(-x*m-_*M)/b,N=(x*_+m*M)/b,S=(-x*m+_*M)/b,T=E-v,C=k-y,A=N-v,P=S-y;return T*T+C*C>A*A+P*P&&(E=N,k=S),{cx:E,cy:k,x01:-s,y01:-f,x11:E*(i/w-1),y11:k*(i/w-1)}}function rb(){var t=Z_,n=K_,e=z_(0),r=null,i=J_,o=tb,a=nb,u=null;function c(){var c,l,s,f=+t.apply(this,arguments),h=+n.apply(this,arguments),d=i.apply(this,arguments)-$_,p=o.apply(this,arguments)-$_,g=F_(p-d),v=p>d;if(u||(u=c=Ra()),hW_)if(g>G_-W_)u.moveTo(h*j_(d),h*H_(d)),u.arc(0,0,h,d,p,!v),f>W_&&(u.moveTo(f*j_(p),f*H_(p)),u.arc(0,0,f,p,d,v));else{var y,m,_=d,b=p,w=d,x=p,M=g,E=g,k=a.apply(this,arguments)/2,N=k>W_&&(r?+r.apply(this,arguments):V_(f*f+h*h)),S=Y_(F_(h-f)/2,+e.apply(this,arguments)),T=S,C=S;if(N>W_){var A=Q_(N/f*H_(k)),P=Q_(N/h*H_(k));(M-=2*A)>W_?(w+=A*=v?1:-1,x-=A):(M=0,w=x=(d+p)/2),(E-=2*P)>W_?(_+=P*=v?1:-1,b-=P):(E=0,_=b=(d+p)/2)}var R=h*j_(_),I=h*H_(_),O=f*j_(x),U=f*H_(x);if(S>W_){var D=h*j_(b),L=h*H_(b),z=f*j_(w),F=f*H_(w);if(gW_?function(t,n,e,r,i,o,a,u){var c=e-t,l=r-n,s=a-i,f=u-o,h=(s*(n-o)-f*(t-i))/(f*c-s*l);return[t+h*c,n+h*l]}(R,I,z,F,D,L,O,U):[O,U],j=R-q[0],B=I-q[1],Y=D-q[0],H=L-q[1],V=1/H_(((s=(j*Y+B*H)/(V_(j*j+B*B)*V_(Y*Y+H*H)))>1?0:s<-1?X_:Math.acos(s))/2),W=V_(q[0]*q[0]+q[1]*q[1]);T=Y_(S,(f-W)/(V-1)),C=Y_(S,(h-W)/(V+1))}}E>W_?C>W_?(y=eb(z,F,R,I,h,C,v),m=eb(D,L,O,U,h,C,v),u.moveTo(y.cx+y.x01,y.cy+y.y01),CW_&&M>W_?T>W_?(y=eb(O,U,D,L,f,-T,v),m=eb(R,I,z,F,f,-T,v),u.lineTo(y.cx+y.x01,y.cy+y.y01),T=s;--f)u.point(v[f],y[f]);u.lineEnd(),u.areaEnd()}g&&(v[l]=+t(h,l,c),y[l]=+e(h,l,c),u.point(n?+n(h,l,c):v[l],r?+r(h,l,c):y[l]))}if(d)return u=null,d+""||null}function l(){return cb().defined(i).curve(a).context(o)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:z_(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:z_(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:z_(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:z_(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:z_(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:z_(+t),c):r},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(r)},c.lineX1=function(){return l().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:z_(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function sb(t,n){return nt?1:n>=t?0:NaN}function fb(t){return t}function hb(){var t=fb,n=sb,e=null,r=z_(0),i=z_(G_),o=z_(0);function a(a){var u,c,l,s,f,h=a.length,d=0,p=new Array(h),g=new Array(h),v=+r.apply(this,arguments),y=Math.min(G_,Math.max(-G_,i.apply(this,arguments)-v)),m=Math.min(Math.abs(y)/h,o.apply(this,arguments)),_=m*(y<0?-1:1);for(u=0;u0&&(d+=f);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,l=d?(y-h*_)/d:0;u0?f*l:0)+_,g[c]={data:a[c],index:u,value:f,startAngle:v,endAngle:s,padAngle:m};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:z_(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:z_(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:z_(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:z_(+t),a):o},a}ib.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var db=gb(ob);function pb(t){this._curve=t}function gb(t){function n(n){return new pb(t(n))}return n._curve=t,n}function vb(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(gb(t)):n()._curve},t}function yb(){return vb(cb().curve(db))}function mb(){var t=lb().curve(db),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=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 vb(e())},delete t.lineX0,t.lineEndAngle=function(){return vb(r())},delete t.lineX1,t.lineInnerRadius=function(){return vb(i())},delete t.lineY0,t.lineOuterRadius=function(){return vb(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(gb(t)):n()._curve},t}function _b(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}pb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var bb=Array.prototype.slice;function wb(t){return t.source}function xb(t){return t.target}function Mb(t){var n=wb,e=xb,r=ab,i=ub,o=null;function a(){var a,u=bb.call(arguments),c=n.apply(this,u),l=e.apply(this,u);if(o||(o=a=Ra()),t(o,+r.apply(this,(u[0]=c,u)),+i.apply(this,u),+r.apply(this,(u[0]=l,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:z_(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:z_(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function Eb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function kb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function Nb(t,n,e,r,i){var o=_b(n,e),a=_b(n,e=(e+i)/2),u=_b(r,e),c=_b(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}function Sb(){return Mb(Eb)}function Tb(){return Mb(kb)}function Cb(){var t=Mb(Nb);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const Ab={draw:function(t,n){var e=Math.sqrt(n/X_);t.moveTo(e,0),t.arc(0,0,e,0,G_)}},Pb={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}};var Rb=Math.sqrt(1/3),Ib=2*Rb;const Ob={draw:function(t,n){var e=Math.sqrt(n/Ib),r=e*Rb;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}};var Ub=Math.sin(X_/10)/Math.sin(7*X_/10),Db=Math.sin(G_/10)*Ub,Lb=-Math.cos(G_/10)*Ub;const zb={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Db*e,i=Lb*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=G_*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*e,-u*e),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},Fb={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}};var qb=Math.sqrt(3);const jb={draw:function(t,n){var e=-Math.sqrt(n/(3*qb));t.moveTo(0,2*e),t.lineTo(-qb*e,-e),t.lineTo(qb*e,-e),t.closePath()}};var Bb=-.5,Yb=Math.sqrt(3)/2,Hb=1/Math.sqrt(12),Vb=3*(Hb/2+1);const Wb={draw:function(t,n){var e=Math.sqrt(n/Vb),r=e/2,i=e*Hb,o=r,a=e*Hb+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(Bb*r-Yb*i,Yb*r+Bb*i),t.lineTo(Bb*o-Yb*a,Yb*o+Bb*a),t.lineTo(Bb*u-Yb*c,Yb*u+Bb*c),t.lineTo(Bb*r+Yb*i,Bb*i-Yb*r),t.lineTo(Bb*o+Yb*a,Bb*a-Yb*o),t.lineTo(Bb*u+Yb*c,Bb*c-Yb*u),t.closePath()}};var Xb=[Ab,Pb,Ob,Fb,zb,jb,Wb];function $b(){var t=z_(Ab),n=z_(64),e=null;function r(){var r;if(e||(e=r=Ra()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:z_(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:z_(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r}function Gb(){}function Qb(t,n,e){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+n)/6,(t._y0+4*t._y1+e)/6)}function Zb(t){this._context=t}function Kb(t){return new Zb(t)}function Jb(t){this._context=t}function tw(t){return new Jb(t)}function nw(t){this._context=t}function ew(t){return new nw(t)}function rw(t,n){this._basis=new Zb(t),this._beta=n}Zb.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:Qb(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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:Qb(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Jb.prototype={areaStart:Gb,areaEnd:Gb,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Qb(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},nw.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Qb(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},rw.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};const iw=function t(n){function e(t){return 1===n?new Zb(t):new rw(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function ow(t,n,e){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-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function aw(t,n){this._context=t,this._k=(1-n)/6}aw.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:ow(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:ow(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const uw=function t(n){function e(t){return new aw(t,n)}return e.tension=function(n){return t(+n)},e}(0);function cw(t,n){this._context=t,this._k=(1-n)/6}cw.prototype={areaStart:Gb,areaEnd:Gb,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:ow(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const lw=function t(n){function e(t){return new cw(t,n)}return e.tension=function(n){return t(+n)},e}(0);function sw(t,n){this._context=t,this._k=(1-n)/6}sw.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,n){switch(t=+t,n=+n,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:ow(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const fw=function t(n){function e(t){return new sw(t,n)}return e.tension=function(n){return t(+n)},e}(0);function hw(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>W_){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>W_){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*l+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function dw(t,n){this._context=t,this._alpha=n}dw.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:hw(this,t,n)}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=n}};const pw=function t(n){function e(t){return n?new dw(t,n):new aw(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function gw(t,n){this._context=t,this._alpha=n}gw.prototype={areaStart:Gb,areaEnd:Gb,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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:hw(this,t,n)}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=n}};const vw=function t(n){function e(t){return n?new gw(t,n):new cw(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function yw(t,n){this._context=t,this._alpha=n}yw.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+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:hw(this,t,n)}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=n}};const mw=function t(n){function e(t){return n?new yw(t,n):new sw(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function _w(t){this._context=t}function bw(t){return new _w(t)}function ww(t){return t<0?-1:1}function xw(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(ww(o)+ww(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Mw(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Ew(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function kw(t){this._context=t}function Nw(t){this._context=new Sw(t)}function Sw(t){this._context=t}function Tw(t){return new kw(t)}function Cw(t){return new Nw(t)}function Aw(t){this._context=t}function Pw(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function Fw(t,n){return t[n]}function qw(){var t=z_([]),n=zw,e=Lw,r=Fw;function i(i){var o,a,u=t.apply(this,arguments),c=i.length,l=u.length,s=new Array(l);for(o=0;o0){for(var e,r,i,o=0,a=t[0].length;o1)for(var e,r,i,o,a,u,c=0,l=t[n[0]].length;c=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o}function Yw(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;a=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}},Jw.prototype={constructor:Jw,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=rx(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(nx(this,e),e=(t=e).U),e.C=!1,r.C=!0,ex(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(ex(this,e),e=(t=e).U),e.C=!1,r.C=!0,nx(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,a=t.R;if(e=o?a?rx(a):o:a,i?i.L===t?i.L=e:i.R=e:this._=e,o&&a?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==a?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=a,a.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,nx(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,ex(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,nx(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,ex(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,nx(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,ex(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};const ix=Jw;function ox(t,n,e,r){var i=[null,null],o=Cx.push(i)-1;return i.left=t,i.right=n,e&&ux(i,t,n,e),r&&ux(i,n,t,r),Sx[t.index].halfedges.push(o),Sx[n.index].halfedges.push(o),i}function ax(t,n,e){var r=[n,e];return r.left=t,r}function ux(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function cx(t,n,e,r,i){var o,a=t[0],u=t[1],c=a[0],l=a[1],s=0,f=1,h=u[0]-c,d=u[1]-l;if(o=n-c,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>f)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>f)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>f)return;o>s&&(s=o)}if(o=i-l,d||!(o<0)){if(o/=d,d<0){if(o>f)return;o>s&&(s=o)}else if(d>0){if(o0||f<1)||(s>0&&(t[0]=[c+s*h,l+s*d]),f<1&&(t[1]=[c+f*h,l+f*d]),!0)}}}}}function lx(t,n,e,r,i){var o=t[1];if(o)return!0;var a,u,c=t[0],l=t.left,s=t.right,f=l[0],h=l[1],d=s[0],p=s[1],g=(f+d)/2,v=(h+p)/2;if(p===h){if(g=r)return;if(f>d){if(c){if(c[1]>=i)return}else c=[g,e];o=[g,i]}else{if(c){if(c[1]1)if(f>d){if(c){if(c[1]>=i)return}else c=[(e-u)/a,e];o=[(i-u)/a,i]}else{if(c){if(c[1]=r)return}else c=[n,a*n+u];o=[r,a*r+u]}else{if(c){if(c[0]=-Px)){var d=c*c+l*l,p=s*s+f*f,g=(f*d-l*p)/h,v=(c*p-s*d)/h,y=px.pop()||new gx;y.arc=t,y.site=i,y.x=g+a,y.y=(y.cy=v+u)+Math.sqrt(g*g+v*v),t.circle=y;for(var m=null,_=Tx._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Tx.insert(m,y),m||(dx=y)}}}}function yx(t){var n=t.circle;n&&(n.P||(dx=n.N),Tx.remove(n),px.push(n),tx(n),t.circle=null)}var mx=[];function _x(){tx(this),this.edge=this.site=this.circle=null}function bx(t){var n=mx.pop()||new _x;return n.site=t,n}function wx(t){yx(t),Nx.remove(t),mx.push(t),tx(t)}function xx(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,a=t.N,u=[t];wx(t);for(var c=o;c.circle&&Math.abs(e-c.circle.x)Ax)u=u.L;else{if(!((i=o-kx(u,a))>Ax)){r>-Ax?(n=u.P,e=u):i>-Ax?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}!function(t){Sx[t.index]={site:t,halfedges:[]}}(t);var c=bx(t);if(Nx.insert(n,c),n||e){if(n===e)return yx(n),e=bx(n.site),Nx.insert(c,e),c.edge=e.edge=ox(n.site,c.site),vx(n),void vx(e);if(e){yx(n),yx(e);var l=n.site,s=l[0],f=l[1],h=t[0]-s,d=t[1]-f,p=e.site,g=p[0]-s,v=p[1]-f,y=2*(h*v-d*g),m=h*h+d*d,_=g*g+v*v,b=[(v*m-d*_)/y+s,(h*_-g*m)/y+f];ux(e.edge,l,p,b),c.edge=ox(l,t,null,b),e.edge=ox(t,p,null,b),vx(n),vx(e)}else c.edge=ox(n.site,c.site)}}function Ex(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var a=t.P;if(!a)return-1/0;var u=(e=a.site)[0],c=e[1],l=c-n;if(!l)return u;var s=u-r,f=1/o-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+i-o/2)))/f+r:(r+u)/2}function kx(t,n){var e=t.N;if(e)return Ex(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var Nx,Sx,Tx,Cx,Ax=1e-6,Px=1e-12;function Rx(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function Ix(t,n){return n[1]-t[1]||n[0]-t[0]}function Ox(t,n){var e,r,i,o=t.sort(Ix).pop();for(Cx=[],Sx=new Array(t.length),Nx=new ix,Tx=new ix;;)if(i=dx,o&&(!i||o[1]Ax||Math.abs(i[0][1]-i[1][1])>Ax)||delete Cx[o]}(a,u,c,l),function(t,n,e,r){var i,o,a,u,c,l,s,f,h,d,p,g,v=Sx.length,y=!0;for(i=0;iAx||Math.abs(g-h)>Ax)&&(c.splice(u,0,Cx.push(ax(a,d,Math.abs(p-t)Ax?[t,Math.abs(f-t)Ax?[Math.abs(h-r)Ax?[e,Math.abs(f-e)Ax?[Math.abs(h-n)=u)return null;var c=t-i.site[0],l=n-i.site[1],s=c*c+l*l;do{i=o.cells[r=a],a=null,i.halfedges.forEach((function(e){var r=o.edges[e],u=r.left;if(u!==i.site&&u||(u=r.right)){var c=t-u[0],l=n-u[1],f=c*c+l*l;fr?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Gx(){var t,n,e=Yx,r=Hx,i=$x,o=Wx,a=Xx,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,s=Dr,f=[],h=(0,st.W)("start","zoom","end"),d=500,p=150,g=0;function v(t){t.property("__zoom",Vx).on("wheel.zoom",M).on("mousedown.zoom",E).on("dblclick.zoom",k).filter(a).on("touchstart.zoom",N).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(u[0],Math.min(u[1],n)))===t.k?t:new zx(n,t.x,t.y)}function m(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new zx(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function b(t,n,e){t.on("start.zoom",(function(){w(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=w(t,i),a=r.apply(t,i),u=e||_(a),c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=t.__zoom,f="function"==typeof n?n.apply(t,i):n,h=s(l.invert(u).concat(c/l.k),f.invert(u).concat(c/f.k));return function(t){if(1===t)t=f;else{var n=h(t),e=c/n[2];t=new zx(e,u[0]-n[0]*e,u[1]-n[1]*e)}o.zoom(null,t)}}))}function w(t,n){for(var e,r=0,i=f.length;rg}t.zoom("mouse",i(m(t.that.__zoom,t.mouse[0]=In(t.that),t.mouse[1]),t.extent,c))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),qn(dn.view,t.moved),Bx(),t.end()}),!0),o=In(this),a=dn.clientX,u=dn.clientY;Fn(dn.view),jx(),t.mouse=[o,this.__zoom.invert(o)],Ci(this),t.start()}}function k(){if(e.apply(this,arguments)){var t=this.__zoom,n=In(this),o=t.invert(n),a=t.k*(dn.shiftKey?.5:2),u=i(m(y(t,a),n,o),r.apply(this,arguments),c);Bx(),l>0?Nn(this).transition().duration(l).call(b,u,n):Nn(this).call(v.transform,u)}}function N(){if(e.apply(this,arguments)){var n,r,i,o,a=w(this,arguments),u=dn.changedTouches,c=u.length;for(jx(),r=0;r{t.exports={graphlib:e(6614),dagre:e(1463),intersect:e(8114),render:e(5787),util:e(8355),version:e(5689)}},9144:(t,n,e)=>{var r=e(8355);function i(t,n,e,i){var o=t.append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(o,e[i+"Style"]),e[i+"Class"]&&o.attr("class",e[i+"Class"])}t.exports={default:i,normal:i,vee:function(t,n,e,i){var o=t.append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(o,e[i+"Style"]),e[i+"Class"]&&o.attr("class",e[i+"Class"])},undirected:function(t,n,e,i){var o=t.append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");r.applyStyle(o,e[i+"Style"]),e[i+"Class"]&&o.attr("class",e[i+"Class"])}}},5632:(t,n,e)=>{var r=e(8355),i=e(4322),o=e(1322);t.exports=function(t,n){var e=n.nodes().filter((function(t){return r.isSubgraph(n,t)})),a=t.selectAll("g.cluster").data(e,(function(t){return t}));return a.selectAll("*").remove(),a.enter().append("g").attr("class","cluster").attr("id",(function(t){return n.node(t).id})).style("opacity",0),a=t.selectAll("g.cluster"),r.applyTransition(a,n).style("opacity",1),a.each((function(t){var e=n.node(t),r=i.select(this);i.select(this).append("rect");var a=r.append("g").attr("class","label");o(a,e,e.clusterLabelPos)})),a.selectAll("rect").each((function(t){var e=n.node(t),o=i.select(this);r.applyStyle(o,e.style)})),r.applyTransition(a.exit(),n).style("opacity",0).remove(),a}},6315:(t,n,e)=>{"use strict";var r=e(1034),i=e(1322),o=e(8355),a=e(4322);t.exports=function(t,n){var e=t.selectAll("g.edgeLabel").data(n.edges(),(function(t){return o.edgeToId(t)})).classed("update",!0);return e.selectAll("*").remove(),e.enter().append("g").classed("edgeLabel",!0).style("opacity",0),(e=t.selectAll("g.edgeLabel")).each((function(t){var e=n.edge(t),o=i(a.select(this),n.edge(t),0,0).classed("label",!0),u=o.node().getBBox();e.labelId&&o.attr("id",e.labelId),r.has(e,"width")||(e.width=u.width),r.has(e,"height")||(e.height=u.height)})),o.applyTransition(e.exit(),n).style("opacity",0).remove(),e}},940:(t,n,e)=>{"use strict";var r=e(1034),i=e(3042),o=e(8355),a=e(4322);function u(t,n){var e=a.line().x((function(t){return t.x})).y((function(t){return t.y}));return e.curve(t.curve),e(n)}t.exports=function(t,n,e){var c=t.selectAll("g.edgePath").data(n.edges(),(function(t){return o.edgeToId(t)})).classed("update",!0);return function(t,n){var e=t.enter().append("g").attr("class","edgePath").style("opacity",0);e.append("path").attr("class","path").attr("d",(function(t){var e=n.edge(t),i=n.node(t.v).elem;return u(e,r.range(e.points.length).map((function(){return n=(t=i).getBBox(),{x:(e=t.ownerSVGElement.getScreenCTM().inverse().multiply(t.getScreenCTM()).translate(n.width/2,n.height/2)).e,y:e.f};var t,n,e})))})),e.append("defs")}(c,n),function(t,n){var e=t.exit();o.applyTransition(e,n).style("opacity",0).remove(),o.applyTransition(e.select("path.path"),n).attr("d",(function(t){var e=n.node(t.v);return e?u({},r.range(this.getTotalLength()).map((function(){return e}))):a.select(this).attr("d")}))}(c,n),c=t.selectAll("g.edgePath"),o.applyTransition(c,n).style("opacity",1),c.each((function(t){var e=a.select(this),r=n.edge(t);r.elem=this,r.id&&e.attr("id",r.id),o.applyClass(e,r.class,(e.classed("update")?"update ":"")+"edgePath")})),c.selectAll("path.path").each((function(t){var e=n.edge(t);e.arrowheadId=r.uniqueId("arrowhead");var c=a.select(this).attr("marker-end",(function(){return"url("+(t=location.href,n=e.arrowheadId,t.split("#")[0]+"#"+n+")");var t,n})).style("fill","none");o.applyTransition(c,n).attr("d",(function(t){return function(t,n){var e=t.edge(n),r=t.node(n.v),o=t.node(n.w),a=e.points.slice(1,e.points.length-1);return a.unshift(i(r,a[0])),a.push(i(o,a[a.length-1])),u(e,a)}(n,t)})),o.applyStyle(c,e.style)})),c.selectAll("defs *").remove(),c.selectAll("defs").each((function(t){var r=n.edge(t);(0,e[r.arrowhead])(a.select(this),r.arrowheadId,r,"arrowhead")})),c}},607:(t,n,e)=>{"use strict";var r=e(1034),i=e(1322),o=e(8355),a=e(4322);t.exports=function(t,n,e){var u=n.nodes().filter((function(t){return!o.isSubgraph(n,t)})),c=t.selectAll("g.node").data(u,(function(t){return t})).classed("update",!0);return c.selectAll("*").remove(),c.enter().append("g").attr("class","node").style("opacity",0),(c=t.selectAll("g.node")).each((function(t){var u=n.node(t),c=a.select(this);o.applyClass(c,u.class,(c.classed("update")?"update ":"")+"node");var l=c.append("g").attr("class","label"),s=i(l,u),f=e[u.shape],h=r.pick(s.node().getBBox(),"width","height");u.elem=this,u.id&&c.attr("id",u.id),u.labelId&&l.attr("id",u.labelId),r.has(u,"width")&&(h.width=u.width),r.has(u,"height")&&(h.height=u.height),h.width+=u.paddingLeft+u.paddingRight,h.height+=u.paddingTop+u.paddingBottom,l.attr("transform","translate("+(u.paddingLeft-u.paddingRight)/2+","+(u.paddingTop-u.paddingBottom)/2+")");var d=f(a.select(this),h,u);o.applyStyle(d,u.style);var p=d.node().getBBox();u.width=p.width,u.height=p.height})),o.applyTransition(c.exit(),n).style("opacity",0).remove(),c}},4322:(t,n,e)=>{var r;if(!r)try{r=e(1524)}catch(t){}r||(r=window.d3),t.exports=r},1463:(t,n,e)=>{var r;try{r=e(681)}catch(t){}r||(r=window.dagre),t.exports=r},6614:(t,n,e)=>{var r;try{r=e(8282)}catch(t){}r||(r=window.graphlib),t.exports=r},8114:(t,n,e)=>{t.exports={node:e(3042),circle:e(6587),ellipse:e(3260),polygon:e(5337),rect:e(8049)}},6587:(t,n,e)=>{var r=e(3260);t.exports=function(t,n,e){return r(t,n,n,e)}},3260:t=>{t.exports=function(t,n,e,r){var i=t.x,o=t.y,a=i-r.x,u=o-r.y,c=Math.sqrt(n*n*u*u+e*e*a*a),l=Math.abs(n*e*a/c);r.x{function n(t,n){return t*n>0}t.exports=function(t,e,r,i){var o,a,u,c,l,s,f,h,d,p,g,v,y;if(!(o=e.y-t.y,u=t.x-e.x,l=e.x*t.y-t.x*e.y,d=o*r.x+u*r.y+l,p=o*i.x+u*i.y+l,0!==d&&0!==p&&n(d,p)||(a=i.y-r.y,c=r.x-i.x,s=i.x*r.y-r.x*i.y,f=a*t.x+c*t.y+s,h=a*e.x+c*e.y+s,0!==f&&0!==h&&n(f,h)||0==(g=o*c-a*u))))return v=Math.abs(g/2),{x:(y=u*s-c*l)<0?(y-v)/g:(y+v)/g,y:(y=a*l-o*s)<0?(y-v)/g:(y+v)/g}}},3042:t=>{t.exports=function(t,n){return t.intersect(n)}},5337:(t,n,e)=>{var r=e(6808);t.exports=function(t,n,e){var i=t.x,o=t.y,a=[],u=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY;n.forEach((function(t){u=Math.min(u,t.x),c=Math.min(c,t.y)}));for(var l=i-t.width/2-u,s=o-t.height/2-c,f=0;f1&&a.sort((function(t,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i),a=n.x-e.x,u=n.y-e.y,c=Math.sqrt(a*a+u*u);return o{t.exports=function(t,n){var e,r,i=t.x,o=t.y,a=n.x-i,u=n.y-o,c=t.width/2,l=t.height/2;return Math.abs(u)*c>Math.abs(a)*l?(u<0&&(l=-l),e=0===u?0:l*a/u,r=l):(a<0&&(c=-c),e=c,r=0===a?0:c*u/a),{x:i+e,y:o+r}}},8284:(t,n,e)=>{var r=e(8355);t.exports=function(t,n){var e=t.append("foreignObject").attr("width","100000"),i=e.append("xhtml:div");i.attr("xmlns","http://www.w3.org/1999/xhtml");var o=n.label;switch(typeof o){case"function":i.insert(o);break;case"object":i.insert((function(){return o}));break;default:i.html(o)}r.applyStyle(i,n.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var a=i.node().getBoundingClientRect();return e.attr("width",a.width).attr("height",a.height),e}},1322:(t,n,e)=>{var r=e(7318),i=e(8284),o=e(8287);t.exports=function(t,n,e){var a=n.label,u=t.append("g");"svg"===n.labelType?o(u,n):"string"!=typeof a||"html"===n.labelType?i(u,n):r(u,n);var c,l=u.node().getBBox();switch(e){case"top":c=-n.height/2;break;case"bottom":c=n.height/2-l.height;break;default:c=-l.height/2}return u.attr("transform","translate("+-l.width/2+","+c+")"),u}},8287:(t,n,e)=>{var r=e(8355);t.exports=function(t,n){var e=t;return e.node().appendChild(n.label),r.applyStyle(e,n.labelStyle),e}},7318:(t,n,e)=>{var r=e(8355);t.exports=function(t,n){for(var e=t.append("text"),i=function(t){for(var n,e="",r=!1,i=0;i{var r;try{r=e(6486)}catch(t){}r||(r=window._),t.exports=r},6381:(t,n,e)=>{"use strict";var r=e(8355),i=e(4322);t.exports=function(t,n){var e=t.filter((function(){return!i.select(this).classed("update")}));function o(t){var e=n.node(t);return"translate("+e.x+","+e.y+")"}e.attr("transform",o),r.applyTransition(t,n).style("opacity",1).attr("transform",o),r.applyTransition(e.selectAll("rect"),n).attr("width",(function(t){return n.node(t).width})).attr("height",(function(t){return n.node(t).height})).attr("x",(function(t){return-n.node(t).width/2})).attr("y",(function(t){return-n.node(t).height/2}))}},4577:(t,n,e)=>{"use strict";var r=e(8355),i=e(4322),o=e(1034);t.exports=function(t,n){function e(t){var e=n.edge(t);return o.has(e,"x")?"translate("+e.x+","+e.y+")":""}t.filter((function(){return!i.select(this).classed("update")})).attr("transform",e),r.applyTransition(t,n).style("opacity",1).attr("transform",e)}},4849:(t,n,e)=>{"use strict";var r=e(8355),i=e(4322);t.exports=function(t,n){function e(t){var e=n.node(t);return"translate("+e.x+","+e.y+")"}t.filter((function(){return!i.select(this).classed("update")})).attr("transform",e),r.applyTransition(t,n).style("opacity",1).attr("transform",e)}},5787:(t,n,e)=>{var r=e(1034),i=e(4322),o=e(1463).layout;t.exports=function(){var t=e(607),n=e(5632),i=e(6315),l=e(940),s=e(4849),f=e(4577),h=e(6381),d=e(4418),p=e(9144),g=function(e,g){!function(t){t.nodes().forEach((function(n){var e=t.node(n);r.has(e,"label")||t.children(n).length||(e.label=n),r.has(e,"paddingX")&&r.defaults(e,{paddingLeft:e.paddingX,paddingRight:e.paddingX}),r.has(e,"paddingY")&&r.defaults(e,{paddingTop:e.paddingY,paddingBottom:e.paddingY}),r.has(e,"padding")&&r.defaults(e,{paddingLeft:e.padding,paddingRight:e.padding,paddingTop:e.padding,paddingBottom:e.padding}),r.defaults(e,a),r.each(["paddingLeft","paddingRight","paddingTop","paddingBottom"],(function(t){e[t]=Number(e[t])})),r.has(e,"width")&&(e._prevWidth=e.width),r.has(e,"height")&&(e._prevHeight=e.height)})),t.edges().forEach((function(n){var e=t.edge(n);r.has(e,"label")||(e.label=""),r.defaults(e,u)}))}(g),e.selectAll("*").remove();var v=c(e,"output"),y=c(v,"clusters"),m=c(v,"edgePaths"),_=i(c(v,"edgeLabels"),g),b=t(c(v,"nodes"),g,d);o(g),s(b,g),f(_,g),l(m,g,p);var w=n(y,g);h(w,g),function(t){r.each(t.nodes(),(function(n){var e=t.node(n);r.has(e,"_prevWidth")?e.width=e._prevWidth:delete e.width,r.has(e,"_prevHeight")?e.height=e._prevHeight:delete e.height,delete e._prevWidth,delete e._prevHeight}))}(g)};return g.createNodes=function(n){return arguments.length?(t=n,g):t},g.createClusters=function(t){return arguments.length?(n=t,g):n},g.createEdgeLabels=function(t){return arguments.length?(i=t,g):i},g.createEdgePaths=function(t){return arguments.length?(l=t,g):l},g.shapes=function(t){return arguments.length?(d=t,g):d},g.arrows=function(t){return arguments.length?(p=t,g):p},g};var a={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},u={arrowhead:"normal",curve:i.curveLinear};function c(t,n){var e=t.select("g."+n);return e.empty()&&(e=t.append("g").attr("class",n)),e}},4418:(t,n,e)=>{"use strict";var r=e(8049),i=e(3260),o=e(6587),a=e(5337);t.exports={rect:function(t,n,e){var i=t.insert("rect",":first-child").attr("rx",e.rx).attr("ry",e.ry).attr("x",-n.width/2).attr("y",-n.height/2).attr("width",n.width).attr("height",n.height);return e.intersect=function(t){return r(e,t)},i},ellipse:function(t,n,e){var r=n.width/2,o=n.height/2,a=t.insert("ellipse",":first-child").attr("x",-n.width/2).attr("y",-n.height/2).attr("rx",r).attr("ry",o);return e.intersect=function(t){return i(e,r,o,t)},a},circle:function(t,n,e){var r=Math.max(n.width,n.height)/2,i=t.insert("circle",":first-child").attr("x",-n.width/2).attr("y",-n.height/2).attr("r",r);return e.intersect=function(t){return o(e,r,t)},i},diamond:function(t,n,e){var r=n.width*Math.SQRT2/2,i=n.height*Math.SQRT2/2,o=[{x:0,y:-i},{x:-r,y:0},{x:0,y:i},{x:r,y:0}],u=t.insert("polygon",":first-child").attr("points",o.map((function(t){return t.x+","+t.y})).join(" "));return e.intersect=function(t){return a(e,o,t)},u}}},8355:(t,n,e)=>{var r=e(1034);t.exports={isSubgraph:function(t,n){return!!t.children(n).length},edgeToId:function(t){return o(t.v)+":"+o(t.w)+":"+o(t.name)},applyStyle:function(t,n){n&&t.attr("style",n)},applyClass:function(t,n,e){n&&t.attr("class",n).attr("class",e+" "+t.attr("class"))},applyTransition:function(t,n){var e=n.graph();if(r.isPlainObject(e)){var i=e.transition;if(r.isFunction(i))return i(t)}return t}};var i=/:/g;function o(t){return t?String(t).replace(i,"\\:"):""}},5689:t=>{t.exports="0.6.1"},1524:(t,n,e)=>{"use strict";e.r(n),e.d(n,{active:()=>VD,arc:()=>iS,area:()=>sS,areaRadial:()=>_S,ascending:()=>i,axisBottom:()=>ct,axisLeft:()=>lt,axisRight:()=>ut,axisTop:()=>at,bisect:()=>l,bisectLeft:()=>c,bisectRight:()=>u,bisector:()=>o,brush:()=>qi,brushSelection:()=>Li,brushX:()=>zi,brushY:()=>Fi,chord:()=>Zi,clientPoint:()=>SN,cluster:()=>Yg,color:()=>Xo,create:()=>xN,creator:()=>hk,cross:()=>h,csv:()=>R_,csvFormat:()=>Sc,csvFormatRows:()=>Tc,csvParse:()=>kc,csvParseRows:()=>Nc,cubehelix:()=>Ca,curveBasis:()=>JS,curveBasisClosed:()=>nT,curveBasisOpen:()=>rT,curveBundle:()=>oT,curveCardinal:()=>cT,curveCardinalClosed:()=>sT,curveCardinalOpen:()=>hT,curveCatmullRom:()=>gT,curveCatmullRomClosed:()=>yT,curveCatmullRomOpen:()=>_T,curveLinear:()=>aS,curveLinearClosed:()=>wT,curveMonotoneX:()=>CT,curveMonotoneY:()=>AT,curveNatural:()=>IT,curveStep:()=>UT,curveStepAfter:()=>LT,curveStepBefore:()=>DT,customEvent:()=>dN,descending:()=>d,deviation:()=>v,dispatch:()=>Da,drag:()=>vc,dragDisable:()=>cc,dragEnable:()=>lc,dsvFormat:()=>Mc,easeBack:()=>yl,easeBackIn:()=>gl,easeBackInOut:()=>yl,easeBackOut:()=>vl,easeBounce:()=>hl,easeBounceIn:()=>fl,easeBounceInOut:()=>dl,easeBounceOut:()=>hl,easeCircle:()=>tl,easeCircleIn:()=>Kc,easeCircleInOut:()=>tl,easeCircleOut:()=>Jc,easeCubic:()=>qc,easeCubicIn:()=>zc,easeCubicInOut:()=>qc,easeCubicOut:()=>Fc,easeElastic:()=>bl,easeElasticIn:()=>_l,easeElasticInOut:()=>wl,easeElasticOut:()=>bl,easeExp:()=>Zc,easeExpIn:()=>Gc,easeExpInOut:()=>Zc,easeExpOut:()=>Qc,easeLinear:()=>Oc,easePoly:()=>Yc,easePolyIn:()=>jc,easePolyInOut:()=>Yc,easePolyOut:()=>Bc,easeQuad:()=>Lc,easeQuadIn:()=>Uc,easeQuadInOut:()=>Lc,easeQuadOut:()=>Dc,easeSin:()=>$c,easeSinIn:()=>Wc,easeSinInOut:()=>$c,easeSinOut:()=>Xc,entries:()=>Co,event:()=>cN,extent:()=>y,forceCenter:()=>xl,forceCollide:()=>Ul,forceLink:()=>Hl,forceManyBody:()=>ws,forceRadial:()=>xs,forceSimulation:()=>bs,forceX:()=>Ms,forceY:()=>Es,format:()=>Os,formatDefaultLocale:()=>zs,formatLocale:()=>Ls,formatPrefix:()=>Us,formatSpecifier:()=>As,geoAlbers:()=>sg,geoAlbersUsa:()=>fg,geoArea:()=>Uf,geoAzimuthalEqualArea:()=>gg,geoAzimuthalEqualAreaRaw:()=>pg,geoAzimuthalEquidistant:()=>yg,geoAzimuthalEquidistantRaw:()=>vg,geoBounds:()=>Sh,geoCentroid:()=>Fh,geoCircle:()=>Qh,geoClipAntimeridian:()=>hd,geoClipCircle:()=>dd,geoClipExtent:()=>yd,geoClipRectangle:()=>vd,geoConicConformal:()=>Mg,geoConicConformalRaw:()=>xg,geoConicEqualArea:()=>lg,geoConicEqualAreaRaw:()=>cg,geoConicEquidistant:()=>Sg,geoConicEquidistantRaw:()=>Ng,geoContains:()=>zd,geoDistance:()=>Cd,geoEquirectangular:()=>kg,geoEquirectangularRaw:()=>Eg,geoGnomonic:()=>Cg,geoGnomonicRaw:()=>Tg,geoGraticule:()=>jd,geoGraticule10:()=>Bd,geoIdentity:()=>Pg,geoInterpolate:()=>Yd,geoLength:()=>Nd,geoMercator:()=>_g,geoMercatorRaw:()=>mg,geoNaturalEarth1:()=>Ig,geoNaturalEarth1Raw:()=>Rg,geoOrthographic:()=>Ug,geoOrthographicRaw:()=>Og,geoPath:()=>Wp,geoProjection:()=>og,geoProjectionMutator:()=>ag,geoRotation:()=>Xh,geoStereographic:()=>Lg,geoStereographicRaw:()=>Dg,geoStream:()=>xf,geoTransform:()=>Xp,geoTransverseMercator:()=>Fg,geoTransverseMercatorRaw:()=>zg,hcl:()=>_a,hierarchy:()=>Vg,histogram:()=>P,hsl:()=>ta,html:()=>N_,interpolate:()=>lm,interpolateArray:()=>em,interpolateBasis:()=>Wy,interpolateBasisClosed:()=>Xy,interpolateCool:()=>KE,interpolateCubehelix:()=>Um,interpolateCubehelixDefault:()=>QE,interpolateCubehelixLong:()=>Dm,interpolateDate:()=>rm,interpolateHcl:()=>Rm,interpolateHclLong:()=>Im,interpolateHsl:()=>Tm,interpolateHslLong:()=>Cm,interpolateInferno:()=>ik,interpolateLab:()=>Am,interpolateMagma:()=>rk,interpolateNumber:()=>im,interpolateObject:()=>om,interpolatePlasma:()=>ok,interpolateRainbow:()=>tk,interpolateRgb:()=>Ky,interpolateRgbBasis:()=>tm,interpolateRgbBasisClosed:()=>nm,interpolateRound:()=>sm,interpolateString:()=>cm,interpolateTransformCss:()=>_m,interpolateTransformSvg:()=>bm,interpolateViridis:()=>ek,interpolateWarm:()=>ZE,interpolateZoom:()=>Nm,interrupt:()=>WO,interval:()=>WR,isoFormat:()=>ER,isoParse:()=>kR,json:()=>S_,keys:()=>So,lab:()=>da,line:()=>lS,lineRadial:()=>mS,linkHorizontal:()=>TS,linkRadial:()=>AS,linkVertical:()=>CS,local:()=>EN,map:()=>yo,matcher:()=>bk,max:()=>U,mean:()=>D,median:()=>L,merge:()=>z,min:()=>F,mouse:()=>TN,namespace:()=>lk,namespaces:()=>ck,nest:()=>mo,now:()=>LR,pack:()=>gv,packEnclose:()=>Zg,packSiblings:()=>sv,pairs:()=>s,partition:()=>wv,path:()=>Hm,permute:()=>q,pie:()=>dS,pointRadial:()=>bS,polygonArea:()=>Vm,polygonCentroid:()=>Wm,polygonContains:()=>Zm,polygonHull:()=>Qm,polygonLength:()=>Km,precisionFixed:()=>Fs,precisionPrefix:()=>qs,precisionRound:()=>js,quadtree:()=>r_,quantile:()=>R,quantize:()=>Lm,queue:()=>p_,radialArea:()=>_S,radialLine:()=>mS,randomBates:()=>b_,randomExponential:()=>w_,randomIrwinHall:()=>__,randomLogNormal:()=>m_,randomNormal:()=>y_,randomUniform:()=>v_,range:()=>M,request:()=>E_,rgb:()=>Zo,ribbon:()=>ho,scaleBand:()=>ob,scaleIdentity:()=>ax,scaleImplicit:()=>rb,scaleLinear:()=>ox,scaleLog:()=>px,scaleOrdinal:()=>ib,scalePoint:()=>ub,scalePow:()=>vx,scaleQuantile:()=>mx,scaleQuantize:()=>_x,scaleSequential:()=>ak,scaleSqrt:()=>yx,scaleThreshold:()=>bx,scaleTime:()=>YE,scaleUtc:()=>HE,scan:()=>j,schemeCategory10:()=>WE,schemeCategory20:()=>GE,schemeCategory20b:()=>XE,schemeCategory20c:()=>$E,select:()=>wN,selectAll:()=>CN,selection:()=>bN,selector:()=>pk,selectorAll:()=>vk,set:()=>No,shuffle:()=>B,stack:()=>jT,stackOffsetDiverging:()=>YT,stackOffsetExpand:()=>BT,stackOffsetNone:()=>zT,stackOffsetSilhouette:()=>HT,stackOffsetWiggle:()=>VT,stackOrderAscending:()=>WT,stackOrderDescending:()=>$T,stackOrderInsideOut:()=>GT,stackOrderNone:()=>FT,stackOrderReverse:()=>QT,stratify:()=>Sv,style:()=>Lk,sum:()=>Y,symbol:()=>GS,symbolCircle:()=>PS,symbolCross:()=>RS,symbolDiamond:()=>US,symbolSquare:()=>qS,symbolStar:()=>FS,symbolTriangle:()=>BS,symbolWye:()=>XS,symbols:()=>$S,text:()=>T_,thresholdFreedmanDiaconis:()=>I,thresholdScott:()=>O,thresholdSturges:()=>A,tickIncrement:()=>T,tickStep:()=>C,ticks:()=>S,timeDay:()=>mC,timeDays:()=>_C,timeFormat:()=>cP,timeFormatDefaultLocale:()=>xR,timeFormatLocale:()=>aP,timeFriday:()=>NC,timeFridays:()=>IC,timeHour:()=>gC,timeHours:()=>vC,timeInterval:()=>JT,timeMillisecond:()=>nC,timeMilliseconds:()=>eC,timeMinute:()=>hC,timeMinutes:()=>dC,timeMonday:()=>xC,timeMondays:()=>CC,timeMonth:()=>DC,timeMonths:()=>LC,timeParse:()=>lP,timeSaturday:()=>SC,timeSaturdays:()=>OC,timeSecond:()=>lC,timeSeconds:()=>sC,timeSunday:()=>wC,timeSundays:()=>TC,timeThursday:()=>kC,timeThursdays:()=>RC,timeTuesday:()=>MC,timeTuesdays:()=>AC,timeWednesday:()=>EC,timeWednesdays:()=>PC,timeWeek:()=>wC,timeWeeks:()=>TC,timeYear:()=>FC,timeYears:()=>qC,timeout:()=>VR,timer:()=>qR,timerFlush:()=>jR,touch:()=>AN,touches:()=>PN,transition:()=>LD,transpose:()=>H,tree:()=>Ov,treemap:()=>Fv,treemapBinary:()=>qv,treemapDice:()=>bv,treemapResquarify:()=>Bv,treemapSlice:()=>Uv,treemapSliceDice:()=>jv,treemapSquarify:()=>zv,tsv:()=>I_,tsvFormat:()=>Rc,tsvFormatRows:()=>Ic,tsvParse:()=>Ac,tsvParseRows:()=>Pc,utcDay:()=>$C,utcDays:()=>GC,utcFormat:()=>sP,utcFriday:()=>eA,utcFridays:()=>lA,utcHour:()=>VC,utcHours:()=>WC,utcMillisecond:()=>nC,utcMilliseconds:()=>eC,utcMinute:()=>BC,utcMinutes:()=>YC,utcMonday:()=>KC,utcMondays:()=>oA,utcMonth:()=>hA,utcMonths:()=>dA,utcParse:()=>fP,utcSaturday:()=>rA,utcSaturdays:()=>sA,utcSecond:()=>lC,utcSeconds:()=>sC,utcSunday:()=>ZC,utcSundays:()=>iA,utcThursday:()=>nA,utcThursdays:()=>cA,utcTuesday:()=>JC,utcTuesdays:()=>aA,utcWednesday:()=>tA,utcWednesdays:()=>uA,utcWeek:()=>ZC,utcWeeks:()=>iA,utcYear:()=>gA,utcYears:()=>vA,values:()=>To,variance:()=>g,version:()=>r,voronoi:()=>PL,window:()=>Ik,xml:()=>C_,zip:()=>W,zoom:()=>Jj,zoomIdentity:()=>Yj,zoomTransform:()=>Hj});var r="4.13.0";function i(t,n){return tn?1:t>=n?0:NaN}function o(t){var n;return 1===t.length&&(n=t,t=function(t,e){return i(n(t),e)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}var a=o(i),u=a.right,c=a.left;const l=u;function s(t,n){null==n&&(n=f);for(var e=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);et?1:n>=t?0:NaN}function p(t){return null===t?NaN:+t}function g(t,n){var e,r,i=t.length,o=0,a=-1,u=0,c=0;if(null==n)for(;++a1)return c/(o-1)}function v(t,n){var e=g(t,n);return e?Math.sqrt(e):e}function y(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a=e)for(r=i=e;++ae&&(r=e),i=e)for(r=i=e;++ae&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=E?10:o>=k?5:o>=N?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=E?10:o>=k?5:o>=N?2:1)}function C(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=E?i*=10:o>=k?i*=5:o>=N&&(i*=2),nf;)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]:s,p.x1=i=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}}function I(t,n,e){return t=b.call(t,p).sort(i),Math.ceil((e-n)/(2*(R(t,.75)-R(t,.25))*Math.pow(t.length,-1/3)))}function O(t,n,e){return Math.ceil((e-n)/(3.5*v(t)*Math.pow(t.length,-1/3)))}function U(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++or&&(r=e)}else for(;++o=e)for(r=e;++or&&(r=e);return r}function D(t,n){var e,r=t.length,i=r,o=-1,a=0;if(null==n)for(;++o=0;)for(n=(r=t[i]).length;--n>=0;)e[--a]=r[n];return e}function F(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++oe&&(r=e)}else for(;++o=e)for(r=e;++oe&&(r=e);return r}function q(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r}function j(t,n){if(e=t.length){var e,r,o=0,a=0,u=t[a];for(null==n&&(n=i);++o=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),yt.hasOwnProperty(n)?{space:yt[n],local:t}:t}function _t(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===vt&&n.documentElement.namespaceURI===vt?n.createElement(t):n.createElementNS(e,t)}}function bt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function wt(t){var n=mt(t);return(n.local?bt:_t)(n)}function xt(){}function Mt(t){return null==t?xt:function(){return this.querySelector(t)}}function Et(){return[]}function kt(t){return null==t?Et:function(){return this.querySelectorAll(t)}}var Nt=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var St=document.documentElement;if(!St.matches){var Tt=St.webkitMatchesSelector||St.msMatchesSelector||St.mozMatchesSelector||St.oMatchesSelector;Nt=function(t){return function(){return Tt.call(this,t)}}}}const Ct=Nt;function At(t){return new Array(t.length)}function Pt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Pt.prototype={constructor:Pt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Rt="$";function It(t,n,e,r,i,o){for(var a,u=0,c=n.length,l=o.length;un?1:t>=n?0:NaN}function Dt(t){return function(){this.removeAttribute(t)}}function Lt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zt(t,n){return function(){this.setAttribute(t,n)}}function Ft(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function qt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function jt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Bt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Yt(t){return function(){this.style.removeProperty(t)}}function Ht(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Vt(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Wt(t,n){return t.style.getPropertyValue(n)||Bt(t).getComputedStyle(t,null).getPropertyValue(n)}function Xt(t){return function(){delete this[t]}}function $t(t,n){return function(){this[t]=n}}function Gt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Qt(t){return t.trim().split(/^|\s+/)}function Zt(t){return t.classList||new Kt(t)}function Kt(t){this._node=t,this._names=Qt(t.getAttribute("class")||"")}function Jt(t,n){for(var e=Zt(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var yn={},mn=null;function _n(t,n,e){return t=bn(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function bn(t,n,e){return function(r){var i=mn;mn=r;try{t.call(this,this.__data__,n,e)}finally{mn=i}}}function wn(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=w&&(w=b+1);!(_=y[w])&&++w=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Ut);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?Yt:"function"==typeof n?Vt:Ht)(t,n,null==e?"":e)):Wt(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Xt:"function"==typeof n?Gt:$t)(t,n)):this.node()[t]},classed:function(t,n){var e=Qt(t+"");if(arguments.length<2){for(var r=Zt(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?xn:wn,null==e&&(e=!1),r=0;r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Hn.exec(t))?Jn(parseInt(n[1],16)):(n=Vn.exec(t))?new re(n[1],n[2],n[3],1):(n=Wn.exec(t))?new re(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Xn.exec(t))?te(n[1],n[2],n[3],n[4]):(n=$n.exec(t))?te(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Gn.exec(t))?oe(n[1],n[2]/100,n[3]/100,1):(n=Qn.exec(t))?oe(n[1],n[2]/100,n[3]/100,n[4]):Zn.hasOwnProperty(t)?Jn(Zn[t]):"transparent"===t?new re(NaN,NaN,NaN,0):null}function Jn(t){return new re(t>>16&255,t>>8&255,255&t,1)}function te(t,n,e,r){return r<=0&&(t=n=e=NaN),new re(t,n,e,r)}function ne(t){return t instanceof Ln||(t=Kn(t)),t?new re((t=t.rgb()).r,t.g,t.b,t.opacity):new re}function ee(t,n,e,r){return 1===arguments.length?ne(t):new re(t,n,e,null==r?1:r)}function re(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function ie(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function oe(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new ue(t,n,e,r)}function ae(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof ue)return new ue(t.h,t.s,t.l,t.opacity);if(t instanceof Ln||(t=Kn(t)),!t)return new ue;if(t instanceof ue)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new ue(a,u,c,t.opacity)}(t):new ue(t,n,e,null==r?1:r)}function ue(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ce(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Un(Ln,Kn,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Un(re,ee,Dn(Ln,{brighter:function(t){return t=null==t?Fn:Math.pow(Fn,t),new re(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?zn:Math.pow(zn,t),new re(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+ie(this.r)+ie(this.g)+ie(this.b)},toString:function(){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+")")}})),Un(ue,ae,Dn(Ln,{brighter:function(t){return t=null==t?Fn:Math.pow(Fn,t),new ue(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?zn:Math.pow(zn,t),new ue(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new re(ce(t>=240?t-240:t+120,i,r),ce(t,i,r),ce(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}}));var le=Math.PI/180,se=180/Math.PI,fe=.96422,he=1,de=.82521,pe=4/29,ge=6/29,ve=3*ge*ge,ye=ge*ge*ge;function me(t){if(t instanceof _e)return new _e(t.l,t.a,t.b,t.opacity);if(t instanceof ke){if(isNaN(t.h))return new _e(t.l,0,0,t.opacity);var n=t.h*le;return new _e(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof re||(t=ne(t));var e,r,i=Me(t.r),o=Me(t.g),a=Me(t.b),u=be((.2225045*i+.7168786*o+.0606169*a)/he);return i===o&&o===a?e=r=u:(e=be((.4360747*i+.3850649*o+.1430804*a)/fe),r=be((.0139322*i+.0971045*o+.7141733*a)/de)),new _e(116*u-16,500*(e-u),200*(u-r),t.opacity)}function _e(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function be(t){return t>ye?Math.pow(t,1/3):t/ve+pe}function we(t){return t>ge?t*t*t:ve*(t-pe)}function xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ee(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof ke)return new ke(t.h,t.c,t.l,t.opacity);if(t instanceof _e||(t=me(t)),0===t.a&&0===t.b)return new ke(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*se;return new ke(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ke(t,n,e,null==r?1:r)}function ke(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Un(_e,(function(t,n,e,r){return 1===arguments.length?me(t):new _e(t,n,e,null==r?1:r)}),Dn(Ln,{brighter:function(t){return new _e(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new _e(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new re(xe(3.1338561*(n=fe*we(n))-1.6168667*(t=he*we(t))-.4906146*(e=de*we(e))),xe(-.9787684*n+1.9161415*t+.033454*e),xe(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),Un(ke,Ee,Dn(Ln,{brighter:function(t){return new ke(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ke(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return me(this).rgb()}}));var Ne=-.14861,Se=1.78277,Te=-.29227,Ce=-.90649,Ae=1.97294,Pe=Ae*Ce,Re=Ae*Se,Ie=Se*Te-Ce*Ne;function Oe(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);t instanceof re||(t=ne(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Ie*r+Pe*n-Re*e)/(Ie+Pe-Re),o=r-i,a=(Ae*(e-i)-Te*o)/Ce,u=Math.sqrt(a*a+o*o)/(Ae*i*(1-i)),c=u?Math.atan2(a,o)*se-120:NaN;return new Ue(c<0?c+360:c,u,i,t.opacity)}(t):new Ue(t,n,e,null==r?1:r)}function Ue(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function De(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function Le(t){return function(){return t}}function ze(t,n){return function(e){return t+e*n}}function Fe(t,n){var e=n-t;return e?ze(t,e>180||e<-180?e-360*Math.round(e/360):e):Le(isNaN(t)?n:t)}function qe(t,n){var e=n-t;return e?ze(t,e):Le(isNaN(t)?n:t)}Un(Ue,Oe,Dn(Ln,{brighter:function(t){return t=null==t?Fn:Math.pow(Fn,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?zn:Math.pow(zn,t),new Ue(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*le,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new re(255*(n+e*(Ne*r+Se*i)),255*(n+e*(Te*r+Ce*i)),255*(n+e*(Ae*r)),this.opacity)}}));const je=function t(n){var e=function(t){return 1==(t=+t)?qe:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Le(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=ee(t)).r,(n=ee(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=qe(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Be(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;e=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=ro&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:Ve(e,r)})),o=$e.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Ve(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Ve(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Ve(t,e)},{i:u-2,x:Ve(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--hr}()}finally{hr=0,function(){for(var t,n,e=sr,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:sr=n);fr=t,Sr(r)}(),yr=0}}function Nr(){var t=_r.now(),n=t-vr;n>gr&&(mr-=n,vr=t)}function Sr(t){hr||(dr&&(dr=clearTimeout(dr)),t-yr>24?(t<1/0&&(dr=setTimeout(kr,t-_r.now()-mr)),pr&&(pr=clearInterval(pr))):(pr||(vr=_r.now(),pr=setInterval(Nr,gr)),hr=1,br(kr)))}function Tr(t,n,e){var r=new Mr;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Mr.prototype=Er.prototype={constructor:Mr,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?wr():+e)+(null==n?0:+n),this._next||fr===this||(fr?fr._next=this:sr=this,fr=this),this._call=t,this._time=e,Sr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sr())}};var Cr=gt("start","end","interrupt"),Ar=[],Pr=0,Rr=1,Ir=2,Or=3,Ur=4,Dr=5,Lr=6;function zr(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var l,s,f,h;if(e.state!==Rr)return u();for(l in i)if((h=i[l]).name===e.name){if(h.state===Or)return Tr(o);h.state===Ur?(h.state=Lr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+lPr)throw new Error("too late; already scheduled");return e}function qr(t,n){var e=jr(t,n);if(e.state>Ir)throw new Error("too late; already started");return e}function jr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Br(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>Ir&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Fr:qr;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=mt(t),r="transform"===e?ar:Wr;return this.attrTween(t,"function"==typeof n?(e.local?Kr:Zr)(e,r,Vr(this,"attr."+t,n)):null==n?(e.local?$r:Xr)(e):(e.local?Qr:Gr)(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=mt(t);return this.tween(e,(r.local?Jr:ti)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?or:Wr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=Wt(this,t),a=(this.style.removeProperty(t),Wt(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,o;return function(){var a=Wt(this,t),u=e(this);return null==u&&(this.style.removeProperty(t),u=Wt(this,t)),a===u?null:a===r&&u===i?o:o=n(r=a,i=u)}}(t,r,Vr(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var o=Wt(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Vr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=jr(this.node(),e).tween,o=0,a=i.length;o0&&(e=i-d),x<0?f=h-p:x>0&&(o=a-p),b=wi,U.attr("cursor",Si.selection),z());break;default:return}yi()}),!0).on("keyup.brush",(function(){switch(mn.keyCode){case 16:A&&(v=y=A=!1,z());break;case 18:b===Mi&&(w<0?l=s:w>0&&(e=i),x<0?f=h:x>0&&(o=a),b=xi,z());break;case 32:b===wi&&(mn.altKey?(w&&(l=s-d*w,e=i+d*w),x&&(f=h-p*x,o=a+p*x),b=Mi):(w<0?l=s:w>0&&(e=i),x<0?f=h:x>0&&(o=a),b=xi),U.attr("cursor",Si[_]),z());break;default:return}yi()}),!0).on("mousemove.brush",L,!0).on("mouseup.brush",F,!0);!function(t){var n=t.document.documentElement,e=An(t).on("dragstart.drag",On,!0);"onselectstart"in n?e.on("selectstart.drag",On,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(mn.view)}vi(),Br(m),u.call(m),I.start()}function L(){var t=In(m);!A||v||y||(Math.abs(t[0]-R[0])>Math.abs(t[1]-R[1])?y=!0:v=!0),R=t,g=!0,yi(),z()}function z(){var t;switch(d=R[0]-P[0],p=R[1]-P[1],b){case wi:case bi:w&&(d=Math.max(N-e,Math.min(T-l,d)),i=e+d,s=l+d),x&&(p=Math.max(S-o,Math.min(C-f,p)),a=o+p,h=f+p);break;case xi:w<0?(d=Math.max(N-e,Math.min(T-e,d)),i=e+d,s=l):w>0&&(d=Math.max(N-l,Math.min(T-l,d)),i=e,s=l+d),x<0?(p=Math.max(S-o,Math.min(C-o,p)),a=o+p,h=f):x>0&&(p=Math.max(S-f,Math.min(C-f,p)),a=o,h=f+p);break;case Mi:w&&(i=Math.max(N,Math.min(T,e-d*w)),s=Math.max(N,Math.min(T,l+d*w))),x&&(a=Math.max(S,Math.min(C,o-p*x)),h=Math.max(S,Math.min(C,f+p*x)))}sn?1:t>=n?0:NaN}1===(mi=Bi).length&&(_i=mi,mi=function(t,n){return Bi(_i(t),n)});var Yi=Array.prototype;function Hi(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++reo)if(Math.abs(s*u-c*l)>eo&&i){var h=e-o,d=r-a,p=u*u+c*c,g=h*h+d*d,v=Math.sqrt(p),y=Math.sqrt(f),m=i*Math.tan((to-Math.acos((p+f-g)/(2*v*y)))/2),_=m/y,b=m/v;Math.abs(_-1)>eo&&(this._+="L"+(t+_*l)+","+(n+_*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>l*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,r,i,o){t=+t,n=+n;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,l=n+u,s=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>eo||Math.abs(this._y1-l)>eo)&&(this._+="L"+c+","+l),e&&(f<0&&(f=f%no+no),f>ro?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=l):f>eo&&(this._+="A"+e+","+e+",0,"+ +(f>=to)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};const ao=oo;function uo(t){return t.source}function co(t){return t.target}function lo(t){return t.radius}function so(t){return t.startAngle}function fo(t){return t.endAngle}function ho(){var t=uo,n=co,e=lo,r=so,i=fo,o=null;function a(){var a,u=Ki.call(arguments),c=t.apply(this,u),l=n.apply(this,u),s=+e.apply(this,(u[0]=c,u)),f=r.apply(this,u)-$i,h=i.apply(this,u)-$i,d=s*Vi(f),p=s*Wi(f),g=+e.apply(this,(u[0]=l,u)),v=r.apply(this,u)-$i,y=i.apply(this,u)-$i;if(o||(o=a=ao()),o.moveTo(d,p),o.arc(0,0,s,f,h),f===v&&h===y||(o.quadraticCurveTo(0,0,g*Vi(v),g*Wi(v)),o.arc(0,0,g,v,y)),o.quadraticCurveTo(0,0,d,p),o.closePath(),a)return o=null,a+""||null}return a.radius=function(t){return arguments.length?(e="function"==typeof t?t:Ji(+t),a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ji(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ji(+t),a):i},a.source=function(n){return arguments.length?(t=n,a):t},a.target=function(t){return arguments.length?(n=t,a):n},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}var po="$";function go(){}function vo(t,n){var e=new go;if(t instanceof go)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var c,l,s,f=-1,h=e.length,d=r[i++],p=yo(),g=a();++fr.length)return t;var o,u=i[e-1];return null!=n&&e>=r.length?o=t.entries():(o=[],t.each((function(t,n){o.push({key:n,values:a(t,e)})}))),null!=u?o.sort((function(t,n){return u(t.key,n.key)})):o}return e={object:function(t){return o(t,0,_o,bo)},map:function(t){return o(t,0,wo,xo)},entries:function(t){return a(o(t,0,wo,xo),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}}function _o(){return{}}function bo(t,n,e){t[n]=e}function wo(){return yo()}function xo(t,n,e){t.set(n,e)}function Mo(){}var Eo=yo.prototype;function ko(t,n){var e=new Mo;if(t instanceof Mo)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Fo.exec(t))?$o(parseInt(n[1],16)):(n=qo.exec(t))?new Ko(n[1],n[2],n[3],1):(n=jo.exec(t))?new Ko(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Bo.exec(t))?Go(n[1],n[2],n[3],n[4]):(n=Yo.exec(t))?Go(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Ho.exec(t))?Jo(n[1],n[2]/100,n[3]/100,1):(n=Vo.exec(t))?Jo(n[1],n[2]/100,n[3]/100,n[4]):Wo.hasOwnProperty(t)?$o(Wo[t]):"transparent"===t?new Ko(NaN,NaN,NaN,0):null}function $o(t){return new Ko(t>>16&255,t>>8&255,255&t,1)}function Go(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ko(t,n,e,r)}function Qo(t){return t instanceof Ro||(t=Xo(t)),t?new Ko((t=t.rgb()).r,t.g,t.b,t.opacity):new Ko}function Zo(t,n,e,r){return 1===arguments.length?Qo(t):new Ko(t,n,e,null==r?1:r)}function Ko(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Jo(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new na(t,n,e,r)}function ta(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof na)return new na(t.h,t.s,t.l,t.opacity);if(t instanceof Ro||(t=Xo(t)),!t)return new na;if(t instanceof na)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new na(a,u,c,t.opacity)}(t):new na(t,n,e,null==r?1:r)}function na(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ea(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Ao(Ro,Xo,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Ao(Ko,Zo,Po(Ro,{brighter:function(t){return t=null==t?Oo:Math.pow(Oo,t),new Ko(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Io:Math.pow(Io,t),new Ko(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){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+")")}})),Ao(na,ta,Po(Ro,{brighter:function(t){return t=null==t?Oo:Math.pow(Oo,t),new na(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Io:Math.pow(Io,t),new na(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ko(ea(t>=240?t-240:t+120,i,r),ea(t,i,r),ea(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}}));var ra=Math.PI/180,ia=180/Math.PI,oa=.95047,aa=1,ua=1.08883,ca=4/29,la=6/29,sa=3*la*la,fa=la*la*la;function ha(t){if(t instanceof pa)return new pa(t.l,t.a,t.b,t.opacity);if(t instanceof ba){var n=t.h*ra;return new pa(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Ko||(t=Qo(t));var e=ma(t.r),r=ma(t.g),i=ma(t.b),o=ga((.4124564*e+.3575761*r+.1804375*i)/oa),a=ga((.2126729*e+.7151522*r+.072175*i)/aa);return new pa(116*a-16,500*(o-a),200*(a-ga((.0193339*e+.119192*r+.9503041*i)/ua)),t.opacity)}function da(t,n,e,r){return 1===arguments.length?ha(t):new pa(t,n,e,null==r?1:r)}function pa(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function ga(t){return t>fa?Math.pow(t,1/3):t/sa+ca}function va(t){return t>la?t*t*t:sa*(t-ca)}function ya(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 _a(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof ba)return new ba(t.h,t.c,t.l,t.opacity);t instanceof pa||(t=ha(t));var n=Math.atan2(t.b,t.a)*ia;return new ba(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ba(t,n,e,null==r?1:r)}function ba(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Ao(pa,da,Po(Ro,{brighter:function(t){return new pa(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new pa(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=aa*va(t),new Ko(ya(3.2404542*(n=oa*va(n))-1.5371385*t-.4985314*(e=ua*va(e))),ya(-.969266*n+1.8760108*t+.041556*e),ya(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Ao(ba,_a,Po(Ro,{brighter:function(t){return new ba(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ba(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ha(this).rgb()}}));var wa=-.14861,xa=1.78277,Ma=-.29227,Ea=-.90649,ka=1.97294,Na=ka*Ea,Sa=ka*xa,Ta=xa*Ma-Ea*wa;function Ca(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Aa)return new Aa(t.h,t.s,t.l,t.opacity);t instanceof Ko||(t=Qo(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Ta*r+Na*n-Sa*e)/(Ta+Na-Sa),o=r-i,a=(ka*(e-i)-Ma*o)/Ea,u=Math.sqrt(a*a+o*o)/(ka*i*(1-i)),c=u?Math.atan2(a,o)*ia-120:NaN;return new Aa(c<0?c+360:c,u,i,t.opacity)}(t):new Aa(t,n,e,null==r?1:r)}function Aa(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}Ao(Aa,Ca,Po(Ro,{brighter:function(t){return t=null==t?Oo:Math.pow(Oo,t),new Aa(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Io:Math.pow(Io,t),new Aa(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*ra,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Ko(255*(n+e*(wa*r+xa*i)),255*(n+e*(Ma*r+Ea*i)),255*(n+e*(ka*r)),this.opacity)}}));var Pa={value:function(){}};function Ra(){for(var t,n=0,e=arguments.length,r={};n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Ha.hasOwnProperty(n)?{space:Ha[n],local:t}:t}function Wa(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Ya&&n.documentElement.namespaceURI===Ya?n.createElement(t):n.createElementNS(e,t)}}function Xa(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $a(t){var n=Va(t);return(n.local?Xa:Wa)(n)}function Ga(){}function Qa(t){return null==t?Ga:function(){return this.querySelector(t)}}function Za(){return[]}var Ka=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Ja=document.documentElement;if(!Ja.matches){var tu=Ja.webkitMatchesSelector||Ja.msMatchesSelector||Ja.mozMatchesSelector||Ja.oMatchesSelector;Ka=function(t){return function(){return tu.call(this,t)}}}}const nu=Ka;function eu(t){return new Array(t.length)}function ru(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}ru.prototype={constructor:ru,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var iu="$";function ou(t,n,e,r,i,o){for(var a,u=0,c=n.length,l=o.length;un?1:t>=n?0:NaN}function cu(t){return function(){this.removeAttribute(t)}}function lu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function su(t,n){return function(){this.setAttribute(t,n)}}function fu(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function hu(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function du(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function pu(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function gu(t){return function(){this.style.removeProperty(t)}}function vu(t,n,e){return function(){this.style.setProperty(t,n,e)}}function yu(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function mu(t){return function(){delete this[t]}}function _u(t,n){return function(){this[t]=n}}function bu(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function wu(t){return t.trim().split(/^|\s+/)}function xu(t){return t.classList||new Mu(t)}function Mu(t){this._node=t,this._names=wu(t.getAttribute("class")||"")}function Eu(t,n){for(var e=xu(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ju={},Bu=null;function Yu(t,n,e){return t=Hu(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Hu(t,n,e){return function(r){var i=Bu;Bu=r;try{t.call(this,this.__data__,n,e)}finally{Bu=i}}}function Vu(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=w&&(w=b+1);!(_=y[w])&&++w=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=uu);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?gu:"function"==typeof n?yu:vu)(t,n,null==e?"":e)):function(t,n){return t.style.getPropertyValue(n)||pu(t).getComputedStyle(t,null).getPropertyValue(n)}(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?mu:"function"==typeof n?bu:_u)(t,n)):this.node()[t]},classed:function(t,n){var e=wu(t+"");if(arguments.length<2){for(var r=xu(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Wu:Vu,null==e&&(e=!1),r=0;rf}c.mouse("drag")}function g(){Ju(Bu.view).on("mousemove.drag mouseup.drag",null),lc(Bu.view,e),uc(),c.mouse("end")}function v(){if(i.apply(this,arguments)){var t,n,e=Bu.changedTouches,r=o.apply(this,arguments),a=e.length;for(t=0;t=o?c=!0:(r=t.charCodeAt(a++))===bc?l=!0:r===wc&&(l=!0,t.charCodeAt(a)===bc&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;a=(o=(g+y)/2))?g=o:y=o,(s=e>=(a=(v+m)/2))?v=a:m=a,i=d,!(d=d[f=s<<1|l]))return i[f]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)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),(l=n>=(o=(g+y)/2))?g=o:y=o,(s=e>=(a=(v+m)/2))?v=a:m=a}while((f=s<<1|l)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[f]=p,t}function Nl(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Sl(t){return t[0]}function Tl(t){return t[1]}function Cl(t,n,e){var r=new Al(null==n?Sl:n,null==e?Tl:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Al(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Pl(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Rl=Cl.prototype=Al.prototype;function Il(t){return t.x+t.vx}function Ol(t){return t.y+t.vy}function Ul(t){var n,e,r=1,i=1;function o(){for(var t,o,u,c,l,s,f,h=n.length,d=0;dc+d||il+d||ou.index){var p=c-a.x-a.vx,g=l-a.y-a.vy,v=p*p+g*g;vt.r&&(t.r=t[n].r)}function u(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;rs&&(s=r),i