@orbcharts/plugins-basic 3.0.0-alpha.70 → 3.0.0-alpha.71
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/core-types.d.ts +1 -0
- package/dist/lib/core.d.ts +1 -0
- package/dist/orbcharts-plugins-basic.es.js +8863 -7397
- package/dist/orbcharts-plugins-basic.umd.js +19 -15
- package/dist/src/base/BaseBarStack.d.ts +1 -1
- package/dist/src/base/BaseBars.d.ts +1 -1
- package/dist/src/base/BaseBarsTriangle.d.ts +1 -1
- package/dist/src/base/BaseDots.d.ts +1 -1
- package/dist/src/base/BaseGroupAxis.d.ts +1 -1
- package/dist/src/base/BaseLegend.d.ts +1 -1
- package/dist/src/base/BaseLineAreas.d.ts +1 -1
- package/dist/src/base/BaseLines.d.ts +1 -1
- package/dist/src/base/BaseValueAxis.d.ts +1 -1
- package/dist/src/const.d.ts +10 -0
- package/dist/src/grid/gridObservables.d.ts +1 -1
- package/dist/src/grid/plugins/BarStack.d.ts +1 -1
- package/dist/src/grid/plugins/Bars.d.ts +1 -1
- package/dist/src/grid/plugins/BarsPN.d.ts +1 -1
- package/dist/src/grid/plugins/BarsTriangle.d.ts +1 -1
- package/dist/src/grid/plugins/Dots.d.ts +1 -1
- package/dist/src/grid/plugins/GridLegend.d.ts +1 -1
- package/dist/src/grid/plugins/GroupAux.d.ts +1 -1
- package/dist/src/grid/plugins/GroupAxis.d.ts +1 -1
- package/dist/src/grid/plugins/LineAreas.d.ts +1 -1
- package/dist/src/grid/plugins/Lines.d.ts +1 -1
- package/dist/src/grid/plugins/ScalingArea.d.ts +1 -1
- package/dist/src/grid/plugins/ValueAxis.d.ts +1 -1
- package/dist/src/grid/plugins/ValueStackAxis.d.ts +1 -1
- package/dist/src/grid/types.d.ts +1 -1
- package/dist/src/multiGrid/multiGridObservables.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiBars.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiBarsTriangle.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiDots.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiGridLegend.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiGroupAxis.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiLineAreas.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiLines.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiValueAxis.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiValueStackAxis.d.ts +1 -1
- package/dist/src/multiGrid/plugins/OverlappingValueAxes.d.ts +1 -1
- package/dist/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +1 -1
- package/dist/src/multiGrid/types.d.ts +1 -1
- package/dist/src/noneData/plugins/Container.d.ts +1 -1
- package/dist/src/noneData/plugins/Tooltip.d.ts +2 -2
- package/dist/src/noneData/types.d.ts +1 -1
- package/dist/src/series/plugins/Bubbles.d.ts +1 -1
- package/dist/src/series/plugins/Pie.d.ts +1 -1
- package/dist/src/series/plugins/PieEventTexts.d.ts +1 -1
- package/dist/src/series/plugins/PieLabels.d.ts +1 -1
- package/dist/src/series/plugins/Rose.d.ts +2 -2
- package/dist/src/series/plugins/RoseLabels.d.ts +1 -1
- package/dist/src/series/plugins/SeriesLegend.d.ts +1 -1
- package/dist/src/series/seriesObservables.d.ts +1 -1
- package/dist/src/series/seriesUtils.d.ts +1 -1
- package/dist/src/series/types.d.ts +1 -1
- package/dist/src/tree/plugins/TreeLegend.d.ts +1 -1
- package/dist/src/tree/plugins/TreeMap.d.ts +1 -1
- package/dist/src/tree/types.d.ts +1 -1
- package/dist/src/utils/orbchartsUtils.d.ts +1 -1
- package/lib/core-types.ts +7 -0
- package/lib/core.ts +6 -0
- package/package.json +3 -2
- package/src/base/BaseBarStack.ts +1 -1
- package/src/base/BaseBars.ts +1 -1
- package/src/base/BaseBarsTriangle.ts +1 -1
- package/src/base/BaseDots.ts +1 -1
- package/src/base/BaseGroupAxis.ts +7 -4
- package/src/base/BaseLegend.ts +1 -1
- package/src/base/BaseLineAreas.ts +1 -2
- package/src/base/BaseLines.ts +1 -1
- package/src/base/BaseValueAxis.ts +2 -2
- package/src/const.ts +30 -0
- package/src/grid/gridObservables.ts +5 -3
- package/src/grid/plugins/BarStack.ts +23 -2
- package/src/grid/plugins/Bars.ts +27 -2
- package/src/grid/plugins/BarsPN.ts +27 -2
- package/src/grid/plugins/BarsTriangle.ts +33 -2
- package/src/grid/plugins/Dots.ts +33 -2
- package/src/grid/plugins/GridLegend.ts +39 -2
- package/src/grid/plugins/GroupAux.ts +115 -31
- package/src/grid/plugins/GroupAxis.ts +63 -2
- package/src/grid/plugins/LineAreas.ts +27 -2
- package/src/grid/plugins/Lines.ts +21 -2
- package/src/grid/plugins/ScalingArea.ts +103 -61
- package/src/grid/plugins/ValueAxis.ts +60 -3
- package/src/grid/plugins/ValueStackAxis.ts +60 -3
- package/src/grid/types.ts +1 -1
- package/src/multiGrid/multiGridObservables.ts +1 -1
- package/src/multiGrid/plugins/MultiBarStack.ts +30 -2
- package/src/multiGrid/plugins/MultiBars.ts +33 -2
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +39 -2
- package/src/multiGrid/plugins/MultiDots.ts +39 -2
- package/src/multiGrid/plugins/MultiGridLegend.ts +61 -2
- package/src/multiGrid/plugins/MultiGroupAxis.ts +69 -2
- package/src/multiGrid/plugins/MultiLineAreas.ts +33 -3
- package/src/multiGrid/plugins/MultiLines.ts +27 -3
- package/src/multiGrid/plugins/MultiValueAxis.ts +66 -2
- package/src/multiGrid/plugins/MultiValueStackAxis.ts +66 -2
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +133 -4
- package/src/multiGrid/plugins/OverlappingValueStackAxes.ts +133 -4
- package/src/multiGrid/types.ts +1 -1
- package/src/noneData/defaults.ts +8 -8
- package/src/noneData/plugins/Container.ts +19 -2
- package/src/noneData/plugins/Tooltip.ts +46 -4
- package/src/noneData/types.ts +1 -1
- package/src/series/defaults.ts +1 -1
- package/src/series/plugins/Bubbles.ts +61 -3
- package/src/series/plugins/Pie.ts +43 -4
- package/src/series/plugins/PieEventTexts.ts +25 -4
- package/src/series/plugins/PieLabels.ts +39 -3
- package/src/series/plugins/Rose.ts +38 -3
- package/src/series/plugins/RoseLabels.ts +32 -3
- package/src/series/plugins/SeriesLegend.ts +39 -2
- package/src/series/seriesObservables.ts +1 -1
- package/src/series/seriesUtils.ts +1 -1
- package/src/series/types.ts +1 -1
- package/src/tree/plugins/TreeLegend.ts +39 -2
- package/src/tree/plugins/TreeMap.ts +31 -3
- package/src/tree/types.ts +1 -1
- package/src/utils/orbchartsUtils.ts +1 -1
@@ -1,20 +1,24 @@
|
|
1
|
-
(function(K,
|
1
|
+
(function(K,gr){typeof exports=="object"&&typeof module<"u"?gr(exports):typeof define=="function"&&define.amd?define(["exports"],gr):(K=typeof globalThis<"u"?globalThis:K||self,gr(K["orbcharts-plugins-basic"]={}))})(this,function(K){"use strict";const gr={lineCurve:"curveLinear",lineWidth:2},hp={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},pp={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1},Yu={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:t=>t,labelPadding:20,labelRotate:0};Yu.labelTextFormat.toString=()=>"text => text";const jo={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},G2={...jo},dp={barWidth:0,barGroupPadding:10,barRadius:!1},gp={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},Uu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};Uu.tickFormat.toString=()=>"text => text";const Wu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},mp={...Wu},yp={},bp={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};var Hu=function(t,e){return Hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Hu(t,e)};function Rn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function z2(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(t,e||[])).next())})}function xp(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function mr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yr(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function _i(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function br(t){return this instanceof br?(this.v=t,this):new br(t)}function Y2(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){h(o[0][3],g)}}function l(p){p.value instanceof br?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){u("next",p)}function f(p){u("throw",p)}function h(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function U2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof mr=="function"?mr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}typeof SuppressedError=="function"&&SuppressedError;function yt(t){return typeof t=="function"}function Xu(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ju=Xu(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
2
2
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function Uu(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Uo=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=cr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(yt(c))try{c()}catch(g){o=g instanceof Yu?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=cr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{gp(d)}catch(g){o=o??[],g instanceof Yu?o=ci(ci([],fr(o)),fr(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new Yu(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)gp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Uu(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Uu(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),pp=Uo.EMPTY;function dp(t){return t instanceof Uo||t&&"closed"in t&&yt(t.remove)&&yt(t.add)&&yt(t.unsubscribe)}function gp(t){yt(t)?t():t.unsubscribe()}var mp={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yp={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ci([t,e],fr(n)))},clearTimeout:function(t){var e=yp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function bp(t){yp.setTimeout(function(){throw t})}function Bu(){}function Bo(t){t()}var Wu=function(t){Pn(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,dp(n)&&n.add(r)):r.destination=w2,r}return e.create=function(n,r,i){return new fi(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Uo),v2=Function.prototype.bind;function Hu(t,e){return v2.call(t,e)}var x2=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Wo(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Wo(r)}else Wo(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Wo(n)}},t}(),fi=function(t){Pn(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(yt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&mp.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Hu(n.next,s),error:n.error&&Hu(n.error,s),complete:n.complete&&Hu(n.complete,s)}):a=n}return o.destination=new x2(a),o}return e}(Wu);function Wo(t){bp(t)}function _2(t){throw t}var w2={closed:!0,next:Bu,error:_2,complete:Bu},Xu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function pr(t){return t}function $2(t){return t.length===0?pr:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var dt=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=A2(e)?e:new fi(e,n,r);return Bo(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=vp(n),new n(function(i,o){var a=new fi({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Xu]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return $2(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=vp(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function vp(t){var e;return(e=t??mp.Promise)!==null&&e!==void 0?e:Promise}function S2(t){return t&&yt(t.next)&&yt(t.error)&&yt(t.complete)}function A2(t){return t&&t instanceof Wu||S2(t)&&dp(t)}function M2(t){return yt(t==null?void 0:t.lift)}function fe(t){return function(e){if(M2(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ae(t,e,n,r,i){return new P2(t,e,n,r,i)}var P2=function(t){Pn(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Wu),D2=Ou(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),nt=function(t){Pn(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new xp(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new D2},e.prototype.next=function(n){var r=this;Bo(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=cr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;Bo(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;Bo(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?pp:(this.currentObservers=null,s.push(n),new Uo(function(){r.currentObservers=null,Uu(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new dt;return n.source=this,n},e.create=function(n,r){return new xp(n,r)},e}(dt),xp=function(t){Pn(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:pp},e}(nt),T2=function(t){Pn(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(nt),_p={now:function(){return(_p.delegate||Date).now()},delegate:void 0},L2=function(t){Pn(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=_p);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(nt),wp=new dt(function(t){return t.complete()});function C2(t){return t&&yt(t.schedule)}function qu(t){return t[t.length-1]}function E2(t){return yt(qu(t))?t.pop():void 0}function ju(t){return C2(qu(t))?t.pop():void 0}function R2(t,e){return typeof qu(t)=="number"?t.pop():e}var Vu=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function $p(t){return yt(t==null?void 0:t.then)}function Sp(t){return yt(t[Xu])}function Ap(t){return Symbol.asyncIterator&&yt(t==null?void 0:t[Symbol.asyncIterator])}function Mp(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function k2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Pp=k2();function Dp(t){return yt(t==null?void 0:t[Pp])}function Tp(t){return y2(this,arguments,function(){var n,r,i,o;return hp(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,hr(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,hr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,hr(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Lp(t){return yt(t==null?void 0:t.getReader)}function he(t){if(t instanceof dt)return t;if(t!=null){if(Sp(t))return I2(t);if(Vu(t))return N2(t);if($p(t))return F2(t);if(Ap(t))return Cp(t);if(Dp(t))return z2(t);if(Lp(t))return G2(t)}throw Mp(t)}function I2(t){return new dt(function(e){var n=t[Xu]();if(yt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function N2(t){return new dt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function F2(t){return new dt(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,bp)})}function z2(t){return new dt(function(e){var n,r;try{for(var i=cr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Cp(t){return new dt(function(e){O2(t,e).catch(function(n){return e.error(n)})})}function G2(t){return Cp(Tp(t))}function O2(t,e){var n,r,i,o;return m2(this,void 0,void 0,function(){var a,s;return hp(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=b2(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function ln(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Ep(t,e){return e===void 0&&(e=0),fe(function(n,r){n.subscribe(ae(r,function(i){return ln(r,t,function(){return r.next(i)},e)},function(){return ln(r,t,function(){return r.complete()},e)},function(i){return ln(r,t,function(){return r.error(i)},e)}))})}function Rp(t,e){return e===void 0&&(e=0),fe(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Y2(t,e){return he(t).pipe(Rp(e),Ep(e))}function U2(t,e){return he(t).pipe(Rp(e),Ep(e))}function B2(t,e){return new dt(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function W2(t,e){return new dt(function(n){var r;return ln(n,e,function(){r=t[Pp](),ln(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return yt(r==null?void 0:r.return)&&r.return()}})}function kp(t,e){if(!t)throw new Error("Iterable cannot be null");return new dt(function(n){ln(n,e,function(){var r=t[Symbol.asyncIterator]();ln(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function H2(t,e){return kp(Tp(t),e)}function X2(t,e){if(t!=null){if(Sp(t))return Y2(t,e);if(Vu(t))return B2(t,e);if($p(t))return U2(t,e);if(Ap(t))return kp(t,e);if(Dp(t))return W2(t,e);if(Lp(t))return H2(t,e)}throw Mp(t)}function Ho(t,e){return e?X2(t,e):he(t)}function Xo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ju(t);return Ho(t,n)}var Ip=Ou(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function F(t,e){return fe(function(n,r){var i=0;n.subscribe(ae(r,function(o){r.next(t.call(e,o,i++))}))})}var q2=Array.isArray;function j2(t,e){return q2(e)?t.apply(void 0,ci([],fr(e))):t(e)}function Np(t){return F(function(e){return j2(t,e)})}var V2=Array.isArray,Z2=Object.getPrototypeOf,K2=Object.prototype,Q2=Object.keys;function J2(t){if(t.length===1){var e=t[0];if(V2(e))return{args:e,keys:null};if(t_(e)){var n=Q2(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function t_(t){return t&&typeof t=="object"&&Z2(t)===K2}function e_(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function B(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ju(t),r=E2(t),i=J2(t),o=i.args,a=i.keys;if(o.length===0)return Ho([],n);var s=new dt(n_(o,n,a?function(u){return e_(a,u)}:pr));return r?s.pipe(Np(r)):s}function n_(t,e,n){return n===void 0&&(n=pr),function(r){Fp(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){Fp(e,function(){var f=Ho(t[c],e),h=!1;f.subscribe(ae(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Fp(t,e,n){t?ln(n,t,e):e()}function r_(t,e,n,r,i,o,a,s){var u=[],l=0,c=0,f=!1,h=function(){f&&!u.length&&!l&&e.complete()},p=function(g){return l<r?d(g):u.push(g)},d=function(g){l++;var m=!1;he(n(g,c++)).subscribe(ae(e,function(y){e.next(y)},function(){m=!0},void 0,function(){if(m)try{l--;for(var y=function(){var v=u.shift();a||d(v)};u.length&&l<r;)y();h()}catch(v){e.error(v)}}))};return t.subscribe(ae(e,p,function(){f=!0,h()})),function(){}}function Zu(t,e,n){return n===void 0&&(n=1/0),yt(e)?Zu(function(r,i){return F(function(o,a){return e(r,o,i,a)})(he(t(r,i)))},n):(typeof e=="number"&&(n=e),fe(function(r,i){return r_(r,i,t,n)}))}function i_(t){return t===void 0&&(t=1/0),Zu(pr,t)}function o_(t){return new dt(function(e){he(t()).subscribe(e)})}var a_=["addListener","removeListener"],s_=["addEventListener","removeEventListener"],u_=["on","off"];function Ku(t,e,n,r){if(yt(n)&&(r=n,n=void 0),r)return Ku(t,e,n).pipe(Np(r));var i=fr(f_(t)?s_.map(function(s){return function(u){return t[s](e,u,n)}}):l_(t)?a_.map(zp(t,e)):c_(t)?u_.map(zp(t,e)):[],2),o=i[0],a=i[1];if(!o&&Vu(t))return Zu(function(s){return Ku(s,e,n)})(he(t));if(!o)throw new TypeError("Invalid event target");return new dt(function(s){var u=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s.next(1<l.length?l:l[0])};return o(u),function(){return a(u)}})}function zp(t,e){return function(n){return function(r){return t[n](e,r)}}}function l_(t){return yt(t.addListener)&&yt(t.removeListener)}function c_(t){return yt(t.on)&&yt(t.off)}function f_(t){return yt(t.addEventListener)&&yt(t.removeEventListener)}function Gp(t,e,n){return o_(function(){return t()?e:n})}function Qu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ju(t),r=R2(t,1/0),i=t;return i.length?i.length===1?he(i[0]):i_(r)(Ho(i,n)):wp}function hi(t,e){return fe(function(n,r){var i=0;n.subscribe(ae(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function h_(t){return fe(function(e,n){var r=!1;e.subscribe(ae(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function p_(t){return t<=0?function(){return wp}:fe(function(e,n){var r=0;e.subscribe(ae(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function tt(t,e){return e===void 0&&(e=pr),t=t??d_,fe(function(n,r){var i,o=!0;n.subscribe(ae(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function d_(t,e){return t===e}function g_(t){return t===void 0&&(t=m_),fe(function(e,n){var r=!1;e.subscribe(ae(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function m_(){return new Ip}function y_(t,e){var n=arguments.length>=2;return function(r){return r.pipe(pr,p_(1),n?h_(e):g_(function(){return new Ip}))}}function b_(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new nt}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},v=function(){var x=c;y(),x==null||x.unsubscribe()};return fe(function(x,b){p++,!g&&!d&&m();var S=h=h??n();b.add(function(){p--,p===0&&!g&&!d&&(f=Ju(v,u))}),S.subscribe(b),!c&&p>0&&(c=new fi({next:function($){return S.next($)},error:function($){g=!0,m(),f=Ju(y,i,$),S.error($)},complete:function(){d=!0,m(),f=Ju(y,a),S.complete()}}),he(x).subscribe(c))})(l)}}function Ju(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new fi({next:function(){i.unsubscribe(),t()}});return he(e.apply(void 0,ci([],fr(n)))).subscribe(i)}}function St(t,e,n){var r,i=!1;return r=t,b_({connector:function(){return new L2(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function W(t,e){return fe(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(ae(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;he(t(u,c)).subscribe(i=ae(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function I(t){return fe(function(e,n){he(t).subscribe(ae(n,function(){return n.complete()},Bu)),!n.closed&&e.subscribe(n)})}const dr={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""};function qo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function v_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Op(t){let e,n,r;t.length!==2?(e=qo,n=(s,u)=>qo(t(s),u),r=(s,u)=>t(s)-u):(e=t===qo||t===v_?t:x_,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function x_(){return 0}function __(t){return t===null?NaN:+t}const w_=Op(qo),Yp=w_.right;Op(__).center;const $_=Math.sqrt(50),S_=Math.sqrt(10),A_=Math.sqrt(2);function jo(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=$_?10:o>=S_?5:o>=A_?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?jo(t,e,n*2):[s,u,l]}function M_(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?jo(e,t,n):jo(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function tl(t,e,n){return e=+e,t=+t,n=+n,jo(t,e,n)[2]}function P_(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?tl(e,t,n):tl(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var D_={value:()=>{}};function Up(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Vo(n)}function Vo(t){this._=t}function T_(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Vo.prototype=Up.prototype={constructor:Vo,on:function(t,e){var n=this._,r=T_(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=L_(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=Bp(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Bp(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Vo(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function L_(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Bp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=D_,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var el="http://www.w3.org/1999/xhtml";const Wp={svg:"http://www.w3.org/2000/svg",xhtml:el,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zo(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Wp.hasOwnProperty(e)?{space:Wp[e],local:t}:t}function C_(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===el&&e.documentElement.namespaceURI===el?e.createElement(t):e.createElementNS(n,t)}}function E_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Hp(t){var e=Zo(t);return(e.local?E_:C_)(e)}function R_(){}function nl(t){return t==null?R_:function(){return this.querySelector(t)}}function k_(t){typeof t!="function"&&(t=nl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new _e(r,this._parents)}function I_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function N_(){return[]}function Xp(t){return t==null?N_:function(){return this.querySelectorAll(t)}}function F_(t){return function(){return I_(t.apply(this,arguments))}}function z_(t){typeof t=="function"?t=F_(t):t=Xp(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new _e(r,i)}function qp(t){return function(){return this.matches(t)}}function jp(t){return function(e){return e.matches(t)}}var G_=Array.prototype.find;function O_(t){return function(){return G_.call(this.children,t)}}function Y_(){return this.firstElementChild}function U_(t){return this.select(t==null?Y_:O_(typeof t=="function"?t:jp(t)))}var B_=Array.prototype.filter;function W_(){return Array.from(this.children)}function H_(t){return function(){return B_.call(this.children,t)}}function X_(t){return this.selectAll(t==null?W_:H_(typeof t=="function"?t:jp(t)))}function q_(t){typeof t!="function"&&(t=qp(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new _e(r,this._parents)}function Vp(t){return new Array(t.length)}function j_(){return new _e(this._enter||this._groups.map(Vp),this._parents)}function Ko(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ko.prototype={constructor:Ko,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function V_(t){return function(){return t}}function Z_(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ko(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function K_(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new Ko(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function Q_(t){return t.__data__}function J_(t,e){if(!arguments.length)return Array.from(this,Q_);var n=e?K_:Z_,r=this._parents,i=this._groups;typeof t!="function"&&(t=V_(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=tw(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var v=0,x=0,b,S;v<d;++v)if(b=g[v]){for(v>=x&&(x=v+1);!(S=m[x])&&++x<d;);b._next=S||null}}return a=new _e(a,r),a._enter=s,a._exit=u,a}function tw(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ew(){return new _e(this._exit||this._groups.map(Vp),this._parents)}function nw(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function rw(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new _e(s,this._parents)}function iw(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function ow(t){t||(t=aw);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new _e(i,this._parents).order()}function aw(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function sw(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function uw(){return Array.from(this)}function lw(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function cw(){let t=0;for(const e of this)++t;return t}function fw(){return!this.node()}function hw(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function pw(t){return function(){this.removeAttribute(t)}}function dw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function gw(t,e){return function(){this.setAttribute(t,e)}}function mw(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function yw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function bw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function vw(t,e){var n=Zo(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?dw:pw:typeof e=="function"?n.local?bw:yw:n.local?mw:gw)(n,e))}function Zp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xw(t){return function(){this.style.removeProperty(t)}}function _w(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ww(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function $w(t,e,n){return arguments.length>1?this.each((e==null?xw:typeof e=="function"?ww:_w)(t,e,n??"")):gr(this.node(),t)}function gr(t,e){return t.style.getPropertyValue(e)||Zp(t).getComputedStyle(t,null).getPropertyValue(e)}function Sw(t){return function(){delete this[t]}}function Aw(t,e){return function(){this[t]=e}}function Mw(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Pw(t,e){return arguments.length>1?this.each((e==null?Sw:typeof e=="function"?Mw:Aw)(t,e)):this.node()[t]}function Kp(t){return t.trim().split(/^|\s+/)}function rl(t){return t.classList||new Qp(t)}function Qp(t){this._node=t,this._names=Kp(t.getAttribute("class")||"")}Qp.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Jp(t,e){for(var n=rl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function td(t,e){for(var n=rl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Dw(t){return function(){Jp(this,t)}}function Tw(t){return function(){td(this,t)}}function Lw(t,e){return function(){(e.apply(this,arguments)?Jp:td)(this,t)}}function Cw(t,e){var n=Kp(t+"");if(arguments.length<2){for(var r=rl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Lw:e?Dw:Tw)(n,e))}function Ew(){this.textContent=""}function Rw(t){return function(){this.textContent=t}}function kw(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Iw(t){return arguments.length?this.each(t==null?Ew:(typeof t=="function"?kw:Rw)(t)):this.node().textContent}function Nw(){this.innerHTML=""}function Fw(t){return function(){this.innerHTML=t}}function zw(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Gw(t){return arguments.length?this.each(t==null?Nw:(typeof t=="function"?zw:Fw)(t)):this.node().innerHTML}function Ow(){this.nextSibling&&this.parentNode.appendChild(this)}function Yw(){return this.each(Ow)}function Uw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Bw(){return this.each(Uw)}function Ww(t){var e=typeof t=="function"?t:Hp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Hw(){return null}function Xw(t,e){var n=typeof t=="function"?t:Hp(t),r=e==null?Hw:typeof e=="function"?e:nl(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qw(){var t=this.parentNode;t&&t.removeChild(this)}function jw(){return this.each(qw)}function Vw(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Zw(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Kw(t){return this.select(t?Zw:Vw)}function Qw(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Jw(t){return function(e){t.call(this,e,this.__data__)}}function t$(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function e$(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function n$(t,e,n){return function(){var r=this.__on,i,o=Jw(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function r$(t,e,n){var r=t$(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?n$:e$,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function ed(t,e,n){var r=Zp(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function i$(t,e){return function(){return ed(this,t,e)}}function o$(t,e){return function(){return ed(this,t,e.apply(this,arguments))}}function a$(t,e){return this.each((typeof e=="function"?o$:i$)(t,e))}function*s$(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var u$=[null];function _e(t,e){this._groups=t,this._parents=e}function pi(){return new _e([[document.documentElement]],u$)}function l$(){return this}_e.prototype=pi.prototype={constructor:_e,select:k_,selectAll:z_,selectChild:U_,selectChildren:X_,filter:q_,data:J_,enter:j_,exit:ew,join:nw,merge:rw,selection:l$,order:iw,sort:ow,call:sw,nodes:uw,node:lw,size:cw,empty:fw,each:hw,attr:vw,style:$w,property:Pw,classed:Cw,text:Iw,html:Gw,raise:Yw,lower:Bw,append:Ww,insert:Xw,remove:jw,clone:Kw,datum:Qw,on:r$,dispatch:a$,[Symbol.iterator]:s$};function il(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function nd(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function di(){}var gi=.7,Qo=1/gi,mr="\\s*([+-]?\\d+)\\s*",mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c$=/^#([0-9a-f]{3,8})$/,f$=new RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),h$=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),p$=new RegExp(`^rgba\\(${mr},${mr},${mr},${mi}\\)$`),d$=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${mi}\\)$`),g$=new RegExp(`^hsl\\(${mi},${Ee},${Ee}\\)$`),m$=new RegExp(`^hsla\\(${mi},${Ee},${Ee},${mi}\\)$`),rd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};il(di,Dn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:id,formatHex:id,formatHex8:y$,formatHsl:b$,formatRgb:od,toString:od});function id(){return this.rgb().formatHex()}function y$(){return this.rgb().formatHex8()}function b$(){return cd(this).formatHsl()}function od(){return this.rgb().formatRgb()}function Dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=c$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ad(e):n===3?new ne(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Jo(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Jo(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=f$.exec(t))?new ne(e[1],e[2],e[3],1):(e=h$.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=p$.exec(t))?Jo(e[1],e[2],e[3],e[4]):(e=d$.exec(t))?Jo(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=g$.exec(t))?ld(e[1],e[2]/100,e[3]/100,1):(e=m$.exec(t))?ld(e[1],e[2]/100,e[3]/100,e[4]):rd.hasOwnProperty(t)?ad(rd[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function ad(t){return new ne(t>>16&255,t>>8&255,t&255,1)}function Jo(t,e,n,r){return r<=0&&(t=e=n=NaN),new ne(t,e,n,r)}function v$(t){return t instanceof di||(t=Dn(t)),t?(t=t.rgb(),new ne(t.r,t.g,t.b,t.opacity)):new ne}function ol(t,e,n,r){return arguments.length===1?v$(t):new ne(t,e,n,r??1)}function ne(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}il(ne,ol,nd(di,{brighter(t){return t=t==null?Qo:Math.pow(Qo,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?gi:Math.pow(gi,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ne(Tn(this.r),Tn(this.g),Tn(this.b),ta(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sd,formatHex:sd,formatHex8:x$,formatRgb:ud,toString:ud}));function sd(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}`}function x$(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}${Ln((isNaN(this.opacity)?1:this.opacity)*255)}`}function ud(){const t=ta(this.opacity);return`${t===1?"rgb(":"rgba("}${Tn(this.r)}, ${Tn(this.g)}, ${Tn(this.b)}${t===1?")":`, ${t})`}`}function ta(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Tn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ln(t){return t=Tn(t),(t<16?"0":"")+t.toString(16)}function ld(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new we(t,e,n,r)}function cd(t){if(t instanceof we)return new we(t.h,t.s,t.l,t.opacity);if(t instanceof di||(t=Dn(t)),!t)return new we;if(t instanceof we)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new we(a,s,u,t.opacity)}function _$(t,e,n,r){return arguments.length===1?cd(t):new we(t,e,n,r??1)}function we(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}il(we,_$,nd(di,{brighter(t){return t=t==null?Qo:Math.pow(Qo,t),new we(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?gi:Math.pow(gi,t),new we(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ne(al(t>=240?t-240:t+120,i,r),al(t,i,r),al(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new we(fd(this.h),ea(this.s),ea(this.l),ta(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ta(this.opacity);return`${t===1?"hsl(":"hsla("}${fd(this.h)}, ${ea(this.s)*100}%, ${ea(this.l)*100}%${t===1?")":`, ${t})`}`}}));function fd(t){return t=(t||0)%360,t<0?t+360:t}function ea(t){return Math.max(0,Math.min(1,t||0))}function al(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const sl=t=>()=>t;function w$(t,e){return function(n){return t+n*e}}function $$(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function S$(t){return(t=+t)==1?hd:function(e,n){return n-e?$$(e,n,t):sl(isNaN(e)?n:e)}}function hd(t,e){var n=e-t;return n?w$(t,n):sl(isNaN(t)?e:t)}const na=function t(e){var n=S$(e);function r(i,o){var a=n((i=ol(i)).r,(o=ol(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=hd(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function A$(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function M$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function P$(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=cl(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function D$(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function $e(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function T$(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=cl(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var ul=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ll=new RegExp(ul.source,"g");function L$(t){return function(){return t}}function C$(t){return function(e){return t(e)+""}}function pd(t,e){var n=ul.lastIndex=ll.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=ul.exec(t))&&(i=ll.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:$e(r,i)})),n=ll.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?C$(u[0].x):L$(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function cl(t,e){var n=typeof e,r;return e==null||n==="boolean"?sl(e):(n==="number"?$e:n==="string"?(r=Dn(e))?(e=r,na):pd:e instanceof Dn?na:e instanceof Date?D$:M$(e)?A$:Array.isArray(e)?P$:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?T$:$e)(t,e)}function E$(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var dd=180/Math.PI,gd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function md(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*dd,skewX:Math.atan(u)*dd,scaleX:a,scaleY:s}}var ra;function R$(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?gd:md(e.a,e.b,e.c,e.d,e.e,e.f)}function k$(t){return t==null||(ra||(ra=document.createElementNS("http://www.w3.org/2000/svg","g")),ra.setAttribute("transform",t),!(t=ra.transform.baseVal.consolidate()))?gd:(t=t.matrix,md(t.a,t.b,t.c,t.d,t.e,t.f))}function yd(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:$e(l,f)},{i:g-2,x:$e(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:$e(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:$e(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:$e(l,f)},{i:g-2,x:$e(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var I$=yd(R$,"px, ","px)","deg)"),N$=yd(k$,", ",")",")"),yr=0,yi=0,bi=0,bd=1e3,ia,vi,oa=0,Cn=0,aa=0,xi=typeof performance=="object"&&performance.now?performance:Date,vd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function fl(){return Cn||(vd(F$),Cn=xi.now()+aa)}function F$(){Cn=0}function sa(){this._call=this._time=this._next=null}sa.prototype=xd.prototype={constructor:sa,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?fl():+n)+(e==null?0:+e),!this._next&&vi!==this&&(vi?vi._next=this:ia=this,vi=this),this._call=t,this._time=n,hl()},stop:function(){this._call&&(this._call=null,this._time=1/0,hl())}};function xd(t,e,n){var r=new sa;return r.restart(t,e,n),r}function z$(){fl(),++yr;for(var t=ia,e;t;)(e=Cn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yr}function _d(){Cn=(oa=xi.now())+aa,yr=yi=0;try{z$()}finally{yr=0,O$(),Cn=0}}function G$(){var t=xi.now(),e=t-oa;e>bd&&(aa-=e,oa=t)}function O$(){for(var t,e=ia,n,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:ia=n);vi=t,hl(r)}function hl(t){if(!yr){yi&&(yi=clearTimeout(yi));var e=t-Cn;e>24?(t<1/0&&(yi=setTimeout(_d,t-xi.now()-aa)),bi&&(bi=clearInterval(bi))):(bi||(oa=xi.now(),bi=setInterval(G$,bd)),yr=1,vd(_d))}}function wd(t,e,n){var r=new sa;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Y$=Up("start","end","cancel","interrupt"),U$=[],$d=0,Sd=1,pl=2,ua=3,Ad=4,dl=5,la=6;function ca(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;B$(t,n,{name:e,index:r,group:i,on:Y$,tween:U$,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:$d})}function gl(t,e){var n=Se(t,e);if(n.state>$d)throw new Error("too late; already scheduled");return n}function Re(t,e){var n=Se(t,e);if(n.state>ua)throw new Error("too late; already running");return n}function Se(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function B$(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=xd(o,0,n.time);function o(l){n.state=Sd,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==Sd)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===ua)return wd(a);p.state===Ad?(p.state=la,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=la,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(wd(function(){n.state===ua&&(n.state=Ad,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=pl,n.on.call("start",t,t.__data__,n.index,n.group),n.state===pl){for(n.state=ua,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=dl,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===dl&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=la,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function W$(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>pl&&r.state<dl,r.state=la,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function H$(t){return this.each(function(){W$(this,t)})}function X$(t,e){var n,r;return function(){var i=Re(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function q$(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Re(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function j$(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Se(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?X$:q$)(n,t,e))}function ml(t,e,n){var r=t._id;return t.each(function(){var i=Re(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Se(i,r).value[e]}}function Md(t,e){var n;return(typeof e=="number"?$e:e instanceof Dn?na:(n=Dn(e))?(e=n,na):pd)(t,e)}function V$(t){return function(){this.removeAttribute(t)}}function Z$(t){return function(){this.removeAttributeNS(t.space,t.local)}}function K$(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function Q$(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function J$(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function tS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function eS(t,e){var n=Zo(t),r=n==="transform"?N$:Md;return this.attrTween(t,typeof e=="function"?(n.local?tS:J$)(n,r,ml(this,"attr."+t,e)):e==null?(n.local?Z$:V$)(n):(n.local?Q$:K$)(n,r,e))}function nS(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function rS(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function iS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&rS(t,o)),n}return i._value=e,i}function oS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&nS(t,o)),n}return i._value=e,i}function aS(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Zo(t);return this.tween(n,(r.local?iS:oS)(r,e))}function sS(t,e){return function(){gl(this,t).delay=+e.apply(this,arguments)}}function uS(t,e){return e=+e,function(){gl(this,t).delay=e}}function lS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?sS:uS)(e,t)):Se(this.node(),e).delay}function cS(t,e){return function(){Re(this,t).duration=+e.apply(this,arguments)}}function fS(t,e){return e=+e,function(){Re(this,t).duration=e}}function hS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?cS:fS)(e,t)):Se(this.node(),e).duration}function pS(t,e){if(typeof e!="function")throw new Error;return function(){Re(this,t).ease=e}}function dS(t){var e=this._id;return arguments.length?this.each(pS(e,t)):Se(this.node(),e).ease}function gS(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Re(this,t).ease=n}}function mS(t){if(typeof t!="function")throw new Error;return this.each(gS(this._id,t))}function yS(t){typeof t!="function"&&(t=qp(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Xe(r,this._parents,this._name,this._id)}function bS(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Xe(a,this._parents,this._name,this._id)}function vS(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function xS(t,e,n){var r,i,o=vS(e)?gl:Re;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function _S(t,e){var n=this._id;return arguments.length<2?Se(this.node(),n).on.on(t):this.each(xS(n,t,e))}function wS(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function $S(){return this.on("end.remove",wS(this._id))}function SS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=nl(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,ca(l[h],e,n,h,l,Se(c,n)));return new Xe(o,this._parents,e,n)}function AS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Xp(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=Se(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&ca(p,e,n,g,h,d);o.push(h),a.push(c)}return new Xe(o,a,e,n)}var MS=pi.prototype.constructor;function PS(){return new MS(this._groups,this._parents)}function DS(t,e){var n,r,i;return function(){var o=gr(this,t),a=(this.style.removeProperty(t),gr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Pd(t){return function(){this.style.removeProperty(t)}}function TS(t,e,n){var r,i=n+"",o;return function(){var a=gr(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function LS(t,e,n){var r,i,o;return function(){var a=gr(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),gr(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function CS(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Re(this,t),l=u.on,c=u.value[o]==null?s||(s=Pd(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function ES(t,e,n){var r=(t+="")=="transform"?I$:Md;return e==null?this.styleTween(t,DS(t,r)).on("end.style."+t,Pd(t)):typeof e=="function"?this.styleTween(t,LS(t,r,ml(this,"style."+t,e))).each(CS(this._id,t)):this.styleTween(t,TS(t,r,e),n).on("end.style."+t,null)}function RS(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function kS(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&RS(t,a,n)),r}return o._value=e,o}function IS(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,kS(t,e,n??""))}function NS(t){return function(){this.textContent=t}}function FS(t){return function(){var e=t(this);this.textContent=e??""}}function zS(t){return this.tween("text",typeof t=="function"?FS(ml(this,"text",t)):NS(t==null?"":t+""))}function GS(t){return function(e){this.textContent=t.call(this,e)}}function OS(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&GS(i)),e}return r._value=t,r}function YS(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,OS(t))}function US(){for(var t=this._name,e=this._id,n=Dd(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=Se(u,e);ca(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Xe(r,this._parents,t,n)}function BS(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Re(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var WS=0;function Xe(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Dd(){return++WS}var qe=pi.prototype;Xe.prototype={constructor:Xe,select:SS,selectAll:AS,selectChild:qe.selectChild,selectChildren:qe.selectChildren,filter:yS,merge:bS,selection:PS,transition:US,call:qe.call,nodes:qe.nodes,node:qe.node,size:qe.size,empty:qe.empty,each:qe.each,on:_S,attr:eS,attrTween:aS,style:ES,styleTween:IS,text:zS,textTween:YS,remove:$S,tween:j$,delay:lS,duration:hS,ease:dS,easeVarying:mS,end:BS,[Symbol.iterator]:qe[Symbol.iterator]};function HS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var XS={time:null,delay:0,duration:250,ease:HS};function qS(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function jS(t){var e,n;t instanceof Xe?(e=t._id,t=t._name):(e=Dd(),(n=XS).time=fl(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&ca(u,t,e,l,a,n||qS(u,e));return new Xe(r,this._parents,t,e)}pi.prototype.interrupt=H$,pi.prototype.transition=jS;function VS(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fa(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function br(t){return t=fa(Math.abs(t)),t?t[1]:NaN}function ZS(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function KS(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var QS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ha(t){if(!(e=QS.exec(t)))throw new Error("invalid format: "+t);var e;return new yl({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ha.prototype=yl.prototype;function yl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}yl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JS(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Td;function tA(t,e){var n=fa(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Td=Math.max(-8,Math.min(8,Math.floor(i/3)))*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")+fa(t,Math.max(0,e+o-1))[0]}function Ld(t,e){var n=fa(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Cd={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:VS,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ld(t*100,e),r:Ld,s:tA,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ed(t){return t}var Rd=Array.prototype.map,kd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function eA(t){var e=t.grouping===void 0||t.thousands===void 0?Ed:ZS(Rd.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Ed:KS(Rd.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=ha(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,v=f.comma,x=f.precision,b=f.trim,S=f.type;S==="n"?(v=!0,S="g"):Cd[S]||(x===void 0&&(x=12),b=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var $=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=g==="$"?r:/[%p]/.test(S)?a:"",M=Cd[S],w=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function P(_){var N=$,T=E,A,C,D;if(S==="c")T=M(_)+T,_="";else{_=+_;var O=_<0||1/_<0;if(_=isNaN(_)?u:M(Math.abs(_),x),b&&(_=JS(_)),O&&+_==0&&d!=="+"&&(O=!1),N=(O?d==="("?d:s:d==="-"||d==="("?"":d)+N,T=(S==="s"?kd[8+Td/3]:"")+T+(O&&d==="("?")":""),w){for(A=-1,C=_.length;++A<C;)if(D=_.charCodeAt(A),48>D||D>57){T=(D===46?i+_.slice(A+1):_.slice(A))+T,_=_.slice(0,A);break}}}v&&!m&&(_=e(_,1/0));var G=N.length+_.length+T.length,k=G<y?new Array(y-G+1).join(h):"";switch(v&&m&&(_=e(k+_,k.length?y-T.length:1/0),k=""),p){case"<":_=N+_+T+k;break;case"=":_=N+k+_+T;break;case"^":_=k.slice(0,G=k.length>>1)+N+_+T+k.slice(G);break;default:_=k+N+_+T;break}return o(_)}return P.toString=function(){return f+""},P}function c(f,h){var p=l((f=ha(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(br(h)/3)))*3,g=Math.pow(10,-d),m=kd[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var pa,Id,Nd;nA({thousands:",",grouping:[3],currency:["$",""]});function nA(t){return pa=eA(t),Id=pa.format,Nd=pa.formatPrefix,pa}function rA(t){return Math.max(0,-br(Math.abs(t)))}function iA(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(br(e)/3)))*3-br(Math.abs(t)))}function oA(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,br(e)-br(t))+1}function Fd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function aA(t){return function(){return t}}function sA(t){return+t}var zd=[0,1];function vr(t){return t}function bl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:aA(isNaN(e)?NaN:.5)}function uA(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function lA(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=bl(i,r),o=n(a,o)):(r=bl(r,i),o=n(o,a)),function(s){return o(r(s))}}function cA(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=bl(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=Yp(t,s,1,r)-1;return o[u](i[u](s))}}function fA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function hA(){var t=zd,e=zd,n=cl,r,i,o,a=vr,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==vr&&(a=uA(t[0],t[h-1])),s=h>2?cA:lA,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),$e)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,sA),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=E$,c()},f.clamp=function(h){return arguments.length?(a=h?!0:vr,c()):a!==vr},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function pA(){return hA()(vr,vr)}function dA(t,e,n,r){var i=P_(t,e,n),o;switch(r=ha(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=iA(i,a))&&(r.precision=o),Nd(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=oA(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=rA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Id(r)}function Gd(t){var e=t.domain;return t.ticks=function(n){var r=e();return M_(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return dA(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=tl(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function Od(){var t=pA();return t.copy=function(){return fA(t,Od())},Fd.apply(t,arguments),Gd(t)}function Yd(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[Yp(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Yd().domain([t,e]).range(i).unknown(o)},Fd.apply(Gd(a),arguments)}function _i(t,e,n){this.k=t,this.x=e,this.y=n}_i.prototype={constructor:_i,scale:function(t){return t===1?this:new _i(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new _i(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},_i.prototype;function da(t){return Object.prototype.toString.call(t)==="[object Object]"}function vl(t,e){if(da(t)===!1||da(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;da(r[a])&&da(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(t,e)}var xl=function(t,e){return xl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},xl(t,e)};function ke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xl(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function gA(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(t,[])).next())})}function Ud(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function xr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wi(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function $i(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function _r(t){return this instanceof _r?(this.v=t,this):new _r(t)}function mA(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){h(o[0][3],g)}}function l(p){p.value instanceof _r?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){u("next",p)}function f(p){u("throw",p)}function h(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function yA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof xr=="function"?xr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}function Ft(t){return typeof t=="function"}function _l(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var wl=_l(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Vu(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Vo=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=mr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(yt(c))try{c()}catch(g){o=g instanceof ju?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=mr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{wp(d)}catch(g){o=o??[],g instanceof ju?o=_i(_i([],yr(o)),yr(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new ju(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)wp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Vu(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Vu(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),vp=Vo.EMPTY;function _p(t){return t instanceof Vo||t&&"closed"in t&&yt(t.remove)&&yt(t.add)&&yt(t.unsubscribe)}function wp(t){yt(t)?t():t.unsubscribe()}var $p={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sp={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,_i([t,e],yr(n)))},clearTimeout:function(t){var e=Sp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ap(t){Sp.setTimeout(function(){throw t})}function qu(){}function qo(t){t()}var Zu=function(t){Rn(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,_p(n)&&n.add(r)):r.destination=j2,r}return e.create=function(n,r,i){return new wi(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Vo),W2=Function.prototype.bind;function Ku(t,e){return W2.call(t,e)}var H2=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Zo(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Zo(r)}else Zo(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Zo(n)}},t}(),wi=function(t){Rn(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(yt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&$p.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ku(n.next,s),error:n.error&&Ku(n.error,s),complete:n.complete&&Ku(n.complete,s)}):a=n}return o.destination=new H2(a),o}return e}(Zu);function Zo(t){Ap(t)}function X2(t){throw t}var j2={closed:!0,next:qu,error:X2,complete:qu},Qu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function xr(t){return t}function V2(t){return t.length===0?xr:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var dt=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=Z2(e)?e:new wi(e,n,r);return qo(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Tp(n),new n(function(i,o){var a=new wi({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Qu]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return V2(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Tp(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Tp(t){var e;return(e=t??$p.Promise)!==null&&e!==void 0?e:Promise}function q2(t){return t&&yt(t.next)&&yt(t.error)&&yt(t.complete)}function Z2(t){return t&&t instanceof Zu||q2(t)&&_p(t)}function K2(t){return yt(t==null?void 0:t.lift)}function he(t){return function(e){if(K2(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function se(t,e,n,r,i){return new Q2(t,e,n,r,i)}var Q2=function(t){Rn(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Zu),J2=Xu(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),nt=function(t){Rn(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Pp(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new J2},e.prototype.next=function(n){var r=this;qo(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=mr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;qo(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;qo(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?vp:(this.currentObservers=null,s.push(n),new Vo(function(){r.currentObservers=null,Vu(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new dt;return n.source=this,n},e.create=function(n,r){return new Pp(n,r)},e}(dt),Pp=function(t){Rn(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:vp},e}(nt),t_=function(t){Rn(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(nt),Mp={now:function(){return(Mp.delegate||Date).now()},delegate:void 0},e_=function(t){Rn(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Mp);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(nt),Dp=new dt(function(t){return t.complete()});function n_(t){return t&&yt(t.schedule)}function Ju(t){return t[t.length-1]}function r_(t){return yt(Ju(t))?t.pop():void 0}function tl(t){return n_(Ju(t))?t.pop():void 0}function i_(t,e){return typeof Ju(t)=="number"?t.pop():e}var el=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Cp(t){return yt(t==null?void 0:t.then)}function Lp(t){return yt(t[Qu])}function kp(t){return Symbol.asyncIterator&&yt(t==null?void 0:t[Symbol.asyncIterator])}function Rp(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function o_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ep=o_();function Ip(t){return yt(t==null?void 0:t[Ep])}function Np(t){return Y2(this,arguments,function(){var n,r,i,o;return xp(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,br(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,br(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,br(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Bp(t){return yt(t==null?void 0:t.getReader)}function pe(t){if(t instanceof dt)return t;if(t!=null){if(Lp(t))return a_(t);if(el(t))return s_(t);if(Cp(t))return u_(t);if(kp(t))return Fp(t);if(Ip(t))return l_(t);if(Bp(t))return c_(t)}throw Rp(t)}function a_(t){return new dt(function(e){var n=t[Qu]();if(yt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function s_(t){return new dt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function u_(t){return new dt(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Ap)})}function l_(t){return new dt(function(e){var n,r;try{for(var i=mr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Fp(t){return new dt(function(e){f_(t,e).catch(function(n){return e.error(n)})})}function c_(t){return Fp(Np(t))}function f_(t,e){var n,r,i,o;return z2(this,void 0,void 0,function(){var a,s;return xp(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=U2(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function fn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Op(t,e){return e===void 0&&(e=0),he(function(n,r){n.subscribe(se(r,function(i){return fn(r,t,function(){return r.next(i)},e)},function(){return fn(r,t,function(){return r.complete()},e)},function(i){return fn(r,t,function(){return r.error(i)},e)}))})}function Gp(t,e){return e===void 0&&(e=0),he(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function h_(t,e){return pe(t).pipe(Gp(e),Op(e))}function p_(t,e){return pe(t).pipe(Gp(e),Op(e))}function d_(t,e){return new dt(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function g_(t,e){return new dt(function(n){var r;return fn(n,e,function(){r=t[Ep](),fn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return yt(r==null?void 0:r.return)&&r.return()}})}function zp(t,e){if(!t)throw new Error("Iterable cannot be null");return new dt(function(n){fn(n,e,function(){var r=t[Symbol.asyncIterator]();fn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function m_(t,e){return zp(Np(t),e)}function y_(t,e){if(t!=null){if(Lp(t))return h_(t,e);if(el(t))return d_(t,e);if(Cp(t))return p_(t,e);if(kp(t))return zp(t,e);if(Ip(t))return g_(t,e);if(Bp(t))return m_(t,e)}throw Rp(t)}function Ko(t,e){return e?y_(t,e):pe(t)}function Qo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t);return Ko(t,n)}var Yp=Xu(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function B(t,e){return he(function(n,r){var i=0;n.subscribe(se(r,function(o){r.next(t.call(e,o,i++))}))})}var b_=Array.isArray;function x_(t,e){return b_(e)?t.apply(void 0,_i([],yr(e))):t(e)}function Up(t){return B(function(e){return x_(t,e)})}var v_=Array.isArray,__=Object.getPrototypeOf,w_=Object.prototype,$_=Object.keys;function S_(t){if(t.length===1){var e=t[0];if(v_(e))return{args:e,keys:null};if(A_(e)){var n=$_(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function A_(t){return t&&typeof t=="object"&&__(t)===w_}function T_(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t),r=r_(t),i=S_(t),o=i.args,a=i.keys;if(o.length===0)return Ko([],n);var s=new dt(P_(o,n,a?function(u){return T_(a,u)}:xr));return r?s.pipe(Up(r)):s}function P_(t,e,n){return n===void 0&&(n=xr),function(r){Wp(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){Wp(e,function(){var f=Ko(t[c],e),h=!1;f.subscribe(se(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Wp(t,e,n){t?fn(n,t,e):e()}function M_(t,e,n,r,i,o,a,s){var u=[],l=0,c=0,f=!1,h=function(){f&&!u.length&&!l&&e.complete()},p=function(g){return l<r?d(g):u.push(g)},d=function(g){l++;var m=!1;pe(n(g,c++)).subscribe(se(e,function(y){e.next(y)},function(){m=!0},void 0,function(){if(m)try{l--;for(var y=function(){var b=u.shift();a||d(b)};u.length&&l<r;)y();h()}catch(b){e.error(b)}}))};return t.subscribe(se(e,p,function(){f=!0,h()})),function(){}}function nl(t,e,n){return n===void 0&&(n=1/0),yt(e)?nl(function(r,i){return B(function(o,a){return e(r,o,i,a)})(pe(t(r,i)))},n):(typeof e=="number"&&(n=e),he(function(r,i){return M_(r,i,t,n)}))}function D_(t){return t===void 0&&(t=1/0),nl(xr,t)}function C_(t){return new dt(function(e){pe(t()).subscribe(e)})}var L_=["addListener","removeListener"],k_=["addEventListener","removeEventListener"],R_=["on","off"];function rl(t,e,n,r){if(yt(n)&&(r=n,n=void 0),r)return rl(t,e,n).pipe(Up(r));var i=yr(N_(t)?k_.map(function(s){return function(u){return t[s](e,u,n)}}):E_(t)?L_.map(Hp(t,e)):I_(t)?R_.map(Hp(t,e)):[],2),o=i[0],a=i[1];if(!o&&el(t))return nl(function(s){return rl(s,e,n)})(pe(t));if(!o)throw new TypeError("Invalid event target");return new dt(function(s){var u=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s.next(1<l.length?l:l[0])};return o(u),function(){return a(u)}})}function Hp(t,e){return function(n){return function(r){return t[n](e,r)}}}function E_(t){return yt(t.addListener)&&yt(t.removeListener)}function I_(t){return yt(t.on)&&yt(t.off)}function N_(t){return yt(t.addEventListener)&&yt(t.removeEventListener)}function Xp(t,e,n){return C_(function(){return t()?e:n})}function il(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t),r=i_(t,1/0),i=t;return i.length?i.length===1?pe(i[0]):D_(r)(Ko(i,n)):Dp}function $i(t,e){return he(function(n,r){var i=0;n.subscribe(se(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function B_(t){return he(function(e,n){var r=!1;e.subscribe(se(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function F_(t){return t<=0?function(){return Dp}:he(function(e,n){var r=0;e.subscribe(se(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function tt(t,e){return e===void 0&&(e=xr),t=t??O_,he(function(n,r){var i,o=!0;n.subscribe(se(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function O_(t,e){return t===e}function G_(t){return t===void 0&&(t=z_),he(function(e,n){var r=!1;e.subscribe(se(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function z_(){return new Yp}function Y_(t,e){var n=arguments.length>=2;return function(r){return r.pipe(xr,F_(1),n?B_(e):G_(function(){return new Yp}))}}function U_(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new nt}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return he(function(v,x){p++,!g&&!d&&m();var S=h=h??n();x.add(function(){p--,p===0&&!g&&!d&&(f=ol(b,u))}),S.subscribe(x),!c&&p>0&&(c=new wi({next:function($){return S.next($)},error:function($){g=!0,m(),f=ol(y,i,$),S.error($)},complete:function(){d=!0,m(),f=ol(y,a),S.complete()}}),pe(v).subscribe(c))})(l)}}function ol(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new wi({next:function(){i.unsubscribe(),t()}});return pe(e.apply(void 0,_i([],yr(n)))).subscribe(i)}}function St(t,e,n){var r,i=!1;return r=t,U_({connector:function(){return new e_(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function W(t,e){return he(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(se(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;pe(t(u,c)).subscribe(i=se(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function I(t){return he(function(e,n){pe(t).subscribe(se(n,function(){return n.complete()},qu)),!n.closed&&e.subscribe(n)})}const vr={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""};function _r(t){return Object.prototype.toString.call(t)==="[object Object]"}function W_(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function al(t,e){if(_r(t)===!1||_r(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;_r(r[a])&&_r(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(t,e)}function H_(t,e){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>_r(i),"object[]":i=>Array.isArray(i)&&i.every(o=>_r(o)),"string[]":i=>Array.isArray(i)&&i.every(o=>typeof o=="string"),"number[]":i=>Array.isArray(i)&&i.every(o=>typeof o=="number"),Function:i=>W_(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="series"||i==="primary"||i==="secondary"||i==="white"||i==="background"};return Object.keys(t).find(i=>{if(e[i]){const o=e[i],a=t[i];if(o.toBeTypes){if(o.toBeTypes.some(s=>n[s](a))===!1)return!0}else if(o.toBe){const{toBe:s,test:u}=o;if(u(a)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](a)===!1)return!0}}return!1})}function X_(t,e){const n=H_(t,e);if(n){const r=e[n],i=r.toBeTypes?r.toBeTypes.join(" | "):r.toBe?r.toBe:r.toBeOption?r.toBeOption:"";return{status:"error",columnName:n,expectToBe:i}}else return{status:"success",columnName:"",expectToBe:""}}function Jo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function j_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jp(t){let e,n,r;t.length!==2?(e=Jo,n=(s,u)=>Jo(t(s),u),r=(s,u)=>t(s)-u):(e=t===Jo||t===j_?t:V_,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function V_(){return 0}function q_(t){return t===null?NaN:+t}const Z_=jp(Jo),Vp=Z_.right;jp(q_).center;const K_=Math.sqrt(50),Q_=Math.sqrt(10),J_=Math.sqrt(2);function ta(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=K_?10:o>=Q_?5:o>=J_?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?ta(t,e,n*2):[s,u,l]}function tw(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?ta(e,t,n):ta(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function sl(t,e,n){return e=+e,t=+t,n=+n,ta(t,e,n)[2]}function ew(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?sl(e,t,n):sl(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var nw={value:()=>{}};function qp(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ea(n)}function ea(t){this._=t}function rw(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ea.prototype=qp.prototype={constructor:ea,on:function(t,e){var n=this._,r=rw(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=iw(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=Zp(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Zp(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ea(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function iw(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Zp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=nw,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ul="http://www.w3.org/1999/xhtml";const Kp={svg:"http://www.w3.org/2000/svg",xhtml:ul,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Kp.hasOwnProperty(e)?{space:Kp[e],local:t}:t}function ow(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ul&&e.documentElement.namespaceURI===ul?e.createElement(t):e.createElementNS(n,t)}}function aw(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qp(t){var e=na(t);return(e.local?aw:ow)(e)}function sw(){}function ll(t){return t==null?sw:function(){return this.querySelector(t)}}function uw(t){typeof t!="function"&&(t=ll(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new we(r,this._parents)}function lw(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cw(){return[]}function Jp(t){return t==null?cw:function(){return this.querySelectorAll(t)}}function fw(t){return function(){return lw(t.apply(this,arguments))}}function hw(t){typeof t=="function"?t=fw(t):t=Jp(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new we(r,i)}function td(t){return function(){return this.matches(t)}}function ed(t){return function(e){return e.matches(t)}}var pw=Array.prototype.find;function dw(t){return function(){return pw.call(this.children,t)}}function gw(){return this.firstElementChild}function mw(t){return this.select(t==null?gw:dw(typeof t=="function"?t:ed(t)))}var yw=Array.prototype.filter;function bw(){return Array.from(this.children)}function xw(t){return function(){return yw.call(this.children,t)}}function vw(t){return this.selectAll(t==null?bw:xw(typeof t=="function"?t:ed(t)))}function _w(t){typeof t!="function"&&(t=td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new we(r,this._parents)}function nd(t){return new Array(t.length)}function ww(){return new we(this._enter||this._groups.map(nd),this._parents)}function ra(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ra.prototype={constructor:ra,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function $w(t){return function(){return t}}function Sw(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new ra(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function Aw(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new ra(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function Tw(t){return t.__data__}function Pw(t,e){if(!arguments.length)return Array.from(this,Tw);var n=e?Aw:Sw,r=this._parents,i=this._groups;typeof t!="function"&&(t=$w(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=Mw(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var b=0,v=0,x,S;b<d;++b)if(x=g[b]){for(b>=v&&(v=b+1);!(S=m[v])&&++v<d;);x._next=S||null}}return a=new we(a,r),a._enter=s,a._exit=u,a}function Mw(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dw(){return new we(this._exit||this._groups.map(nd),this._parents)}function Cw(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Lw(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new we(s,this._parents)}function kw(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Rw(t){t||(t=Ew);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new we(i,this._parents).order()}function Ew(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Iw(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Nw(){return Array.from(this)}function Bw(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Fw(){let t=0;for(const e of this)++t;return t}function Ow(){return!this.node()}function Gw(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function zw(t){return function(){this.removeAttribute(t)}}function Yw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Uw(t,e){return function(){this.setAttribute(t,e)}}function Ww(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Hw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Xw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function jw(t,e){var n=na(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Yw:zw:typeof e=="function"?n.local?Xw:Hw:n.local?Ww:Uw)(n,e))}function rd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Vw(t){return function(){this.style.removeProperty(t)}}function qw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Zw(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Kw(t,e,n){return arguments.length>1?this.each((e==null?Vw:typeof e=="function"?Zw:qw)(t,e,n??"")):wr(this.node(),t)}function wr(t,e){return t.style.getPropertyValue(e)||rd(t).getComputedStyle(t,null).getPropertyValue(e)}function Qw(t){return function(){delete this[t]}}function Jw(t,e){return function(){this[t]=e}}function t$(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function e$(t,e){return arguments.length>1?this.each((e==null?Qw:typeof e=="function"?t$:Jw)(t,e)):this.node()[t]}function id(t){return t.trim().split(/^|\s+/)}function cl(t){return t.classList||new od(t)}function od(t){this._node=t,this._names=id(t.getAttribute("class")||"")}od.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ad(t,e){for(var n=cl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function sd(t,e){for(var n=cl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function n$(t){return function(){ad(this,t)}}function r$(t){return function(){sd(this,t)}}function i$(t,e){return function(){(e.apply(this,arguments)?ad:sd)(this,t)}}function o$(t,e){var n=id(t+"");if(arguments.length<2){for(var r=cl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?i$:e?n$:r$)(n,e))}function a$(){this.textContent=""}function s$(t){return function(){this.textContent=t}}function u$(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function l$(t){return arguments.length?this.each(t==null?a$:(typeof t=="function"?u$:s$)(t)):this.node().textContent}function c$(){this.innerHTML=""}function f$(t){return function(){this.innerHTML=t}}function h$(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function p$(t){return arguments.length?this.each(t==null?c$:(typeof t=="function"?h$:f$)(t)):this.node().innerHTML}function d$(){this.nextSibling&&this.parentNode.appendChild(this)}function g$(){return this.each(d$)}function m$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function y$(){return this.each(m$)}function b$(t){var e=typeof t=="function"?t:Qp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function x$(){return null}function v$(t,e){var n=typeof t=="function"?t:Qp(t),r=e==null?x$:typeof e=="function"?e:ll(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _$(){var t=this.parentNode;t&&t.removeChild(this)}function w$(){return this.each(_$)}function $$(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function S$(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function A$(t){return this.select(t?S$:$$)}function T$(t){return arguments.length?this.property("__data__",t):this.node().__data__}function P$(t){return function(e){t.call(this,e,this.__data__)}}function M$(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function D$(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function C$(t,e,n){return function(){var r=this.__on,i,o=P$(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function L$(t,e,n){var r=M$(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?C$:D$,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function ud(t,e,n){var r=rd(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function k$(t,e){return function(){return ud(this,t,e)}}function R$(t,e){return function(){return ud(this,t,e.apply(this,arguments))}}function E$(t,e){return this.each((typeof e=="function"?R$:k$)(t,e))}function*I$(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var N$=[null];function we(t,e){this._groups=t,this._parents=e}function Si(){return new we([[document.documentElement]],N$)}function B$(){return this}we.prototype=Si.prototype={constructor:we,select:uw,selectAll:hw,selectChild:mw,selectChildren:vw,filter:_w,data:Pw,enter:ww,exit:Dw,join:Cw,merge:Lw,selection:B$,order:kw,sort:Rw,call:Iw,nodes:Nw,node:Bw,size:Fw,empty:Ow,each:Gw,attr:jw,style:Kw,property:e$,classed:o$,text:l$,html:p$,raise:g$,lower:y$,append:b$,insert:v$,remove:w$,clone:A$,datum:T$,on:L$,dispatch:E$,[Symbol.iterator]:I$};function fl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ld(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ai(){}var Ti=.7,ia=1/Ti,$r="\\s*([+-]?\\d+)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F$=/^#([0-9a-f]{3,8})$/,O$=new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`),G$=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),z$=new RegExp(`^rgba\\(${$r},${$r},${$r},${Pi}\\)$`),Y$=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${Pi}\\)$`),U$=new RegExp(`^hsl\\(${Pi},${Ee},${Ee}\\)$`),W$=new RegExp(`^hsla\\(${Pi},${Ee},${Ee},${Pi}\\)$`),cd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};fl(Ai,En,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fd,formatHex:fd,formatHex8:H$,formatHsl:X$,formatRgb:hd,toString:hd});function fd(){return this.rgb().formatHex()}function H$(){return this.rgb().formatHex8()}function X$(){return yd(this).formatHsl()}function hd(){return this.rgb().formatRgb()}function En(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=F$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?pd(e):n===3?new ne(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oa(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=O$.exec(t))?new ne(e[1],e[2],e[3],1):(e=G$.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=z$.exec(t))?oa(e[1],e[2],e[3],e[4]):(e=Y$.exec(t))?oa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=U$.exec(t))?md(e[1],e[2]/100,e[3]/100,1):(e=W$.exec(t))?md(e[1],e[2]/100,e[3]/100,e[4]):cd.hasOwnProperty(t)?pd(cd[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function pd(t){return new ne(t>>16&255,t>>8&255,t&255,1)}function oa(t,e,n,r){return r<=0&&(t=e=n=NaN),new ne(t,e,n,r)}function j$(t){return t instanceof Ai||(t=En(t)),t?(t=t.rgb(),new ne(t.r,t.g,t.b,t.opacity)):new ne}function hl(t,e,n,r){return arguments.length===1?j$(t):new ne(t,e,n,r??1)}function ne(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}fl(ne,hl,ld(Ai,{brighter(t){return t=t==null?ia:Math.pow(ia,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ne(In(this.r),In(this.g),In(this.b),aa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dd,formatHex:dd,formatHex8:V$,formatRgb:gd,toString:gd}));function dd(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}`}function V$(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}${Nn((isNaN(this.opacity)?1:this.opacity)*255)}`}function gd(){const t=aa(this.opacity);return`${t===1?"rgb(":"rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${t===1?")":`, ${t})`}`}function aa(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function In(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Nn(t){return t=In(t),(t<16?"0":"")+t.toString(16)}function md(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $e(t,e,n,r)}function yd(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof Ai||(t=En(t)),!t)return new $e;if(t instanceof $e)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new $e(a,s,u,t.opacity)}function q$(t,e,n,r){return arguments.length===1?yd(t):new $e(t,e,n,r??1)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}fl($e,q$,ld(Ai,{brighter(t){return t=t==null?ia:Math.pow(ia,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new $e(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ne(pl(t>=240?t-240:t+120,i,r),pl(t,i,r),pl(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new $e(bd(this.h),sa(this.s),sa(this.l),aa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=aa(this.opacity);return`${t===1?"hsl(":"hsla("}${bd(this.h)}, ${sa(this.s)*100}%, ${sa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function bd(t){return t=(t||0)%360,t<0?t+360:t}function sa(t){return Math.max(0,Math.min(1,t||0))}function pl(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const dl=t=>()=>t;function Z$(t,e){return function(n){return t+n*e}}function K$(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Q$(t){return(t=+t)==1?xd:function(e,n){return n-e?K$(e,n,t):dl(isNaN(e)?n:e)}}function xd(t,e){var n=e-t;return n?Z$(t,n):dl(isNaN(t)?e:t)}const ua=function t(e){var n=Q$(e);function r(i,o){var a=n((i=hl(i)).r,(o=hl(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=xd(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function J$(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function tS(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function eS(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=yl(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function nS(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Se(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function rS(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=yl(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var gl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ml=new RegExp(gl.source,"g");function iS(t){return function(){return t}}function oS(t){return function(e){return t(e)+""}}function vd(t,e){var n=gl.lastIndex=ml.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=gl.exec(t))&&(i=ml.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:Se(r,i)})),n=ml.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?oS(u[0].x):iS(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function yl(t,e){var n=typeof e,r;return e==null||n==="boolean"?dl(e):(n==="number"?Se:n==="string"?(r=En(e))?(e=r,ua):vd:e instanceof En?ua:e instanceof Date?nS:tS(e)?J$:Array.isArray(e)?eS:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?rS:Se)(t,e)}function aS(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var _d=180/Math.PI,wd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $d(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*_d,skewX:Math.atan(u)*_d,scaleX:a,scaleY:s}}var la;function sS(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?wd:$d(e.a,e.b,e.c,e.d,e.e,e.f)}function uS(t){return t==null||(la||(la=document.createElementNS("http://www.w3.org/2000/svg","g")),la.setAttribute("transform",t),!(t=la.transform.baseVal.consolidate()))?wd:(t=t.matrix,$d(t.a,t.b,t.c,t.d,t.e,t.f))}function Sd(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:Se(l,f)},{i:g-2,x:Se(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Se(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Se(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:Se(l,f)},{i:g-2,x:Se(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var lS=Sd(sS,"px, ","px)","deg)"),cS=Sd(uS,", ",")",")"),Sr=0,Mi=0,Di=0,Ad=1e3,ca,Ci,fa=0,Bn=0,ha=0,Li=typeof performance=="object"&&performance.now?performance:Date,Td=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function bl(){return Bn||(Td(fS),Bn=Li.now()+ha)}function fS(){Bn=0}function pa(){this._call=this._time=this._next=null}pa.prototype=Pd.prototype={constructor:pa,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?bl():+n)+(e==null?0:+e),!this._next&&Ci!==this&&(Ci?Ci._next=this:ca=this,Ci=this),this._call=t,this._time=n,xl()},stop:function(){this._call&&(this._call=null,this._time=1/0,xl())}};function Pd(t,e,n){var r=new pa;return r.restart(t,e,n),r}function hS(){bl(),++Sr;for(var t=ca,e;t;)(e=Bn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Sr}function Md(){Bn=(fa=Li.now())+ha,Sr=Mi=0;try{hS()}finally{Sr=0,dS(),Bn=0}}function pS(){var t=Li.now(),e=t-fa;e>Ad&&(ha-=e,fa=t)}function dS(){for(var t,e=ca,n,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:ca=n);Ci=t,xl(r)}function xl(t){if(!Sr){Mi&&(Mi=clearTimeout(Mi));var e=t-Bn;e>24?(t<1/0&&(Mi=setTimeout(Md,t-Li.now()-ha)),Di&&(Di=clearInterval(Di))):(Di||(fa=Li.now(),Di=setInterval(pS,Ad)),Sr=1,Td(Md))}}function Dd(t,e,n){var r=new pa;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var gS=qp("start","end","cancel","interrupt"),mS=[],Cd=0,Ld=1,vl=2,da=3,kd=4,_l=5,ga=6;function ma(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;yS(t,n,{name:e,index:r,group:i,on:gS,tween:mS,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Cd})}function wl(t,e){var n=Ae(t,e);if(n.state>Cd)throw new Error("too late; already scheduled");return n}function Ie(t,e){var n=Ae(t,e);if(n.state>da)throw new Error("too late; already running");return n}function Ae(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function yS(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Pd(o,0,n.time);function o(l){n.state=Ld,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==Ld)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===da)return Dd(a);p.state===kd?(p.state=ga,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=ga,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(Dd(function(){n.state===da&&(n.state=kd,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=vl,n.on.call("start",t,t.__data__,n.index,n.group),n.state===vl){for(n.state=da,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=_l,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===_l&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=ga,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function bS(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>vl&&r.state<_l,r.state=ga,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function xS(t){return this.each(function(){bS(this,t)})}function vS(t,e){var n,r;return function(){var i=Ie(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function _S(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ie(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function wS(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Ae(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?vS:_S)(n,t,e))}function $l(t,e,n){var r=t._id;return t.each(function(){var i=Ie(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Ae(i,r).value[e]}}function Rd(t,e){var n;return(typeof e=="number"?Se:e instanceof En?ua:(n=En(e))?(e=n,ua):vd)(t,e)}function $S(t){return function(){this.removeAttribute(t)}}function SS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function AS(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function TS(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function PS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function MS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function DS(t,e){var n=na(t),r=n==="transform"?cS:Rd;return this.attrTween(t,typeof e=="function"?(n.local?MS:PS)(n,r,$l(this,"attr."+t,e)):e==null?(n.local?SS:$S)(n):(n.local?TS:AS)(n,r,e))}function CS(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function LS(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function kS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&LS(t,o)),n}return i._value=e,i}function RS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&CS(t,o)),n}return i._value=e,i}function ES(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=na(t);return this.tween(n,(r.local?kS:RS)(r,e))}function IS(t,e){return function(){wl(this,t).delay=+e.apply(this,arguments)}}function NS(t,e){return e=+e,function(){wl(this,t).delay=e}}function BS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?IS:NS)(e,t)):Ae(this.node(),e).delay}function FS(t,e){return function(){Ie(this,t).duration=+e.apply(this,arguments)}}function OS(t,e){return e=+e,function(){Ie(this,t).duration=e}}function GS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?FS:OS)(e,t)):Ae(this.node(),e).duration}function zS(t,e){if(typeof e!="function")throw new Error;return function(){Ie(this,t).ease=e}}function YS(t){var e=this._id;return arguments.length?this.each(zS(e,t)):Ae(this.node(),e).ease}function US(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ie(this,t).ease=n}}function WS(t){if(typeof t!="function")throw new Error;return this.each(US(this._id,t))}function HS(t){typeof t!="function"&&(t=td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Ve(r,this._parents,this._name,this._id)}function XS(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Ve(a,this._parents,this._name,this._id)}function jS(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function VS(t,e,n){var r,i,o=jS(e)?wl:Ie;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function qS(t,e){var n=this._id;return arguments.length<2?Ae(this.node(),n).on.on(t):this.each(VS(n,t,e))}function ZS(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function KS(){return this.on("end.remove",ZS(this._id))}function QS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ll(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,ma(l[h],e,n,h,l,Ae(c,n)));return new Ve(o,this._parents,e,n)}function JS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jp(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=Ae(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&ma(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ve(o,a,e,n)}var tA=Si.prototype.constructor;function eA(){return new tA(this._groups,this._parents)}function nA(t,e){var n,r,i;return function(){var o=wr(this,t),a=(this.style.removeProperty(t),wr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Ed(t){return function(){this.style.removeProperty(t)}}function rA(t,e,n){var r,i=n+"",o;return function(){var a=wr(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function iA(t,e,n){var r,i,o;return function(){var a=wr(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),wr(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function oA(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Ie(this,t),l=u.on,c=u.value[o]==null?s||(s=Ed(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function aA(t,e,n){var r=(t+="")=="transform"?lS:Rd;return e==null?this.styleTween(t,nA(t,r)).on("end.style."+t,Ed(t)):typeof e=="function"?this.styleTween(t,iA(t,r,$l(this,"style."+t,e))).each(oA(this._id,t)):this.styleTween(t,rA(t,r,e),n).on("end.style."+t,null)}function sA(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function uA(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&sA(t,a,n)),r}return o._value=e,o}function lA(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,uA(t,e,n??""))}function cA(t){return function(){this.textContent=t}}function fA(t){return function(){var e=t(this);this.textContent=e??""}}function hA(t){return this.tween("text",typeof t=="function"?fA($l(this,"text",t)):cA(t==null?"":t+""))}function pA(t){return function(e){this.textContent=t.call(this,e)}}function dA(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&pA(i)),e}return r._value=t,r}function gA(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,dA(t))}function mA(){for(var t=this._name,e=this._id,n=Id(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=Ae(u,e);ma(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ve(r,this._parents,t,n)}function yA(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Ie(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var bA=0;function Ve(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Id(){return++bA}var qe=Si.prototype;Ve.prototype={constructor:Ve,select:QS,selectAll:JS,selectChild:qe.selectChild,selectChildren:qe.selectChildren,filter:HS,merge:XS,selection:eA,transition:mA,call:qe.call,nodes:qe.nodes,node:qe.node,size:qe.size,empty:qe.empty,each:qe.each,on:qS,attr:DS,attrTween:ES,style:aA,styleTween:lA,text:hA,textTween:gA,remove:KS,tween:wS,delay:BS,duration:GS,ease:YS,easeVarying:WS,end:yA,[Symbol.iterator]:qe[Symbol.iterator]};function xA(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vA={time:null,delay:0,duration:250,ease:xA};function _A(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function wA(t){var e,n;t instanceof Ve?(e=t._id,t=t._name):(e=Id(),(n=vA).time=bl(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&ma(u,t,e,l,a,n||_A(u,e));return new Ve(r,this._parents,t,e)}Si.prototype.interrupt=xS,Si.prototype.transition=wA;function $A(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ya(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ar(t){return t=ya(Math.abs(t)),t?t[1]:NaN}function SA(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function AA(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var TA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ba(t){if(!(e=TA.exec(t)))throw new Error("invalid format: "+t);var e;return new Sl({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ba.prototype=Sl.prototype;function Sl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Sl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function PA(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Nd;function MA(t,e){var n=ya(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Nd=Math.max(-8,Math.min(8,Math.floor(i/3)))*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")+ya(t,Math.max(0,e+o-1))[0]}function Bd(t,e){var n=ya(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Fd={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:$A,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Bd(t*100,e),r:Bd,s:MA,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Od(t){return t}var Gd=Array.prototype.map,zd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function DA(t){var e=t.grouping===void 0||t.thousands===void 0?Od:SA(Gd.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Od:AA(Gd.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=ba(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,S=f.type;S==="n"?(b=!0,S="g"):Fd[S]||(v===void 0&&(v=12),x=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var $=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",R=g==="$"?r:/[%p]/.test(S)?a:"",T=Fd[S],w=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(_){var N=$,D=R,A,L,M;if(S==="c")D=T(_)+D,_="";else{_=+_;var G=_<0||1/_<0;if(_=isNaN(_)?u:T(Math.abs(_),v),x&&(_=PA(_)),G&&+_==0&&d!=="+"&&(G=!1),N=(G?d==="("?d:s:d==="-"||d==="("?"":d)+N,D=(S==="s"?zd[8+Nd/3]:"")+D+(G&&d==="("?")":""),w){for(A=-1,L=_.length;++A<L;)if(M=_.charCodeAt(A),48>M||M>57){D=(M===46?i+_.slice(A+1):_.slice(A))+D,_=_.slice(0,A);break}}}b&&!m&&(_=e(_,1/0));var O=N.length+_.length+D.length,E=O<y?new Array(y-O+1).join(h):"";switch(b&&m&&(_=e(E+_,E.length?y-D.length:1/0),E=""),p){case"<":_=N+_+D+E;break;case"=":_=N+E+_+D;break;case"^":_=E.slice(0,O=E.length>>1)+N+_+D+E.slice(O);break;default:_=E+N+_+D;break}return o(_)}return P.toString=function(){return f+""},P}function c(f,h){var p=l((f=ba(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Ar(h)/3)))*3,g=Math.pow(10,-d),m=zd[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var xa,Yd,Ud;CA({thousands:",",grouping:[3],currency:["$",""]});function CA(t){return xa=DA(t),Yd=xa.format,Ud=xa.formatPrefix,xa}function LA(t){return Math.max(0,-Ar(Math.abs(t)))}function kA(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ar(e)/3)))*3-Ar(Math.abs(t)))}function RA(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ar(e)-Ar(t))+1}function Wd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function EA(t){return function(){return t}}function IA(t){return+t}var Hd=[0,1];function Tr(t){return t}function Al(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:EA(isNaN(e)?NaN:.5)}function NA(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function BA(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Al(i,r),o=n(a,o)):(r=Al(r,i),o=n(o,a)),function(s){return o(r(s))}}function FA(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Al(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=Vp(t,s,1,r)-1;return o[u](i[u](s))}}function OA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function GA(){var t=Hd,e=Hd,n=yl,r,i,o,a=Tr,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==Tr&&(a=NA(t[0],t[h-1])),s=h>2?FA:BA,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),Se)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,IA),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=aS,c()},f.clamp=function(h){return arguments.length?(a=h?!0:Tr,c()):a!==Tr},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function zA(){return GA()(Tr,Tr)}function YA(t,e,n,r){var i=ew(t,e,n),o;switch(r=ba(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=kA(i,a))&&(r.precision=o),Ud(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=RA(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=LA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Yd(r)}function Xd(t){var e=t.domain;return t.ticks=function(n){var r=e();return tw(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return YA(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=sl(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function jd(){var t=zA();return t.copy=function(){return OA(t,jd())},Wd.apply(t,arguments),Xd(t)}function Vd(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[Vp(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Vd().domain([t,e]).range(i).unknown(o)},Wd.apply(Xd(a),arguments)}function ki(t,e,n){this.k=t,this.x=e,this.y=n}ki.prototype={constructor:ki,scale:function(t){return t===1?this:new ki(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ki(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},ki.prototype;function UA(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function qd(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:UA(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=u*c+u*r,p=l*f+l*r,d=[h,p],g=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:g}})}var Tl=function(t,e){return Tl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Tl(t,e)};function Ne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Tl(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function WA(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(t,[])).next())})}function Zd(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Pr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mr(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Dr(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Cr(t){return this instanceof Cr?(this.v=t,this):new Cr(t)}function HA(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){h(o[0][3],g)}}function l(p){p.value instanceof Cr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){u("next",p)}function f(p){u("throw",p)}function h(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function XA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Pr=="function"?Pr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}function Dt(t){return typeof t=="function"}function Pl(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ml=Pl(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
|
4
4
|
`+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
|
5
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function ga(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Si=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=xr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(Ft(c))try{c()}catch(g){o=g instanceof wl?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=xr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{Hd(d)}catch(g){o=o??[],g instanceof wl?o=$i($i([],wi(o)),wi(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new wl(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Hd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ga(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ga(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Bd=Si.EMPTY;function Wd(t){return t instanceof Si||t&&"closed"in t&&Ft(t.remove)&&Ft(t.add)&&Ft(t.unsubscribe)}function Hd(t){Ft(t)?t():t.unsubscribe()}var Xd={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},bA={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,$i([t,e],wi(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function qd(t){bA.setTimeout(function(){throw t})}function $l(){}function ma(t){t()}var Sl=function(t){ke(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Wd(n)&&n.add(r)):r.destination=wA,r}return e.create=function(n,r,i){return new Ai(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Si),vA=Function.prototype.bind;function Al(t,e){return vA.call(t,e)}var xA=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){ya(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){ya(r)}else ya(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){ya(n)}},t}(),Ai=function(t){ke(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(Ft(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&Xd.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Al(n.next,s),error:n.error&&Al(n.error,s),complete:n.complete&&Al(n.complete,s)}):a=n}return o.destination=new xA(a),o}return e}(Sl);function ya(t){qd(t)}function _A(t){throw t}var wA={closed:!0,next:$l,error:_A,complete:$l},Ml=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function jd(t){return t}function $A(t){return t.length===0?jd:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var cn=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=AA(e)?e:new Ai(e,n,r);return ma(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Vd(n),new n(function(i,o){var a=new Ai({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Ml]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return $A(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Vd(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Vd(t){var e;return(e=t??Xd.Promise)!==null&&e!==void 0?e:Promise}function SA(t){return t&&Ft(t.next)&&Ft(t.error)&&Ft(t.complete)}function AA(t){return t&&t instanceof Sl||SA(t)&&Wd(t)}function MA(t){return Ft(t==null?void 0:t.lift)}function Mi(t){return function(e){if(MA(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Pi(t,e,n,r,i){return new PA(t,e,n,r,i)}var PA=function(t){ke(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Sl),DA=_l(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Di=function(t){ke(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Zd(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new DA},e.prototype.next=function(n){var r=this;ma(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=xr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;ma(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;ma(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Bd:(this.currentObservers=null,s.push(n),new Si(function(){r.currentObservers=null,ga(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new cn;return n.source=this,n},e.create=function(n,r){return new Zd(n,r)},e}(cn),Zd=function(t){ke(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Bd},e}(Di),Kd=function(t){ke(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(Di),Pl={now:function(){return(Pl.delegate||Date).now()},delegate:void 0},TA=function(t){ke(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Pl);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(Di),LA=function(t){ke(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Si),Qd={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,$i([t,e],wi(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},CA=function(t){ke(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Qd.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Qd.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ga(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(LA),Jd=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=Pl.now,t}(),EA=function(t){ke(e,t);function e(n,r){r===void 0&&(r=Jd.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Jd);new EA(CA);var RA=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function kA(t){return Ft(t==null?void 0:t.then)}function IA(t){return Ft(t[Ml])}function NA(t){return Symbol.asyncIterator&&Ft(t==null?void 0:t[Symbol.asyncIterator])}function FA(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zA(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var GA=zA();function OA(t){return Ft(t==null?void 0:t[GA])}function YA(t){return mA(this,arguments,function(){var e,n,r,i;return Ud(this,function(o){switch(o.label){case 0:e=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,_r(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,_r(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,_r(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function UA(t){return Ft(t==null?void 0:t.getReader)}function ba(t){if(t instanceof cn)return t;if(t!=null){if(IA(t))return BA(t);if(RA(t))return WA(t);if(kA(t))return HA(t);if(NA(t))return tg(t);if(OA(t))return XA(t);if(UA(t))return qA(t)}throw FA(t)}function BA(t){return new cn(function(e){var n=t[Ml]();if(Ft(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function WA(t){return new cn(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function HA(t){return new cn(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,qd)})}function XA(t){return new cn(function(e){var n,r;try{for(var i=xr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function tg(t){return new cn(function(e){jA(t,e).catch(function(n){return e.error(n)})})}function qA(t){return tg(YA(t))}function jA(t,e){var n,r,i,o;return gA(this,void 0,void 0,function(){var a,s;return Ud(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=yA(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}_l(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Dl(t,e){return Mi(function(n,r){var i=0;n.subscribe(Pi(r,function(o){r.next(t.call(e,o,i++))}))})}function VA(t,e){return e===void 0&&(e=jd),t=t??ZA,Mi(function(n,r){var i,o=!0;n.subscribe(Pi(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function ZA(t,e){return t===e}function KA(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new Di}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},v=function(){var x=c;y(),x==null||x.unsubscribe()};return Mi(function(x,b){p++,!g&&!d&&m();var S=h=h??n();b.add(function(){p--,p===0&&!g&&!d&&(f=Tl(v,u))}),S.subscribe(b),!c&&p>0&&(c=new Ai({next:function($){return S.next($)},error:function($){g=!0,m(),f=Tl(y,i,$),S.error($)},complete:function(){d=!0,m(),f=Tl(y,a),S.complete()}}),ba(x).subscribe(c))})(l)}}function Tl(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ai({next:function(){i.unsubscribe(),t()}});return ba(e.apply(void 0,$i([],wi(n)))).subscribe(i)}}function QA(t,e,n){var r,i=!1;return r=t,KA({connector:function(){return new TA(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function JA(t,e){return Mi(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(Pi(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;ba(t(u,c)).subscribe(i=Pi(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function t3(t){return Mi(function(e,n){ba(t).subscribe(Pi(n,function(){return n.complete()},$l)),!n.closed&&e.subscribe(n)})}const e3=t=>t.pipe(Dl(e=>e.styles.textSize),VA(),Dl(e=>{let n=NaN;if(typeof e=="string")if(e.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(e)*r}else e.includes("px")&&(n=parseFloat(e));else if(typeof e=="number")return e;return n||14})),eg=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=dr.scaleDomain,scaleRange:i=dr.scaleRange})=>{const o=r[0]??dr.scaleDomain[0],a=r[1]??dr.scaleDomain[1],s=i[0]??dr.scaleRange[0],u=i[1]??dr.scaleRange[1];let l=o==="auto"?e<0?e:0:o==="min"?e:o,c=a==="auto"?t>=0?t:0:a==="max"?t:a;const f=t-(t-l)/(1-s),h=c/u;return Od().domain([f,h]).range([0,n])},ng=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((u,l)=>l);r&&i.reverse();const o=i.length-1+n*2,a=e/o,s=a*n-a*.5;return Yd().domain([s,e-s]).range(i)};function n3({name:t,defaultParams:e,initFn:n}){const r=new Di,i=new WeakMap;let o=()=>{},a;const s=new Kd(e),u=new Kd({}),l=s.pipe(JA(c=>u.pipe(t3(r),Dl(f=>vl(f,c)))),QA(1));return{params$:u,name:t,defaultParams:e,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:c=>{s.next(vl(c,e))},setContext:c=>{a=c,a.observer.fullParams$=l}}}const Ti=()=>function(t,e){return function(n){return class{constructor(){const r=n3({name:t,defaultParams:e,initFn:n});this.params$=r.params$,this.name=r.name,this.defaultParams=r.defaultParams,this.init=r.init,this.destroy=r.destroy,this.setPresetParams=r.setPresetParams,this.setContext=r.setContext}}}},En=Ti(),se=Ti(),pe=Ti(),r3=Ti(),rg=Ti();function _t(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ig(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function va(t){let e,n,r;t.length!==2?(e=_t,n=(s,u)=>_t(t(s),u),r=(s,u)=>t(s)-u):(e=t===_t||t===ig?t:i3,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function i3(){return 0}function xa(t){return t===null?NaN:+t}function*o3(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const og=va(_t),ag=og.right,a3=og.left,s3=va(xa).center,Rn=ag;function u3(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=Ll(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const sg=ug(Ll),l3=ug(c3);function ug(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const s=n&&t(n),u=r&&t(r),l=i.slice();return s&&u?(wr(s,l,i,o,a),wr(s,i,l,o,a),wr(s,l,i,o,a),$r(u,i,l,o,a),$r(u,l,i,o,a),$r(u,i,l,o,a)):s?(wr(s,i,l,o,a),wr(s,l,i,o,a),wr(s,i,l,o,a)):u&&($r(u,i,l,o,a),$r(u,l,i,o,a),$r(u,i,l,o,a)),e}}function wr(t,e,n,r,i){for(let o=0,a=r*i;o<a;)t(e,n,o,o+=r,1)}function $r(t,e,n,r,i){for(let o=0,a=r*i;o<r;++o)t(e,n,o,o+a,r)}function c3(t){const e=Ll(t);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,e(n,r,i+0,o+0,a),e(n,r,i+1,o+1,a),e(n,r,i+2,o+2,a),e(n,r,i+3,o+3,a)}}function Ll(t){const e=Math.floor(t);if(e===t)return f3(t);const n=t-e,r=2*t+1;return(i,o,a,s,u)=>{if(!((s-=u)>=a))return;let l=e*o[a];const c=u*e,f=c+u;for(let h=a,p=a+c;h<p;h+=u)l+=o[Math.min(s,h)];for(let h=a,p=s;h<=p;h+=u)l+=o[Math.min(s,h+c)],i[h]=(l+n*(o[Math.max(a,h-f)]+o[Math.min(s,h+f)]))/r,l-=o[Math.max(a,h-c)]}}function f3(t){const e=2*t+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let l=i,c=i+u;l<c;l+=a)s+=r[Math.min(o,l)];for(let l=i,c=o;l<=c;l+=a)s+=r[Math.min(o,l+u)],n[l]=s/e,s-=r[Math.max(i,l-u)]}}function _a(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function h3(t){return t.length|0}function p3(t){return!(t>0)}function d3(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function g3(t){return e=>t(...e)}function m3(...t){const e=typeof t[t.length-1]=="function"&&g3(t.pop());t=t.map(d3);const n=t.map(h3),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(p3))return o;for(;;){o.push(i.map((s,u)=>t[u][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return e?o.map(e):o;i[a--]=0}}}function y3(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?i=>n+=+i||0:i=>n+=+e(i,r++,t)||0)}function lg(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function cg(t,e){const n=lg(t,e);return n&&Math.sqrt(n)}function Li(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Tt{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function b3(t,e){const n=new Tt;if(e===void 0)for(let r of t)(r=+r)&&n.add(r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function v3(t,e){const n=new Tt;let r=-1;return Float64Array.from(t,e===void 0?i=>n.add(+i||0):i=>n.add(+e(i,++r,t)||0))}class Ci extends Map{constructor(e,n=pg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Cl(this,e))}has(e){return super.has(Cl(this,e))}set(e,n){return super.set(fg(this,e),n)}delete(e){return super.delete(hg(this,e))}}class kn extends Set{constructor(e,n=pg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(Cl(this,e))}add(e){return super.add(fg(this,e))}delete(e){return super.delete(hg(this,e))}}function Cl({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function fg({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function hg({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function pg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Sr(t){return t}function dg(t,...e){return Ar(t,Sr,Sr,e)}function gg(t,...e){return Ar(t,Array.from,Sr,e)}function mg(t,e){for(let n=1,r=e.length;n<r;++n)t=t.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return t}function x3(t,...e){return mg(gg(t,...e),e)}function _3(t,e,...n){return mg(bg(t,e,...n),n)}function yg(t,e,...n){return Ar(t,Sr,e,n)}function bg(t,e,...n){return Ar(t,Array.from,e,n)}function w3(t,...e){return Ar(t,Sr,vg,e)}function $3(t,...e){return Ar(t,Array.from,vg,e)}function vg(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Ar(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new Ci,u=r[a++];let l=-1;for(const c of o){const f=u(c,++l,o),h=s.get(f);h?h.push(c):s.set(f,[c])}for(const[c,f]of s)s.set(c,i(f,a));return e(s)}(t,0)}function xg(t,e){return Array.from(e,n=>t[n])}function El(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=Mr(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>Mr(n[i],n[o]))),xg(t,r)}return t.sort(Rl(n))}function Rl(t=_t){if(t===_t)return Mr;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Mr(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function S3(t,e,n){return(e.length!==2?El(yg(t,e,n),([r,i],[o,a])=>_t(i,a)||_t(r,o)):El(dg(t,n),([r,i],[o,a])=>e(i,a)||_t(r,o))).map(([r])=>r)}var A3=Array.prototype,M3=A3.slice;function kl(t){return()=>t}const P3=Math.sqrt(50),D3=Math.sqrt(10),T3=Math.sqrt(2);function wa(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=P3?10:o>=D3?5:o>=T3?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?wa(t,e,n*2):[s,u,l]}function In(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?wa(e,t,n):wa(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function Nn(t,e,n){return e=+e,t=+t,n=+n,wa(t,e,n)[2]}function $a(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Nn(e,t,n):Nn(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Il(t,e,n){let r;for(;;){const i=Nn(t,e,n);if(i===r||i===0||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function Nl(t){return Math.max(1,Math.ceil(Math.log(_a(t))/Math.LN2)+1)}function _g(){var t=Sr,e=Li,n=Nl;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,u,l=new Array(a);for(o=0;o<a;++o)l[o]=t(i[o],o,i);var c=e(l),f=c[0],h=c[1],p=n(l,f,h);if(!Array.isArray(p)){const x=h,b=+p;if(e===Li&&([f,h]=Il(f,h,b)),p=In(f,h,b),p[0]<=f&&(u=Nn(f,h,b)),p[p.length-1]>=h)if(x>=h&&e===Li){const S=Nn(f,h,b);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}else p.pop()}for(var d=p.length,g=0,m=d;p[g]<=f;)++g;for(;p[m-1]>h;)--m;(g||m<d)&&(p=p.slice(g,m),d=m-g);var y=new Array(d+1),v;for(o=0;o<=d;++o)v=y[o]=[],v.x0=o>0?p[o-1]:f,v.x1=o<d?p[o]:h;if(isFinite(u)){if(u>0)for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[Math.min(d,Math.floor((s-f)/u))].push(i[o]);else if(u<0){for(o=0;o<a;++o)if((s=l[o])!=null&&f<=s&&s<=h){const x=Math.floor((f-s)*u);y[Math.min(d,x+(p[x]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[Rn(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:kl(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:kl([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:kl(Array.isArray(i)?M3.call(i):i),r):n},r}function Ei(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Fl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Sa(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function zl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Aa(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?Mr:Rl(i);r>n;){if(r-n>600){const u=r-n+1,l=e-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(e-l*f/u+h)),d=Math.min(r,Math.floor(e+(u-l)*f/u+h));Aa(t,e,p,d,i)}const o=t[e];let a=n,s=r;for(Ri(t,n,e),i(t[r],o)>0&&Ri(t,n,r);a<s;){for(Ri(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Ri(t,n,s):(++s,Ri(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Ri(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function wg(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)>0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function ki(t,e,n){if(t=Float64Array.from(o3(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Sa(t);if(e>=1)return Ei(t);var r,i=(r-1)*e,o=Math.floor(i),a=Ei(Aa(t,o).subarray(0,o+1)),s=Sa(t.subarray(o+1));return a+(s-a)*(i-o)}}function $g(t,e,n=xa){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function Sg(t,e,n=xa){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,u)=>xa(n(t[u],u,t))),e<=0)return zl(r);if(e>=1)return Fl(r);var r,i=Uint32Array.from(t,(s,u)=>u),o=r.length-1,a=Math.floor(o*e);return Aa(i,a,0,o,(s,u)=>Mr(r[s],r[u])),a=wg(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function L3(t,e,n){const r=_a(t),i=ki(t,.75)-ki(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function C3(t,e,n){const r=_a(t),i=cg(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function E3(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function R3(t,e){return ki(t,.5,e)}function k3(t,e){return Sg(t,.5,e)}function*I3(t){for(const e of t)yield*e}function Gl(t){return Array.from(I3(t))}function N3(t,e){const n=new Ci;if(e===void 0)for(let o of t)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of t)(a=e(a,++o,t))!=null&&a>=a&&n.set(a,(n.get(a)||0)+1)}let r,i=0;for(const[o,a]of n)a>i&&(i=a,r=o);return r}function F3(t,e=z3){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function z3(t,e){return[t,e]}function fn(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function G3(t,e=_t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t);const r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=_t);const i=(s,u)=>e(n[s],n[u]);let o,a;return t=Uint32Array.from(n,(s,u)=>u),t.sort(e===_t?(s,u)=>Mr(n[s],n[u]):Rl(i)),t.forEach((s,u)=>{const l=i(s,o===void 0?s:o);l>=0?((o===void 0||l>0)&&(o=s,a=u),r[s]=a):r[s]=NaN}),r}function O3(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)<0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function Ag(t,e=_t){if(e.length===1)return zl(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)<0)&&(n=o,r=i);return r}function Y3(t,e=_t){if(e.length===1)return Fl(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)>0)&&(n=o,r=i);return r}function U3(t,e){const n=Ag(t,e);return n<0?void 0:n}const B3=Mg(Math.random);function Mg(t){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=t()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function Pg(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Dg(t){if(!(o=t.length))return[];for(var e=-1,n=Sa(t,W3),r=new Array(n);++e<n;)for(var i=-1,o,a=r[e]=new Array(o);++i<o;)a[i]=t[i][e];return r}function W3(t){return t.length}function H3(){return Dg(arguments)}function X3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(!e(r,++n,t))return!1;return!0}function q3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(e(r,++n,t))return!0;return!1}function j3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of t)e(i,++r,t)&&n.push(i);return n}function V3(t,e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof e!="function")throw new TypeError("mapper is not a function");return Array.from(t,(n,r)=>e(n,r,t))}function Z3(t,e,n){if(typeof e!="function")throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:n}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)n=e(n,o,++a,t);return n}function K3(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function Q3(t,...e){t=new kn(t);for(const n of e)for(const r of n)t.delete(r);return t}function J3(t,e){const n=e[Symbol.iterator](),r=new kn;for(const i of t){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function t5(t,...e){t=new kn(t),e=e.map(e5);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function e5(t){return t instanceof kn?t:new kn(t)}function Tg(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=Lg(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=Lg(a);if(r.add(u),Object.is(o,u))break}}return!0}function Lg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function n5(t,e){return Tg(e,t)}function r5(...t){const e=new kn;for(const n of t)for(const r of n)e.add(r);return e}function i5(t){return t}var Ma=1,Pa=2,Ol=3,Ii=4,Cg=1e-6;function o5(t){return"translate("+t+",0)"}function a5(t){return"translate(0,"+t+")"}function s5(t){return e=>+t(e)}function u5(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function l5(){return!this.__axis}function Da(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===Ma||t===Ii?-1:1,c=t===Ii||t===Pa?"x":"y",f=t===Ma||t===Ol?o5:a5;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=i??(e.tickFormat?e.tickFormat.apply(e,n):i5),m=Math.max(o,0)+s,y=e.range(),v=+y[0]+u,x=+y[y.length-1]+u,b=(e.bandwidth?u5:s5)(e.copy(),u),S=p.selection?p.selection():p,$=S.selectAll(".domain").data([null]),E=S.selectAll(".tick").data(d,e).order(),M=E.exit(),w=E.enter().append("g").attr("class","tick"),P=E.select("line"),_=E.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(w),P=P.merge(w.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),_=_.merge(w.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",t===Ma?"0em":t===Ol?"0.71em":"0.32em")),p!==S&&($=$.transition(p),E=E.transition(p),P=P.transition(p),_=_.transition(p),M=M.transition(p).attr("opacity",Cg).attr("transform",function(N){return isFinite(N=b(N))?f(N+u):this.getAttribute("transform")}),w.attr("opacity",Cg).attr("transform",function(N){var T=this.parentNode.__axis;return f((T&&isFinite(T=T(N))?T:b(N))+u)})),M.remove(),$.attr("d",t===Ii||t===Pa?a?"M"+l*a+","+v+"H"+u+"V"+x+"H"+l*a:"M"+u+","+v+"V"+x:a?"M"+v+","+l*a+"V"+u+"H"+x+"V"+l*a:"M"+v+","+u+"H"+x),E.attr("opacity",1).attr("transform",function(N){return f(b(N)+u)}),P.attr(c+"2",l*o),_.attr(c,l*m).text(g),S.filter(l5).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Pa?"start":t===Ii?"end":"middle"),S.each(function(){this.__axis=b})}return h.scale=function(p){return arguments.length?(e=p,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(o=a=+p,h):o},h.tickSizeInner=function(p){return arguments.length?(o=+p,h):o},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(s=+p,h):s},h.offset=function(p){return arguments.length?(u=+p,h):u},h}function c5(t){return Da(Ma,t)}function f5(t){return Da(Pa,t)}function Eg(t){return Da(Ol,t)}function Rg(t){return Da(Ii,t)}var h5={value:()=>{}};function Fn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ta(n)}function Ta(t){this._=t}function p5(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ta.prototype=Fn.prototype={constructor:Ta,on:function(t,e){var n=this._,r=p5(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=d5(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=kg(n[i],t.name,e);else if(e==null)for(i in n)n[i]=kg(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ta(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function d5(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function kg(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=h5,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Yl="http://www.w3.org/1999/xhtml";const Ul={svg:"http://www.w3.org/2000/svg",xhtml:Yl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ni(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ul.hasOwnProperty(e)?{space:Ul[e],local:t}:t}function g5(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Yl&&e.documentElement.namespaceURI===Yl?e.createElement(t):e.createElementNS(n,t)}}function m5(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function La(t){var e=Ni(t);return(e.local?m5:g5)(e)}function y5(){}function Ca(t){return t==null?y5:function(){return this.querySelector(t)}}function b5(t){typeof t!="function"&&(t=Ca(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new Wt(r,this._parents)}function Ig(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function v5(){return[]}function Bl(t){return t==null?v5:function(){return this.querySelectorAll(t)}}function x5(t){return function(){return Ig(t.apply(this,arguments))}}function _5(t){typeof t=="function"?t=x5(t):t=Bl(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new Wt(r,i)}function Wl(t){return function(){return this.matches(t)}}function Ng(t){return function(e){return e.matches(t)}}var w5=Array.prototype.find;function $5(t){return function(){return w5.call(this.children,t)}}function S5(){return this.firstElementChild}function A5(t){return this.select(t==null?S5:$5(typeof t=="function"?t:Ng(t)))}var M5=Array.prototype.filter;function P5(){return Array.from(this.children)}function D5(t){return function(){return M5.call(this.children,t)}}function T5(t){return this.selectAll(t==null?P5:D5(typeof t=="function"?t:Ng(t)))}function L5(t){typeof t!="function"&&(t=Wl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Wt(r,this._parents)}function Fg(t){return new Array(t.length)}function C5(){return new Wt(this._enter||this._groups.map(Fg),this._parents)}function Ea(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ea.prototype={constructor:Ea,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function E5(t){return function(){return t}}function R5(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ea(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function k5(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new Ea(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function I5(t){return t.__data__}function N5(t,e){if(!arguments.length)return Array.from(this,I5);var n=e?k5:R5,r=this._parents,i=this._groups;typeof t!="function"&&(t=E5(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=F5(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var v=0,x=0,b,S;v<d;++v)if(b=g[v]){for(v>=x&&(x=v+1);!(S=m[x])&&++x<d;);b._next=S||null}}return a=new Wt(a,r),a._enter=s,a._exit=u,a}function F5(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function z5(){return new Wt(this._exit||this._groups.map(Fg),this._parents)}function G5(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function O5(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new Wt(s,this._parents)}function Y5(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function U5(t){t||(t=B5);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new Wt(i,this._parents).order()}function B5(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function W5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function H5(){return Array.from(this)}function X5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function q5(){let t=0;for(const e of this)++t;return t}function j5(){return!this.node()}function V5(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function Z5(t){return function(){this.removeAttribute(t)}}function K5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Q5(t,e){return function(){this.setAttribute(t,e)}}function J5(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function t6(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function e6(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function n6(t,e){var n=Ni(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?K5:Z5:typeof e=="function"?n.local?e6:t6:n.local?J5:Q5)(n,e))}function Hl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function r6(t){return function(){this.style.removeProperty(t)}}function i6(t,e,n){return function(){this.style.setProperty(t,e,n)}}function o6(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function a6(t,e,n){return arguments.length>1?this.each((e==null?r6:typeof e=="function"?o6:i6)(t,e,n??"")):zn(this.node(),t)}function zn(t,e){return t.style.getPropertyValue(e)||Hl(t).getComputedStyle(t,null).getPropertyValue(e)}function s6(t){return function(){delete this[t]}}function u6(t,e){return function(){this[t]=e}}function l6(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function c6(t,e){return arguments.length>1?this.each((e==null?s6:typeof e=="function"?l6:u6)(t,e)):this.node()[t]}function zg(t){return t.trim().split(/^|\s+/)}function Xl(t){return t.classList||new Gg(t)}function Gg(t){this._node=t,this._names=zg(t.getAttribute("class")||"")}Gg.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Og(t,e){for(var n=Xl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Yg(t,e){for(var n=Xl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function f6(t){return function(){Og(this,t)}}function h6(t){return function(){Yg(this,t)}}function p6(t,e){return function(){(e.apply(this,arguments)?Og:Yg)(this,t)}}function d6(t,e){var n=zg(t+"");if(arguments.length<2){for(var r=Xl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?p6:e?f6:h6)(n,e))}function g6(){this.textContent=""}function m6(t){return function(){this.textContent=t}}function y6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function b6(t){return arguments.length?this.each(t==null?g6:(typeof t=="function"?y6:m6)(t)):this.node().textContent}function v6(){this.innerHTML=""}function x6(t){return function(){this.innerHTML=t}}function _6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function w6(t){return arguments.length?this.each(t==null?v6:(typeof t=="function"?_6:x6)(t)):this.node().innerHTML}function $6(){this.nextSibling&&this.parentNode.appendChild(this)}function S6(){return this.each($6)}function A6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M6(){return this.each(A6)}function P6(t){var e=typeof t=="function"?t:La(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function D6(){return null}function T6(t,e){var n=typeof t=="function"?t:La(t),r=e==null?D6:typeof e=="function"?e:Ca(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function L6(){var t=this.parentNode;t&&t.removeChild(this)}function C6(){return this.each(L6)}function E6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function R6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function k6(t){return this.select(t?R6:E6)}function I6(t){return arguments.length?this.property("__data__",t):this.node().__data__}function N6(t){return function(e){t.call(this,e,this.__data__)}}function F6(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function z6(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function G6(t,e,n){return function(){var r=this.__on,i,o=N6(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function O6(t,e,n){var r=F6(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?G6:z6,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function Ug(t,e,n){var r=Hl(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Y6(t,e){return function(){return Ug(this,t,e)}}function U6(t,e){return function(){return Ug(this,t,e.apply(this,arguments))}}function B6(t,e){return this.each((typeof e=="function"?U6:Y6)(t,e))}function*W6(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var ql=[null];function Wt(t,e){this._groups=t,this._parents=e}function Gn(){return new Wt([[document.documentElement]],ql)}function H6(){return this}Wt.prototype=Gn.prototype={constructor:Wt,select:b5,selectAll:_5,selectChild:A5,selectChildren:T5,filter:L5,data:N5,enter:C5,exit:z5,join:G5,merge:O5,selection:H6,order:Y5,sort:U5,call:W5,nodes:H5,node:X5,size:q5,empty:j5,each:V5,attr:n6,style:a6,property:c6,classed:d6,text:b6,html:w6,raise:S6,lower:M6,append:P6,insert:T6,remove:C6,clone:k6,datum:I6,on:O6,dispatch:B6,[Symbol.iterator]:W6};function j(t){return typeof t=="string"?new Wt([[document.querySelector(t)]],[document.documentElement]):new Wt([[t]],ql)}function X6(t){return j(La(t).call(document.documentElement))}var q6=0;function Bg(){return new jl}function jl(){this._="@"+(++q6).toString(36)}jl.prototype=Bg.prototype={constructor:jl,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function Wg(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ue(t,e){if(t=Wg(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function j6(t,e){return t.target&&(t=Wg(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>ue(n,e))}function V6(t){return typeof t=="string"?new Wt([document.querySelectorAll(t)],[document.documentElement]):new Wt([Ig(t)],ql)}const Z6={passive:!1},Fi={capture:!0,passive:!1};function Vl(t){t.stopImmediatePropagation()}function Pr(t){t.preventDefault(),t.stopImmediatePropagation()}function Ra(t){var e=t.document.documentElement,n=j(t).on("dragstart.drag",Pr,Fi);"onselectstart"in e?n.on("selectstart.drag",Pr,Fi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function ka(t,e){var n=t.document.documentElement,r=j(t).on("dragstart.drag",null);e&&(r.on("click.drag",Pr,Fi),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ia=t=>()=>t;function Zl(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}Zl.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function K6(t){return!t.ctrlKey&&!t.button}function Q6(){return this.parentNode}function J6(t,e){return e??{x:t.x,y:t.y}}function t8(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hg(){var t=K6,e=Q6,n=J6,r=t8,i={},o=Fn("start","drag","end"),a=0,s,u,l,c,f=0;function h(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,Z6).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,S){if(!(c||!t.call(this,b,S))){var $=x(this,e.call(this,b,S),b,S,"mouse");$&&(j(b.view).on("mousemove.drag",d,Fi).on("mouseup.drag",g,Fi),Ra(b.view),Vl(b),l=!1,s=b.clientX,u=b.clientY,$("start",b))}}function d(b){if(Pr(b),!l){var S=b.clientX-s,$=b.clientY-u;l=S*S+$*$>f}i.mouse("drag",b)}function g(b){j(b.view).on("mousemove.drag mouseup.drag",null),ka(b.view,l),Pr(b),i.mouse("end",b)}function m(b,S){if(t.call(this,b,S)){var $=b.changedTouches,E=e.call(this,b,S),M=$.length,w,P;for(w=0;w<M;++w)(P=x(this,E,b,S,$[w].identifier,$[w]))&&(Vl(b),P("start",b,$[w]))}}function y(b){var S=b.changedTouches,$=S.length,E,M;for(E=0;E<$;++E)(M=i[S[E].identifier])&&(Pr(b),M("drag",b,S[E]))}function v(b){var S=b.changedTouches,$=S.length,E,M;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),E=0;E<$;++E)(M=i[S[E].identifier])&&(Vl(b),M("end",b,S[E]))}function x(b,S,$,E,M,w){var P=o.copy(),_=ue(w||$,S),N,T,A;if((A=n.call(b,new Zl("beforestart",{sourceEvent:$,target:h,identifier:M,active:a,x:_[0],y:_[1],dx:0,dy:0,dispatch:P}),E))!=null)return N=A.x-_[0]||0,T=A.y-_[1]||0,function C(D,O,G){var k=_,R;switch(D){case"start":i[M]=C,R=a++;break;case"end":delete i[M],--a;case"drag":_=ue(G||O,S),R=a;break}P.call(D,b,new Zl(D,{sourceEvent:O,subject:A,target:h,identifier:M,active:R,x:_[0]+N,y:_[1]+T,dx:_[0]-k[0],dy:_[1]-k[1],dispatch:P}),E)}}return h.filter=function(b){return arguments.length?(t=typeof b=="function"?b:Ia(!!b),h):t},h.container=function(b){return arguments.length?(e=typeof b=="function"?b:Ia(b),h):e},h.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Ia(b),h):n},h.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Ia(!!b),h):r},h.on=function(){var b=o.on.apply(o,arguments);return b===o?h:b},h.clickDistance=function(b){return arguments.length?(f=(b=+b)*b,h):Math.sqrt(f)},h}function Dr(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function hn(){}var On=.7,Tr=1/On,Lr="\\s*([+-]?\\d+)\\s*",Gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ie="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e8=/^#([0-9a-f]{3,8})$/,n8=new RegExp(`^rgb\\(${Lr},${Lr},${Lr}\\)$`),r8=new RegExp(`^rgb\\(${Ie},${Ie},${Ie}\\)$`),i8=new RegExp(`^rgba\\(${Lr},${Lr},${Lr},${Gi}\\)$`),o8=new RegExp(`^rgba\\(${Ie},${Ie},${Ie},${Gi}\\)$`),a8=new RegExp(`^hsl\\(${Gi},${Ie},${Ie}\\)$`),s8=new RegExp(`^hsla\\(${Gi},${Ie},${Ie},${Gi}\\)$`),Xg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Dr(hn,pn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:qg,formatHex:qg,formatHex8:u8,formatHsl:l8,formatRgb:jg,toString:jg});function qg(){return this.rgb().formatHex()}function u8(){return this.rgb().formatHex8()}function l8(){return Jg(this).formatHsl()}function jg(){return this.rgb().formatRgb()}function pn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=e8.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Vg(e):n===3?new Et(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Na(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Na(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=n8.exec(t))?new Et(e[1],e[2],e[3],1):(e=r8.exec(t))?new Et(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=i8.exec(t))?Na(e[1],e[2],e[3],e[4]):(e=o8.exec(t))?Na(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=a8.exec(t))?Qg(e[1],e[2]/100,e[3]/100,1):(e=s8.exec(t))?Qg(e[1],e[2]/100,e[3]/100,e[4]):Xg.hasOwnProperty(t)?Vg(Xg[t]):t==="transparent"?new Et(NaN,NaN,NaN,0):null}function Vg(t){return new Et(t>>16&255,t>>8&255,t&255,1)}function Na(t,e,n,r){return r<=0&&(t=e=n=NaN),new Et(t,e,n,r)}function Kl(t){return t instanceof hn||(t=pn(t)),t?(t=t.rgb(),new Et(t.r,t.g,t.b,t.opacity)):new Et}function Cr(t,e,n,r){return arguments.length===1?Kl(t):new Et(t,e,n,r??1)}function Et(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Dr(Et,Cr,zi(hn,{brighter(t){return t=t==null?Tr:Math.pow(Tr,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?On:Math.pow(On,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Et(Yn(this.r),Yn(this.g),Yn(this.b),Fa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zg,formatHex:Zg,formatHex8:c8,formatRgb:Kg,toString:Kg}));function Zg(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}`}function c8(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}${Un((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kg(){const t=Fa(this.opacity);return`${t===1?"rgb(":"rgba("}${Yn(this.r)}, ${Yn(this.g)}, ${Yn(this.b)}${t===1?")":`, ${t})`}`}function Fa(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Yn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Un(t){return t=Yn(t),(t<16?"0":"")+t.toString(16)}function Qg(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ae(t,e,n,r)}function Jg(t){if(t instanceof Ae)return new Ae(t.h,t.s,t.l,t.opacity);if(t instanceof hn||(t=pn(t)),!t)return new Ae;if(t instanceof Ae)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Ae(a,s,u,t.opacity)}function za(t,e,n,r){return arguments.length===1?Jg(t):new Ae(t,e,n,r??1)}function Ae(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Dr(Ae,za,zi(hn,{brighter(t){return t=t==null?Tr:Math.pow(Tr,t),new Ae(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?On:Math.pow(On,t),new Ae(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Et(Ql(t>=240?t-240:t+120,i,r),Ql(t,i,r),Ql(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ae(t0(this.h),Ga(this.s),Ga(this.l),Fa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Fa(this.opacity);return`${t===1?"hsl(":"hsla("}${t0(this.h)}, ${Ga(this.s)*100}%, ${Ga(this.l)*100}%${t===1?")":`, ${t})`}`}}));function t0(t){return t=(t||0)%360,t<0?t+360:t}function Ga(t){return Math.max(0,Math.min(1,t||0))}function Ql(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const e0=Math.PI/180,n0=180/Math.PI,Oa=18,r0=.96422,i0=1,o0=.82521,a0=4/29,Er=6/29,s0=3*Er*Er,f8=Er*Er*Er;function u0(t){if(t instanceof Me)return new Me(t.l,t.a,t.b,t.opacity);if(t instanceof Ne)return c0(t);t instanceof Et||(t=Kl(t));var e=nc(t.r),n=nc(t.g),r=nc(t.b),i=Jl((.2225045*e+.7168786*n+.0606169*r)/i0),o,a;return e===n&&n===r?o=a=i:(o=Jl((.4360747*e+.3850649*n+.1430804*r)/r0),a=Jl((.0139322*e+.0971045*n+.7141733*r)/o0)),new Me(116*i-16,500*(o-i),200*(i-a),t.opacity)}function h8(t,e){return new Me(t,0,0,e??1)}function Ya(t,e,n,r){return arguments.length===1?u0(t):new Me(t,e,n,r??1)}function Me(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Dr(Me,Ya,zi(hn,{brighter(t){return new Me(this.l+Oa*(t??1),this.a,this.b,this.opacity)},darker(t){return new Me(this.l-Oa*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=r0*tc(e),t=i0*tc(t),n=o0*tc(n),new Et(ec(3.1338561*e-1.6168667*t-.4906146*n),ec(-.9787684*e+1.9161415*t+.033454*n),ec(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function Jl(t){return t>f8?Math.pow(t,1/3):t/s0+a0}function tc(t){return t>Er?t*t*t:s0*(t-a0)}function ec(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function l0(t){if(t instanceof Ne)return new Ne(t.h,t.c,t.l,t.opacity);if(t instanceof Me||(t=u0(t)),t.a===0&&t.b===0)return new Ne(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*n0;return new Ne(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function p8(t,e,n,r){return arguments.length===1?l0(t):new Ne(n,e,t,r??1)}function Ua(t,e,n,r){return arguments.length===1?l0(t):new Ne(t,e,n,r??1)}function Ne(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function c0(t){if(isNaN(t.h))return new Me(t.l,0,0,t.opacity);var e=t.h*e0;return new Me(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Dr(Ne,Ua,zi(hn,{brighter(t){return new Ne(this.h,this.c,this.l+Oa*(t??1),this.opacity)},darker(t){return new Ne(this.h,this.c,this.l-Oa*(t??1),this.opacity)},rgb(){return c0(this).rgb()}}));var f0=-.14861,rc=1.78277,ic=-.29227,Ba=-.90649,Oi=1.97294,h0=Oi*Ba,p0=Oi*rc,d0=rc*ic-Ba*f0;function d8(t){if(t instanceof Bn)return new Bn(t.h,t.s,t.l,t.opacity);t instanceof Et||(t=Kl(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(d0*r+h0*e-p0*n)/(d0+h0-p0),o=r-i,a=(Oi*(n-i)-ic*o)/Ba,s=Math.sqrt(a*a+o*o)/(Oi*i*(1-i)),u=s?Math.atan2(a,o)*n0-120:NaN;return new Bn(u<0?u+360:u,s,i,t.opacity)}function Pe(t,e,n,r){return arguments.length===1?d8(t):new Bn(t,e,n,r??1)}function Bn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Dr(Bn,Pe,zi(hn,{brighter(t){return t=t==null?Tr:Math.pow(Tr,t),new Bn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?On:Math.pow(On,t),new Bn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*e0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Et(255*(e+n*(f0*r+rc*i)),255*(e+n*(ic*r+Ba*i)),255*(e+n*(Oi*r)),this.opacity)}}));function g0(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function m0(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return g0((n-r/e)*e,a,i,o,s)}}function y0(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return g0((n-r/e)*e,i,o,a,s)}}const Wa=t=>()=>t;function b0(t,e){return function(n){return t+n*e}}function g8(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Ha(t,e){var n=e-t;return n?b0(t,n>180||n<-180?n-360*Math.round(n/360):n):Wa(isNaN(t)?e:t)}function m8(t){return(t=+t)==1?Rt:function(e,n){return n-e?g8(e,n,t):Wa(isNaN(e)?n:e)}}function Rt(t,e){var n=e-t;return n?b0(t,n):Wa(isNaN(t)?e:t)}const Yi=function t(e){var n=m8(e);function r(i,o){var a=n((i=Cr(i)).r,(o=Cr(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=Rt(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function v0(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Cr(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(u){return s.r=r(u),s.g=i(u),s.b=o(u),s+""}}}var x0=v0(m0),y8=v0(y0);function oc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function _0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function b8(t,e){return(_0(e)?oc:w0)(t,e)}function w0(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=je(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function $0(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function de(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function S0(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=je(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var ac=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sc=new RegExp(ac.source,"g");function v8(t){return function(){return t}}function x8(t){return function(e){return t(e)+""}}function uc(t,e){var n=ac.lastIndex=sc.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=ac.exec(t))&&(i=sc.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:de(r,i)})),n=sc.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?x8(u[0].x):v8(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function je(t,e){var n=typeof e,r;return e==null||n==="boolean"?Wa(e):(n==="number"?de:n==="string"?(r=pn(e))?(e=r,Yi):uc:e instanceof pn?Yi:e instanceof Date?$0:_0(e)?oc:Array.isArray(e)?w0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?S0:de)(t,e)}function _8(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function w8(t,e){var n=Ha(+t,+e);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Xa(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var A0=180/Math.PI,lc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function M0(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*A0,skewX:Math.atan(u)*A0,scaleX:a,scaleY:s}}var qa;function $8(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?lc:M0(e.a,e.b,e.c,e.d,e.e,e.f)}function S8(t){return t==null||(qa||(qa=document.createElementNS("http://www.w3.org/2000/svg","g")),qa.setAttribute("transform",t),!(t=qa.transform.baseVal.consolidate()))?lc:(t=t.matrix,M0(t.a,t.b,t.c,t.d,t.e,t.f))}function P0(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:de(l,f)},{i:g-2,x:de(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:de(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:de(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:de(l,f)},{i:g-2,x:de(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var D0=P0($8,"px, ","px)","deg)"),T0=P0(S8,", ",")",")"),A8=1e-12;function L0(t){return((t=Math.exp(t))+1/t)/2}function M8(t){return((t=Math.exp(t))-1/t)/2}function P8(t){return((t=Math.exp(2*t))-1)/(t+1)}const C0=function t(e,n,r){function i(o,a){var s=o[0],u=o[1],l=o[2],c=a[0],f=a[1],h=a[2],p=c-s,d=f-u,g=p*p+d*d,m,y;if(g<A8)y=Math.log(h/l)/e,m=function(E){return[s+E*p,u+E*d,l*Math.exp(e*E*y)]};else{var v=Math.sqrt(g),x=(h*h-l*l+r*g)/(2*l*n*v),b=(h*h-l*l-r*g)/(2*h*n*v),S=Math.log(Math.sqrt(x*x+1)-x),$=Math.log(Math.sqrt(b*b+1)-b);y=($-S)/e,m=function(E){var M=E*y,w=L0(S),P=l/(n*v)*(w*P8(e*M+S)-M8(S));return[s+P*p,u+P*d,l*w/L0(e*M+S)]}}return m.duration=y*1e3*e/Math.SQRT2,m}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,u=s*s;return t(a,s,u)},i}(Math.SQRT2,2,4);function E0(t){return function(e,n){var r=t((e=za(e)).h,(n=za(n)).h),i=Rt(e.s,n.s),o=Rt(e.l,n.l),a=Rt(e.opacity,n.opacity);return function(s){return e.h=r(s),e.s=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const D8=E0(Ha);var T8=E0(Rt);function L8(t,e){var n=Rt((t=Ya(t)).l,(e=Ya(e)).l),r=Rt(t.a,e.a),i=Rt(t.b,e.b),o=Rt(t.opacity,e.opacity);return function(a){return t.l=n(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function R0(t){return function(e,n){var r=t((e=Ua(e)).h,(n=Ua(n)).h),i=Rt(e.c,n.c),o=Rt(e.l,n.l),a=Rt(e.opacity,n.opacity);return function(s){return e.h=r(s),e.c=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const C8=R0(Ha);var E8=R0(Rt);function k0(t){return function e(n){n=+n;function r(i,o){var a=t((i=Pe(i)).h,(o=Pe(o)).h),s=Rt(i.s,o.s),u=Rt(i.l,o.l),l=Rt(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=u(Math.pow(c,n)),i.opacity=l(c),i+""}}return r.gamma=e,r}(1)}const R8=k0(Ha);var ja=k0(Rt);function I0(t,e){e===void 0&&(e=t,t=je);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function k8(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Rr=0,Ui=0,Bi=0,N0=1e3,Va,Wi,Za=0,Wn=0,Ka=0,Hi=typeof performance=="object"&&performance.now?performance:Date,F0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xi(){return Wn||(F0(I8),Wn=Hi.now()+Ka)}function I8(){Wn=0}function qi(){this._call=this._time=this._next=null}qi.prototype=Qa.prototype={constructor:qi,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Xi():+n)+(e==null?0:+e),!this._next&&Wi!==this&&(Wi?Wi._next=this:Va=this,Wi=this),this._call=t,this._time=n,cc()},stop:function(){this._call&&(this._call=null,this._time=1/0,cc())}};function Qa(t,e,n){var r=new qi;return r.restart(t,e,n),r}function z0(){Xi(),++Rr;for(var t=Va,e;t;)(e=Wn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Rr}function G0(){Wn=(Za=Hi.now())+Ka,Rr=Ui=0;try{z0()}finally{Rr=0,F8(),Wn=0}}function N8(){var t=Hi.now(),e=t-Za;e>N0&&(Ka-=e,Za=t)}function F8(){for(var t,e=Va,n,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:Va=n);Wi=t,cc(r)}function cc(t){if(!Rr){Ui&&(Ui=clearTimeout(Ui));var e=t-Wn;e>24?(t<1/0&&(Ui=setTimeout(G0,t-Hi.now()-Ka)),Bi&&(Bi=clearInterval(Bi))):(Bi||(Za=Hi.now(),Bi=setInterval(N8,N0)),Rr=1,F0(G0))}}function fc(t,e,n){var r=new qi;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function z8(t,e,n){var r=new qi,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Xi():+s,r._restart(function u(l){l+=i,r._restart(u,i+=a,s),o(l)},a,s)},r.restart(t,e,n),r)}var G8=Fn("start","end","cancel","interrupt"),O8=[],O0=0,hc=1,pc=2,Ja=3,Y0=4,dc=5,ts=6;function es(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Y8(t,n,{name:e,index:r,group:i,on:G8,tween:O8,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:O0})}function gc(t,e){var n=De(t,e);if(n.state>O0)throw new Error("too late; already scheduled");return n}function Fe(t,e){var n=De(t,e);if(n.state>Ja)throw new Error("too late; already running");return n}function De(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Y8(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Qa(o,0,n.time);function o(l){n.state=hc,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==hc)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Ja)return fc(a);p.state===Y0?(p.state=ts,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=ts,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(fc(function(){n.state===Ja&&(n.state=Y0,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=pc,n.on.call("start",t,t.__data__,n.index,n.group),n.state===pc){for(n.state=Ja,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=dc,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===dc&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=ts,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Hn(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>pc&&r.state<dc,r.state=ts,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function U8(t){return this.each(function(){Hn(this,t)})}function B8(t,e){var n,r;return function(){var i=Fe(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function W8(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Fe(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function H8(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=De(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?B8:W8)(n,t,e))}function mc(t,e,n){var r=t._id;return t.each(function(){var i=Fe(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return De(i,r).value[e]}}function U0(t,e){var n;return(typeof e=="number"?de:e instanceof pn?Yi:(n=pn(e))?(e=n,Yi):uc)(t,e)}function X8(t){return function(){this.removeAttribute(t)}}function q8(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j8(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function V8(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function Z8(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function K8(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function Q8(t,e){var n=Ni(t),r=n==="transform"?T0:U0;return this.attrTween(t,typeof e=="function"?(n.local?K8:Z8)(n,r,mc(this,"attr."+t,e)):e==null?(n.local?q8:X8)(n):(n.local?V8:j8)(n,r,e))}function J8(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function tM(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function eM(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&tM(t,o)),n}return i._value=e,i}function nM(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&J8(t,o)),n}return i._value=e,i}function rM(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Ni(t);return this.tween(n,(r.local?eM:nM)(r,e))}function iM(t,e){return function(){gc(this,t).delay=+e.apply(this,arguments)}}function oM(t,e){return e=+e,function(){gc(this,t).delay=e}}function aM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?iM:oM)(e,t)):De(this.node(),e).delay}function sM(t,e){return function(){Fe(this,t).duration=+e.apply(this,arguments)}}function uM(t,e){return e=+e,function(){Fe(this,t).duration=e}}function lM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?sM:uM)(e,t)):De(this.node(),e).duration}function cM(t,e){if(typeof e!="function")throw new Error;return function(){Fe(this,t).ease=e}}function fM(t){var e=this._id;return arguments.length?this.each(cM(e,t)):De(this.node(),e).ease}function hM(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Fe(this,t).ease=n}}function pM(t){if(typeof t!="function")throw new Error;return this.each(hM(this._id,t))}function dM(t){typeof t!="function"&&(t=Wl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new ze(r,this._parents,this._name,this._id)}function gM(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new ze(a,this._parents,this._name,this._id)}function mM(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function yM(t,e,n){var r,i,o=mM(e)?gc:Fe;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function bM(t,e){var n=this._id;return arguments.length<2?De(this.node(),n).on.on(t):this.each(yM(n,t,e))}function vM(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function xM(){return this.on("end.remove",vM(this._id))}function _M(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ca(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,es(l[h],e,n,h,l,De(c,n)));return new ze(o,this._parents,e,n)}function wM(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Bl(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=De(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&es(p,e,n,g,h,d);o.push(h),a.push(c)}return new ze(o,a,e,n)}var $M=Gn.prototype.constructor;function SM(){return new $M(this._groups,this._parents)}function AM(t,e){var n,r,i;return function(){var o=zn(this,t),a=(this.style.removeProperty(t),zn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function B0(t){return function(){this.style.removeProperty(t)}}function MM(t,e,n){var r,i=n+"",o;return function(){var a=zn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function PM(t,e,n){var r,i,o;return function(){var a=zn(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),zn(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function DM(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Fe(this,t),l=u.on,c=u.value[o]==null?s||(s=B0(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function TM(t,e,n){var r=(t+="")=="transform"?D0:U0;return e==null?this.styleTween(t,AM(t,r)).on("end.style."+t,B0(t)):typeof e=="function"?this.styleTween(t,PM(t,r,mc(this,"style."+t,e))).each(DM(this._id,t)):this.styleTween(t,MM(t,r,e),n).on("end.style."+t,null)}function LM(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function CM(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&LM(t,a,n)),r}return o._value=e,o}function EM(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,CM(t,e,n??""))}function RM(t){return function(){this.textContent=t}}function kM(t){return function(){var e=t(this);this.textContent=e??""}}function IM(t){return this.tween("text",typeof t=="function"?kM(mc(this,"text",t)):RM(t==null?"":t+""))}function NM(t){return function(e){this.textContent=t.call(this,e)}}function FM(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&NM(i)),e}return r._value=t,r}function zM(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,FM(t))}function GM(){for(var t=this._name,e=this._id,n=H0(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=De(u,e);es(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ze(r,this._parents,t,n)}function OM(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Fe(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var YM=0;function ze(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function W0(t){return Gn().transition(t)}function H0(){return++YM}var Ve=Gn.prototype;ze.prototype=W0.prototype={constructor:ze,select:_M,selectAll:wM,selectChild:Ve.selectChild,selectChildren:Ve.selectChildren,filter:dM,merge:gM,selection:SM,transition:GM,call:Ve.call,nodes:Ve.nodes,node:Ve.node,size:Ve.size,empty:Ve.empty,each:Ve.each,on:bM,attr:Q8,attrTween:rM,style:TM,styleTween:EM,text:IM,textTween:zM,remove:xM,tween:H8,delay:aM,duration:lM,ease:fM,easeVarying:pM,end:OM,[Symbol.iterator]:Ve[Symbol.iterator]};const UM=t=>+t;function BM(t){return t*t}function WM(t){return t*(2-t)}function X0(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function HM(t){return t*t*t}function XM(t){return--t*t*t+1}function ji(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yc=3,qM=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}(yc),jM=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}(yc),q0=function t(e){e=+e;function n(r){return((r*=2)<=1?Math.pow(r,e):2-Math.pow(2-r,e))/2}return n.exponent=t,n}(yc),j0=Math.PI,V0=j0/2;function VM(t){return+t==1?1:1-Math.cos(t*V0)}function ZM(t){return Math.sin(t*V0)}function Z0(t){return(1-Math.cos(j0*t))/2}function dn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function KM(t){return dn(1-+t)}function QM(t){return 1-dn(t)}function K0(t){return((t*=2)<=1?dn(1-t):2-dn(t-1))/2}function JM(t){return 1-Math.sqrt(1-t*t)}function t4(t){return Math.sqrt(1- --t*t)}function Q0(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var bc=4/11,e4=6/11,n4=8/11,r4=3/4,i4=9/11,o4=10/11,a4=15/16,s4=21/22,u4=63/64,ns=1/bc/bc;function l4(t){return 1-Vi(1-t)}function Vi(t){return(t=+t)<bc?ns*t*t:t<n4?ns*(t-=e4)*t+r4:t<o4?ns*(t-=i4)*t+a4:ns*(t-=s4)*t+u4}function c4(t){return((t*=2)<=1?1-Vi(1-t):Vi(t-1)+1)/2}var vc=1.70158,f4=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(vc),h4=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(vc),J0=function t(e){e=+e;function n(r){return((r*=2)<1?r*r*((e+1)*r-e):(r-=2)*r*((e+1)*r+e)+2)/2}return n.overshoot=t,n}(vc),kr=2*Math.PI,xc=1,_c=.3,p4=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=kr);function i(o){return e*dn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return t(o,n*kr)},i.period=function(o){return t(e,o)},i}(xc,_c),Zi=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=kr);function i(o){return 1-e*dn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return t(o,n*kr)},i.period=function(o){return t(e,o)},i}(xc,_c),d4=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=kr);function i(o){return((o=o*2-1)<0?e*dn(-o)*Math.sin((r-o)/n):2-e*dn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return t(o,n*kr)},i.period=function(o){return t(e,o)},i}(xc,_c),g4={time:null,delay:0,duration:250,ease:ji};function m4(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function y4(t){var e,n;t instanceof ze?(e=t._id,t=t._name):(e=H0(),(n=g4).time=Xi(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&es(u,t,e,l,a,n||m4(u,e));return new ze(r,this._parents,t,e)}Gn.prototype.interrupt=U8,Gn.prototype.transition=y4;var b4=[null];function v4(t,e){var n=t.__transition,r,i;if(n){e=e==null?null:e+"";for(i in n)if((r=n[i]).state>hc&&r.name===e)return new ze([[t]],b4,e,+i)}return null}const wc=t=>()=>t;function x4(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function _4(t){t.stopImmediatePropagation()}function $c(t){t.preventDefault(),t.stopImmediatePropagation()}var tm={name:"drag"},Sc={name:"space"},Ir={name:"handle"},Nr={name:"center"};const{abs:em,max:zt,min:Gt}=Math;function nm(t){return[+t[0],+t[1]]}function Ac(t){return[nm(t[0]),nm(t[1])]}var rs={name:"x",handles:["w","e"].map(Ki),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},is={name:"y",handles:["n","s"].map(Ki),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},w4={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ki),input:function(t){return t==null?null:Ac(t)},output:function(t){return t}},Ze={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"},rm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},im={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},$4={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},S4={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ki(t){return{type:t}}function A4(t){return!t.ctrlKey&&!t.button}function M4(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function P4(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mc(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function D4(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function T4(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function L4(){return Pc(rs)}function C4(){return Pc(is)}function E4(){return Pc(w4)}function Pc(t){var e=M4,n=A4,r=P4,i=!0,o=Fn("start","brush","end"),a=6,s;function u(m){var y=m.property("__brush",g).selectAll(".overlay").data([Ki("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ze.overlay).merge(y).each(function(){var x=Mc(this).extent;j(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([Ki("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ze.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var v=m.selectAll(".handle").data(t.handles,function(x){return x.type});v.exit().remove(),v.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return Ze[x.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}u.move=function(m,y,v){m.tween?m.on("start.brush",function(x){c(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){c(this,arguments).end(x)}).tween("brush",function(){var x=this,b=x.__brush,S=c(x,arguments),$=b.selection,E=t.input(typeof y=="function"?y.apply(this,arguments):y,b.extent),M=je($,E);function w(P){b.selection=P===1&&E===null?null:M(P),l.call(x),S.brush()}return $!==null&&E!==null?w:w(1)}):m.each(function(){var x=this,b=arguments,S=x.__brush,$=t.input(typeof y=="function"?y.apply(x,b):y,S.extent),E=c(x,b).beforestart();Hn(x),S.selection=$===null?null:$,l.call(x),E.start(v).brush(v).end(v)})},u.clear=function(m,y){u.move(m,null,y)};function l(){var m=j(this),y=Mc(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(v){return v.type[v.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(v){return v.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(v){return v.type==="n"||v.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(v){return v.type==="e"||v.type==="w"?y[1][1]-y[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,y,v){var x=m.__brush.emitter;return x&&(!v||!x.clean)?x:new f(m,y,v)}function f(m,y,v){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=v}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,v){var x=j(this.that).datum();o.call(m,this.that,new x4(m,{sourceEvent:y,target:u,selection:t.output(this.state.selection),mode:v,dispatch:o}),x)}};function h(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,v=m.target.__data__.type,x=(i&&m.metaKey?v="overlay":v)==="selection"?tm:i&&m.altKey?Nr:Ir,b=t===is?null:$4[v],S=t===rs?null:S4[v],$=Mc(y),E=$.extent,M=$.selection,w=E[0][0],P,_,N=E[0][1],T,A,C=E[1][0],D,O,G=E[1][1],k,R,L=0,z=0,X,Q=b&&S&&i&&m.shiftKey,Y,Z,U=Array.from(m.touches||[m],st=>{const Pt=st.identifier;return st=ue(st,y),st.point0=st.slice(),st.identifier=Pt,st});Hn(y);var V=c(y,arguments,!0).beforestart();if(v==="overlay"){M&&(X=!0);const st=[U[0],U[1]||U[0]];$.selection=M=[[P=t===is?w:Gt(st[0][0],st[1][0]),T=t===rs?N:Gt(st[0][1],st[1][1])],[D=t===is?C:zt(st[0][0],st[1][0]),k=t===rs?G:zt(st[0][1],st[1][1])]],U.length>1&&mt(m)}else P=M[0][0],T=M[0][1],D=M[1][0],k=M[1][1];_=P,A=T,O=D,R=k;var q=j(y).attr("pointer-events","none"),rt=q.selectAll(".overlay").attr("cursor",Ze[v]);if(m.touches)V.moved=H,V.ended=ht;else{var ut=j(m.view).on("mousemove.brush",H,!0).on("mouseup.brush",ht,!0);i&&ut.on("keydown.brush",Bt,!0).on("keyup.brush",ee,!0),Ra(m.view)}l.call(y),V.start(m,x.name);function H(st){for(const Pt of st.changedTouches||[st])for(const Oo of U)Oo.identifier===Pt.identifier&&(Oo.cur=ue(Pt,y));if(Q&&!Y&&!Z&&U.length===1){const Pt=U[0];em(Pt.cur[0]-Pt[0])>em(Pt.cur[1]-Pt[1])?Z=!0:Y=!0}for(const Pt of U)Pt.cur&&(Pt[0]=Pt.cur[0],Pt[1]=Pt.cur[1]);X=!0,$c(st),mt(st)}function mt(st){const Pt=U[0],Oo=Pt.point0;var Mn;switch(L=Pt[0]-Oo[0],z=Pt[1]-Oo[1],x){case Sc:case tm:{b&&(L=zt(w-P,Gt(C-D,L)),_=P+L,O=D+L),S&&(z=zt(N-T,Gt(G-k,z)),A=T+z,R=k+z);break}case Ir:{U[1]?(b&&(_=zt(w,Gt(C,U[0][0])),O=zt(w,Gt(C,U[1][0])),b=1),S&&(A=zt(N,Gt(G,U[0][1])),R=zt(N,Gt(G,U[1][1])),S=1)):(b<0?(L=zt(w-P,Gt(C-P,L)),_=P+L,O=D):b>0&&(L=zt(w-D,Gt(C-D,L)),_=P,O=D+L),S<0?(z=zt(N-T,Gt(G-T,z)),A=T+z,R=k):S>0&&(z=zt(N-k,Gt(G-k,z)),A=T,R=k+z));break}case Nr:{b&&(_=zt(w,Gt(C,P-L*b)),O=zt(w,Gt(C,D+L*b))),S&&(A=zt(N,Gt(G,T-z*S)),R=zt(N,Gt(G,k+z*S)));break}}O<_&&(b*=-1,Mn=P,P=D,D=Mn,Mn=_,_=O,O=Mn,v in rm&&rt.attr("cursor",Ze[v=rm[v]])),R<A&&(S*=-1,Mn=T,T=k,k=Mn,Mn=A,A=R,R=Mn,v in im&&rt.attr("cursor",Ze[v=im[v]])),$.selection&&(M=$.selection),Y&&(_=M[0][0],O=M[1][0]),Z&&(A=M[0][1],R=M[1][1]),(M[0][0]!==_||M[0][1]!==A||M[1][0]!==O||M[1][1]!==R)&&($.selection=[[_,A],[O,R]],l.call(y),V.brush(st,x.name))}function ht(st){if(_4(st),st.touches){if(st.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else ka(st.view,X),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),rt.attr("cursor",Ze.overlay),$.selection&&(M=$.selection),D4(M)&&($.selection=null,l.call(y)),V.end(st,x.name)}function Bt(st){switch(st.keyCode){case 16:{Q=b&&S;break}case 18:{x===Ir&&(b&&(D=O-L*b,P=_+L*b),S&&(k=R-z*S,T=A+z*S),x=Nr,mt(st));break}case 32:{(x===Ir||x===Nr)&&(b<0?D=O-L:b>0&&(P=_-L),S<0?k=R-z:S>0&&(T=A-z),x=Sc,rt.attr("cursor",Ze.selection),mt(st));break}default:return}$c(st)}function ee(st){switch(st.keyCode){case 16:{Q&&(Y=Z=Q=!1,mt(st));break}case 18:{x===Nr&&(b<0?D=O:b>0&&(P=_),S<0?k=R:S>0&&(T=A),x=Ir,mt(st));break}case 32:{x===Sc&&(st.altKey?(b&&(D=O-L*b,P=_+L*b),S&&(k=R-z*S,T=A+z*S),x=Nr):(b<0?D=O:b>0&&(P=_),S<0?k=R:S>0&&(T=A),x=Ir),rt.attr("cursor",Ze[v]),mt(st));break}default:return}$c(st)}}function p(m){c(this,arguments).moved(m)}function d(m){c(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Ac(e.apply(this,arguments)),m.dim=t,m}return u.extent=function(m){return arguments.length?(e=typeof m=="function"?m:wc(Ac(m)),u):e},u.filter=function(m){return arguments.length?(n=typeof m=="function"?m:wc(!!m),u):n},u.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:wc(!!m),u):r},u.handleSize=function(m){return arguments.length?(a=+m,u):a},u.keyModifiers=function(m){return arguments.length?(i=!!m,u):i},u.on=function(){var m=o.on.apply(o,arguments);return m===o?u:m},u}var om=Math.abs,Fr=Math.cos,zr=Math.sin,am=Math.PI,os=am/2,sm=am*2,um=Math.max,Dc=1e-12;function Tc(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function R4(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function k4(){return Lc(!1,!1)}function I4(){return Lc(!1,!0)}function N4(){return Lc(!0,!1)}function Lc(t,e){var n=0,r=null,i=null,o=null;function a(s){var u=s.length,l=new Array(u),c=Tc(0,u),f=new Array(u*u),h=new Array(u),p=0,d;s=Float64Array.from({length:u*u},e?(g,m)=>s[m%u][m/u|0]:(g,m)=>s[m/u|0][m%u]);for(let g=0;g<u;++g){let m=0;for(let y=0;y<u;++y)m+=s[g*u+y]+t*s[y*u+g];p+=l[g]=m}p=um(0,sm-n*u)/p,d=p?n:sm/u;{let g=0;r&&c.sort((m,y)=>r(l[m],l[y]));for(const m of c){const y=g;if(t){const v=Tc(~u+1,u).filter(x=>x<0?s[~x*u+m]:s[m*u+x]);i&&v.sort((x,b)=>i(x<0?-s[~x*u+m]:s[m*u+x],b<0?-s[~b*u+m]:s[m*u+b]));for(const x of v)if(x<0){const b=f[~x*u+m]||(f[~x*u+m]={source:null,target:null});b.target={index:m,startAngle:g,endAngle:g+=s[~x*u+m]*p,value:s[~x*u+m]}}else{const b=f[m*u+x]||(f[m*u+x]={source:null,target:null});b.source={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}else{const v=Tc(0,u).filter(x=>s[m*u+x]||s[x*u+m]);i&&v.sort((x,b)=>i(s[m*u+x],s[m*u+b]));for(const x of v){let b;if(m<x?(b=f[m*u+x]||(f[m*u+x]={source:null,target:null}),b.source={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]}):(b=f[x*u+m]||(f[x*u+m]={source:null,target:null}),b.target={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]},m===x&&(b.source=b.target)),b.source&&b.target&&b.source.value<b.target.value){const S=b.source;b.source=b.target,b.target=S}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}g+=d}}return f=Object.values(f),f.groups=h,o?f.sort(o):f}return a.padAngle=function(s){return arguments.length?(n=um(0,s),a):n},a.sortGroups=function(s){return arguments.length?(r=s,a):r},a.sortSubgroups=function(s){return arguments.length?(i=s,a):i},a.sortChords=function(s){return arguments.length?(s==null?o=null:(o=R4(s))._=s,a):o&&o._},a}const Cc=Math.PI,Ec=2*Cc,Xn=1e-6,F4=Ec-Xn;function lm(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function z4(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return lm;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Qi=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?lm:z4(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-e,l=i-n,c=a-e,f=s-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>Xn)if(!(Math.abs(f*u-l*c)>Xn)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,d=i-s,g=u*u+l*l,m=p*p+d*d,y=Math.sqrt(g),v=Math.sqrt(h),x=o*Math.tan((Cc-Math.acos((g+h-m)/(2*y*v)))/2),b=x/v,S=x/y;Math.abs(b-1)>Xn&&this._append`L${e+b*c},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=e+S*u},${this._y1=n+S*l}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=e+s,c=n+u,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Xn||Math.abs(this._y1-c)>Xn)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%Ec+Ec),h>F4?this._append`A${r},${r},0,1,${f},${e-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:h>Xn&&this._append`A${r},${r},0,${+(h>=Cc)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Rc(){return new Qi}Rc.prototype=Qi.prototype;function G4(t=3){return new Qi(+t)}var O4=Array.prototype.slice;function qn(t){return function(){return t}}function Y4(t){return t.source}function U4(t){return t.target}function cm(t){return t.radius}function B4(t){return t.startAngle}function W4(t){return t.endAngle}function H4(){return 0}function X4(){return 10}function fm(t){var e=Y4,n=U4,r=cm,i=cm,o=B4,a=W4,s=H4,u=null;function l(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=O4.call(arguments),g=+r.apply(this,(d[0]=f,d)),m=o.apply(this,d)-os,y=a.apply(this,d)-os,v=+i.apply(this,(d[0]=h,d)),x=o.apply(this,d)-os,b=a.apply(this,d)-os;if(u||(u=c=Rc()),p>Dc&&(om(y-m)>p*2+Dc?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,om(b-x)>p*2+Dc?b>x?(x+=p,b-=p):(x-=p,b+=p):x=b=(x+b)/2),u.moveTo(g*Fr(m),g*zr(m)),u.arc(0,0,g,m,y),m!==x||y!==b)if(t){var S=+t.apply(this,arguments),$=v-S,E=(x+b)/2;u.quadraticCurveTo(0,0,$*Fr(x),$*zr(x)),u.lineTo(v*Fr(E),v*zr(E)),u.lineTo($*Fr(b),$*zr(b))}else u.quadraticCurveTo(0,0,v*Fr(x),v*zr(x)),u.arc(0,0,v,x,b);if(u.quadraticCurveTo(0,0,g*Fr(m),g*zr(m)),u.closePath(),c)return u=null,c+""||null}return t&&(l.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:qn(+c),l):t}),l.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:qn(+c),l):r},l.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:qn(+c),l):r},l.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:qn(+c),l):i},l.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:qn(+c),l):o},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:qn(+c),l):a},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:qn(+c),l):s},l.source=function(c){return arguments.length?(e=c,l):e},l.target=function(c){return arguments.length?(n=c,l):n},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function q4(){return fm()}function j4(){return fm(X4)}var V4=Array.prototype,hm=V4.slice;function Z4(t,e){return t-e}function K4(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}const gn=t=>()=>t;function Q4(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=J4(t,e[n]))return i;return 0}function J4(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],l=u[0],c=u[1],f=t[s],h=f[0],p=f[1];if(tP(u,f,e))return 0;c>r!=p>r&&n<(h-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function tP(t,e,n){var r;return eP(t,e,n)&&nP(t[r=+(t[0]===e[0])],n[r],e[r])}function eP(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function nP(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function rP(){}var Ke=[[],[[[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 kc(){var t=1,e=1,n=Nl,r=u;function i(l){var c=n(l);if(Array.isArray(c))c=c.slice().sort(Z4);else{const f=Li(l,iP);for(c=In(...Il(f[0],f[1],c),c);c[c.length-1]>=f[1];)c.pop();for(;c[1]<f[0];)c.shift()}return c.map(f=>o(l,f))}function o(l,c){const f=c==null?NaN:+c;if(isNaN(f))throw new Error(`invalid value: ${c}`);var h=[],p=[];return a(l,f,function(d){r(d,l,f),K4(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=h.length,y;g<m;++g)if(Q4((y=h[g])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:h}}function a(l,c,f){var h=new Array,p=new Array,d,g,m,y,v,x;for(d=g=-1,y=jn(l[0],c),Ke[y<<1].forEach(b);++d<t-1;)m=y,y=jn(l[d+1],c),Ke[m|y<<1].forEach(b);for(Ke[y<<0].forEach(b);++g<e-1;){for(d=-1,y=jn(l[g*t+t],c),v=jn(l[g*t],c),Ke[y<<1|v<<2].forEach(b);++d<t-1;)m=y,y=jn(l[g*t+t+d+1],c),x=v,v=jn(l[g*t+d+1],c),Ke[m|y<<1|v<<2|x<<3].forEach(b);Ke[y|v<<3].forEach(b)}for(d=-1,v=l[g*t]>=c,Ke[v<<2].forEach(b);++d<t-1;)x=v,v=jn(l[g*t+d+1],c),Ke[v<<2|x<<3].forEach(b);Ke[v<<3].forEach(b);function b(S){var $=[S[0][0]+d,S[0][1]+g],E=[S[1][0]+d,S[1][1]+g],M=s($),w=s(E),P,_;(P=p[M])?(_=h[w])?(delete p[P.end],delete h[_.start],P===_?(P.ring.push(E),f(P.ring)):h[P.start]=p[_.end]={start:P.start,end:_.end,ring:P.ring.concat(_.ring)}):(delete p[P.end],P.ring.push(E),p[P.end=w]=P):(P=h[w])?(_=p[M])?(delete h[P.start],delete p[_.end],P===_?(P.ring.push(E),f(P.ring)):h[_.start]=p[P.end]={start:_.start,end:P.end,ring:_.ring.concat(P.ring)}):(delete h[P.start],P.ring.unshift($),h[P.start=M]=P):h[M]=p[w]={start:M,end:w,ring:[$,E]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function u(l,c,f){l.forEach(function(h){var p=h[0],d=h[1],g=p|0,m=d|0,y=Ic(c[m*t+g]);p>0&&p<t&&g===p&&(h[0]=pm(p,Ic(c[m*t+g-1]),y,f)),d>0&&d<e&&m===d&&(h[1]=pm(d,Ic(c[(m-1)*t+g]),y,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[t,e];var c=Math.floor(l[0]),f=Math.floor(l[1]);if(!(c>=0&&f>=0))throw new Error("invalid size");return t=c,e=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?gn(hm.call(l)):gn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:rP,i):r===u},i}function iP(t){return isFinite(t)?t:NaN}function jn(t,e){return t==null?!1:+t>=e}function Ic(t){return t==null||isNaN(t=+t)?-1/0:t}function pm(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function oP(t){return t[0]}function aP(t){return t[1]}function sP(){return 1}function uP(){var t=oP,e=aP,n=sP,r=960,i=500,o=20,a=2,s=o*3,u=r+s*2>>a,l=i+s*2>>a,c=gn(20);function f(v){var x=new Float32Array(u*l),b=Math.pow(2,-a),S=-1;for(const T of v){var $=(t(T,++S,v)+s)*b,E=(e(T,S,v)+s)*b,M=+n(T,S,v);if(M&&$>=0&&$<u&&E>=0&&E<l){var w=Math.floor($),P=Math.floor(E),_=$-w-.5,N=E-P-.5;x[w+P*u]+=(1-_)*(1-N)*M,x[w+1+P*u]+=_*(1-N)*M,x[w+1+(P+1)*u]+=_*N*M,x[w+(P+1)*u]+=(1-_)*N*M}}return sg({data:x,width:u,height:l},o*b),x}function h(v){var x=f(v),b=c(x),S=Math.pow(2,2*a);return Array.isArray(b)||(b=In(Number.MIN_VALUE,Ei(x)/S,b)),kc().size([u,l]).thresholds(b.map($=>$*S))(x).map(($,E)=>($.value=+b[E],p($)))}h.contours=function(v){var x=f(v),b=kc().size([u,l]),S=Math.pow(2,2*a),$=E=>{E=+E;var M=p(b.contour(x,E*S));return M.value=E,M};return Object.defineProperty($,"max",{get:()=>Ei(x)/S}),$};function p(v){return v.coordinates.forEach(d),v}function d(v){v.forEach(g)}function g(v){v.forEach(m)}function m(v){v[0]=v[0]*Math.pow(2,a)-s,v[1]=v[1]*Math.pow(2,a)-s}function y(){return s=o*3,u=r+s*2>>a,l=i+s*2>>a,h}return h.x=function(v){return arguments.length?(t=typeof v=="function"?v:gn(+v),h):t},h.y=function(v){return arguments.length?(e=typeof v=="function"?v:gn(+v),h):e},h.weight=function(v){return arguments.length?(n=typeof v=="function"?v:gn(+v),h):n},h.size=function(v){if(!arguments.length)return[r,i];var x=+v[0],b=+v[1];if(!(x>=0&&b>=0))throw new Error("invalid size");return r=x,i=b,y()},h.cellSize=function(v){if(!arguments.length)return 1<<a;if(!((v=+v)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(v)/Math.LN2),y()},h.thresholds=function(v){return arguments.length?(c=typeof v=="function"?v:Array.isArray(v)?gn(hm.call(v)):gn(v),h):c},h.bandwidth=function(v){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((v=+v)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*v*v+1)-1)/2,y()},h}const Qe=11102230246251565e-32,Ot=134217729,lP=(3+8*Qe)*Qe;function Nc(t,e,n,r,i){let o,a,s,u,l=e[0],c=r[0],f=0,h=0;c>l==c>-l?(o=l,l=e[++f]):(o=c,c=r[++h]);let p=0;if(f<t&&h<n)for(c>l==c>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,s!==0&&(i[p++]=s);f<t&&h<n;)c>l==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h]),o=a,s!==0&&(i[p++]=s);for(;f<t;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f],o=a,s!==0&&(i[p++]=s);for(;h<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function cP(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function Ji(t){return new Float64Array(t)}const fP=(3+16*Qe)*Qe,hP=(2+12*Qe)*Qe,pP=(9+64*Qe)*Qe*Qe,Gr=Ji(4),dm=Ji(8),gm=Ji(12),mm=Ji(16),Ht=Ji(4);function dP(t,e,n,r,i,o,a){let s,u,l,c,f,h,p,d,g,m,y,v,x,b,S,$,E,M;const w=t-i,P=n-i,_=e-o,N=r-o;b=w*N,h=Ot*w,p=h-(h-w),d=w-p,h=Ot*N,g=h-(h-N),m=N-g,S=d*m-(b-p*g-d*g-p*m),$=_*P,h=Ot*_,p=h-(h-_),d=_-p,h=Ot*P,g=h-(h-P),m=P-g,E=d*m-($-p*g-d*g-p*m),y=S-E,f=S-y,Gr[0]=S-(y+f)+(f-E),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-$,f=x-y,Gr[1]=x-(y+f)+(f-$),M=v+y,f=M-v,Gr[2]=v-(M-f)+(y-f),Gr[3]=M;let T=cP(4,Gr),A=hP*a;if(T>=A||-T>=A||(f=t-w,s=t-(w+f)+(f-i),f=n-P,l=n-(P+f)+(f-i),f=e-_,u=e-(_+f)+(f-o),f=r-N,c=r-(N+f)+(f-o),s===0&&u===0&&l===0&&c===0)||(A=pP*a+lP*Math.abs(T),T+=w*c+N*s-(_*l+P*u),T>=A||-T>=A))return T;b=s*N,h=Ot*s,p=h-(h-s),d=s-p,h=Ot*N,g=h-(h-N),m=N-g,S=d*m-(b-p*g-d*g-p*m),$=u*P,h=Ot*u,p=h-(h-u),d=u-p,h=Ot*P,g=h-(h-P),m=P-g,E=d*m-($-p*g-d*g-p*m),y=S-E,f=S-y,Ht[0]=S-(y+f)+(f-E),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-$,f=x-y,Ht[1]=x-(y+f)+(f-$),M=v+y,f=M-v,Ht[2]=v-(M-f)+(y-f),Ht[3]=M;const C=Nc(4,Gr,4,Ht,dm);b=w*c,h=Ot*w,p=h-(h-w),d=w-p,h=Ot*c,g=h-(h-c),m=c-g,S=d*m-(b-p*g-d*g-p*m),$=_*l,h=Ot*_,p=h-(h-_),d=_-p,h=Ot*l,g=h-(h-l),m=l-g,E=d*m-($-p*g-d*g-p*m),y=S-E,f=S-y,Ht[0]=S-(y+f)+(f-E),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-$,f=x-y,Ht[1]=x-(y+f)+(f-$),M=v+y,f=M-v,Ht[2]=v-(M-f)+(y-f),Ht[3]=M;const D=Nc(C,dm,4,Ht,gm);b=s*c,h=Ot*s,p=h-(h-s),d=s-p,h=Ot*c,g=h-(h-c),m=c-g,S=d*m-(b-p*g-d*g-p*m),$=u*l,h=Ot*u,p=h-(h-u),d=u-p,h=Ot*l,g=h-(h-l),m=l-g,E=d*m-($-p*g-d*g-p*m),y=S-E,f=S-y,Ht[0]=S-(y+f)+(f-E),v=b+y,f=v-b,x=b-(v-f)+(y-f),y=x-$,f=x-y,Ht[1]=x-(y+f)+(f-$),M=v+y,f=M-v,Ht[2]=v-(M-f)+(y-f),Ht[3]=M;const O=Nc(D,gm,4,Ht,mm);return mm[O-1]}function as(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),u=a-s,l=Math.abs(a+s);return Math.abs(u)>=fP*l?u:-dP(t,e,n,r,i,o,l)}const ym=Math.pow(2,-52),ss=new Uint32Array(512);class us{static from(e,n=vP,r=xP){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=e[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new us(o)}constructor(e){const n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=e.length>>1;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let w=0;w<a;w++){const P=e[2*w],_=e[2*w+1];P<s&&(s=P),_<u&&(u=_),P>l&&(l=P),_>c&&(c=_),this._ids[w]=w}const f=(s+l)/2,h=(u+c)/2;let p,d,g;for(let w=0,P=1/0;w<a;w++){const _=Fc(f,h,e[2*w],e[2*w+1]);_<P&&(p=w,P=_)}const m=e[2*p],y=e[2*p+1];for(let w=0,P=1/0;w<a;w++){if(w===p)continue;const _=Fc(m,y,e[2*w],e[2*w+1]);_<P&&_>0&&(d=w,P=_)}let v=e[2*d],x=e[2*d+1],b=1/0;for(let w=0;w<a;w++){if(w===p||w===d)continue;const P=yP(m,y,v,x,e[2*w],e[2*w+1]);P<b&&(g=w,b=P)}let S=e[2*g],$=e[2*g+1];if(b===1/0){for(let _=0;_<a;_++)this._dists[_]=e[2*_]-e[0]||e[2*_+1]-e[1];Or(this._ids,this._dists,0,a-1);const w=new Uint32Array(a);let P=0;for(let _=0,N=-1/0;_<a;_++){const T=this._ids[_],A=this._dists[T];A>N&&(w[P++]=T,N=A)}this.hull=w.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(as(m,y,v,x,S,$)<0){const w=d,P=v,_=x;d=g,v=S,x=$,g=w,S=P,$=_}const E=bP(m,y,v,x,S,$);this._cx=E.x,this._cy=E.y;for(let w=0;w<a;w++)this._dists[w]=Fc(e[2*w],e[2*w+1],E.x,E.y);Or(this._ids,this._dists,0,a-1),this._hullStart=p;let M=3;r[p]=n[g]=d,r[d]=n[p]=g,r[g]=n[d]=p,i[p]=0,i[d]=1,i[g]=2,o.fill(-1),o[this._hashKey(m,y)]=p,o[this._hashKey(v,x)]=d,o[this._hashKey(S,$)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let w=0,P,_;w<this._ids.length;w++){const N=this._ids[w],T=e[2*N],A=e[2*N+1];if(w>0&&Math.abs(T-P)<=ym&&Math.abs(A-_)<=ym||(P=T,_=A,N===p||N===d||N===g))continue;let C=0;for(let R=0,L=this._hashKey(T,A);R<this._hashSize&&(C=o[(L+R)%this._hashSize],!(C!==-1&&C!==r[C]));R++);C=n[C];let D=C,O;for(;O=r[D],as(T,A,e[2*D],e[2*D+1],e[2*O],e[2*O+1])>=0;)if(D=O,D===C){D=-1;break}if(D===-1)continue;let G=this._addTriangle(D,N,r[D],-1,-1,i[D]);i[N]=this._legalize(G+2),i[D]=G,M++;let k=r[D];for(;O=r[k],as(T,A,e[2*k],e[2*k+1],e[2*O],e[2*O+1])<0;)G=this._addTriangle(k,N,O,i[N],-1,i[k]),i[N]=this._legalize(G+2),r[k]=k,M--,k=O;if(D===C)for(;O=n[D],as(T,A,e[2*O],e[2*O+1],e[2*D],e[2*D+1])<0;)G=this._addTriangle(O,N,D,-1,i[D],i[O]),this._legalize(G+2),i[O]=G,r[D]=D,M--,D=O;this._hullStart=n[N]=D,r[D]=n[k]=N,r[N]=k,o[this._hashKey(T,A)]=N,o[this._hashKey(e[2*D],e[2*D+1])]=D}this.hull=new Uint32Array(M);for(let w=0,P=this._hullStart;w<M;w++)this.hull[w]=P,P=r[P];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(gP(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[e],u=e-e%3;if(a=u+(e+2)%3,s===-1){if(o===0)break;e=ss[--o];continue}const l=s-s%3,c=u+(e+1)%3,f=l+(s+2)%3,h=n[a],p=n[e],d=n[c],g=n[f];if(mP(i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*g],i[2*g+1])){n[e]=g,n[s]=h;const y=r[f];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===f){this._hullTri[x]=e;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(e,y),this._link(s,r[a]),this._link(a,f);const v=l+(s+1)%3;o<ss.length&&(ss[o++]=v)}else{if(o===0)break;e=ss[--o]}}return a}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=e,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function gP(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function Fc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function mP(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,h=i-a,p=o-s,d=u*u+l*l,g=c*c+f*f,m=h*h+p*p;return u*(f*m-g*p)-l*(c*m-g*h)+d*(c*p-f*h)<0}function yP(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=(l*c-s*f)*h,d=(a*f-u*c)*h;return p*p+d*d}function bP(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=t+(l*c-s*f)*h,d=e+(a*f-u*c)*h;return{x:p,y:d}}function Or(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],a=e[o];let s=i-1;for(;s>=n&&e[t[s]]>a;)t[s+1]=t[s--];t[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;to(t,i,o),e[t[n]]>e[t[r]]&&to(t,n,r),e[t[o]]>e[t[r]]&&to(t,o,r),e[t[n]]>e[t[o]]&&to(t,n,o);const s=t[o],u=e[s];for(;;){do o++;while(e[t[o]]<u);do a--;while(e[t[a]]>u);if(a<o)break;to(t,o,a)}t[n+1]=t[a],t[a]=s,r-o+1>=a-n?(Or(t,e,o,r),Or(t,e,n,a-1)):(Or(t,e,n,a-1),Or(t,e,o,r))}}function to(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function vP(t){return t[0]}function xP(t){return t[1]}const bm=1e-6;class Vn{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>bm||Math.abs(this._y1-o)>bm)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class zc{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}class vm{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,y=r.length,v,x;g<y;g+=3,m+=2){const b=r[g]*2,S=r[g+1]*2,$=r[g+2]*2,E=e[b],M=e[b+1],w=e[S],P=e[S+1],_=e[$],N=e[$+1],T=w-E,A=P-M,C=_-E,D=N-M,O=(T*D-A*C)*2;if(Math.abs(O)<1e-9){if(o===void 0){o=a=0;for(const k of n)o+=e[k*2],a+=e[k*2+1];o/=n.length,a/=n.length}const G=1e9*Math.sign((o-E)*D-(a-M)*C);v=(E+_)/2-G*D,x=(M+N)/2+G*C}else{const G=1/O,k=T*T+A*A,R=C*C+D*D;v=E+(D*k-A*R)*G,x=M+(T*R-C*k)*G}s[m]=v,s[m+1]=x}let u=n[n.length-1],l,c=u*4,f,h=e[2*u],p,d=e[2*u+1];i.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=h,p=d,c=u*4,h=e[2*u],d=e[2*u+1],i[l+2]=i[c]=p-d,i[l+3]=i[c+1]=h-f}render(e){const n=e==null?e=new Vn:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){const h=r[c];if(h<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(h/3)*2,g=a[p],m=a[p+1],y=a[d],v=a[d+1];this._renderSegment(g,m,y,v,e)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(i[l]/3)*2,h=a[f],p=a[f+1],d=u*4,g=this._project(h,p,s[d+2],s[d+3]);g&&this._renderSegment(h,p,g[0],g[1],e)}return n&&n.value()}renderBounds(e){const n=e==null?e=new Vn:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){const r=n==null?n=new Vn:void 0,i=this._clip(e);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(e){const n=new zc;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,i,o){let a;const s=this._regioncode(e,n),u=this._regioncode(r,i);s===0&&u===0?(o.moveTo(e,n),o.lineTo(r,i)):(a=this._clipSegment(e,n,r,i,s,u))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){const n=this._clip(e);if(n)for(const r of this.delaunay.neighbors(e)){const i=this._clip(r);if(i){t:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,u=i.length;s<u;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+u-2)%u]&&n[(o+3)%a]===i[(s+u-1)%u]){yield r;break t}}}}_cell(e){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[e];if(a===-1)return null;const s=[];let u=a;do{const l=Math.floor(u/3);if(s.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==e)break;u=i[u]}while(u!==a&&u!==-1);return s}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(e);if(n===null)return null;const{vectors:r}=this,i=e*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(e,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(e,n))}_clipFinite(e,n){const r=n.length;let i=null,o,a,s=n[r-2],u=n[r-1],l,c=this._regioncode(s,u),f,h=0;for(let p=0;p<r;p+=2)if(o=s,a=u,s=n[p],u=n[p+1],l=c,c=this._regioncode(s,u),l===0&&c===0)f=h,h=0,i?i.push(s,u):i=[s,u];else{let d,g,m,y,v;if(l===0){if((d=this._clipSegment(o,a,s,u,l,c))===null)continue;[g,m,y,v]=d}else{if((d=this._clipSegment(s,u,o,a,c,l))===null)continue;[y,v,g,m]=d,f=h,h=this._edgecode(g,m),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(g,m):i=[g,m]}f=h,h=this._edgecode(y,v),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(y,v):i=[y,v]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(e,f,h,i,i.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(e,n,r,i,o,a){const s=o<a;for(s&&([e,n,r,i,o,a]=[r,i,e,n,a,o]);;){if(o===0&&a===0)return s?[r,i,e,n]:[e,n,r,i];if(o&a)return null;let u,l,c=o||a;c&8?(u=e+(r-e)*(this.ymax-n)/(i-n),l=this.ymax):c&4?(u=e+(r-e)*(this.ymin-n)/(i-n),l=this.ymin):c&2?(l=n+(i-n)*(this.xmax-e)/(r-e),u=this.xmax):(l=n+(i-n)*(this.xmin-e)/(r-e),u=this.xmin),o?(e=u,n=l,o=this._regioncode(e,n)):(r=u,i=l,a=this._regioncode(r,i))}}_clipInfinite(e,n,r,i,o,a){let s=Array.from(n),u;if((u=this._project(s[0],s[1],r,i))&&s.unshift(u[0],u[1]),(u=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(u[0],u[1]),s=this._clipFinite(e,s))for(let l=0,c=s.length,f,h=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)f=h,h=this._edgecode(s[l],s[l+1]),f&&h&&(l=this._edge(e,f,h,s,l),c=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(e,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(e,n,r,i){let o=1/0,a,s,u;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(u=this.ymin,s=e+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(u=this.ymax,s=e+(o=a)*r)}if(r>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/r)<o&&(s=this.xmax,u=n+(o=a)*i)}else if(r<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/r)<o&&(s=this.xmin,u=n+(o=a)*i)}return[s,u]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){const r=(n+2)%e.length,i=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[i]||e[n+1]===e[r+1]&&e[r+1]===e[i+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}}const _P=2*Math.PI,Yr=Math.pow;function wP(t){return t[0]}function $P(t){return t[1]}function SP(t){const{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){const i=2*e[r],o=2*e[r+1],a=2*e[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function AP(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Gc{static from(e,n=wP,r=$P,i){return new Gc("length"in e?MP(e,n,r,i):Float64Array.from(PP(e,n,r,i)))}constructor(e){this._delaunator=new us(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&SP(e)){this.collinear=Int32Array.from({length:n.length/2},(h,p)=>p).sort((h,p)=>n[2*h]-n[2*p]||n[2*h+1]-n[2*p+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let h=0,p=n.length/2;h<p;++h){const d=AP(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new us(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let u=0,l=r.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(r[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=i.length;u<l;++u)s[i[u]]=u;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new vm(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const f=s.indexOf(e);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}const u=n[e];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==e)return;if(l=o[l],l===-1){const f=r[(i[e]+1)%r.length];f!==c&&(yield f);return}}while(l!==u)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,e,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:u,points:l}=this;if(i[e]===-1||!l.length)return(e+1)%(l.length>>1);let c=e,f=Yr(n-l[e*2],2)+Yr(r-l[e*2+1],2);const h=i[e];let p=h;do{let d=u[p];const g=Yr(n-l[d*2],2)+Yr(r-l[d*2+1],2);if(g<f&&(f=g,c=d),p=p%3===2?p-2:p+1,u[p]!==e)break;if(p=s[p],p===-1){if(p=o[(a[e]+1)%o.length],p!==d&&Yr(n-l[p*2],2)+Yr(r-l[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(e){const n=e==null?e=new Vn:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const u=i[a];if(u<a)continue;const l=o[a]*2,c=o[u]*2;e.moveTo(r[l],r[l+1]),e.lineTo(r[c],r[c+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;const r=e==null?e=new Vn:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],u=i[o+1];e.moveTo(s+n,u),e.arc(s,u,n,0,_P)}return r&&r.value()}renderHull(e){const n=e==null?e=new Vn:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;e.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const u=2*r[s];e.lineTo(i[u],i[u+1])}return e.closePath(),n&&n.value()}hullPolygon(){const e=new zc;return this.renderHull(e),e.value()}renderTriangle(e,n){const r=n==null?n=new Vn:void 0,{points:i,triangles:o}=this,a=o[e*=3]*2,s=o[e+1]*2,u=o[e+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[u],i[u+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){const n=new zc;return this.renderTriangle(e,n),n.value()}}function MP(t,e,n,r){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=t[a];o[a*2]=e.call(r,s,a,t),o[a*2+1]=n.call(r,s,a,t)}return o}function*PP(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}var xm={},Oc={},Yc=34,eo=10,Uc=13;function _m(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function DP(t,e){var n=_m(t);return function(r,i){return e(n(r),i,t)}}function wm(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function re(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function TP(t){return t<0?"-"+re(-t,6):t>9999?"+"+re(t,6):re(t,4)}function LP(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":TP(t.getUTCFullYear())+"-"+re(t.getUTCMonth()+1,2)+"-"+re(t.getUTCDate(),2)+(i?"T"+re(e,2)+":"+re(n,2)+":"+re(r,2)+"."+re(i,3)+"Z":r?"T"+re(e,2)+":"+re(n,2)+":"+re(r,2)+"Z":n||e?"T"+re(e,2)+":"+re(n,2)+"Z":"")}function ls(t){var e=new RegExp('["'+t+`
|
6
|
-
|
7
|
-
`
|
5
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function va(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Ri=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Pr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(Dt(c))try{c()}catch(g){o=g instanceof Ml?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Pr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{Jd(d)}catch(g){o=o??[],g instanceof Ml?o=Dr(Dr([],Mr(o)),Mr(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new Ml(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Jd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&va(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&va(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Kd=Ri.EMPTY;function Qd(t){return t instanceof Ri||t&&"closed"in t&&Dt(t.remove)&&Dt(t.add)&&Dt(t.unsubscribe)}function Jd(t){Dt(t)?t():t.unsubscribe()}var tg={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},jA={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Dr([t,e],Mr(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function eg(t){jA.setTimeout(function(){throw t})}function Dl(){}function _a(t){t()}var Cl=function(t){Ne(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Qd(n)&&n.add(r)):r.destination=KA,r}return e.create=function(n,r,i){return new Ei(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ri),VA=Function.prototype.bind;function Ll(t,e){return VA.call(t,e)}var qA=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){wa(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){wa(r)}else wa(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){wa(n)}},t}(),Ei=function(t){Ne(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(Dt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&tg.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ll(n.next,s),error:n.error&&Ll(n.error,s),complete:n.complete&&Ll(n.complete,s)}):a=n}return o.destination=new qA(a),o}return e}(Cl);function wa(t){eg(t)}function ZA(t){throw t}var KA={closed:!0,next:Dl,error:ZA,complete:Dl},kl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $a(t){return t}function QA(t){return t.length===0?$a:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var re=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=tT(e)?e:new Ei(e,n,r);return _a(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=ng(n),new n(function(i,o){var a=new Ei({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[kl]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return QA(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=ng(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function ng(t){var e;return(e=t??tg.Promise)!==null&&e!==void 0?e:Promise}function JA(t){return t&&Dt(t.next)&&Dt(t.error)&&Dt(t.complete)}function tT(t){return t&&t instanceof Cl||JA(t)&&Qd(t)}function eT(t){return Dt(t==null?void 0:t.lift)}function hn(t){return function(e){if(eT(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function pn(t,e,n,r,i){return new nT(t,e,n,r,i)}var nT=function(t){Ne(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Cl),rT=Pl(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Lr=function(t){Ne(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new rg(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new rT},e.prototype.next=function(n){var r=this;_a(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Pr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;_a(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;_a(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Kd:(this.currentObservers=null,s.push(n),new Ri(function(){r.currentObservers=null,va(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new re;return n.source=this,n},e.create=function(n,r){return new rg(n,r)},e}(re),rg=function(t){Ne(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Kd},e}(Lr),ig=function(t){Ne(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(Lr),Rl={now:function(){return(Rl.delegate||Date).now()},delegate:void 0},iT=function(t){Ne(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Rl);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(Lr),oT=function(t){Ne(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Ri),og={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Dr([t,e],Mr(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},aT=function(t){Ne(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),og.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&og.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,va(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(oT),ag=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=Rl.now,t}(),sT=function(t){Ne(e,t);function e(n,r){r===void 0&&(r=ag.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(ag);new sT(aT);var uT=new re(function(t){return t.complete()});function lT(t){return t&&Dt(t.schedule)}function sg(t){return t[t.length-1]}function cT(t){return Dt(sg(t))?t.pop():void 0}function fT(t){return lT(sg(t))?t.pop():void 0}var ug=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function lg(t){return Dt(t==null?void 0:t.then)}function cg(t){return Dt(t[kl])}function fg(t){return Symbol.asyncIterator&&Dt(t==null?void 0:t[Symbol.asyncIterator])}function hg(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function hT(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var pg=hT();function dg(t){return Dt(t==null?void 0:t[pg])}function gg(t){return HA(this,arguments,function(){var e,n,r,i;return Zd(this,function(o){switch(o.label){case 0:e=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Cr(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Cr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Cr(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function mg(t){return Dt(t==null?void 0:t.getReader)}function dn(t){if(t instanceof re)return t;if(t!=null){if(cg(t))return pT(t);if(ug(t))return dT(t);if(lg(t))return gT(t);if(fg(t))return yg(t);if(dg(t))return mT(t);if(mg(t))return yT(t)}throw hg(t)}function pT(t){return new re(function(e){var n=t[kl]();if(Dt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function dT(t){return new re(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function gT(t){return new re(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,eg)})}function mT(t){return new re(function(e){var n,r;try{for(var i=Pr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function yg(t){return new re(function(e){bT(t,e).catch(function(n){return e.error(n)})})}function yT(t){return yg(gg(t))}function bT(t,e){var n,r,i,o;return WA(this,void 0,void 0,function(){var a,s;return Zd(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=XA(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function gn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function bg(t,e){return e===void 0&&(e=0),hn(function(n,r){n.subscribe(pn(r,function(i){return gn(r,t,function(){return r.next(i)},e)},function(){return gn(r,t,function(){return r.complete()},e)},function(i){return gn(r,t,function(){return r.error(i)},e)}))})}function xg(t,e){return e===void 0&&(e=0),hn(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function xT(t,e){return dn(t).pipe(xg(e),bg(e))}function vT(t,e){return dn(t).pipe(xg(e),bg(e))}function _T(t,e){return new re(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function wT(t,e){return new re(function(n){var r;return gn(n,e,function(){r=t[pg](),gn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return Dt(r==null?void 0:r.return)&&r.return()}})}function vg(t,e){if(!t)throw new Error("Iterable cannot be null");return new re(function(n){gn(n,e,function(){var r=t[Symbol.asyncIterator]();gn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function $T(t,e){return vg(gg(t),e)}function ST(t,e){if(t!=null){if(cg(t))return xT(t,e);if(ug(t))return _T(t,e);if(lg(t))return vT(t,e);if(fg(t))return vg(t,e);if(dg(t))return wT(t,e);if(mg(t))return $T(t,e)}throw hg(t)}function _g(t,e){return e?ST(t,e):dn(t)}Pl(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function kr(t,e){return hn(function(n,r){var i=0;n.subscribe(pn(r,function(o){r.next(t.call(e,o,i++))}))})}var AT=Array.isArray;function TT(t,e){return AT(e)?t.apply(void 0,Dr([],Mr(e))):t(e)}function PT(t){return kr(function(e){return TT(t,e)})}var MT=Array.isArray,DT=Object.getPrototypeOf,CT=Object.prototype,LT=Object.keys;function kT(t){if(t.length===1){var e=t[0];if(MT(e))return{args:e,keys:null};if(RT(e)){var n=LT(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function RT(t){return t&&typeof t=="object"&&DT(t)===CT}function ET(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function wg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=fT(t),r=cT(t),i=kT(t),o=i.args,a=i.keys;if(o.length===0)return _g([],n);var s=new re(IT(o,n,a?function(u){return ET(a,u)}:$a));return r?s.pipe(PT(r)):s}function IT(t,e,n){return n===void 0&&(n=$a),function(r){$g(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){$g(e,function(){var f=_g(t[c],e),h=!1;f.subscribe(pn(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function $g(t,e,n){t?gn(n,t,e):e()}function Sg(t){return hn(function(e,n){var r=null,i=!1,o;r=e.subscribe(pn(n,void 0,void 0,function(a){o=dn(t(a,Sg(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function NT(t,e){return e===void 0&&(e=$a),t=t??BT,hn(function(n,r){var i,o=!0;n.subscribe(pn(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function BT(t,e){return t===e}function FT(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new Lr}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return hn(function(v,x){p++,!g&&!d&&m();var S=h=h??n();x.add(function(){p--,p===0&&!g&&!d&&(f=El(b,u))}),S.subscribe(x),!c&&p>0&&(c=new Ei({next:function($){return S.next($)},error:function($){g=!0,m(),f=El(y,i,$),S.error($)},complete:function(){d=!0,m(),f=El(y,a),S.complete()}}),dn(v).subscribe(c))})(l)}}function El(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ei({next:function(){i.unsubscribe(),t()}});return dn(e.apply(void 0,Dr([],Mr(n)))).subscribe(i)}}function OT(t,e,n){var r,i=!1;return r=t,FT({connector:function(){return new iT(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Il(t,e){return hn(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(pn(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;dn(t(u,c)).subscribe(i=pn(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function Ag(t){return hn(function(e,n){dn(t).subscribe(pn(n,function(){return n.complete()},Dl)),!n.closed&&e.subscribe(n)})}const GT=t=>t.pipe(kr(e=>e.styles.textSize),NT(),kr(e=>{let n=NaN;if(typeof e=="string")if(e.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(e)*r}else e.includes("px")&&(n=parseFloat(e));else if(typeof e=="number")return e;return n||14})),Tg=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=vr.scaleDomain,scaleRange:i=vr.scaleRange})=>{const o=r[0]??vr.scaleDomain[0],a=r[1]??vr.scaleDomain[1],s=i[0]??vr.scaleRange[0],u=i[1]??vr.scaleRange[1];let l=o==="auto"?e<0?e:0:o==="min"?e:o,c=a==="auto"?t>=0?t:0:a==="max"?t:a;const f=t-(t-l)/(1-s),h=c/u;return jd().domain([f,h]).range([0,n])},Pg=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((u,l)=>l);r&&i.reverse();const o=i.length-1+n*2,a=e/o,s=a*n-a*.5;return Vd().domain([s,e-s]).range(i)},Mg=({fullDataFormatter$:t,layout$:e})=>{const n=new Lr;function r({xAxis:i,yAxis:o,width:a,height:s}){if(!i||!o)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,c=0,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,l=s):o.position==="right"?(f=180,h=180,u=a,l=s):(f=180,l=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,u=a):(f=180,l=s)):i.position==="left"?o.position==="bottom"?(c=-90,l=s):o.position==="top"?(c=-90,h=180):(f=180,l=s):i.position==="right"?o.position==="bottom"?(c=-90,f=180,l=s,u=a):o.position==="top"?(c=-90,f=180,h=180,u=a):(f=180,l=s):(f=180,l=s),{translate:[u,l],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new re(i=>(wg({fullDataFormatter:t,layout:e}).pipe(Ag(n),Il(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Dg=({gridAxesTransform$:t})=>t.pipe(kr(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}})),Cg=({computedData$:t,fullDataFormatter$:e,layout$:n})=>wg({computedData:t,fullDataFormatter:e,layout:n}).pipe(Il(async r=>r),kr(r=>{if(r.fullDataFormatter.grid.separateSeries)return qd(r.layout,r.fullDataFormatter.container,r.computedData.length);{const i=qd(r.layout,r.fullDataFormatter.container,1);return r.computedData.map((o,a)=>i[0])}}));function zT(t){return`[OrbCharts warn]: ${t.message}`}function YT({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
|
6
|
+
|
7
|
+
----> find in '${n}'`}function UT({columnName:t,expectToBe:e,from:n}){return`Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
|
8
|
+
|
9
|
+
----> find in '${n}'`}function WT({chartType:t,config:e,initFn:n}){const r=new Lr,i=new WeakMap;let o=()=>{},a;const s=new ig(e.defaultParams),u=new ig({}),l=s.pipe(Il(c=>u.pipe(Ag(r),kr(f=>{try{const{status:h,columnName:p,expectToBe:d}=e.validator(f,{validateColumns:X_});if(h==="error")throw new Error(YT({columnName:p,expectToBe:d,from:"Chart.constructor"}));return h==="warning"&&console.warn(UT({columnName:p,expectToBe:d,from:"Chart.constructor"})),al(f,c)}catch(h){throw new Error(h.message)}}),Sg(f=>(console.error(zT(f)),uT)))),OT(1));return{params$:u,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.layerIndex,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:c=>{s.next(al(c,e.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=l}}}const Ii=t=>function(e){return function(n){return class{constructor(){const r=WT({chartType:t,config:e,initFn:n});this.params$=r.params$,this.name=r.name,this.chartType=r.chartType,this.defaultParams=r.defaultParams,this.layerIndex=r.layerIndex,this.init=r.init,this.destroy=r.destroy,this.setPresetParams=r.setPresetParams,this.setContext=r.setContext}}}},Fn=Ii("series"),ue=Ii("grid"),de=Ii("multiGrid"),HT=Ii("noneData"),Lg=Ii("tree");function _t(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function kg(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Sa(t){let e,n,r;t.length!==2?(e=_t,n=(s,u)=>_t(t(s),u),r=(s,u)=>t(s)-u):(e=t===_t||t===kg?t:XT,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function XT(){return 0}function Aa(t){return t===null?NaN:+t}function*jT(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const Rg=Sa(_t),Eg=Rg.right,VT=Rg.left,qT=Sa(Aa).center,On=Eg;function ZT(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=Nl(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const Ig=Ng(Nl),KT=Ng(QT);function Ng(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const s=n&&t(n),u=r&&t(r),l=i.slice();return s&&u?(Rr(s,l,i,o,a),Rr(s,i,l,o,a),Rr(s,l,i,o,a),Er(u,i,l,o,a),Er(u,l,i,o,a),Er(u,i,l,o,a)):s?(Rr(s,i,l,o,a),Rr(s,l,i,o,a),Rr(s,i,l,o,a)):u&&(Er(u,i,l,o,a),Er(u,l,i,o,a),Er(u,i,l,o,a)),e}}function Rr(t,e,n,r,i){for(let o=0,a=r*i;o<a;)t(e,n,o,o+=r,1)}function Er(t,e,n,r,i){for(let o=0,a=r*i;o<r;++o)t(e,n,o,o+a,r)}function QT(t){const e=Nl(t);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,e(n,r,i+0,o+0,a),e(n,r,i+1,o+1,a),e(n,r,i+2,o+2,a),e(n,r,i+3,o+3,a)}}function Nl(t){const e=Math.floor(t);if(e===t)return JT(t);const n=t-e,r=2*t+1;return(i,o,a,s,u)=>{if(!((s-=u)>=a))return;let l=e*o[a];const c=u*e,f=c+u;for(let h=a,p=a+c;h<p;h+=u)l+=o[Math.min(s,h)];for(let h=a,p=s;h<=p;h+=u)l+=o[Math.min(s,h+c)],i[h]=(l+n*(o[Math.max(a,h-f)]+o[Math.min(s,h+f)]))/r,l-=o[Math.max(a,h-c)]}}function JT(t){const e=2*t+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let l=i,c=i+u;l<c;l+=a)s+=r[Math.min(o,l)];for(let l=i,c=o;l<=c;l+=a)s+=r[Math.min(o,l+u)],n[l]=s/e,s-=r[Math.max(i,l-u)]}}function Ta(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function t3(t){return t.length|0}function e3(t){return!(t>0)}function n3(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function r3(t){return e=>t(...e)}function i3(...t){const e=typeof t[t.length-1]=="function"&&r3(t.pop());t=t.map(n3);const n=t.map(t3),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(e3))return o;for(;;){o.push(i.map((s,u)=>t[u][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return e?o.map(e):o;i[a--]=0}}}function o3(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?i=>n+=+i||0:i=>n+=+e(i,r++,t)||0)}function Bg(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function Fg(t,e){const n=Bg(t,e);return n&&Math.sqrt(n)}function Ni(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Ct{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function a3(t,e){const n=new Ct;if(e===void 0)for(let r of t)(r=+r)&&n.add(r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function s3(t,e){const n=new Ct;let r=-1;return Float64Array.from(t,e===void 0?i=>n.add(+i||0):i=>n.add(+e(i,++r,t)||0))}class Bi extends Map{constructor(e,n=zg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Bl(this,e))}has(e){return super.has(Bl(this,e))}set(e,n){return super.set(Og(this,e),n)}delete(e){return super.delete(Gg(this,e))}}class Gn extends Set{constructor(e,n=zg){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(Bl(this,e))}add(e){return super.add(Og(this,e))}delete(e){return super.delete(Gg(this,e))}}function Bl({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Og({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Gg({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function zg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Ir(t){return t}function Yg(t,...e){return Nr(t,Ir,Ir,e)}function Ug(t,...e){return Nr(t,Array.from,Ir,e)}function Wg(t,e){for(let n=1,r=e.length;n<r;++n)t=t.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return t}function u3(t,...e){return Wg(Ug(t,...e),e)}function l3(t,e,...n){return Wg(Xg(t,e,...n),n)}function Hg(t,e,...n){return Nr(t,Ir,e,n)}function Xg(t,e,...n){return Nr(t,Array.from,e,n)}function c3(t,...e){return Nr(t,Ir,jg,e)}function f3(t,...e){return Nr(t,Array.from,jg,e)}function jg(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Nr(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new Bi,u=r[a++];let l=-1;for(const c of o){const f=u(c,++l,o),h=s.get(f);h?h.push(c):s.set(f,[c])}for(const[c,f]of s)s.set(c,i(f,a));return e(s)}(t,0)}function Vg(t,e){return Array.from(e,n=>t[n])}function Fl(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=Br(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>Br(n[i],n[o]))),Vg(t,r)}return t.sort(Ol(n))}function Ol(t=_t){if(t===_t)return Br;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Br(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function h3(t,e,n){return(e.length!==2?Fl(Hg(t,e,n),([r,i],[o,a])=>_t(i,a)||_t(r,o)):Fl(Yg(t,n),([r,i],[o,a])=>e(i,a)||_t(r,o))).map(([r])=>r)}var p3=Array.prototype,d3=p3.slice;function Gl(t){return()=>t}const g3=Math.sqrt(50),m3=Math.sqrt(10),y3=Math.sqrt(2);function Pa(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=g3?10:o>=m3?5:o>=y3?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?Pa(t,e,n*2):[s,u,l]}function zn(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Pa(e,t,n):Pa(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function Yn(t,e,n){return e=+e,t=+t,n=+n,Pa(t,e,n)[2]}function Ma(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Yn(e,t,n):Yn(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function zl(t,e,n){let r;for(;;){const i=Yn(t,e,n);if(i===r||i===0||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function Yl(t){return Math.max(1,Math.ceil(Math.log(Ta(t))/Math.LN2)+1)}function qg(){var t=Ir,e=Ni,n=Yl;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,u,l=new Array(a);for(o=0;o<a;++o)l[o]=t(i[o],o,i);var c=e(l),f=c[0],h=c[1],p=n(l,f,h);if(!Array.isArray(p)){const v=h,x=+p;if(e===Ni&&([f,h]=zl(f,h,x)),p=zn(f,h,x),p[0]<=f&&(u=Yn(f,h,x)),p[p.length-1]>=h)if(v>=h&&e===Ni){const S=Yn(f,h,x);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}else p.pop()}for(var d=p.length,g=0,m=d;p[g]<=f;)++g;for(;p[m-1]>h;)--m;(g||m<d)&&(p=p.slice(g,m),d=m-g);var y=new Array(d+1),b;for(o=0;o<=d;++o)b=y[o]=[],b.x0=o>0?p[o-1]:f,b.x1=o<d?p[o]:h;if(isFinite(u)){if(u>0)for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[Math.min(d,Math.floor((s-f)/u))].push(i[o]);else if(u<0){for(o=0;o<a;++o)if((s=l[o])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*u);y[Math.min(d,v+(p[v]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=l[o])!=null&&f<=s&&s<=h&&y[On(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:Gl(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:Gl([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Gl(Array.isArray(i)?d3.call(i):i),r):n},r}function Fi(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Ul(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Da(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Wl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Ca(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?Br:Ol(i);r>n;){if(r-n>600){const u=r-n+1,l=e-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(e-l*f/u+h)),d=Math.min(r,Math.floor(e+(u-l)*f/u+h));Ca(t,e,p,d,i)}const o=t[e];let a=n,s=r;for(Oi(t,n,e),i(t[r],o)>0&&Oi(t,n,r);a<s;){for(Oi(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Oi(t,n,s):(++s,Oi(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Oi(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Zg(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)>0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function Gi(t,e,n){if(t=Float64Array.from(jT(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Da(t);if(e>=1)return Fi(t);var r,i=(r-1)*e,o=Math.floor(i),a=Fi(Ca(t,o).subarray(0,o+1)),s=Da(t.subarray(o+1));return a+(s-a)*(i-o)}}function Kg(t,e,n=Aa){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function Qg(t,e,n=Aa){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,u)=>Aa(n(t[u],u,t))),e<=0)return Wl(r);if(e>=1)return Ul(r);var r,i=Uint32Array.from(t,(s,u)=>u),o=r.length-1,a=Math.floor(o*e);return Ca(i,a,0,o,(s,u)=>Br(r[s],r[u])),a=Zg(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function b3(t,e,n){const r=Ta(t),i=Gi(t,.75)-Gi(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function x3(t,e,n){const r=Ta(t),i=Fg(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function v3(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function _3(t,e){return Gi(t,.5,e)}function w3(t,e){return Qg(t,.5,e)}function*$3(t){for(const e of t)yield*e}function Hl(t){return Array.from($3(t))}function S3(t,e){const n=new Bi;if(e===void 0)for(let o of t)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of t)(a=e(a,++o,t))!=null&&a>=a&&n.set(a,(n.get(a)||0)+1)}let r,i=0;for(const[o,a]of n)a>i&&(i=a,r=o);return r}function A3(t,e=T3){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function T3(t,e){return[t,e]}function mn(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function P3(t,e=_t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t);const r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=_t);const i=(s,u)=>e(n[s],n[u]);let o,a;return t=Uint32Array.from(n,(s,u)=>u),t.sort(e===_t?(s,u)=>Br(n[s],n[u]):Ol(i)),t.forEach((s,u)=>{const l=i(s,o===void 0?s:o);l>=0?((o===void 0||l>0)&&(o=s,a=u),r[s]=a):r[s]=NaN}),r}function M3(t,e=_t){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?_t(a,i)<0:_t(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function Jg(t,e=_t){if(e.length===1)return Wl(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)<0)&&(n=o,r=i);return r}function D3(t,e=_t){if(e.length===1)return Ul(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)>0)&&(n=o,r=i);return r}function C3(t,e){const n=Jg(t,e);return n<0?void 0:n}const L3=t0(Math.random);function t0(t){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=t()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function e0(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function n0(t){if(!(o=t.length))return[];for(var e=-1,n=Da(t,k3),r=new Array(n);++e<n;)for(var i=-1,o,a=r[e]=new Array(o);++i<o;)a[i]=t[i][e];return r}function k3(t){return t.length}function R3(){return n0(arguments)}function E3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(!e(r,++n,t))return!1;return!0}function I3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(e(r,++n,t))return!0;return!1}function N3(t,e){if(typeof e!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of t)e(i,++r,t)&&n.push(i);return n}function B3(t,e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof e!="function")throw new TypeError("mapper is not a function");return Array.from(t,(n,r)=>e(n,r,t))}function F3(t,e,n){if(typeof e!="function")throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:n}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)n=e(n,o,++a,t);return n}function O3(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function G3(t,...e){t=new Gn(t);for(const n of e)for(const r of n)t.delete(r);return t}function z3(t,e){const n=e[Symbol.iterator](),r=new Gn;for(const i of t){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function Y3(t,...e){t=new Gn(t),e=e.map(U3);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function U3(t){return t instanceof Gn?t:new Gn(t)}function r0(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=i0(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=i0(a);if(r.add(u),Object.is(o,u))break}}return!0}function i0(t){return t!==null&&typeof t=="object"?t.valueOf():t}function W3(t,e){return r0(e,t)}function H3(...t){const e=new Gn;for(const n of t)for(const r of n)e.add(r);return e}function X3(t){return t}var La=1,ka=2,Xl=3,zi=4,o0=1e-6;function j3(t){return"translate("+t+",0)"}function V3(t){return"translate(0,"+t+")"}function q3(t){return e=>+t(e)}function Z3(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function K3(){return!this.__axis}function Ra(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===La||t===zi?-1:1,c=t===zi||t===ka?"x":"y",f=t===La||t===Xl?j3:V3;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=i??(e.tickFormat?e.tickFormat.apply(e,n):X3),m=Math.max(o,0)+s,y=e.range(),b=+y[0]+u,v=+y[y.length-1]+u,x=(e.bandwidth?Z3:q3)(e.copy(),u),S=p.selection?p.selection():p,$=S.selectAll(".domain").data([null]),R=S.selectAll(".tick").data(d,e).order(),T=R.exit(),w=R.enter().append("g").attr("class","tick"),P=R.select("line"),_=R.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(w),P=P.merge(w.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),_=_.merge(w.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",t===La?"0em":t===Xl?"0.71em":"0.32em")),p!==S&&($=$.transition(p),R=R.transition(p),P=P.transition(p),_=_.transition(p),T=T.transition(p).attr("opacity",o0).attr("transform",function(N){return isFinite(N=x(N))?f(N+u):this.getAttribute("transform")}),w.attr("opacity",o0).attr("transform",function(N){var D=this.parentNode.__axis;return f((D&&isFinite(D=D(N))?D:x(N))+u)})),T.remove(),$.attr("d",t===zi||t===ka?a?"M"+l*a+","+b+"H"+u+"V"+v+"H"+l*a:"M"+u+","+b+"V"+v:a?"M"+b+","+l*a+"V"+u+"H"+v+"V"+l*a:"M"+b+","+u+"H"+v),R.attr("opacity",1).attr("transform",function(N){return f(x(N)+u)}),P.attr(c+"2",l*o),_.attr(c,l*m).text(g),S.filter(K3).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ka?"start":t===zi?"end":"middle"),S.each(function(){this.__axis=x})}return h.scale=function(p){return arguments.length?(e=p,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(o=a=+p,h):o},h.tickSizeInner=function(p){return arguments.length?(o=+p,h):o},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(s=+p,h):s},h.offset=function(p){return arguments.length?(u=+p,h):u},h}function Q3(t){return Ra(La,t)}function J3(t){return Ra(ka,t)}function a0(t){return Ra(Xl,t)}function s0(t){return Ra(zi,t)}var t5={value:()=>{}};function Un(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ea(n)}function Ea(t){this._=t}function e5(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ea.prototype=Un.prototype={constructor:Ea,on:function(t,e){var n=this._,r=e5(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=n5(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=u0(n[i],t.name,e);else if(e==null)for(i in n)n[i]=u0(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ea(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function n5(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function u0(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=t5,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var jl="http://www.w3.org/1999/xhtml";const Vl={svg:"http://www.w3.org/2000/svg",xhtml:jl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Vl.hasOwnProperty(e)?{space:Vl[e],local:t}:t}function r5(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===jl&&e.documentElement.namespaceURI===jl?e.createElement(t):e.createElementNS(n,t)}}function i5(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ia(t){var e=Yi(t);return(e.local?i5:r5)(e)}function o5(){}function Na(t){return t==null?o5:function(){return this.querySelector(t)}}function a5(t){typeof t!="function"&&(t=Na(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new Wt(r,this._parents)}function l0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function s5(){return[]}function ql(t){return t==null?s5:function(){return this.querySelectorAll(t)}}function u5(t){return function(){return l0(t.apply(this,arguments))}}function l5(t){typeof t=="function"?t=u5(t):t=ql(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new Wt(r,i)}function Zl(t){return function(){return this.matches(t)}}function c0(t){return function(e){return e.matches(t)}}var c5=Array.prototype.find;function f5(t){return function(){return c5.call(this.children,t)}}function h5(){return this.firstElementChild}function p5(t){return this.select(t==null?h5:f5(typeof t=="function"?t:c0(t)))}var d5=Array.prototype.filter;function g5(){return Array.from(this.children)}function m5(t){return function(){return d5.call(this.children,t)}}function y5(t){return this.selectAll(t==null?g5:m5(typeof t=="function"?t:c0(t)))}function b5(t){typeof t!="function"&&(t=Zl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Wt(r,this._parents)}function f0(t){return new Array(t.length)}function x5(){return new Wt(this._enter||this._groups.map(f0),this._parents)}function Ba(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ba.prototype={constructor:Ba,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function v5(t){return function(){return t}}function _5(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ba(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function w5(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new Ba(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function $5(t){return t.__data__}function S5(t,e){if(!arguments.length)return Array.from(this,$5);var n=e?w5:_5,r=this._parents,i=this._groups;typeof t!="function"&&(t=v5(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=A5(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var b=0,v=0,x,S;b<d;++b)if(x=g[b]){for(b>=v&&(v=b+1);!(S=m[v])&&++v<d;);x._next=S||null}}return a=new Wt(a,r),a._enter=s,a._exit=u,a}function A5(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function T5(){return new Wt(this._exit||this._groups.map(f0),this._parents)}function P5(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function M5(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new Wt(s,this._parents)}function D5(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function C5(t){t||(t=L5);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new Wt(i,this._parents).order()}function L5(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function k5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function R5(){return Array.from(this)}function E5(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function I5(){let t=0;for(const e of this)++t;return t}function N5(){return!this.node()}function B5(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function F5(t){return function(){this.removeAttribute(t)}}function O5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function G5(t,e){return function(){this.setAttribute(t,e)}}function z5(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Y5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function U5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function W5(t,e){var n=Yi(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?O5:F5:typeof e=="function"?n.local?U5:Y5:n.local?z5:G5)(n,e))}function Kl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function H5(t){return function(){this.style.removeProperty(t)}}function X5(t,e,n){return function(){this.style.setProperty(t,e,n)}}function j5(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function V5(t,e,n){return arguments.length>1?this.each((e==null?H5:typeof e=="function"?j5:X5)(t,e,n??"")):Wn(this.node(),t)}function Wn(t,e){return t.style.getPropertyValue(e)||Kl(t).getComputedStyle(t,null).getPropertyValue(e)}function q5(t){return function(){delete this[t]}}function Z5(t,e){return function(){this[t]=e}}function K5(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Q5(t,e){return arguments.length>1?this.each((e==null?q5:typeof e=="function"?K5:Z5)(t,e)):this.node()[t]}function h0(t){return t.trim().split(/^|\s+/)}function Ql(t){return t.classList||new p0(t)}function p0(t){this._node=t,this._names=h0(t.getAttribute("class")||"")}p0.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function d0(t,e){for(var n=Ql(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function g0(t,e){for(var n=Ql(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function J5(t){return function(){d0(this,t)}}function t6(t){return function(){g0(this,t)}}function e6(t,e){return function(){(e.apply(this,arguments)?d0:g0)(this,t)}}function n6(t,e){var n=h0(t+"");if(arguments.length<2){for(var r=Ql(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?e6:e?J5:t6)(n,e))}function r6(){this.textContent=""}function i6(t){return function(){this.textContent=t}}function o6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function a6(t){return arguments.length?this.each(t==null?r6:(typeof t=="function"?o6:i6)(t)):this.node().textContent}function s6(){this.innerHTML=""}function u6(t){return function(){this.innerHTML=t}}function l6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function c6(t){return arguments.length?this.each(t==null?s6:(typeof t=="function"?l6:u6)(t)):this.node().innerHTML}function f6(){this.nextSibling&&this.parentNode.appendChild(this)}function h6(){return this.each(f6)}function p6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function d6(){return this.each(p6)}function g6(t){var e=typeof t=="function"?t:Ia(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function m6(){return null}function y6(t,e){var n=typeof t=="function"?t:Ia(t),r=e==null?m6:typeof e=="function"?e:Na(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function b6(){var t=this.parentNode;t&&t.removeChild(this)}function x6(){return this.each(b6)}function v6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function w6(t){return this.select(t?_6:v6)}function $6(t){return arguments.length?this.property("__data__",t):this.node().__data__}function S6(t){return function(e){t.call(this,e,this.__data__)}}function A6(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function T6(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function P6(t,e,n){return function(){var r=this.__on,i,o=S6(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function M6(t,e,n){var r=A6(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?P6:T6,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function m0(t,e,n){var r=Kl(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function D6(t,e){return function(){return m0(this,t,e)}}function C6(t,e){return function(){return m0(this,t,e.apply(this,arguments))}}function L6(t,e){return this.each((typeof e=="function"?C6:D6)(t,e))}function*k6(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Jl=[null];function Wt(t,e){this._groups=t,this._parents=e}function Hn(){return new Wt([[document.documentElement]],Jl)}function R6(){return this}Wt.prototype=Hn.prototype={constructor:Wt,select:a5,selectAll:l5,selectChild:p5,selectChildren:y5,filter:b5,data:S5,enter:x5,exit:T5,join:P5,merge:M5,selection:R6,order:D5,sort:C5,call:k5,nodes:R5,node:E5,size:I5,empty:N5,each:B5,attr:W5,style:V5,property:Q5,classed:n6,text:a6,html:c6,raise:h6,lower:d6,append:g6,insert:y6,remove:x6,clone:w6,datum:$6,on:M6,dispatch:L6,[Symbol.iterator]:k6};function V(t){return typeof t=="string"?new Wt([[document.querySelector(t)]],[document.documentElement]):new Wt([[t]],Jl)}function E6(t){return V(Ia(t).call(document.documentElement))}var I6=0;function y0(){return new tc}function tc(){this._="@"+(++I6).toString(36)}tc.prototype=y0.prototype={constructor:tc,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function b0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function le(t,e){if(t=b0(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function N6(t,e){return t.target&&(t=b0(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>le(n,e))}function B6(t){return typeof t=="string"?new Wt([document.querySelectorAll(t)],[document.documentElement]):new Wt([l0(t)],Jl)}const F6={passive:!1},Ui={capture:!0,passive:!1};function ec(t){t.stopImmediatePropagation()}function Fr(t){t.preventDefault(),t.stopImmediatePropagation()}function Fa(t){var e=t.document.documentElement,n=V(t).on("dragstart.drag",Fr,Ui);"onselectstart"in e?n.on("selectstart.drag",Fr,Ui):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Oa(t,e){var n=t.document.documentElement,r=V(t).on("dragstart.drag",null);e&&(r.on("click.drag",Fr,Ui),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ga=t=>()=>t;function nc(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}nc.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function O6(t){return!t.ctrlKey&&!t.button}function G6(){return this.parentNode}function z6(t,e){return e??{x:t.x,y:t.y}}function Y6(){return navigator.maxTouchPoints||"ontouchstart"in this}function x0(){var t=O6,e=G6,n=z6,r=Y6,i={},o=Un("start","drag","end"),a=0,s,u,l,c,f=0;function h(x){x.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,F6).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,S){if(!(c||!t.call(this,x,S))){var $=v(this,e.call(this,x,S),x,S,"mouse");$&&(V(x.view).on("mousemove.drag",d,Ui).on("mouseup.drag",g,Ui),Fa(x.view),ec(x),l=!1,s=x.clientX,u=x.clientY,$("start",x))}}function d(x){if(Fr(x),!l){var S=x.clientX-s,$=x.clientY-u;l=S*S+$*$>f}i.mouse("drag",x)}function g(x){V(x.view).on("mousemove.drag mouseup.drag",null),Oa(x.view,l),Fr(x),i.mouse("end",x)}function m(x,S){if(t.call(this,x,S)){var $=x.changedTouches,R=e.call(this,x,S),T=$.length,w,P;for(w=0;w<T;++w)(P=v(this,R,x,S,$[w].identifier,$[w]))&&(ec(x),P("start",x,$[w]))}}function y(x){var S=x.changedTouches,$=S.length,R,T;for(R=0;R<$;++R)(T=i[S[R].identifier])&&(Fr(x),T("drag",x,S[R]))}function b(x){var S=x.changedTouches,$=S.length,R,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),R=0;R<$;++R)(T=i[S[R].identifier])&&(ec(x),T("end",x,S[R]))}function v(x,S,$,R,T,w){var P=o.copy(),_=le(w||$,S),N,D,A;if((A=n.call(x,new nc("beforestart",{sourceEvent:$,target:h,identifier:T,active:a,x:_[0],y:_[1],dx:0,dy:0,dispatch:P}),R))!=null)return N=A.x-_[0]||0,D=A.y-_[1]||0,function L(M,G,O){var E=_,k;switch(M){case"start":i[T]=L,k=a++;break;case"end":delete i[T],--a;case"drag":_=le(O||G,S),k=a;break}P.call(M,x,new nc(M,{sourceEvent:G,subject:A,target:h,identifier:T,active:k,x:_[0]+N,y:_[1]+D,dx:_[0]-E[0],dy:_[1]-E[1],dispatch:P}),R)}}return h.filter=function(x){return arguments.length?(t=typeof x=="function"?x:Ga(!!x),h):t},h.container=function(x){return arguments.length?(e=typeof x=="function"?x:Ga(x),h):e},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:Ga(x),h):n},h.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:Ga(!!x),h):r},h.on=function(){var x=o.on.apply(o,arguments);return x===o?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}function Or(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Wi(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function yn(){}var Xn=.7,Gr=1/Xn,zr="\\s*([+-]?\\d+)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Be="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U6=/^#([0-9a-f]{3,8})$/,W6=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),H6=new RegExp(`^rgb\\(${Be},${Be},${Be}\\)$`),X6=new RegExp(`^rgba\\(${zr},${zr},${zr},${Hi}\\)$`),j6=new RegExp(`^rgba\\(${Be},${Be},${Be},${Hi}\\)$`),V6=new RegExp(`^hsl\\(${Hi},${Be},${Be}\\)$`),q6=new RegExp(`^hsla\\(${Hi},${Be},${Be},${Hi}\\)$`),v0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Or(yn,bn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_0,formatHex:_0,formatHex8:Z6,formatHsl:K6,formatRgb:w0,toString:w0});function _0(){return this.rgb().formatHex()}function Z6(){return this.rgb().formatHex8()}function K6(){return P0(this).formatHsl()}function w0(){return this.rgb().formatRgb()}function bn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=U6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$0(e):n===3?new Rt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?za(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?za(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=W6.exec(t))?new Rt(e[1],e[2],e[3],1):(e=H6.exec(t))?new Rt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=X6.exec(t))?za(e[1],e[2],e[3],e[4]):(e=j6.exec(t))?za(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=V6.exec(t))?T0(e[1],e[2]/100,e[3]/100,1):(e=q6.exec(t))?T0(e[1],e[2]/100,e[3]/100,e[4]):v0.hasOwnProperty(t)?$0(v0[t]):t==="transparent"?new Rt(NaN,NaN,NaN,0):null}function $0(t){return new Rt(t>>16&255,t>>8&255,t&255,1)}function za(t,e,n,r){return r<=0&&(t=e=n=NaN),new Rt(t,e,n,r)}function rc(t){return t instanceof yn||(t=bn(t)),t?(t=t.rgb(),new Rt(t.r,t.g,t.b,t.opacity)):new Rt}function Yr(t,e,n,r){return arguments.length===1?rc(t):new Rt(t,e,n,r??1)}function Rt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Or(Rt,Yr,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new Rt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new Rt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Rt(jn(this.r),jn(this.g),jn(this.b),Ya(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S0,formatHex:S0,formatHex8:Q6,formatRgb:A0,toString:A0}));function S0(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function Q6(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function A0(){const t=Ya(this.opacity);return`${t===1?"rgb(":"rgba("}${jn(this.r)}, ${jn(this.g)}, ${jn(this.b)}${t===1?")":`, ${t})`}`}function Ya(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Vn(t){return t=jn(t),(t<16?"0":"")+t.toString(16)}function T0(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Te(t,e,n,r)}function P0(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof yn||(t=bn(t)),!t)return new Te;if(t instanceof Te)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Te(a,s,u,t.opacity)}function Ua(t,e,n,r){return arguments.length===1?P0(t):new Te(t,e,n,r??1)}function Te(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Or(Te,Ua,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Rt(ic(t>=240?t-240:t+120,i,r),ic(t,i,r),ic(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Te(M0(this.h),Wa(this.s),Wa(this.l),Ya(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ya(this.opacity);return`${t===1?"hsl(":"hsla("}${M0(this.h)}, ${Wa(this.s)*100}%, ${Wa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function M0(t){return t=(t||0)%360,t<0?t+360:t}function Wa(t){return Math.max(0,Math.min(1,t||0))}function ic(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const D0=Math.PI/180,C0=180/Math.PI,Ha=18,L0=.96422,k0=1,R0=.82521,E0=4/29,Ur=6/29,I0=3*Ur*Ur,J6=Ur*Ur*Ur;function N0(t){if(t instanceof Pe)return new Pe(t.l,t.a,t.b,t.opacity);if(t instanceof Fe)return F0(t);t instanceof Rt||(t=rc(t));var e=uc(t.r),n=uc(t.g),r=uc(t.b),i=oc((.2225045*e+.7168786*n+.0606169*r)/k0),o,a;return e===n&&n===r?o=a=i:(o=oc((.4360747*e+.3850649*n+.1430804*r)/L0),a=oc((.0139322*e+.0971045*n+.7141733*r)/R0)),new Pe(116*i-16,500*(o-i),200*(i-a),t.opacity)}function tP(t,e){return new Pe(t,0,0,e??1)}function Xa(t,e,n,r){return arguments.length===1?N0(t):new Pe(t,e,n,r??1)}function Pe(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Or(Pe,Xa,Wi(yn,{brighter(t){return new Pe(this.l+Ha*(t??1),this.a,this.b,this.opacity)},darker(t){return new Pe(this.l-Ha*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=L0*ac(e),t=k0*ac(t),n=R0*ac(n),new Rt(sc(3.1338561*e-1.6168667*t-.4906146*n),sc(-.9787684*e+1.9161415*t+.033454*n),sc(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oc(t){return t>J6?Math.pow(t,1/3):t/I0+E0}function ac(t){return t>Ur?t*t*t:I0*(t-E0)}function sc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function uc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function B0(t){if(t instanceof Fe)return new Fe(t.h,t.c,t.l,t.opacity);if(t instanceof Pe||(t=N0(t)),t.a===0&&t.b===0)return new Fe(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*C0;return new Fe(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function eP(t,e,n,r){return arguments.length===1?B0(t):new Fe(n,e,t,r??1)}function ja(t,e,n,r){return arguments.length===1?B0(t):new Fe(t,e,n,r??1)}function Fe(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function F0(t){if(isNaN(t.h))return new Pe(t.l,0,0,t.opacity);var e=t.h*D0;return new Pe(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Or(Fe,ja,Wi(yn,{brighter(t){return new Fe(this.h,this.c,this.l+Ha*(t??1),this.opacity)},darker(t){return new Fe(this.h,this.c,this.l-Ha*(t??1),this.opacity)},rgb(){return F0(this).rgb()}}));var O0=-.14861,lc=1.78277,cc=-.29227,Va=-.90649,Xi=1.97294,G0=Xi*Va,z0=Xi*lc,Y0=lc*cc-Va*O0;function nP(t){if(t instanceof qn)return new qn(t.h,t.s,t.l,t.opacity);t instanceof Rt||(t=rc(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Y0*r+G0*e-z0*n)/(Y0+G0-z0),o=r-i,a=(Xi*(n-i)-cc*o)/Va,s=Math.sqrt(a*a+o*o)/(Xi*i*(1-i)),u=s?Math.atan2(a,o)*C0-120:NaN;return new qn(u<0?u+360:u,s,i,t.opacity)}function Me(t,e,n,r){return arguments.length===1?nP(t):new qn(t,e,n,r??1)}function qn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Or(qn,Me,Wi(yn,{brighter(t){return t=t==null?Gr:Math.pow(Gr,t),new qn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xn:Math.pow(Xn,t),new qn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*D0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Rt(255*(e+n*(O0*r+lc*i)),255*(e+n*(cc*r+Va*i)),255*(e+n*(Xi*r)),this.opacity)}}));function U0(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function W0(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return U0((n-r/e)*e,a,i,o,s)}}function H0(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return U0((n-r/e)*e,i,o,a,s)}}const qa=t=>()=>t;function X0(t,e){return function(n){return t+n*e}}function rP(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Za(t,e){var n=e-t;return n?X0(t,n>180||n<-180?n-360*Math.round(n/360):n):qa(isNaN(t)?e:t)}function iP(t){return(t=+t)==1?Et:function(e,n){return n-e?rP(e,n,t):qa(isNaN(e)?n:e)}}function Et(t,e){var n=e-t;return n?X0(t,n):qa(isNaN(t)?e:t)}const ji=function t(e){var n=iP(e);function r(i,o){var a=n((i=Yr(i)).r,(o=Yr(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=Et(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function j0(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Yr(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(u){return s.r=r(u),s.g=i(u),s.b=o(u),s+""}}}var V0=j0(W0),oP=j0(H0);function fc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function q0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function aP(t,e){return(q0(e)?fc:Z0)(t,e)}function Z0(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Ze(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function K0(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function ge(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Q0(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Ze(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var hc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pc=new RegExp(hc.source,"g");function sP(t){return function(){return t}}function uP(t){return function(e){return t(e)+""}}function dc(t,e){var n=hc.lastIndex=pc.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=hc.exec(t))&&(i=pc.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:ge(r,i)})),n=pc.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?uP(u[0].x):sP(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function Ze(t,e){var n=typeof e,r;return e==null||n==="boolean"?qa(e):(n==="number"?ge:n==="string"?(r=bn(e))?(e=r,ji):dc:e instanceof bn?ji:e instanceof Date?K0:q0(e)?fc:Array.isArray(e)?Z0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Q0:ge)(t,e)}function lP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function cP(t,e){var n=Za(+t,+e);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Ka(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var J0=180/Math.PI,gc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tm(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*J0,skewX:Math.atan(u)*J0,scaleX:a,scaleY:s}}var Qa;function fP(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?gc:tm(e.a,e.b,e.c,e.d,e.e,e.f)}function hP(t){return t==null||(Qa||(Qa=document.createElementNS("http://www.w3.org/2000/svg","g")),Qa.setAttribute("transform",t),!(t=Qa.transform.baseVal.consolidate()))?gc:(t=t.matrix,tm(t.a,t.b,t.c,t.d,t.e,t.f))}function em(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:ge(l,f)},{i:g-2,x:ge(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:ge(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:ge(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:ge(l,f)},{i:g-2,x:ge(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var nm=em(fP,"px, ","px)","deg)"),rm=em(hP,", ",")",")"),pP=1e-12;function im(t){return((t=Math.exp(t))+1/t)/2}function dP(t){return((t=Math.exp(t))-1/t)/2}function gP(t){return((t=Math.exp(2*t))-1)/(t+1)}const om=function t(e,n,r){function i(o,a){var s=o[0],u=o[1],l=o[2],c=a[0],f=a[1],h=a[2],p=c-s,d=f-u,g=p*p+d*d,m,y;if(g<pP)y=Math.log(h/l)/e,m=function(R){return[s+R*p,u+R*d,l*Math.exp(e*R*y)]};else{var b=Math.sqrt(g),v=(h*h-l*l+r*g)/(2*l*n*b),x=(h*h-l*l-r*g)/(2*h*n*b),S=Math.log(Math.sqrt(v*v+1)-v),$=Math.log(Math.sqrt(x*x+1)-x);y=($-S)/e,m=function(R){var T=R*y,w=im(S),P=l/(n*b)*(w*gP(e*T+S)-dP(S));return[s+P*p,u+P*d,l*w/im(e*T+S)]}}return m.duration=y*1e3*e/Math.SQRT2,m}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,u=s*s;return t(a,s,u)},i}(Math.SQRT2,2,4);function am(t){return function(e,n){var r=t((e=Ua(e)).h,(n=Ua(n)).h),i=Et(e.s,n.s),o=Et(e.l,n.l),a=Et(e.opacity,n.opacity);return function(s){return e.h=r(s),e.s=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const mP=am(Za);var yP=am(Et);function bP(t,e){var n=Et((t=Xa(t)).l,(e=Xa(e)).l),r=Et(t.a,e.a),i=Et(t.b,e.b),o=Et(t.opacity,e.opacity);return function(a){return t.l=n(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function sm(t){return function(e,n){var r=t((e=ja(e)).h,(n=ja(n)).h),i=Et(e.c,n.c),o=Et(e.l,n.l),a=Et(e.opacity,n.opacity);return function(s){return e.h=r(s),e.c=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const xP=sm(Za);var vP=sm(Et);function um(t){return function e(n){n=+n;function r(i,o){var a=t((i=Me(i)).h,(o=Me(o)).h),s=Et(i.s,o.s),u=Et(i.l,o.l),l=Et(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=u(Math.pow(c,n)),i.opacity=l(c),i+""}}return r.gamma=e,r}(1)}const _P=um(Za);var Ja=um(Et);function lm(t,e){e===void 0&&(e=t,t=Ze);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function wP(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Wr=0,Vi=0,qi=0,cm=1e3,ts,Zi,es=0,Zn=0,ns=0,Ki=typeof performance=="object"&&performance.now?performance:Date,fm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qi(){return Zn||(fm($P),Zn=Ki.now()+ns)}function $P(){Zn=0}function Ji(){this._call=this._time=this._next=null}Ji.prototype=rs.prototype={constructor:Ji,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Qi():+n)+(e==null?0:+e),!this._next&&Zi!==this&&(Zi?Zi._next=this:ts=this,Zi=this),this._call=t,this._time=n,mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,mc())}};function rs(t,e,n){var r=new Ji;return r.restart(t,e,n),r}function hm(){Qi(),++Wr;for(var t=ts,e;t;)(e=Zn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Wr}function pm(){Zn=(es=Ki.now())+ns,Wr=Vi=0;try{hm()}finally{Wr=0,AP(),Zn=0}}function SP(){var t=Ki.now(),e=t-es;e>cm&&(ns-=e,es=t)}function AP(){for(var t,e=ts,n,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:ts=n);Zi=t,mc(r)}function mc(t){if(!Wr){Vi&&(Vi=clearTimeout(Vi));var e=t-Zn;e>24?(t<1/0&&(Vi=setTimeout(pm,t-Ki.now()-ns)),qi&&(qi=clearInterval(qi))):(qi||(es=Ki.now(),qi=setInterval(SP,cm)),Wr=1,fm(pm))}}function yc(t,e,n){var r=new Ji;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function TP(t,e,n){var r=new Ji,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Qi():+s,r._restart(function u(l){l+=i,r._restart(u,i+=a,s),o(l)},a,s)},r.restart(t,e,n),r)}var PP=Un("start","end","cancel","interrupt"),MP=[],dm=0,bc=1,xc=2,is=3,gm=4,vc=5,os=6;function as(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;DP(t,n,{name:e,index:r,group:i,on:PP,tween:MP,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:dm})}function _c(t,e){var n=De(t,e);if(n.state>dm)throw new Error("too late; already scheduled");return n}function Oe(t,e){var n=De(t,e);if(n.state>is)throw new Error("too late; already running");return n}function De(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function DP(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=rs(o,0,n.time);function o(l){n.state=bc,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==bc)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===is)return yc(a);p.state===gm?(p.state=os,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=os,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(yc(function(){n.state===is&&(n.state=gm,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=xc,n.on.call("start",t,t.__data__,n.index,n.group),n.state===xc){for(n.state=is,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=vc,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===vc&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=os,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Kn(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>xc&&r.state<vc,r.state=os,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function CP(t){return this.each(function(){Kn(this,t)})}function LP(t,e){var n,r;return function(){var i=Oe(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function kP(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Oe(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function RP(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=De(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?LP:kP)(n,t,e))}function wc(t,e,n){var r=t._id;return t.each(function(){var i=Oe(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return De(i,r).value[e]}}function mm(t,e){var n;return(typeof e=="number"?ge:e instanceof bn?ji:(n=bn(e))?(e=n,ji):dc)(t,e)}function EP(t){return function(){this.removeAttribute(t)}}function IP(t){return function(){this.removeAttributeNS(t.space,t.local)}}function NP(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function BP(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function FP(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function OP(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function GP(t,e){var n=Yi(t),r=n==="transform"?rm:mm;return this.attrTween(t,typeof e=="function"?(n.local?OP:FP)(n,r,wc(this,"attr."+t,e)):e==null?(n.local?IP:EP)(n):(n.local?BP:NP)(n,r,e))}function zP(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function YP(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function UP(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&YP(t,o)),n}return i._value=e,i}function WP(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&zP(t,o)),n}return i._value=e,i}function HP(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Yi(t);return this.tween(n,(r.local?UP:WP)(r,e))}function XP(t,e){return function(){_c(this,t).delay=+e.apply(this,arguments)}}function jP(t,e){return e=+e,function(){_c(this,t).delay=e}}function VP(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?XP:jP)(e,t)):De(this.node(),e).delay}function qP(t,e){return function(){Oe(this,t).duration=+e.apply(this,arguments)}}function ZP(t,e){return e=+e,function(){Oe(this,t).duration=e}}function KP(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?qP:ZP)(e,t)):De(this.node(),e).duration}function QP(t,e){if(typeof e!="function")throw new Error;return function(){Oe(this,t).ease=e}}function JP(t){var e=this._id;return arguments.length?this.each(QP(e,t)):De(this.node(),e).ease}function t8(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Oe(this,t).ease=n}}function e8(t){if(typeof t!="function")throw new Error;return this.each(t8(this._id,t))}function n8(t){typeof t!="function"&&(t=Zl(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Ge(r,this._parents,this._name,this._id)}function r8(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Ge(a,this._parents,this._name,this._id)}function i8(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function o8(t,e,n){var r,i,o=i8(e)?_c:Oe;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function a8(t,e){var n=this._id;return arguments.length<2?De(this.node(),n).on.on(t):this.each(o8(n,t,e))}function s8(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function u8(){return this.on("end.remove",s8(this._id))}function l8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Na(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,as(l[h],e,n,h,l,De(c,n)));return new Ge(o,this._parents,e,n)}function c8(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ql(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=De(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&as(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ge(o,a,e,n)}var f8=Hn.prototype.constructor;function h8(){return new f8(this._groups,this._parents)}function p8(t,e){var n,r,i;return function(){var o=Wn(this,t),a=(this.style.removeProperty(t),Wn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function ym(t){return function(){this.style.removeProperty(t)}}function d8(t,e,n){var r,i=n+"",o;return function(){var a=Wn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function g8(t,e,n){var r,i,o;return function(){var a=Wn(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),Wn(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function m8(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Oe(this,t),l=u.on,c=u.value[o]==null?s||(s=ym(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function y8(t,e,n){var r=(t+="")=="transform"?nm:mm;return e==null?this.styleTween(t,p8(t,r)).on("end.style."+t,ym(t)):typeof e=="function"?this.styleTween(t,g8(t,r,wc(this,"style."+t,e))).each(m8(this._id,t)):this.styleTween(t,d8(t,r,e),n).on("end.style."+t,null)}function b8(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function x8(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&b8(t,a,n)),r}return o._value=e,o}function v8(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,x8(t,e,n??""))}function _8(t){return function(){this.textContent=t}}function w8(t){return function(){var e=t(this);this.textContent=e??""}}function $8(t){return this.tween("text",typeof t=="function"?w8(wc(this,"text",t)):_8(t==null?"":t+""))}function S8(t){return function(e){this.textContent=t.call(this,e)}}function A8(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&S8(i)),e}return r._value=t,r}function T8(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,A8(t))}function P8(){for(var t=this._name,e=this._id,n=xm(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=De(u,e);as(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ge(r,this._parents,t,n)}function M8(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Oe(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var D8=0;function Ge(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function bm(t){return Hn().transition(t)}function xm(){return++D8}var Ke=Hn.prototype;Ge.prototype=bm.prototype={constructor:Ge,select:l8,selectAll:c8,selectChild:Ke.selectChild,selectChildren:Ke.selectChildren,filter:n8,merge:r8,selection:h8,transition:P8,call:Ke.call,nodes:Ke.nodes,node:Ke.node,size:Ke.size,empty:Ke.empty,each:Ke.each,on:a8,attr:GP,attrTween:HP,style:y8,styleTween:v8,text:$8,textTween:T8,remove:u8,tween:RP,delay:VP,duration:KP,ease:JP,easeVarying:e8,end:M8,[Symbol.iterator]:Ke[Symbol.iterator]};const C8=t=>+t;function L8(t){return t*t}function k8(t){return t*(2-t)}function vm(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function R8(t){return t*t*t}function E8(t){return--t*t*t+1}function to(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $c=3,I8=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}($c),N8=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}($c),_m=function t(e){e=+e;function n(r){return((r*=2)<=1?Math.pow(r,e):2-Math.pow(2-r,e))/2}return n.exponent=t,n}($c),wm=Math.PI,$m=wm/2;function B8(t){return+t==1?1:1-Math.cos(t*$m)}function F8(t){return Math.sin(t*$m)}function Sm(t){return(1-Math.cos(wm*t))/2}function xn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function O8(t){return xn(1-+t)}function G8(t){return 1-xn(t)}function Am(t){return((t*=2)<=1?xn(1-t):2-xn(t-1))/2}function z8(t){return 1-Math.sqrt(1-t*t)}function Y8(t){return Math.sqrt(1- --t*t)}function Tm(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Sc=4/11,U8=6/11,W8=8/11,H8=3/4,X8=9/11,j8=10/11,V8=15/16,q8=21/22,Z8=63/64,ss=1/Sc/Sc;function K8(t){return 1-eo(1-t)}function eo(t){return(t=+t)<Sc?ss*t*t:t<W8?ss*(t-=U8)*t+H8:t<j8?ss*(t-=X8)*t+V8:ss*(t-=q8)*t+Z8}function Q8(t){return((t*=2)<=1?1-eo(1-t):eo(t-1)+1)/2}var Ac=1.70158,J8=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(Ac),tM=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(Ac),Pm=function t(e){e=+e;function n(r){return((r*=2)<1?r*r*((e+1)*r-e):(r-=2)*r*((e+1)*r+e)+2)/2}return n.overshoot=t,n}(Ac),Hr=2*Math.PI,Tc=1,Pc=.3,eM=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return e*xn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),no=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return 1-e*xn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),nM=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Hr);function i(o){return((o=o*2-1)<0?e*xn(-o)*Math.sin((r-o)/n):2-e*xn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return t(o,n*Hr)},i.period=function(o){return t(e,o)},i}(Tc,Pc),rM={time:null,delay:0,duration:250,ease:to};function iM(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function oM(t){var e,n;t instanceof Ge?(e=t._id,t=t._name):(e=xm(),(n=rM).time=Qi(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&as(u,t,e,l,a,n||iM(u,e));return new Ge(r,this._parents,t,e)}Hn.prototype.interrupt=CP,Hn.prototype.transition=oM;var aM=[null];function sM(t,e){var n=t.__transition,r,i;if(n){e=e==null?null:e+"";for(i in n)if((r=n[i]).state>bc&&r.name===e)return new Ge([[t]],aM,e,+i)}return null}const Mc=t=>()=>t;function uM(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function lM(t){t.stopImmediatePropagation()}function Dc(t){t.preventDefault(),t.stopImmediatePropagation()}var Mm={name:"drag"},Cc={name:"space"},Xr={name:"handle"},jr={name:"center"};const{abs:Dm,max:Ft,min:Ot}=Math;function Cm(t){return[+t[0],+t[1]]}function Lc(t){return[Cm(t[0]),Cm(t[1])]}var us={name:"x",handles:["w","e"].map(ro),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ls={name:"y",handles:["n","s"].map(ro),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},cM={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ro),input:function(t){return t==null?null:Lc(t)},output:function(t){return t}},Qe={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"},Lm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},km={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},fM={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},hM={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ro(t){return{type:t}}function pM(t){return!t.ctrlKey&&!t.button}function dM(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function gM(){return navigator.maxTouchPoints||"ontouchstart"in this}function kc(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function mM(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function yM(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function bM(){return Rc(us)}function xM(){return Rc(ls)}function vM(){return Rc(cM)}function Rc(t){var e=dM,n=pM,r=gM,i=!0,o=Un("start","brush","end"),a=6,s;function u(m){var y=m.property("__brush",g).selectAll(".overlay").data([ro("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Qe.overlay).merge(y).each(function(){var v=kc(this).extent;V(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),m.selectAll(".selection").data([ro("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Qe.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=m.selectAll(".handle").data(t.handles,function(v){return v.type});b.exit().remove(),b.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return Qe[v.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}u.move=function(m,y,b){m.tween?m.on("start.brush",function(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,x=v.__brush,S=c(v,arguments),$=x.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,x.extent),T=Ze($,R);function w(P){x.selection=P===1&&R===null?null:T(P),l.call(v),S.brush()}return $!==null&&R!==null?w:w(1)}):m.each(function(){var v=this,x=arguments,S=v.__brush,$=t.input(typeof y=="function"?y.apply(v,x):y,S.extent),R=c(v,x).beforestart();Kn(v),S.selection=$===null?null:$,l.call(v),R.start(b).brush(b).end(b)})},u.clear=function(m,y){u.move(m,null,y)};function l(){var m=V(this),y=kc(this).selection;y?(m.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?y[1][1]-y[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,y,b){var v=m.__brush.emitter;return v&&(!b||!v.clean)?v:new f(m,y,b)}function f(m,y,b){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=b}f.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,b){var v=V(this.that).datum();o.call(m,this.that,new uM(m,{sourceEvent:y,target:u,selection:t.output(this.state.selection),mode:b,dispatch:o}),v)}};function h(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,b=m.target.__data__.type,v=(i&&m.metaKey?b="overlay":b)==="selection"?Mm:i&&m.altKey?jr:Xr,x=t===ls?null:fM[b],S=t===us?null:hM[b],$=kc(y),R=$.extent,T=$.selection,w=R[0][0],P,_,N=R[0][1],D,A,L=R[1][0],M,G,O=R[1][1],E,k,C=0,F=0,X,Q=x&&S&&i&&m.shiftKey,z,Z,Y=Array.from(m.touches||[m],st=>{const Pt=st.identifier;return st=le(st,y),st.point0=st.slice(),st.identifier=Pt,st});Kn(y);var q=c(y,arguments,!0).beforestart();if(b==="overlay"){T&&(X=!0);const st=[Y[0],Y[1]||Y[0]];$.selection=T=[[P=t===ls?w:Ot(st[0][0],st[1][0]),D=t===us?N:Ot(st[0][1],st[1][1])],[M=t===ls?L:Ft(st[0][0],st[1][0]),E=t===us?O:Ft(st[0][1],st[1][1])]],Y.length>1&&mt(m)}else P=T[0][0],D=T[0][1],M=T[1][0],E=T[1][1];_=P,A=D,G=M,k=E;var j=V(y).attr("pointer-events","none"),rt=j.selectAll(".overlay").attr("cursor",Qe[b]);if(m.touches)q.moved=H,q.ended=ht;else{var ut=V(m.view).on("mousemove.brush",H,!0).on("mouseup.brush",ht,!0);i&&ut.on("keydown.brush",Ut,!0).on("keyup.brush",ee,!0),Fa(m.view)}l.call(y),q.start(m,v.name);function H(st){for(const Pt of st.changedTouches||[st])for(const Xo of Y)Xo.identifier===Pt.identifier&&(Xo.cur=le(Pt,y));if(Q&&!z&&!Z&&Y.length===1){const Pt=Y[0];Dm(Pt.cur[0]-Pt[0])>Dm(Pt.cur[1]-Pt[1])?Z=!0:z=!0}for(const Pt of Y)Pt.cur&&(Pt[0]=Pt.cur[0],Pt[1]=Pt.cur[1]);X=!0,Dc(st),mt(st)}function mt(st){const Pt=Y[0],Xo=Pt.point0;var kn;switch(C=Pt[0]-Xo[0],F=Pt[1]-Xo[1],v){case Cc:case Mm:{x&&(C=Ft(w-P,Ot(L-M,C)),_=P+C,G=M+C),S&&(F=Ft(N-D,Ot(O-E,F)),A=D+F,k=E+F);break}case Xr:{Y[1]?(x&&(_=Ft(w,Ot(L,Y[0][0])),G=Ft(w,Ot(L,Y[1][0])),x=1),S&&(A=Ft(N,Ot(O,Y[0][1])),k=Ft(N,Ot(O,Y[1][1])),S=1)):(x<0?(C=Ft(w-P,Ot(L-P,C)),_=P+C,G=M):x>0&&(C=Ft(w-M,Ot(L-M,C)),_=P,G=M+C),S<0?(F=Ft(N-D,Ot(O-D,F)),A=D+F,k=E):S>0&&(F=Ft(N-E,Ot(O-E,F)),A=D,k=E+F));break}case jr:{x&&(_=Ft(w,Ot(L,P-C*x)),G=Ft(w,Ot(L,M+C*x))),S&&(A=Ft(N,Ot(O,D-F*S)),k=Ft(N,Ot(O,E+F*S)));break}}G<_&&(x*=-1,kn=P,P=M,M=kn,kn=_,_=G,G=kn,b in Lm&&rt.attr("cursor",Qe[b=Lm[b]])),k<A&&(S*=-1,kn=D,D=E,E=kn,kn=A,A=k,k=kn,b in km&&rt.attr("cursor",Qe[b=km[b]])),$.selection&&(T=$.selection),z&&(_=T[0][0],G=T[1][0]),Z&&(A=T[0][1],k=T[1][1]),(T[0][0]!==_||T[0][1]!==A||T[1][0]!==G||T[1][1]!==k)&&($.selection=[[_,A],[G,k]],l.call(y),q.brush(st,v.name))}function ht(st){if(lM(st),st.touches){if(st.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else Oa(st.view,X),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);j.attr("pointer-events","all"),rt.attr("cursor",Qe.overlay),$.selection&&(T=$.selection),mM(T)&&($.selection=null,l.call(y)),q.end(st,v.name)}function Ut(st){switch(st.keyCode){case 16:{Q=x&&S;break}case 18:{v===Xr&&(x&&(M=G-C*x,P=_+C*x),S&&(E=k-F*S,D=A+F*S),v=jr,mt(st));break}case 32:{(v===Xr||v===jr)&&(x<0?M=G-C:x>0&&(P=_-C),S<0?E=k-F:S>0&&(D=A-F),v=Cc,rt.attr("cursor",Qe.selection),mt(st));break}default:return}Dc(st)}function ee(st){switch(st.keyCode){case 16:{Q&&(z=Z=Q=!1,mt(st));break}case 18:{v===jr&&(x<0?M=G:x>0&&(P=_),S<0?E=k:S>0&&(D=A),v=Xr,mt(st));break}case 32:{v===Cc&&(st.altKey?(x&&(M=G-C*x,P=_+C*x),S&&(E=k-F*S,D=A+F*S),v=jr):(x<0?M=G:x>0&&(P=_),S<0?E=k:S>0&&(D=A),v=Xr),rt.attr("cursor",Qe[b]),mt(st));break}default:return}Dc(st)}}function p(m){c(this,arguments).moved(m)}function d(m){c(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Lc(e.apply(this,arguments)),m.dim=t,m}return u.extent=function(m){return arguments.length?(e=typeof m=="function"?m:Mc(Lc(m)),u):e},u.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Mc(!!m),u):n},u.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Mc(!!m),u):r},u.handleSize=function(m){return arguments.length?(a=+m,u):a},u.keyModifiers=function(m){return arguments.length?(i=!!m,u):i},u.on=function(){var m=o.on.apply(o,arguments);return m===o?u:m},u}var Rm=Math.abs,Vr=Math.cos,qr=Math.sin,Em=Math.PI,cs=Em/2,Im=Em*2,Nm=Math.max,Ec=1e-12;function Ic(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function _M(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function wM(){return Nc(!1,!1)}function $M(){return Nc(!1,!0)}function SM(){return Nc(!0,!1)}function Nc(t,e){var n=0,r=null,i=null,o=null;function a(s){var u=s.length,l=new Array(u),c=Ic(0,u),f=new Array(u*u),h=new Array(u),p=0,d;s=Float64Array.from({length:u*u},e?(g,m)=>s[m%u][m/u|0]:(g,m)=>s[m/u|0][m%u]);for(let g=0;g<u;++g){let m=0;for(let y=0;y<u;++y)m+=s[g*u+y]+t*s[y*u+g];p+=l[g]=m}p=Nm(0,Im-n*u)/p,d=p?n:Im/u;{let g=0;r&&c.sort((m,y)=>r(l[m],l[y]));for(const m of c){const y=g;if(t){const b=Ic(~u+1,u).filter(v=>v<0?s[~v*u+m]:s[m*u+v]);i&&b.sort((v,x)=>i(v<0?-s[~v*u+m]:s[m*u+v],x<0?-s[~x*u+m]:s[m*u+x]));for(const v of b)if(v<0){const x=f[~v*u+m]||(f[~v*u+m]={source:null,target:null});x.target={index:m,startAngle:g,endAngle:g+=s[~v*u+m]*p,value:s[~v*u+m]}}else{const x=f[m*u+v]||(f[m*u+v]={source:null,target:null});x.source={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}else{const b=Ic(0,u).filter(v=>s[m*u+v]||s[v*u+m]);i&&b.sort((v,x)=>i(s[m*u+v],s[m*u+x]));for(const v of b){let x;if(m<v?(x=f[m*u+v]||(f[m*u+v]={source:null,target:null}),x.source={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]}):(x=f[v*u+m]||(f[v*u+m]={source:null,target:null}),x.target={index:m,startAngle:g,endAngle:g+=s[m*u+v]*p,value:s[m*u+v]},m===v&&(x.source=x.target)),x.source&&x.target&&x.source.value<x.target.value){const S=x.source;x.source=x.target,x.target=S}}h[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}g+=d}}return f=Object.values(f),f.groups=h,o?f.sort(o):f}return a.padAngle=function(s){return arguments.length?(n=Nm(0,s),a):n},a.sortGroups=function(s){return arguments.length?(r=s,a):r},a.sortSubgroups=function(s){return arguments.length?(i=s,a):i},a.sortChords=function(s){return arguments.length?(s==null?o=null:(o=_M(s))._=s,a):o&&o._},a}const Bc=Math.PI,Fc=2*Bc,Qn=1e-6,AM=Fc-Qn;function Bm(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function TM(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Bm;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let io=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Bm:TM(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-e,l=i-n,c=a-e,f=s-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>Qn)if(!(Math.abs(f*u-l*c)>Qn)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,d=i-s,g=u*u+l*l,m=p*p+d*d,y=Math.sqrt(g),b=Math.sqrt(h),v=o*Math.tan((Bc-Math.acos((g+h-m)/(2*y*b)))/2),x=v/b,S=v/y;Math.abs(x-1)>Qn&&this._append`L${e+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=e+S*u},${this._y1=n+S*l}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),u=r*Math.sin(i),l=e+s,c=n+u,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Qn||Math.abs(this._y1-c)>Qn)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%Fc+Fc),h>AM?this._append`A${r},${r},0,1,${f},${e-s},${n-u}A${r},${r},0,1,${f},${this._x1=l},${this._y1=c}`:h>Qn&&this._append`A${r},${r},0,${+(h>=Bc)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Oc(){return new io}Oc.prototype=io.prototype;function PM(t=3){return new io(+t)}var MM=Array.prototype.slice;function Jn(t){return function(){return t}}function DM(t){return t.source}function CM(t){return t.target}function Fm(t){return t.radius}function LM(t){return t.startAngle}function kM(t){return t.endAngle}function RM(){return 0}function EM(){return 10}function Om(t){var e=DM,n=CM,r=Fm,i=Fm,o=LM,a=kM,s=RM,u=null;function l(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=MM.call(arguments),g=+r.apply(this,(d[0]=f,d)),m=o.apply(this,d)-cs,y=a.apply(this,d)-cs,b=+i.apply(this,(d[0]=h,d)),v=o.apply(this,d)-cs,x=a.apply(this,d)-cs;if(u||(u=c=Oc()),p>Ec&&(Rm(y-m)>p*2+Ec?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,Rm(x-v)>p*2+Ec?x>v?(v+=p,x-=p):(v-=p,x+=p):v=x=(v+x)/2),u.moveTo(g*Vr(m),g*qr(m)),u.arc(0,0,g,m,y),m!==v||y!==x)if(t){var S=+t.apply(this,arguments),$=b-S,R=(v+x)/2;u.quadraticCurveTo(0,0,$*Vr(v),$*qr(v)),u.lineTo(b*Vr(R),b*qr(R)),u.lineTo($*Vr(x),$*qr(x))}else u.quadraticCurveTo(0,0,b*Vr(v),b*qr(v)),u.arc(0,0,b,v,x);if(u.quadraticCurveTo(0,0,g*Vr(m),g*qr(m)),u.closePath(),c)return u=null,c+""||null}return t&&(l.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Jn(+c),l):t}),l.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:Jn(+c),l):r},l.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Jn(+c),l):r},l.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:Jn(+c),l):i},l.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Jn(+c),l):o},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Jn(+c),l):a},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Jn(+c),l):s},l.source=function(c){return arguments.length?(e=c,l):e},l.target=function(c){return arguments.length?(n=c,l):n},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function IM(){return Om()}function NM(){return Om(EM)}var BM=Array.prototype,Gm=BM.slice;function FM(t,e){return t-e}function OM(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}const vn=t=>()=>t;function GM(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=zM(t,e[n]))return i;return 0}function zM(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],l=u[0],c=u[1],f=t[s],h=f[0],p=f[1];if(YM(u,f,e))return 0;c>r!=p>r&&n<(h-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function YM(t,e,n){var r;return UM(t,e,n)&&WM(t[r=+(t[0]===e[0])],n[r],e[r])}function UM(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function WM(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function HM(){}var Je=[[],[[[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 Gc(){var t=1,e=1,n=Yl,r=u;function i(l){var c=n(l);if(Array.isArray(c))c=c.slice().sort(FM);else{const f=Ni(l,XM);for(c=zn(...zl(f[0],f[1],c),c);c[c.length-1]>=f[1];)c.pop();for(;c[1]<f[0];)c.shift()}return c.map(f=>o(l,f))}function o(l,c){const f=c==null?NaN:+c;if(isNaN(f))throw new Error(`invalid value: ${c}`);var h=[],p=[];return a(l,f,function(d){r(d,l,f),OM(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=h.length,y;g<m;++g)if(GM((y=h[g])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:h}}function a(l,c,f){var h=new Array,p=new Array,d,g,m,y,b,v;for(d=g=-1,y=tr(l[0],c),Je[y<<1].forEach(x);++d<t-1;)m=y,y=tr(l[d+1],c),Je[m|y<<1].forEach(x);for(Je[y<<0].forEach(x);++g<e-1;){for(d=-1,y=tr(l[g*t+t],c),b=tr(l[g*t],c),Je[y<<1|b<<2].forEach(x);++d<t-1;)m=y,y=tr(l[g*t+t+d+1],c),v=b,b=tr(l[g*t+d+1],c),Je[m|y<<1|b<<2|v<<3].forEach(x);Je[y|b<<3].forEach(x)}for(d=-1,b=l[g*t]>=c,Je[b<<2].forEach(x);++d<t-1;)v=b,b=tr(l[g*t+d+1],c),Je[b<<2|v<<3].forEach(x);Je[b<<3].forEach(x);function x(S){var $=[S[0][0]+d,S[0][1]+g],R=[S[1][0]+d,S[1][1]+g],T=s($),w=s(R),P,_;(P=p[T])?(_=h[w])?(delete p[P.end],delete h[_.start],P===_?(P.ring.push(R),f(P.ring)):h[P.start]=p[_.end]={start:P.start,end:_.end,ring:P.ring.concat(_.ring)}):(delete p[P.end],P.ring.push(R),p[P.end=w]=P):(P=h[w])?(_=p[T])?(delete h[P.start],delete p[_.end],P===_?(P.ring.push(R),f(P.ring)):h[_.start]=p[P.end]={start:_.start,end:P.end,ring:_.ring.concat(P.ring)}):(delete h[P.start],P.ring.unshift($),h[P.start=T]=P):h[T]=p[w]={start:T,end:w,ring:[$,R]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function u(l,c,f){l.forEach(function(h){var p=h[0],d=h[1],g=p|0,m=d|0,y=zc(c[m*t+g]);p>0&&p<t&&g===p&&(h[0]=zm(p,zc(c[m*t+g-1]),y,f)),d>0&&d<e&&m===d&&(h[1]=zm(d,zc(c[(m-1)*t+g]),y,f))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[t,e];var c=Math.floor(l[0]),f=Math.floor(l[1]);if(!(c>=0&&f>=0))throw new Error("invalid size");return t=c,e=f,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?vn(Gm.call(l)):vn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:HM,i):r===u},i}function XM(t){return isFinite(t)?t:NaN}function tr(t,e){return t==null?!1:+t>=e}function zc(t){return t==null||isNaN(t=+t)?-1/0:t}function zm(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function jM(t){return t[0]}function VM(t){return t[1]}function qM(){return 1}function ZM(){var t=jM,e=VM,n=qM,r=960,i=500,o=20,a=2,s=o*3,u=r+s*2>>a,l=i+s*2>>a,c=vn(20);function f(b){var v=new Float32Array(u*l),x=Math.pow(2,-a),S=-1;for(const D of b){var $=(t(D,++S,b)+s)*x,R=(e(D,S,b)+s)*x,T=+n(D,S,b);if(T&&$>=0&&$<u&&R>=0&&R<l){var w=Math.floor($),P=Math.floor(R),_=$-w-.5,N=R-P-.5;v[w+P*u]+=(1-_)*(1-N)*T,v[w+1+P*u]+=_*(1-N)*T,v[w+1+(P+1)*u]+=_*N*T,v[w+(P+1)*u]+=(1-_)*N*T}}return Ig({data:v,width:u,height:l},o*x),v}function h(b){var v=f(b),x=c(v),S=Math.pow(2,2*a);return Array.isArray(x)||(x=zn(Number.MIN_VALUE,Fi(v)/S,x)),Gc().size([u,l]).thresholds(x.map($=>$*S))(v).map(($,R)=>($.value=+x[R],p($)))}h.contours=function(b){var v=f(b),x=Gc().size([u,l]),S=Math.pow(2,2*a),$=R=>{R=+R;var T=p(x.contour(v,R*S));return T.value=R,T};return Object.defineProperty($,"max",{get:()=>Fi(v)/S}),$};function p(b){return b.coordinates.forEach(d),b}function d(b){b.forEach(g)}function g(b){b.forEach(m)}function m(b){b[0]=b[0]*Math.pow(2,a)-s,b[1]=b[1]*Math.pow(2,a)-s}function y(){return s=o*3,u=r+s*2>>a,l=i+s*2>>a,h}return h.x=function(b){return arguments.length?(t=typeof b=="function"?b:vn(+b),h):t},h.y=function(b){return arguments.length?(e=typeof b=="function"?b:vn(+b),h):e},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:vn(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var v=+b[0],x=+b[1];if(!(v>=0&&x>=0))throw new Error("invalid size");return r=v,i=x,y()},h.cellSize=function(b){if(!arguments.length)return 1<<a;if(!((b=+b)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(b)/Math.LN2),y()},h.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?vn(Gm.call(b)):vn(b),h):c},h.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},h}const tn=11102230246251565e-32,Gt=134217729,KM=(3+8*tn)*tn;function Yc(t,e,n,r,i){let o,a,s,u,l=e[0],c=r[0],f=0,h=0;c>l==c>-l?(o=l,l=e[++f]):(o=c,c=r[++h]);let p=0;if(f<t&&h<n)for(c>l==c>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,s!==0&&(i[p++]=s);f<t&&h<n;)c>l==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h]),o=a,s!==0&&(i[p++]=s);for(;f<t;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f],o=a,s!==0&&(i[p++]=s);for(;h<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function QM(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function oo(t){return new Float64Array(t)}const JM=(3+16*tn)*tn,t4=(2+12*tn)*tn,e4=(9+64*tn)*tn*tn,Zr=oo(4),Ym=oo(8),Um=oo(12),Wm=oo(16),Ht=oo(4);function n4(t,e,n,r,i,o,a){let s,u,l,c,f,h,p,d,g,m,y,b,v,x,S,$,R,T;const w=t-i,P=n-i,_=e-o,N=r-o;x=w*N,h=Gt*w,p=h-(h-w),d=w-p,h=Gt*N,g=h-(h-N),m=N-g,S=d*m-(x-p*g-d*g-p*m),$=_*P,h=Gt*_,p=h-(h-_),d=_-p,h=Gt*P,g=h-(h-P),m=P-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Zr[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Zr[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Zr[2]=b-(T-f)+(y-f),Zr[3]=T;let D=QM(4,Zr),A=t4*a;if(D>=A||-D>=A||(f=t-w,s=t-(w+f)+(f-i),f=n-P,l=n-(P+f)+(f-i),f=e-_,u=e-(_+f)+(f-o),f=r-N,c=r-(N+f)+(f-o),s===0&&u===0&&l===0&&c===0)||(A=e4*a+KM*Math.abs(D),D+=w*c+N*s-(_*l+P*u),D>=A||-D>=A))return D;x=s*N,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*N,g=h-(h-N),m=N-g,S=d*m-(x-p*g-d*g-p*m),$=u*P,h=Gt*u,p=h-(h-u),d=u-p,h=Gt*P,g=h-(h-P),m=P-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const L=Yc(4,Zr,4,Ht,Ym);x=w*c,h=Gt*w,p=h-(h-w),d=w-p,h=Gt*c,g=h-(h-c),m=c-g,S=d*m-(x-p*g-d*g-p*m),$=_*l,h=Gt*_,p=h-(h-_),d=_-p,h=Gt*l,g=h-(h-l),m=l-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const M=Yc(L,Ym,4,Ht,Um);x=s*c,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*c,g=h-(h-c),m=c-g,S=d*m-(x-p*g-d*g-p*m),$=u*l,h=Gt*u,p=h-(h-u),d=u-p,h=Gt*l,g=h-(h-l),m=l-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-$,f=v-y,Ht[1]=v-(y+f)+(f-$),T=b+y,f=T-b,Ht[2]=b-(T-f)+(y-f),Ht[3]=T;const G=Yc(M,Um,4,Ht,Wm);return Wm[G-1]}function fs(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),u=a-s,l=Math.abs(a+s);return Math.abs(u)>=JM*l?u:-n4(t,e,n,r,i,o,l)}const Hm=Math.pow(2,-52),hs=new Uint32Array(512);class ps{static from(e,n=s4,r=u4){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=e[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new ps(o)}constructor(e){const n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=e.length>>1;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let w=0;w<a;w++){const P=e[2*w],_=e[2*w+1];P<s&&(s=P),_<u&&(u=_),P>l&&(l=P),_>c&&(c=_),this._ids[w]=w}const f=(s+l)/2,h=(u+c)/2;let p,d,g;for(let w=0,P=1/0;w<a;w++){const _=Uc(f,h,e[2*w],e[2*w+1]);_<P&&(p=w,P=_)}const m=e[2*p],y=e[2*p+1];for(let w=0,P=1/0;w<a;w++){if(w===p)continue;const _=Uc(m,y,e[2*w],e[2*w+1]);_<P&&_>0&&(d=w,P=_)}let b=e[2*d],v=e[2*d+1],x=1/0;for(let w=0;w<a;w++){if(w===p||w===d)continue;const P=o4(m,y,b,v,e[2*w],e[2*w+1]);P<x&&(g=w,x=P)}let S=e[2*g],$=e[2*g+1];if(x===1/0){for(let _=0;_<a;_++)this._dists[_]=e[2*_]-e[0]||e[2*_+1]-e[1];Kr(this._ids,this._dists,0,a-1);const w=new Uint32Array(a);let P=0;for(let _=0,N=-1/0;_<a;_++){const D=this._ids[_],A=this._dists[D];A>N&&(w[P++]=D,N=A)}this.hull=w.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fs(m,y,b,v,S,$)<0){const w=d,P=b,_=v;d=g,b=S,v=$,g=w,S=P,$=_}const R=a4(m,y,b,v,S,$);this._cx=R.x,this._cy=R.y;for(let w=0;w<a;w++)this._dists[w]=Uc(e[2*w],e[2*w+1],R.x,R.y);Kr(this._ids,this._dists,0,a-1),this._hullStart=p;let T=3;r[p]=n[g]=d,r[d]=n[p]=g,r[g]=n[d]=p,i[p]=0,i[d]=1,i[g]=2,o.fill(-1),o[this._hashKey(m,y)]=p,o[this._hashKey(b,v)]=d,o[this._hashKey(S,$)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let w=0,P,_;w<this._ids.length;w++){const N=this._ids[w],D=e[2*N],A=e[2*N+1];if(w>0&&Math.abs(D-P)<=Hm&&Math.abs(A-_)<=Hm||(P=D,_=A,N===p||N===d||N===g))continue;let L=0;for(let k=0,C=this._hashKey(D,A);k<this._hashSize&&(L=o[(C+k)%this._hashSize],!(L!==-1&&L!==r[L]));k++);L=n[L];let M=L,G;for(;G=r[M],fs(D,A,e[2*M],e[2*M+1],e[2*G],e[2*G+1])>=0;)if(M=G,M===L){M=-1;break}if(M===-1)continue;let O=this._addTriangle(M,N,r[M],-1,-1,i[M]);i[N]=this._legalize(O+2),i[M]=O,T++;let E=r[M];for(;G=r[E],fs(D,A,e[2*E],e[2*E+1],e[2*G],e[2*G+1])<0;)O=this._addTriangle(E,N,G,i[N],-1,i[E]),i[N]=this._legalize(O+2),r[E]=E,T--,E=G;if(M===L)for(;G=n[M],fs(D,A,e[2*G],e[2*G+1],e[2*M],e[2*M+1])<0;)O=this._addTriangle(G,N,M,-1,i[M],i[G]),this._legalize(O+2),i[G]=O,r[M]=M,T--,M=G;this._hullStart=n[N]=M,r[M]=n[E]=N,r[N]=E,o[this._hashKey(D,A)]=N,o[this._hashKey(e[2*M],e[2*M+1])]=M}this.hull=new Uint32Array(T);for(let w=0,P=this._hullStart;w<T;w++)this.hull[w]=P,P=r[P];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(r4(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[e],u=e-e%3;if(a=u+(e+2)%3,s===-1){if(o===0)break;e=hs[--o];continue}const l=s-s%3,c=u+(e+1)%3,f=l+(s+2)%3,h=n[a],p=n[e],d=n[c],g=n[f];if(i4(i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*g],i[2*g+1])){n[e]=g,n[s]=h;const y=r[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=e;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(e,y),this._link(s,r[a]),this._link(a,f);const b=l+(s+1)%3;o<hs.length&&(hs[o++]=b)}else{if(o===0)break;e=hs[--o]}}return a}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=e,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function r4(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function Uc(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function i4(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,h=i-a,p=o-s,d=u*u+l*l,g=c*c+f*f,m=h*h+p*p;return u*(f*m-g*p)-l*(c*m-g*h)+d*(c*p-f*h)<0}function o4(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=(l*c-s*f)*h,d=(a*f-u*c)*h;return p*p+d*d}function a4(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),p=t+(l*c-s*f)*h,d=e+(a*f-u*c)*h;return{x:p,y:d}}function Kr(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],a=e[o];let s=i-1;for(;s>=n&&e[t[s]]>a;)t[s+1]=t[s--];t[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;ao(t,i,o),e[t[n]]>e[t[r]]&&ao(t,n,r),e[t[o]]>e[t[r]]&&ao(t,o,r),e[t[n]]>e[t[o]]&&ao(t,n,o);const s=t[o],u=e[s];for(;;){do o++;while(e[t[o]]<u);do a--;while(e[t[a]]>u);if(a<o)break;ao(t,o,a)}t[n+1]=t[a],t[a]=s,r-o+1>=a-n?(Kr(t,e,o,r),Kr(t,e,n,a-1)):(Kr(t,e,n,a-1),Kr(t,e,o,r))}}function ao(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function s4(t){return t[0]}function u4(t){return t[1]}const Xm=1e-6;class er{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Xm||Math.abs(this._y1-o)>Xm)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Wc{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}class jm{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,y=r.length,b,v;g<y;g+=3,m+=2){const x=r[g]*2,S=r[g+1]*2,$=r[g+2]*2,R=e[x],T=e[x+1],w=e[S],P=e[S+1],_=e[$],N=e[$+1],D=w-R,A=P-T,L=_-R,M=N-T,G=(D*M-A*L)*2;if(Math.abs(G)<1e-9){if(o===void 0){o=a=0;for(const E of n)o+=e[E*2],a+=e[E*2+1];o/=n.length,a/=n.length}const O=1e9*Math.sign((o-R)*M-(a-T)*L);b=(R+_)/2-O*M,v=(T+N)/2+O*L}else{const O=1/G,E=D*D+A*A,k=L*L+M*M;b=R+(M*E-A*k)*O,v=T+(D*k-L*E)*O}s[m]=b,s[m+1]=v}let u=n[n.length-1],l,c=u*4,f,h=e[2*u],p,d=e[2*u+1];i.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=h,p=d,c=u*4,h=e[2*u],d=e[2*u+1],i[l+2]=i[c]=p-d,i[l+3]=i[c+1]=h-f}render(e){const n=e==null?e=new er:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){const h=r[c];if(h<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(h/3)*2,g=a[p],m=a[p+1],y=a[d],b=a[d+1];this._renderSegment(g,m,y,b,e)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(i[l]/3)*2,h=a[f],p=a[f+1],d=u*4,g=this._project(h,p,s[d+2],s[d+3]);g&&this._renderSegment(h,p,g[0],g[1],e)}return n&&n.value()}renderBounds(e){const n=e==null?e=new er:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){const r=n==null?n=new er:void 0,i=this._clip(e);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let n=0,r=e.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(e){const n=new Wc;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,i,o){let a;const s=this._regioncode(e,n),u=this._regioncode(r,i);s===0&&u===0?(o.moveTo(e,n),o.lineTo(r,i)):(a=this._clipSegment(e,n,r,i,s,u))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){const n=this._clip(e);if(n)for(const r of this.delaunay.neighbors(e)){const i=this._clip(r);if(i){t:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,u=i.length;s<u;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+u-2)%u]&&n[(o+3)%a]===i[(s+u-1)%u]){yield r;break t}}}}_cell(e){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[e];if(a===-1)return null;const s=[];let u=a;do{const l=Math.floor(u/3);if(s.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==e)break;u=i[u]}while(u!==a&&u!==-1);return s}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(e);if(n===null)return null;const{vectors:r}=this,i=e*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(e,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(e,n))}_clipFinite(e,n){const r=n.length;let i=null,o,a,s=n[r-2],u=n[r-1],l,c=this._regioncode(s,u),f,h=0;for(let p=0;p<r;p+=2)if(o=s,a=u,s=n[p],u=n[p+1],l=c,c=this._regioncode(s,u),l===0&&c===0)f=h,h=0,i?i.push(s,u):i=[s,u];else{let d,g,m,y,b;if(l===0){if((d=this._clipSegment(o,a,s,u,l,c))===null)continue;[g,m,y,b]=d}else{if((d=this._clipSegment(s,u,o,a,c,l))===null)continue;[y,b,g,m]=d,f=h,h=this._edgecode(g,m),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(g,m):i=[g,m]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(e,f,h,i,i.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(e,n,r,i,o,a){const s=o<a;for(s&&([e,n,r,i,o,a]=[r,i,e,n,a,o]);;){if(o===0&&a===0)return s?[r,i,e,n]:[e,n,r,i];if(o&a)return null;let u,l,c=o||a;c&8?(u=e+(r-e)*(this.ymax-n)/(i-n),l=this.ymax):c&4?(u=e+(r-e)*(this.ymin-n)/(i-n),l=this.ymin):c&2?(l=n+(i-n)*(this.xmax-e)/(r-e),u=this.xmax):(l=n+(i-n)*(this.xmin-e)/(r-e),u=this.xmin),o?(e=u,n=l,o=this._regioncode(e,n)):(r=u,i=l,a=this._regioncode(r,i))}}_clipInfinite(e,n,r,i,o,a){let s=Array.from(n),u;if((u=this._project(s[0],s[1],r,i))&&s.unshift(u[0],u[1]),(u=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(u[0],u[1]),s=this._clipFinite(e,s))for(let l=0,c=s.length,f,h=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)f=h,h=this._edgecode(s[l],s[l+1]),f&&h&&(l=this._edge(e,f,h,s,l),c=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(e,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(e,n,r,i){let o=1/0,a,s,u;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(u=this.ymin,s=e+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(u=this.ymax,s=e+(o=a)*r)}if(r>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/r)<o&&(s=this.xmax,u=n+(o=a)*i)}else if(r<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/r)<o&&(s=this.xmin,u=n+(o=a)*i)}return[s,u]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){const r=(n+2)%e.length,i=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[i]||e[n+1]===e[r+1]&&e[r+1]===e[i+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}}const l4=2*Math.PI,Qr=Math.pow;function c4(t){return t[0]}function f4(t){return t[1]}function h4(t){const{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){const i=2*e[r],o=2*e[r+1],a=2*e[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function p4(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Hc{static from(e,n=c4,r=f4,i){return new Hc("length"in e?d4(e,n,r,i):Float64Array.from(g4(e,n,r,i)))}constructor(e){this._delaunator=new ps(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&h4(e)){this.collinear=Int32Array.from({length:n.length/2},(h,p)=>p).sort((h,p)=>n[2*h]-n[2*p]||n[2*h+1]-n[2*p+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let h=0,p=n.length/2;h<p;++h){const d=p4(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new ps(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let u=0,l=r.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(r[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=i.length;u<l;++u)s[i[u]]=u;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new jm(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const f=s.indexOf(e);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}const u=n[e];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==e)return;if(l=o[l],l===-1){const f=r[(i[e]+1)%r.length];f!==c&&(yield f);return}}while(l!==u)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,e,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:u,points:l}=this;if(i[e]===-1||!l.length)return(e+1)%(l.length>>1);let c=e,f=Qr(n-l[e*2],2)+Qr(r-l[e*2+1],2);const h=i[e];let p=h;do{let d=u[p];const g=Qr(n-l[d*2],2)+Qr(r-l[d*2+1],2);if(g<f&&(f=g,c=d),p=p%3===2?p-2:p+1,u[p]!==e)break;if(p=s[p],p===-1){if(p=o[(a[e]+1)%o.length],p!==d&&Qr(n-l[p*2],2)+Qr(r-l[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(e){const n=e==null?e=new er:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const u=i[a];if(u<a)continue;const l=o[a]*2,c=o[u]*2;e.moveTo(r[l],r[l+1]),e.lineTo(r[c],r[c+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;const r=e==null?e=new er:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],u=i[o+1];e.moveTo(s+n,u),e.arc(s,u,n,0,l4)}return r&&r.value()}renderHull(e){const n=e==null?e=new er:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;e.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const u=2*r[s];e.lineTo(i[u],i[u+1])}return e.closePath(),n&&n.value()}hullPolygon(){const e=new Wc;return this.renderHull(e),e.value()}renderTriangle(e,n){const r=n==null?n=new er:void 0,{points:i,triangles:o}=this,a=o[e*=3]*2,s=o[e+1]*2,u=o[e+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[u],i[u+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){const n=new Wc;return this.renderTriangle(e,n),n.value()}}function d4(t,e,n,r){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=t[a];o[a*2]=e.call(r,s,a,t),o[a*2+1]=n.call(r,s,a,t)}return o}function*g4(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}var Vm={},Xc={},jc=34,so=10,Vc=13;function qm(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function m4(t,e){var n=qm(t);return function(r,i){return e(n(r),i,t)}}function Zm(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function ie(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function y4(t){return t<0?"-"+ie(-t,6):t>9999?"+"+ie(t,6):ie(t,4)}function b4(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":y4(t.getUTCFullYear())+"-"+ie(t.getUTCMonth()+1,2)+"-"+ie(t.getUTCDate(),2)+(i?"T"+ie(e,2)+":"+ie(n,2)+":"+ie(r,2)+"."+ie(i,3)+"Z":r?"T"+ie(e,2)+":"+ie(n,2)+":"+ie(r,2)+"Z":n||e?"T"+ie(e,2)+":"+ie(n,2)+"Z":"")}function ds(t){var e=new RegExp('["'+t+`
|
10
|
+
\r]`),n=t.charCodeAt(0);function r(f,h){var p,d,g=i(f,function(m,y){if(p)return p(m,y-1);d=m,p=h?m4(m,h):qm(m)});return g.columns=d||[],g}function i(f,h){var p=[],d=f.length,g=0,m=0,y,b=d<=0,v=!1;f.charCodeAt(d-1)===so&&--d,f.charCodeAt(d-1)===Vc&&--d;function x(){if(b)return Xc;if(v)return v=!1,Vm;var $,R=g,T;if(f.charCodeAt(R)===jc){for(;g++<d&&f.charCodeAt(g)!==jc||f.charCodeAt(++g)===jc;);return($=g)>=d?b=!0:(T=f.charCodeAt(g++))===so?v=!0:T===Vc&&(v=!0,f.charCodeAt(g)===so&&++g),f.slice(R+1,$-1).replace(/""/g,'"')}for(;g<d;){if((T=f.charCodeAt($=g++))===so)v=!0;else if(T===Vc)v=!0,f.charCodeAt(g)===so&&++g;else if(T!==n)continue;return f.slice(R,$)}return b=!0,f.slice(R,d)}for(;(y=x())!==Xc;){for(var S=[];y!==Vm&&y!==Xc;)S.push(y),y=x();h&&(S=h(S,m++))==null||p.push(S)}return p}function o(f,h){return f.map(function(p){return h.map(function(d){return c(p[d])}).join(t)})}function a(f,h){return h==null&&(h=Zm(f)),[h.map(c).join(t)].concat(o(f,h)).join(`
|
11
|
+
`)}function s(f,h){return h==null&&(h=Zm(f)),o(f,h).join(`
|
8
12
|
`)}function u(f){return f.map(l).join(`
|
9
|
-
`)}function l(f){return f.map(c).join(t)}function c(f){return f==null?"":f instanceof Date?LP(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:u,formatRow:l,formatValue:c}}var Zn=ls(","),$m=Zn.parse,CP=Zn.parseRows,EP=Zn.format,RP=Zn.formatBody,kP=Zn.formatRows,IP=Zn.formatRow,NP=Zn.formatValue,Kn=ls(" "),Sm=Kn.parse,FP=Kn.parseRows,zP=Kn.format,GP=Kn.formatBody,OP=Kn.formatRows,YP=Kn.formatRow,UP=Kn.formatValue;function BP(t){for(var e in t){var n=t[e].trim(),r,i;if(!n)n=null;else if(n==="true")n=!0;else if(n==="false")n=!1;else if(n==="NaN")n=NaN;else if(!isNaN(r=+n))n=r;else if(i=n.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/))WP&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;t[e]=n}return t}const WP=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function HP(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function XP(t,e){return fetch(t,e).then(HP)}function qP(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function jP(t,e){return fetch(t,e).then(qP)}function VP(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function cs(t,e){return fetch(t,e).then(VP)}function Am(t){return function(e,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),cs(e,n).then(function(i){return t(i,r)})}}function ZP(t,e,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=ls(t);return cs(e,n).then(function(o){return i.parse(o,r)})}var KP=Am($m),QP=Am(Sm);function JP(t,e){return new Promise(function(n,r){var i=new Image;for(var o in e)i[o]=e[o];i.onerror=r,i.onload=function(){n(i)},i.src=t})}function tD(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(!(t.status===204||t.status===205))return t.json()}function eD(t,e){return fetch(t,e).then(tD)}function Bc(t){return(e,n)=>cs(e,n).then(r=>new DOMParser().parseFromString(r,t))}const nD=Bc("application/xml");var rD=Bc("text/html"),iD=Bc("image/svg+xml");function oD(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var o,a=n.length,s,u=0,l=0;for(o=0;o<a;++o)s=n[o],u+=s.x,l+=s.y;for(u=(u/a-t)*r,l=(l/a-e)*r,o=0;o<a;++o)s=n[o],s.x-=u,s.y-=l}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(t=+o,i):t},i.y=function(o){return arguments.length?(e=+o,i):e},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function aD(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Mm(this.cover(e,n),e,n,t)}function Mm(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o=t._root,a={data:r},s=t._x0,u=t._y0,l=t._x1,c=t._y1,f,h,p,d,g,m,y,v;if(!o)return t._root=a,t;for(;o.length;)if((g=e>=(f=(s+l)/2))?s=f:l=f,(m=n>=(h=(u+c)/2))?u=h:c=h,i=o,!(o=o[y=m<<1|g]))return i[y]=a,t;if(p=+t._x.call(null,o.data),d=+t._y.call(null,o.data),e===p&&n===d)return a.next=o,i?i[y]=a:t._root=a,t;do i=i?i[y]=new Array(4):t._root=new Array(4),(g=e>=(f=(s+l)/2))?s=f:l=f,(m=n>=(h=(u+c)/2))?u=h:c=h;while((y=m<<1|g)===(v=(d>=h)<<1|p>=f));return i[v]=o,i[y]=a,t}function sD(t){var e,n,r=t.length,i,o,a=new Array(r),s=new Array(r),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=i,s[n]=o,i<u&&(u=i),i>c&&(c=i),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<r;++n)Mm(this,a[n],s[n],t[n]);return this}function uD(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a=i-n||1,s=this._root,u,l;n>t||t>=i||r>e||e>=o;)switch(l=(e<r)<<1|t<n,u=new Array(4),u[l]=s,s=u,a*=2,l){case 0:i=n+a,o=r+a;break;case 1:n=i-a,o=r+a;break;case 2:i=n+a,r=o-a;break;case 3:n=i-a,r=o-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function lD(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function cD(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]]}function Xt(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function fD(t,e,n){var r,i=this._x0,o=this._y0,a,s,u,l,c=this._x1,f=this._y1,h=[],p=this._root,d,g;for(p&&h.push(new Xt(p,i,o,c,f)),n==null?n=1/0:(i=t-n,o=e-n,c=t+n,f=e+n,n*=n);d=h.pop();)if(!(!(p=d.node)||(a=d.x0)>c||(s=d.y0)>f||(u=d.x1)<i||(l=d.y1)<o))if(p.length){var m=(a+u)/2,y=(s+l)/2;h.push(new Xt(p[3],m,y,u,l),new Xt(p[2],a,y,m,l),new Xt(p[1],m,s,u,y),new Xt(p[0],a,s,m,y)),(g=(e>=y)<<1|t>=m)&&(d=h[h.length-1],h[h.length-1]=h[h.length-1-g],h[h.length-1-g]=d)}else{var v=t-+this._x.call(null,p.data),x=e-+this._y.call(null,p.data),b=v*v+x*x;if(b<n){var S=Math.sqrt(n=b);i=t-S,o=e-S,c=t+S,f=e+S,r=p.data}}return r}function hD(t){if(isNaN(c=+this._x.call(null,t))||isNaN(f=+this._y.call(null,t)))return this;var e,n=this._root,r,i,o,a=this._x0,s=this._y0,u=this._x1,l=this._y1,c,f,h,p,d,g,m,y;if(!n)return this;if(n.length)for(;;){if((d=c>=(h=(a+u)/2))?a=h:u=h,(g=f>=(p=(s+l)/2))?s=p:l=p,e=n,!(n=n[m=g<<1|d]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,y=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function pD(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function dD(){return this._root}function gD(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function mD(t){var e=[],n,r=this._root,i,o,a,s,u;for(r&&e.push(new Xt(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,o=n.x0,a=n.y0,s=n.x1,u=n.y1)&&r.length){var l=(o+s)/2,c=(a+u)/2;(i=r[3])&&e.push(new Xt(i,l,c,s,u)),(i=r[2])&&e.push(new Xt(i,o,c,l,u)),(i=r[1])&&e.push(new Xt(i,l,a,s,c)),(i=r[0])&&e.push(new Xt(i,o,a,l,c))}return this}function yD(t){var e=[],n=[],r;for(this._root&&e.push(new Xt(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var o,a=r.x0,s=r.y0,u=r.x1,l=r.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&e.push(new Xt(o,a,s,c,f)),(o=i[1])&&e.push(new Xt(o,c,s,u,f)),(o=i[2])&&e.push(new Xt(o,a,f,c,l)),(o=i[3])&&e.push(new Xt(o,c,f,u,l))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function bD(t){return t[0]}function vD(t){return arguments.length?(this._x=t,this):this._x}function xD(t){return t[1]}function _D(t){return arguments.length?(this._y=t,this):this._y}function fs(t,e,n){var r=new Wc(e??bD,n??xD,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function Wc(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Pm(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var qt=fs.prototype=Wc.prototype;qt.copy=function(){var t=new Wc(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=Pm(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=Pm(r));return t},qt.add=aD,qt.addAll=sD,qt.cover=uD,qt.data=lD,qt.extent=cD,qt.find=fD,qt.remove=hD,qt.removeAll=pD,qt.root=dD,qt.size=gD,qt.visit=mD,qt.visitAfter=yD,qt.x=vD,qt.y=_D;function Lt(t){return function(){return t}}function mn(t){return(t()-.5)*1e-6}function wD(t){return t.x+t.vx}function $D(t){return t.y+t.vy}function Dm(t){var e,n,r,i=1,o=1;typeof t!="function"&&(t=Lt(t==null?1:+t));function a(){for(var l,c=e.length,f,h,p,d,g,m,y=0;y<o;++y)for(f=fs(e,wD,$D).visitAfter(s),l=0;l<c;++l)h=e[l],g=n[h.index],m=g*g,p=h.x+h.vx,d=h.y+h.vy,f.visit(v);function v(x,b,S,$,E){var M=x.data,w=x.r,P=g+w;if(M){if(M.index>h.index){var _=p-M.x-M.vx,N=d-M.y-M.vy,T=_*_+N*N;T<P*P&&(_===0&&(_=mn(r),T+=_*_),N===0&&(N=mn(r),T+=N*N),T=(P-(T=Math.sqrt(T)))/T*i,h.vx+=(_*=T)*(P=(w*=w)/(m+w)),h.vy+=(N*=T)*P,M.vx-=_*(P=1-P),M.vy-=N*P)}return}return b>p+P||$<p-P||S>d+P||E<d-P}}function s(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(e){var l,c=e.length,f;for(n=new Array(c),l=0;l<c;++l)f=e[l],n[f.index]=+t(f,l,e)}}return a.initialize=function(l,c){e=l,r=c,u()},a.iterations=function(l){return arguments.length?(o=+l,a):o},a.strength=function(l){return arguments.length?(i=+l,a):i},a.radius=function(l){return arguments.length?(t=typeof l=="function"?l:Lt(+l),u(),a):t},a}function SD(t){return t.index}function Tm(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function AD(t){var e=SD,n=f,r,i=Lt(30),o,a,s,u,l,c=1;t==null&&(t=[]);function f(m){return 1/Math.min(s[m.source.index],s[m.target.index])}function h(m){for(var y=0,v=t.length;y<c;++y)for(var x=0,b,S,$,E,M,w,P;x<v;++x)b=t[x],S=b.source,$=b.target,E=$.x+$.vx-S.x-S.vx||mn(l),M=$.y+$.vy-S.y-S.vy||mn(l),w=Math.sqrt(E*E+M*M),w=(w-o[x])/w*m*r[x],E*=w,M*=w,$.vx-=E*(P=u[x]),$.vy-=M*P,S.vx+=E*(P=1-P),S.vy+=M*P}function p(){if(a){var m,y=a.length,v=t.length,x=new Map(a.map((S,$)=>[e(S,$,a),S])),b;for(m=0,s=new Array(y);m<v;++m)b=t[m],b.index=m,typeof b.source!="object"&&(b.source=Tm(x,b.source)),typeof b.target!="object"&&(b.target=Tm(x,b.target)),s[b.source.index]=(s[b.source.index]||0)+1,s[b.target.index]=(s[b.target.index]||0)+1;for(m=0,u=new Array(v);m<v;++m)b=t[m],u[m]=s[b.source.index]/(s[b.source.index]+s[b.target.index]);r=new Array(v),d(),o=new Array(v),g()}}function d(){if(a)for(var m=0,y=t.length;m<y;++m)r[m]=+n(t[m],m,t)}function g(){if(a)for(var m=0,y=t.length;m<y;++m)o[m]=+i(t[m],m,t)}return h.initialize=function(m,y){a=m,l=y,p()},h.links=function(m){return arguments.length?(t=m,p(),h):t},h.id=function(m){return arguments.length?(e=m,h):e},h.iterations=function(m){return arguments.length?(c=+m,h):c},h.strength=function(m){return arguments.length?(n=typeof m=="function"?m:Lt(+m),d(),h):n},h.distance=function(m){return arguments.length?(i=typeof m=="function"?m:Lt(+m),g(),h):i},h}const MD=1664525,PD=1013904223,Lm=4294967296;function DD(){let t=1;return()=>(t=(MD*t+PD)%Lm)/Lm}function TD(t){return t.x}function LD(t){return t.y}var CD=10,ED=Math.PI*(3-Math.sqrt(5));function Cm(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=Qa(f),l=Fn("tick","end"),c=DD();t==null&&(t=[]);function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(g){var m,y=t.length,v;g===void 0&&(g=1);for(var x=0;x<g;++x)for(n+=(o-n)*i,s.forEach(function(b){b(n)}),m=0;m<y;++m)v=t[m],v.fx==null?v.x+=v.vx*=a:(v.x=v.fx,v.vx=0),v.fy==null?v.y+=v.vy*=a:(v.y=v.fy,v.vy=0);return e}function p(){for(var g=0,m=t.length,y;g<m;++g){if(y=t[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var v=CD*Math.sqrt(.5+g),x=g*ED;y.x=v*Math.cos(x),y.y=v*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function d(g){return g.initialize&&g.initialize(t,c),g}return p(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(g){return arguments.length?(t=g,p(),s.forEach(d),e):t},alpha:function(g){return arguments.length?(n=+g,e):n},alphaMin:function(g){return arguments.length?(r=+g,e):r},alphaDecay:function(g){return arguments.length?(i=+g,e):+i},alphaTarget:function(g){return arguments.length?(o=+g,e):o},velocityDecay:function(g){return arguments.length?(a=1-g,e):1-a},randomSource:function(g){return arguments.length?(c=g,s.forEach(d),e):c},force:function(g,m){return arguments.length>1?(m==null?s.delete(g):s.set(g,d(m)),e):s.get(g)},find:function(g,m,y){var v=0,x=t.length,b,S,$,E,M;for(y==null?y=1/0:y*=y,v=0;v<x;++v)E=t[v],b=g-E.x,S=m-E.y,$=b*b+S*S,$<y&&(M=E,y=$);return M},on:function(g,m){return arguments.length>1?(l.on(g,m),e):l.on(g)}}}function Em(){var t,e,n,r,i=Lt(-30),o,a=1,s=1/0,u=.81;function l(p){var d,g=t.length,m=fs(t,TD,LD).visitAfter(f);for(r=p,d=0;d<g;++d)e=t[d],m.visit(h)}function c(){if(t){var p,d=t.length,g;for(o=new Array(d),p=0;p<d;++p)g=t[p],o[g.index]=+i(g,p,t)}}function f(p){var d=0,g,m,y=0,v,x,b;if(p.length){for(v=x=b=0;b<4;++b)(g=p[b])&&(m=Math.abs(g.value))&&(d+=g.value,y+=m,v+=m*g.x,x+=m*g.y);p.x=v/y,p.y=x/y}else{g=p,g.x=g.data.x,g.y=g.data.y;do d+=o[g.data.index];while(g=g.next)}p.value=d}function h(p,d,g,m){if(!p.value)return!0;var y=p.x-e.x,v=p.y-e.y,x=m-d,b=y*y+v*v;if(x*x/u<b)return b<s&&(y===0&&(y=mn(n),b+=y*y),v===0&&(v=mn(n),b+=v*v),b<a&&(b=Math.sqrt(a*b)),e.vx+=y*p.value*r/b,e.vy+=v*p.value*r/b),!0;if(p.length||b>=s)return;(p.data!==e||p.next)&&(y===0&&(y=mn(n),b+=y*y),v===0&&(v=mn(n),b+=v*v),b<a&&(b=Math.sqrt(a*b)));do p.data!==e&&(x=o[p.data.index]*r/b,e.vx+=y*x,e.vy+=v*x);while(p=p.next)}return l.initialize=function(p,d){t=p,n=d,c()},l.strength=function(p){return arguments.length?(i=typeof p=="function"?p:Lt(+p),c(),l):i},l.distanceMin=function(p){return arguments.length?(a=p*p,l):Math.sqrt(a)},l.distanceMax=function(p){return arguments.length?(s=p*p,l):Math.sqrt(s)},l.theta=function(p){return arguments.length?(u=p*p,l):Math.sqrt(u)},l}function RD(t,e,n){var r,i=Lt(.1),o,a;typeof t!="function"&&(t=Lt(+t)),e==null&&(e=0),n==null&&(n=0);function s(l){for(var c=0,f=r.length;c<f;++c){var h=r[c],p=h.x-e||1e-6,d=h.y-n||1e-6,g=Math.sqrt(p*p+d*d),m=(a[c]-g)*o[c]*l/g;h.vx+=p*m,h.vy+=d*m}}function u(){if(r){var l,c=r.length;for(o=new Array(c),a=new Array(c),l=0;l<c;++l)a[l]=+t(r[l],l,r),o[l]=isNaN(a[l])?0:+i(r[l],l,r)}}return s.initialize=function(l){r=l,u()},s.strength=function(l){return arguments.length?(i=typeof l=="function"?l:Lt(+l),u(),s):i},s.radius=function(l){return arguments.length?(t=typeof l=="function"?l:Lt(+l),u(),s):t},s.x=function(l){return arguments.length?(e=+l,s):e},s.y=function(l){return arguments.length?(n=+l,s):n},s}function Rm(t){var e=Lt(.1),n,r,i;typeof t!="function"&&(t=Lt(t==null?0:+t));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(i[u]-c.x)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(e=typeof s=="function"?s:Lt(+s),a(),o):e},o.x=function(s){return arguments.length?(t=typeof s=="function"?s:Lt(+s),a(),o):t},o}function km(t){var e=Lt(.1),n,r,i;typeof t!="function"&&(t=Lt(t==null?0:+t));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(i[u]-c.y)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(e=typeof s=="function"?s:Lt(+s),a(),o):e},o.y=function(s){return arguments.length?(t=typeof s=="function"?s:Lt(+s),a(),o):t},o}function kD(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function hs(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ur(t){return t=hs(Math.abs(t)),t?t[1]:NaN}function ID(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function ND(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var FD=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Br(t){if(!(e=FD.exec(t)))throw new Error("invalid format: "+t);var e;return new ps({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Br.prototype=ps.prototype;function ps(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ps.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function zD(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Im;function GD(t,e){var n=hs(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Im=Math.max(-8,Math.min(8,Math.floor(i/3)))*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")+hs(t,Math.max(0,e+o-1))[0]}function Nm(t,e){var n=hs(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Fm={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:kD,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Nm(t*100,e),r:Nm,s:GD,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function zm(t){return t}var Gm=Array.prototype.map,Om=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ym(t){var e=t.grouping===void 0||t.thousands===void 0?zm:ID(Gm.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?zm:ND(Gm.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=Br(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,v=f.comma,x=f.precision,b=f.trim,S=f.type;S==="n"?(v=!0,S="g"):Fm[S]||(x===void 0&&(x=12),b=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var $=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=g==="$"?r:/[%p]/.test(S)?a:"",M=Fm[S],w=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function P(_){var N=$,T=E,A,C,D;if(S==="c")T=M(_)+T,_="";else{_=+_;var O=_<0||1/_<0;if(_=isNaN(_)?u:M(Math.abs(_),x),b&&(_=zD(_)),O&&+_==0&&d!=="+"&&(O=!1),N=(O?d==="("?d:s:d==="-"||d==="("?"":d)+N,T=(S==="s"?Om[8+Im/3]:"")+T+(O&&d==="("?")":""),w){for(A=-1,C=_.length;++A<C;)if(D=_.charCodeAt(A),48>D||D>57){T=(D===46?i+_.slice(A+1):_.slice(A))+T,_=_.slice(0,A);break}}}v&&!m&&(_=e(_,1/0));var G=N.length+_.length+T.length,k=G<y?new Array(y-G+1).join(h):"";switch(v&&m&&(_=e(k+_,k.length?y-T.length:1/0),k=""),p){case"<":_=N+_+T+k;break;case"=":_=N+k+_+T;break;case"^":_=k.slice(0,G=k.length>>1)+N+_+T+k.slice(G);break;default:_=k+N+_+T;break}return o(_)}return P.toString=function(){return f+""},P}function c(f,h){var p=l((f=Br(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Ur(h)/3)))*3,g=Math.pow(10,-d),m=Om[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var ds,no,Hc;Um({thousands:",",grouping:[3],currency:["$",""]});function Um(t){return ds=Ym(t),no=ds.format,Hc=ds.formatPrefix,ds}function Bm(t){return Math.max(0,-Ur(Math.abs(t)))}function Wm(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ur(e)/3)))*3-Ur(Math.abs(t)))}function Hm(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ur(e)-Ur(t))+1}var ot=1e-6,ro=1e-12,ft=Math.PI,At=ft/2,gs=ft/4,jt=ft*2,bt=180/ft,at=ft/180,pt=Math.abs,Wr=Math.atan,Vt=Math.atan2,et=Math.cos,ms=Math.ceil,Xm=Math.exp,Xc=Math.hypot,ys=Math.log,qc=Math.pow,J=Math.sin,ge=Math.sign||function(t){return t>0?1:t<0?-1:0},kt=Math.sqrt,jc=Math.tan;function qm(t){return t>1?0:t<-1?ft:Math.acos(t)}function Zt(t){return t>1?At:t<-1?-At:Math.asin(t)}function jm(t){return(t=J(t/2))*t}function wt(){}function bs(t,e){t&&Zm.hasOwnProperty(t.type)&&Zm[t.type](t,e)}var Vm={Feature:function(t,e){bs(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)bs(n[r].geometry,e)}},Zm={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Vc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Vc(n[r],e,0)},Polygon:function(t,e){Km(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Km(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)bs(n[r],e)}};function Vc(t,e,n){var r=-1,i=t.length-n,o;for(e.lineStart();++r<i;)o=t[r],e.point(o[0],o[1],o[2]);e.lineEnd()}function Km(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Vc(t[n],e,1);e.polygonEnd()}function Te(t,e){t&&Vm.hasOwnProperty(t.type)?Vm[t.type](t,e):bs(t,e)}var vs=new Tt,xs=new Tt,Qm,Jm,Zc,Kc,Qc,Ge={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){vs=new Tt,Ge.lineStart=OD,Ge.lineEnd=YD},polygonEnd:function(){var t=+vs;xs.add(t<0?jt+t:t),this.lineStart=this.lineEnd=this.point=wt},sphere:function(){xs.add(jt)}};function OD(){Ge.point=UD}function YD(){t1(Qm,Jm)}function UD(t,e){Ge.point=t1,Qm=t,Jm=e,t*=at,e*=at,Zc=t,Kc=et(e=e/2+gs),Qc=J(e)}function t1(t,e){t*=at,e*=at,e=e/2+gs;var n=t-Zc,r=n>=0?1:-1,i=r*n,o=et(e),a=J(e),s=Qc*a,u=Kc*o+s*et(i),l=s*r*J(i);vs.add(Vt(l,u)),Zc=t,Kc=o,Qc=a}function BD(t){return xs=new Tt,Te(t,Ge),xs*2}function _s(t){return[Vt(t[1],t[0]),Zt(t[2])]}function Qn(t){var e=t[0],n=t[1],r=et(n);return[r*et(e),r*J(e),J(n)]}function ws(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Hr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Jc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function $s(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ss(t){var e=kt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var $t,ie,Mt,le,Jn,e1,n1,Xr,io,yn,Je,tn={point:tf,lineStart:i1,lineEnd:o1,polygonStart:function(){tn.point=a1,tn.lineStart=WD,tn.lineEnd=HD,io=new Tt,Ge.polygonStart()},polygonEnd:function(){Ge.polygonEnd(),tn.point=tf,tn.lineStart=i1,tn.lineEnd=o1,vs<0?($t=-(Mt=180),ie=-(le=90)):io>ot?le=90:io<-ot&&(ie=-90),Je[0]=$t,Je[1]=Mt},sphere:function(){$t=-(Mt=180),ie=-(le=90)}};function tf(t,e){yn.push(Je=[$t=t,Mt=t]),e<ie&&(ie=e),e>le&&(le=e)}function r1(t,e){var n=Qn([t*at,e*at]);if(Xr){var r=Hr(Xr,n),i=[r[1],-r[0],0],o=Hr(i,r);Ss(o),o=_s(o);var a=t-Jn,s=a>0?1:-1,u=o[0]*bt*s,l,c=pt(a)>180;c^(s*Jn<u&&u<s*t)?(l=o[1]*bt,l>le&&(le=l)):(u=(u+360)%360-180,c^(s*Jn<u&&u<s*t)?(l=-o[1]*bt,l<ie&&(ie=l)):(e<ie&&(ie=e),e>le&&(le=e))),c?t<Jn?ce($t,t)>ce($t,Mt)&&(Mt=t):ce(t,Mt)>ce($t,Mt)&&($t=t):Mt>=$t?(t<$t&&($t=t),t>Mt&&(Mt=t)):t>Jn?ce($t,t)>ce($t,Mt)&&(Mt=t):ce(t,Mt)>ce($t,Mt)&&($t=t)}else yn.push(Je=[$t=t,Mt=t]);e<ie&&(ie=e),e>le&&(le=e),Xr=n,Jn=t}function i1(){tn.point=r1}function o1(){Je[0]=$t,Je[1]=Mt,tn.point=tf,Xr=null}function a1(t,e){if(Xr){var n=t-Jn;io.add(pt(n)>180?n+(n>0?360:-360):n)}else e1=t,n1=e;Ge.point(t,e),r1(t,e)}function WD(){Ge.lineStart()}function HD(){a1(e1,n1),Ge.lineEnd(),pt(io)>ot&&($t=-(Mt=180)),Je[0]=$t,Je[1]=Mt,Xr=null}function ce(t,e){return(e-=t)<0?e+360:e}function XD(t,e){return t[0]-e[0]}function s1(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function qD(t){var e,n,r,i,o,a,s;if(le=Mt=-($t=ie=1/0),yn=[],Te(t,tn),n=yn.length){for(yn.sort(XD),e=1,r=yn[0],o=[r];e<n;++e)i=yn[e],s1(r,i[0])||s1(r,i[1])?(ce(r[0],i[1])>ce(r[0],r[1])&&(r[1]=i[1]),ce(i[0],r[1])>ce(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(s=ce(r[1],i[0]))>a&&(a=s,$t=i[0],Mt=r[1])}return yn=Je=null,$t===1/0||ie===1/0?[[NaN,NaN],[NaN,NaN]]:[[$t,ie],[Mt,le]]}var oo,As,Ms,Ps,Ds,Ts,Ls,Cs,ef,nf,rf,u1,l1,Kt,Qt,Jt,Le={sphere:wt,point:of,lineStart:c1,lineEnd:f1,polygonStart:function(){Le.lineStart=ZD,Le.lineEnd=KD},polygonEnd:function(){Le.lineStart=c1,Le.lineEnd=f1}};function of(t,e){t*=at,e*=at;var n=et(e);ao(n*et(t),n*J(t),J(e))}function ao(t,e,n){++oo,Ms+=(t-Ms)/oo,Ps+=(e-Ps)/oo,Ds+=(n-Ds)/oo}function c1(){Le.point=jD}function jD(t,e){t*=at,e*=at;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),Le.point=VD,ao(Kt,Qt,Jt)}function VD(t,e){t*=at,e*=at;var n=et(e),r=n*et(t),i=n*J(t),o=J(e),a=Vt(kt((a=Qt*o-Jt*i)*a+(a=Jt*r-Kt*o)*a+(a=Kt*i-Qt*r)*a),Kt*r+Qt*i+Jt*o);As+=a,Ts+=a*(Kt+(Kt=r)),Ls+=a*(Qt+(Qt=i)),Cs+=a*(Jt+(Jt=o)),ao(Kt,Qt,Jt)}function f1(){Le.point=of}function ZD(){Le.point=QD}function KD(){h1(u1,l1),Le.point=of}function QD(t,e){u1=t,l1=e,t*=at,e*=at,Le.point=h1;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),ao(Kt,Qt,Jt)}function h1(t,e){t*=at,e*=at;var n=et(e),r=n*et(t),i=n*J(t),o=J(e),a=Qt*o-Jt*i,s=Jt*r-Kt*o,u=Kt*i-Qt*r,l=Xc(a,s,u),c=Zt(l),f=l&&-c/l;ef.add(f*a),nf.add(f*s),rf.add(f*u),As+=c,Ts+=c*(Kt+(Kt=r)),Ls+=c*(Qt+(Qt=i)),Cs+=c*(Jt+(Jt=o)),ao(Kt,Qt,Jt)}function JD(t){oo=As=Ms=Ps=Ds=Ts=Ls=Cs=0,ef=new Tt,nf=new Tt,rf=new Tt,Te(t,Le);var e=+ef,n=+nf,r=+rf,i=Xc(e,n,r);return i<ro&&(e=Ts,n=Ls,r=Cs,As<ot&&(e=Ms,n=Ps,r=Ds),i=Xc(e,n,r),i<ro)?[NaN,NaN]:[Vt(n,e)*bt,Zt(r/i)*bt]}function qr(t){return function(){return t}}function af(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function sf(t,e){return pt(t)>ft&&(t-=Math.round(t/jt)*jt),[t,e]}sf.invert=sf;function uf(t,e,n){return(t%=jt)?e||n?af(d1(t),g1(e,n)):d1(t):e||n?g1(e,n):sf}function p1(t){return function(e,n){return e+=t,pt(e)>ft&&(e-=Math.round(e/jt)*jt),[e,n]}}function d1(t){var e=p1(t);return e.invert=p1(-t),e}function g1(t,e){var n=et(t),r=J(t),i=et(e),o=J(e);function a(s,u){var l=et(u),c=et(s)*l,f=J(s)*l,h=J(u),p=h*n+c*r;return[Vt(f*i-p*o,c*n-h*r),Zt(p*i+f*o)]}return a.invert=function(s,u){var l=et(u),c=et(s)*l,f=J(s)*l,h=J(u),p=h*i-f*o;return[Vt(f*i+h*o,c*n+p*r),Zt(p*n-c*r)]},a}function m1(t){t=uf(t[0]*at,t[1]*at,t.length>2?t[2]*at:0);function e(n){return n=t(n[0]*at,n[1]*at),n[0]*=bt,n[1]*=bt,n}return e.invert=function(n){return n=t.invert(n[0]*at,n[1]*at),n[0]*=bt,n[1]*=bt,n},e}function y1(t,e,n,r,i,o){if(n){var a=et(e),s=J(e),u=r*n;i==null?(i=e+r*jt,o=e-u/2):(i=b1(a,i),o=b1(a,o),(r>0?i<o:i>o)&&(i+=r*jt));for(var l,c=i;r>0?c>o:c<o;c-=u)l=_s([a,-s*et(c),-s*J(c)]),t.point(l[0],l[1])}}function b1(t,e){e=Qn(e),e[0]-=t,Ss(e);var n=qm(-e[1]);return((-e[2]<0?-n:n)+jt-ot)%jt}function t7(){var t=qr([0,0]),e=qr(90),n=qr(2),r,i,o={point:a};function a(u,l){r.push(u=i(u,l)),u[0]*=bt,u[1]*=bt}function s(){var u=t.apply(this,arguments),l=e.apply(this,arguments)*at,c=n.apply(this,arguments)*at;return r=[],i=uf(-u[0]*at,-u[1]*at,0).invert,y1(o,l,c,1),u={type:"Polygon",coordinates:[r]},r=i=null,u}return s.center=function(u){return arguments.length?(t=typeof u=="function"?u:qr([+u[0],+u[1]]),s):t},s.radius=function(u){return arguments.length?(e=typeof u=="function"?u:qr(+u),s):e},s.precision=function(u){return arguments.length?(n=typeof u=="function"?u:qr(+u),s):n},s}function v1(){var t=[],e;return{point:function(n,r,i){e.push([n,r,i])},lineStart:function(){t.push(e=[])},lineEnd:wt,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Es(t,e){return pt(t[0]-e[0])<ot&&pt(t[1]-e[1])<ot}function Rs(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function x1(t,e,n,r,i){var o=[],a=[],s,u;if(t.forEach(function(d){if(!((g=d.length-1)<=0)){var g,m=d[0],y=d[g],v;if(Es(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),s=0;s<g;++s)i.point((m=d[s])[0],m[1]);i.lineEnd();return}y[0]+=2*ot}o.push(v=new Rs(m,d,null,!0)),a.push(v.o=new Rs(m,null,v,!1)),o.push(v=new Rs(y,d,null,!1)),a.push(v.o=new Rs(y,null,v,!0))}}),!!o.length){for(a.sort(e),_1(o),_1(a),s=0,u=a.length;s<u;++s)a[s].e=n=!n;for(var l=o[0],c,f;;){for(var h=l,p=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,u=c.length;s<u;++s)i.point((f=c[s])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(c=h.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);i.lineEnd()}}}function _1(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function lf(t){return pt(t[0])<=ft?t[0]:ge(t[0])*((pt(t[0])+ft)%jt-ft)}function w1(t,e){var n=lf(e),r=e[1],i=J(r),o=[J(n),-et(n),0],a=0,s=0,u=new Tt;i===1?r=At+ot:i===-1&&(r=-At-ot);for(var l=0,c=t.length;l<c;++l)if(h=(f=t[l]).length)for(var f,h,p=f[h-1],d=lf(p),g=p[1]/2+gs,m=J(g),y=et(g),v=0;v<h;++v,d=b,m=$,y=E,p=x){var x=f[v],b=lf(x),S=x[1]/2+gs,$=J(S),E=et(S),M=b-d,w=M>=0?1:-1,P=w*M,_=P>ft,N=m*$;if(u.add(Vt(N*w*J(P),y*E+N*et(P))),a+=_?M+w*jt:M,_^d>=n^b>=n){var T=Hr(Qn(p),Qn(x));Ss(T);var A=Hr(o,T);Ss(A);var C=(_^M>=0?-1:1)*Zt(A[2]);(r>C||r===C&&(T[0]||T[1]))&&(s+=_^M>=0?1:-1)}}return(a<-ot||a<ot&&u<-ro)^s&1}function $1(t,e,n,r){return function(i){var o=e(i),a=v1(),s=e(a),u=!1,l,c,f,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=v,h.lineEnd=x,c=[],l=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,c=Gl(c);var b=w1(l,r);c.length?(u||(i.polygonStart(),u=!0),x1(c,n7,b,n,i)):b&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),c=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(b,S){t(b,S)&&i.point(b,S)}function d(b,S){o.point(b,S)}function g(){h.point=d,o.lineStart()}function m(){h.point=p,o.lineEnd()}function y(b,S){f.push([b,S]),s.point(b,S)}function v(){s.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),s.lineEnd();var b=s.clean(),S=a.result(),$,E=S.length,M,w,P;if(f.pop(),l.push(f),f=null,!!E){if(b&1){if(w=S[0],(M=w.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),$=0;$<M;++$)i.point((P=w[$])[0],P[1]);i.lineEnd()}return}E>1&&b&2&&S.push(S.pop().concat(S.shift())),c.push(S.filter(e7))}}return h}}function e7(t){return t.length>1}function n7(t,e){return((t=t.x)[0]<0?t[1]-At-ot:At-t[1])-((e=e.x)[0]<0?e[1]-At-ot:At-e[1])}const cf=$1(function(){return!0},r7,o7,[-ft,-At]);function r7(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var s=o>0?ft:-ft,u=pt(o-e);pt(u-ft)<ot?(t.point(e,n=(n+a)/2>0?At:-At),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),i=0):r!==s&&u>=ft&&(pt(e-r)<ot&&(e-=r*ot),pt(o-s)<ot&&(o-=s*ot),n=i7(e,n,o,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),i=0),t.point(e=o,n=a),r=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-i}}}function i7(t,e,n,r){var i,o,a=J(t-n);return pt(a)>ot?Wr((J(e)*(o=et(r))*J(n)-J(r)*(i=et(e))*J(t))/(i*o*a)):(e+r)/2}function o7(t,e,n,r){var i;if(t==null)i=n*At,r.point(-ft,i),r.point(0,i),r.point(ft,i),r.point(ft,0),r.point(ft,-i),r.point(0,-i),r.point(-ft,-i),r.point(-ft,0),r.point(-ft,i);else if(pt(t[0]-e[0])>ot){var o=t[0]<e[0]?ft:-ft;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function S1(t){var e=et(t),n=2*at,r=e>0,i=pt(e)>ot;function o(c,f,h,p){y1(p,t,n,h,c,f)}function a(c,f){return et(c)*et(f)>e}function s(c){var f,h,p,d,g;return{lineStart:function(){d=p=!1,g=1},point:function(m,y){var v=[m,y],x,b=a(m,y),S=r?b?0:l(m,y):b?l(m+(m<0?ft:-ft),y):0;if(!f&&(d=p=b)&&c.lineStart(),b!==p&&(x=u(f,v),(!x||Es(f,x)||Es(v,x))&&(v[2]=1)),b!==p)g=0,b?(c.lineStart(),x=u(v,f),c.point(x[0],x[1])):(x=u(f,v),c.point(x[0],x[1],2),c.lineEnd()),f=x;else if(i&&f&&r^b){var $;!(S&h)&&($=u(v,f,!0))&&(g=0,r?(c.lineStart(),c.point($[0][0],$[0][1]),c.point($[1][0],$[1][1]),c.lineEnd()):(c.point($[1][0],$[1][1]),c.lineEnd(),c.lineStart(),c.point($[0][0],$[0][1],3)))}b&&(!f||!Es(f,v))&&c.point(v[0],v[1]),f=v,p=b,h=S},lineEnd:function(){p&&c.lineEnd(),f=null},clean:function(){return g|(d&&p)<<1}}}function u(c,f,h){var p=Qn(c),d=Qn(f),g=[1,0,0],m=Hr(p,d),y=ws(m,m),v=m[0],x=y-v*v;if(!x)return!h&&c;var b=e*y/x,S=-e*v/x,$=Hr(g,m),E=$s(g,b),M=$s(m,S);Jc(E,M);var w=$,P=ws(E,w),_=ws(w,w),N=P*P-_*(ws(E,E)-1);if(!(N<0)){var T=kt(N),A=$s(w,(-P-T)/_);if(Jc(A,E),A=_s(A),!h)return A;var C=c[0],D=f[0],O=c[1],G=f[1],k;D<C&&(k=C,C=D,D=k);var R=D-C,L=pt(R-ft)<ot,z=L||R<ot;if(!L&&G<O&&(k=O,O=G,G=k),z?L?O+G>0^A[1]<(pt(A[0]-C)<ot?O:G):O<=A[1]&&A[1]<=G:R>ft^(C<=A[0]&&A[0]<=D)){var X=$s(w,(-P+T)/_);return Jc(X,E),[A,_s(X)]}}}function l(c,f){var h=r?t:ft-t,p=0;return c<-h?p|=1:c>h&&(p|=2),f<-h?p|=4:f>h&&(p|=8),p}return $1(a,s,o,r?[0,-t]:[-ft,t-ft])}function a7(t,e,n,r,i,o){var a=t[0],s=t[1],u=e[0],l=e[1],c=0,f=1,h=u-a,p=l-s,d;if(d=n-a,!(!h&&d>0)){if(d/=h,h<0){if(d<c)return;d<f&&(f=d)}else if(h>0){if(d>f)return;d>c&&(c=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>f)return;d>c&&(c=d)}else if(h>0){if(d<c)return;d<f&&(f=d)}if(d=r-s,!(!p&&d>0)){if(d/=p,p<0){if(d<c)return;d<f&&(f=d)}else if(p>0){if(d>f)return;d>c&&(c=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>f)return;d>c&&(c=d)}else if(p>0){if(d<c)return;d<f&&(f=d)}return c>0&&(t[0]=a+c*h,t[1]=s+c*p),f<1&&(e[0]=a+f*h,e[1]=s+f*p),!0}}}}}var so=1e9,ks=-so;function Is(t,e,n,r){function i(l,c){return t<=l&&l<=n&&e<=c&&c<=r}function o(l,c,f,h){var p=0,d=0;if(l==null||(p=a(l,f))!==(d=a(c,f))||u(l,c)<0^f>0)do h.point(p===0||p===3?t:n,p>1?r:e);while((p=(p+f+4)%4)!==d);else h.point(c[0],c[1])}function a(l,c){return pt(l[0]-t)<ot?c>0?0:3:pt(l[0]-n)<ot?c>0?2:1:pt(l[1]-e)<ot?c>0?1:0:c>0?3:2}function s(l,c){return u(l.x,c.x)}function u(l,c){var f=a(l,1),h=a(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=v1(),h,p,d,g,m,y,v,x,b,S,$,E={point:M,lineStart:N,lineEnd:T,polygonStart:P,polygonEnd:_};function M(C,D){i(C,D)&&c.point(C,D)}function w(){for(var C=0,D=0,O=p.length;D<O;++D)for(var G=p[D],k=1,R=G.length,L=G[0],z,X,Q=L[0],Y=L[1];k<R;++k)z=Q,X=Y,L=G[k],Q=L[0],Y=L[1],X<=r?Y>r&&(Q-z)*(r-X)>(Y-X)*(t-z)&&++C:Y<=r&&(Q-z)*(r-X)<(Y-X)*(t-z)&&--C;return C}function P(){c=f,h=[],p=[],$=!0}function _(){var C=w(),D=$&&C,O=(h=Gl(h)).length;(D||O)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),O&&x1(h,s,C,o,l),l.polygonEnd()),c=l,h=p=d=null}function N(){E.point=A,p&&p.push(d=[]),S=!0,b=!1,v=x=NaN}function T(){h&&(A(g,m),y&&b&&f.rejoin(),h.push(f.result())),E.point=M,b&&c.lineEnd()}function A(C,D){var O=i(C,D);if(p&&d.push([C,D]),S)g=C,m=D,y=O,S=!1,O&&(c.lineStart(),c.point(C,D));else if(O&&b)c.point(C,D);else{var G=[v=Math.max(ks,Math.min(so,v)),x=Math.max(ks,Math.min(so,x))],k=[C=Math.max(ks,Math.min(so,C)),D=Math.max(ks,Math.min(so,D))];a7(G,k,t,e,n,r)?(b||(c.lineStart(),c.point(G[0],G[1])),c.point(k[0],k[1]),O||c.lineEnd(),$=!1):O&&(c.lineStart(),c.point(C,D),$=!1)}v=C,x=D,b=O}return E}}function s7(){var t=0,e=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=Is(t,e,n,r)(o=s)},extent:function(s){return arguments.length?(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1],i=o=null,a):[[t,e],[n,r]]}}}var ff,hf,Ns,Fs,jr={sphere:wt,point:wt,lineStart:u7,lineEnd:wt,polygonStart:wt,polygonEnd:wt};function u7(){jr.point=c7,jr.lineEnd=l7}function l7(){jr.point=jr.lineEnd=wt}function c7(t,e){t*=at,e*=at,hf=t,Ns=J(e),Fs=et(e),jr.point=f7}function f7(t,e){t*=at,e*=at;var n=J(e),r=et(e),i=pt(t-hf),o=et(i),a=J(i),s=r*a,u=Fs*n-Ns*r*o,l=Ns*n+Fs*r*o;ff.add(Vt(kt(s*s+u*u),l)),hf=t,Ns=n,Fs=r}function A1(t){return ff=new Tt,Te(t,jr),+ff}var pf=[null,null],h7={type:"LineString",coordinates:pf};function zs(t,e){return pf[0]=t,pf[1]=e,A1(h7)}var M1={Feature:function(t,e){return Gs(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(Gs(n[r].geometry,e))return!0;return!1}},P1={Sphere:function(){return!0},Point:function(t,e){return D1(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(D1(n[r],e))return!0;return!1},LineString:function(t,e){return T1(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(T1(n[r],e))return!0;return!1},Polygon:function(t,e){return L1(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(L1(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(Gs(n[r],e))return!0;return!1}};function Gs(t,e){return t&&P1.hasOwnProperty(t.type)?P1[t.type](t,e):!1}function D1(t,e){return zs(t,e)===0}function T1(t,e){for(var n,r,i,o=0,a=t.length;o<a;o++){if(r=zs(t[o],e),r===0||o>0&&(i=zs(t[o],t[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<ro*i))return!0;n=r}return!1}function L1(t,e){return!!w1(t.map(p7),C1(e))}function p7(t){return t=t.map(C1),t.pop(),t}function C1(t){return[t[0]*at,t[1]*at]}function d7(t,e){return(t&&M1.hasOwnProperty(t.type)?M1[t.type]:Gs)(t,e)}function E1(t,e,n){var r=fn(t,e-ot,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function R1(t,e,n){var r=fn(t,e-ot,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function k1(){var t,e,n,r,i,o,a,s,u=10,l=u,c=90,f=360,h,p,d,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return fn(ms(r/c)*c,n,c).map(d).concat(fn(ms(s/f)*f,a,f).map(g)).concat(fn(ms(e/u)*u,t,u).filter(function(x){return pt(x%c)>ot}).map(h)).concat(fn(ms(o/l)*l,i,l).filter(function(x){return pt(x%f)>ot}).map(p))}return y.lines=function(){return v().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(g(a).slice(1),d(n).reverse().slice(1),g(s).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],s=+x[0][1],a=+x[1][1],r>n&&(x=r,r=n,n=x),s>a&&(x=s,s=a,a=x),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(x){return arguments.length?(e=+x[0][0],t=+x[1][0],o=+x[0][1],i=+x[1][1],e>t&&(x=e,e=t,t=x),o>i&&(x=o,o=i,i=x),y.precision(m)):[[e,o],[t,i]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(c=+x[0],f=+x[1],y):[c,f]},y.stepMinor=function(x){return arguments.length?(u=+x[0],l=+x[1],y):[u,l]},y.precision=function(x){return arguments.length?(m=+x,h=E1(o,i,90),p=R1(e,t,m),d=E1(s,a,90),g=R1(r,n,m),y):m},y.extentMajor([[-180,-90+ot],[180,90-ot]]).extentMinor([[-180,-80-ot],[180,80+ot]])}function g7(){return k1()()}function m7(t,e){var n=t[0]*at,r=t[1]*at,i=e[0]*at,o=e[1]*at,a=et(r),s=J(r),u=et(o),l=J(o),c=a*et(n),f=a*J(n),h=u*et(i),p=u*J(i),d=2*Zt(kt(jm(o-r)+a*u*jm(i-n))),g=J(d),m=d?function(y){var v=J(y*=d)/g,x=J(d-y)/g,b=x*c+v*h,S=x*f+v*p,$=x*s+v*l;return[Vt(S,b)*bt,Vt($,kt(b*b+S*S))*bt]}:function(){return[n*bt,r*bt]};return m.distance=d,m}const uo=t=>t;var df=new Tt,gf=new Tt,I1,N1,mf,yf,en={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){en.lineStart=y7,en.lineEnd=v7},polygonEnd:function(){en.lineStart=en.lineEnd=en.point=wt,df.add(pt(gf)),gf=new Tt},result:function(){var t=df/2;return df=new Tt,t}};function y7(){en.point=b7}function b7(t,e){en.point=F1,I1=mf=t,N1=yf=e}function F1(t,e){gf.add(yf*t-mf*e),mf=t,yf=e}function v7(){F1(I1,N1)}var Vr=1/0,Os=Vr,lo=-Vr,Ys=lo,Us={point:x7,lineStart:wt,lineEnd:wt,polygonStart:wt,polygonEnd:wt,result:function(){var t=[[Vr,Os],[lo,Ys]];return lo=Ys=-(Os=Vr=1/0),t}};function x7(t,e){t<Vr&&(Vr=t),t>lo&&(lo=t),e<Os&&(Os=e),e>Ys&&(Ys=e)}var bf=0,vf=0,co=0,Bs=0,Ws=0,Zr=0,xf=0,_f=0,fo=0,z1,G1,Oe,Ye,me={point:tr,lineStart:O1,lineEnd:Y1,polygonStart:function(){me.lineStart=$7,me.lineEnd=S7},polygonEnd:function(){me.point=tr,me.lineStart=O1,me.lineEnd=Y1},result:function(){var t=fo?[xf/fo,_f/fo]:Zr?[Bs/Zr,Ws/Zr]:co?[bf/co,vf/co]:[NaN,NaN];return bf=vf=co=Bs=Ws=Zr=xf=_f=fo=0,t}};function tr(t,e){bf+=t,vf+=e,++co}function O1(){me.point=_7}function _7(t,e){me.point=w7,tr(Oe=t,Ye=e)}function w7(t,e){var n=t-Oe,r=e-Ye,i=kt(n*n+r*r);Bs+=i*(Oe+t)/2,Ws+=i*(Ye+e)/2,Zr+=i,tr(Oe=t,Ye=e)}function Y1(){me.point=tr}function $7(){me.point=A7}function S7(){U1(z1,G1)}function A7(t,e){me.point=U1,tr(z1=Oe=t,G1=Ye=e)}function U1(t,e){var n=t-Oe,r=e-Ye,i=kt(n*n+r*r);Bs+=i*(Oe+t)/2,Ws+=i*(Ye+e)/2,Zr+=i,i=Ye*t-Oe*e,xf+=i*(Oe+t),_f+=i*(Ye+e),fo+=i*3,tr(Oe=t,Ye=e)}function B1(t){this._context=t}B1.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(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,jt);break}}},result:wt};var wf=new Tt,$f,W1,H1,ho,po,go={point:wt,lineStart:function(){go.point=M7},lineEnd:function(){$f&&X1(W1,H1),go.point=wt},polygonStart:function(){$f=!0},polygonEnd:function(){$f=null},result:function(){var t=+wf;return wf=new Tt,t}};function M7(t,e){go.point=X1,W1=ho=t,H1=po=e}function X1(t,e){ho-=t,po-=e,wf.add(kt(ho*ho+po*po)),ho=t,po=e}let q1,Hs,j1,V1;class Z1{constructor(e){this._append=e==null?K1:P7(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==j1||this._append!==Hs){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,j1=r,Hs=this._append,V1=this._,this._=i}this._+=V1;break}}}result(){const e=this._;return this._="",e.length?e:null}}function K1(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function P7(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return K1;if(e!==q1){const n=10**e;q1=e,Hs=function(i){let o=1;this._+=i[0];for(const a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Hs}function D7(t,e){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Te(s,i(o))),o.result()}return a.area=function(s){return Te(s,i(en)),en.result()},a.measure=function(s){return Te(s,i(go)),go.result()},a.bounds=function(s){return Te(s,i(Us)),Us.result()},a.centroid=function(s){return Te(s,i(me)),me.result()},a.projection=function(s){return arguments.length?(i=s==null?(t=null,uo):(t=s).stream,a):t},a.context=function(s){return arguments.length?(o=s==null?(e=null,new Z1(n)):new B1(e=s),typeof r!="function"&&o.pointRadius(r),a):e},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const u=Math.floor(s);if(!(u>=0))throw new RangeError(`invalid digits: ${s}`);n=u}return e===null&&(o=new Z1(n)),a},a.projection(t).digits(n).context(e)}function T7(t){return{stream:mo(t)}}function mo(t){return function(e){var n=new Sf;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Sf(){}Sf.prototype={constructor:Sf,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Af(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Te(n,t.stream(Us)),e(Us.result()),r!=null&&t.clipExtent(r),t}function Xs(t,e,n){return Af(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+e[0][0]+(i-a*(r[1][0]+r[0][0]))/2,u=+e[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([s,u])},n)}function Mf(t,e,n){return Xs(t,[[0,0],e],n)}function Pf(t,e,n){return Af(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];t.scale(150*o).translate([a,s])},n)}function Df(t,e,n){return Af(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,s])},n)}var Q1=16,L7=et(30*at);function J1(t,e){return+e?E7(t,e):C7(t)}function C7(t){return mo({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function E7(t,e){function n(r,i,o,a,s,u,l,c,f,h,p,d,g,m){var y=l-r,v=c-i,x=y*y+v*v;if(x>4*e&&g--){var b=a+h,S=s+p,$=u+d,E=kt(b*b+S*S+$*$),M=Zt($/=E),w=pt(pt($)-1)<ot||pt(o-f)<ot?(o+f)/2:Vt(S,b),P=t(w,M),_=P[0],N=P[1],T=_-r,A=N-i,C=v*T-y*A;(C*C/x>e||pt((y*T+v*A)/x-.5)>.3||a*h+s*p+u*d<L7)&&(n(r,i,o,a,s,u,_,N,w,b/=E,S/=E,$,g,m),m.point(_,N),n(_,N,w,b,S,$,l,c,f,h,p,d,g,m))}}return function(r){var i,o,a,s,u,l,c,f,h,p,d,g,m={point:y,lineStart:v,lineEnd:b,polygonStart:function(){r.polygonStart(),m.lineStart=S},polygonEnd:function(){r.polygonEnd(),m.lineStart=v}};function y(M,w){M=t(M,w),r.point(M[0],M[1])}function v(){f=NaN,m.point=x,r.lineStart()}function x(M,w){var P=Qn([M,w]),_=t(M,w);n(f,h,c,p,d,g,f=_[0],h=_[1],c=M,p=P[0],d=P[1],g=P[2],Q1,r),r.point(f,h)}function b(){m.point=y,r.lineEnd()}function S(){v(),m.point=$,m.lineEnd=E}function $(M,w){x(i=M,w),o=f,a=h,s=p,u=d,l=g,m.point=x}function E(){n(f,h,c,p,d,g,o,a,i,s,u,l,Q1,r),m.lineEnd=b,b()}return m}}var R7=mo({point:function(t,e){this.stream.point(t*at,e*at)}});function k7(t){return mo({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function I7(t,e,n,r,i){function o(a,s){return a*=r,s*=i,[e+t*a,n-t*s]}return o.invert=function(a,s){return[(a-e)/t*r,(n-s)/t*i]},o}function ty(t,e,n,r,i,o){if(!o)return I7(t,e,n,r,i);var a=et(o),s=J(o),u=a*t,l=s*t,c=a/t,f=s/t,h=(s*n-a*e)/t,p=(s*e+a*n)/t;function d(g,m){return g*=r,m*=i,[u*g-l*m+e,n-l*g-u*m]}return d.invert=function(g,m){return[r*(c*g-f*m+h),i*(p-f*g-c*m)]},d}function Ue(t){return Tf(function(){return t})()}function Tf(t){var e,n=150,r=480,i=250,o=0,a=0,s=0,u=0,l=0,c,f=0,h=1,p=1,d=null,g=cf,m=null,y,v,x,b=uo,S=.5,$,E,M,w,P;function _(C){return M(C[0]*at,C[1]*at)}function N(C){return C=M.invert(C[0],C[1]),C&&[C[0]*bt,C[1]*bt]}_.stream=function(C){return w&&P===C?w:w=R7(k7(c)(g($(b(P=C)))))},_.preclip=function(C){return arguments.length?(g=C,d=void 0,A()):g},_.postclip=function(C){return arguments.length?(b=C,m=y=v=x=null,A()):b},_.clipAngle=function(C){return arguments.length?(g=+C?S1(d=C*at):(d=null,cf),A()):d*bt},_.clipExtent=function(C){return arguments.length?(b=C==null?(m=y=v=x=null,uo):Is(m=+C[0][0],y=+C[0][1],v=+C[1][0],x=+C[1][1]),A()):m==null?null:[[m,y],[v,x]]},_.scale=function(C){return arguments.length?(n=+C,T()):n},_.translate=function(C){return arguments.length?(r=+C[0],i=+C[1],T()):[r,i]},_.center=function(C){return arguments.length?(o=C[0]%360*at,a=C[1]%360*at,T()):[o*bt,a*bt]},_.rotate=function(C){return arguments.length?(s=C[0]%360*at,u=C[1]%360*at,l=C.length>2?C[2]%360*at:0,T()):[s*bt,u*bt,l*bt]},_.angle=function(C){return arguments.length?(f=C%360*at,T()):f*bt},_.reflectX=function(C){return arguments.length?(h=C?-1:1,T()):h<0},_.reflectY=function(C){return arguments.length?(p=C?-1:1,T()):p<0},_.precision=function(C){return arguments.length?($=J1(E,S=C*C),A()):kt(S)},_.fitExtent=function(C,D){return Xs(_,C,D)},_.fitSize=function(C,D){return Mf(_,C,D)},_.fitWidth=function(C,D){return Pf(_,C,D)},_.fitHeight=function(C,D){return Df(_,C,D)};function T(){var C=ty(n,0,0,h,p,f).apply(null,e(o,a)),D=ty(n,r-C[0],i-C[1],h,p,f);return c=uf(s,u,l),E=af(e,D),M=af(c,E),$=J1(E,S),A()}function A(){return w=P=null,_}return function(){return e=t.apply(this,arguments),_.invert=e.invert&&N,T()}}function Lf(t){var e=0,n=ft/3,r=Tf(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*at,n=o[1]*at):[e*bt,n*bt]},i}function N7(t){var e=et(t);function n(r,i){return[r*e,J(i)/e]}return n.invert=function(r,i){return[r/e,Zt(i*e)]},n}function ey(t,e){var n=J(t),r=(n+J(e))/2;if(pt(r)<ot)return N7(t);var i=1+n*(2*r-n),o=kt(i)/r;function a(s,u){var l=kt(i-2*r*J(u))/r;return[l*J(s*=r),o-l*et(s)]}return a.invert=function(s,u){var l=o-u,c=Vt(s,pt(l))*ge(l);return l*r<0&&(c-=ft*ge(s)*ge(l)),[c/r,Zt((i-(s*s+l*l)*r*r)/(2*r))]},a}function qs(){return Lf(ey).scale(155.424).center([0,33.6442])}function ny(){return qs().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function F7(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function z7(){var t,e,n=ny(),r,i=qs().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=qs().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,u,l={point:function(h,p){u=[h,p]}};function c(h){var p=h[0],d=h[1];return u=null,r.point(p,d),u||(o.point(p,d),u)||(s.point(p,d),u)}c.invert=function(h){var p=n.scale(),d=n.translate(),g=(h[0]-d[0])/p,m=(h[1]-d[1])/p;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?a:n).invert(h)},c.stream=function(h){return t&&e===h?t:t=F7([n.stream(e=h),i.stream(h),a.stream(h)])},c.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),a.precision(h),f()):n.precision()},c.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),a.scale(h),c.translate(n.translate())):n.scale()},c.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),d=+h[0],g=+h[1];return r=n.translate(h).clipExtent([[d-.455*p,g-.238*p],[d+.455*p,g+.238*p]]).stream(l),o=i.translate([d-.307*p,g+.201*p]).clipExtent([[d-.425*p+ot,g+.12*p+ot],[d-.214*p-ot,g+.234*p-ot]]).stream(l),s=a.translate([d-.205*p,g+.212*p]).clipExtent([[d-.214*p+ot,g+.166*p+ot],[d-.115*p-ot,g+.234*p-ot]]).stream(l),f()},c.fitExtent=function(h,p){return Xs(c,h,p)},c.fitSize=function(h,p){return Mf(c,h,p)},c.fitWidth=function(h,p){return Pf(c,h,p)},c.fitHeight=function(h,p){return Df(c,h,p)};function f(){return t=e=null,c}return c.scale(1070)}function ry(t){return function(e,n){var r=et(e),i=et(n),o=t(r*i);return o===1/0?[2,0]:[o*i*J(e),o*J(n)]}}function yo(t){return function(e,n){var r=kt(e*e+n*n),i=t(r),o=J(i),a=et(i);return[Vt(e*o,r*a),Zt(r&&n*o/r)]}}var Cf=ry(function(t){return kt(2/(1+t))});Cf.invert=yo(function(t){return 2*Zt(t/2)});function G7(){return Ue(Cf).scale(124.75).clipAngle(180-.001)}var Ef=ry(function(t){return(t=qm(t))&&t/J(t)});Ef.invert=yo(function(t){return t});function O7(){return Ue(Ef).scale(79.4188).clipAngle(180-.001)}function bo(t,e){return[t,ys(jc((At+e)/2))]}bo.invert=function(t,e){return[t,2*Wr(Xm(e))-At]};function Y7(){return iy(bo).scale(961/jt)}function iy(t){var e=Ue(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,a=null,s,u,l;e.scale=function(f){return arguments.length?(r(f),c()):r()},e.translate=function(f){return arguments.length?(i(f),c()):i()},e.center=function(f){return arguments.length?(n(f),c()):n()},e.clipExtent=function(f){return arguments.length?(f==null?a=s=u=l=null:(a=+f[0][0],s=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):a==null?null:[[a,s],[u,l]]};function c(){var f=ft*r(),h=e(m1(e.rotate()).invert([0,0]));return o(a==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:t===bo?[[Math.max(h[0]-f,a),s],[Math.min(h[0]+f,u),l]]:[[a,Math.max(h[1]-f,s)],[u,Math.min(h[1]+f,l)]])}return c()}function js(t){return jc((At+t)/2)}function oy(t,e){var n=et(t),r=t===e?J(t):ys(n/et(e))/ys(js(e)/js(t)),i=n*qc(js(t),r)/r;if(!r)return bo;function o(a,s){i>0?s<-At+ot&&(s=-At+ot):s>At-ot&&(s=At-ot);var u=i/qc(js(s),r);return[u*J(r*a),i-u*et(r*a)]}return o.invert=function(a,s){var u=i-s,l=ge(r)*kt(a*a+u*u),c=Vt(a,pt(u))*ge(u);return u*r<0&&(c-=ft*ge(a)*ge(u)),[c/r,2*Wr(qc(i/l,1/r))-At]},o}function U7(){return Lf(oy).scale(109.5).parallels([30,30])}function vo(t,e){return[t,e]}vo.invert=vo;function B7(){return Ue(vo).scale(152.63)}function ay(t,e){var n=et(t),r=t===e?J(t):(n-et(e))/(e-t),i=n/r+t;if(pt(r)<ot)return vo;function o(a,s){var u=i-s,l=r*a;return[u*J(l),i-u*et(l)]}return o.invert=function(a,s){var u=i-s,l=Vt(a,pt(u))*ge(u);return u*r<0&&(l-=ft*ge(a)*ge(u)),[l/r,i-ge(r)*kt(a*a+u*u)]},o}function W7(){return Lf(ay).scale(131.154).center([0,13.9389])}var xo=1.340264,_o=-.081106,wo=893e-6,$o=.003796,Vs=kt(3)/2,H7=12;function Rf(t,e){var n=Zt(Vs*J(e)),r=n*n,i=r*r*r;return[t*et(n)/(Vs*(xo+3*_o*r+i*(7*wo+9*$o*r))),n*(xo+_o*r+i*(wo+$o*r))]}Rf.invert=function(t,e){for(var n=e,r=n*n,i=r*r*r,o=0,a,s,u;o<H7&&(s=n*(xo+_o*r+i*(wo+$o*r))-e,u=xo+3*_o*r+i*(7*wo+9*$o*r),n-=a=s/u,r=n*n,i=r*r*r,!(pt(a)<ro));++o);return[Vs*t*(xo+3*_o*r+i*(7*wo+9*$o*r))/et(n),Zt(J(n)/Vs)]};function X7(){return Ue(Rf).scale(177.158)}function kf(t,e){var n=et(e),r=et(t)*n;return[n*J(t)/r,J(e)/r]}kf.invert=yo(Wr);function q7(){return Ue(kf).scale(144.049).clipAngle(60)}function j7(){var t=1,e=0,n=0,r=1,i=1,o=0,a,s,u=null,l,c,f,h=1,p=1,d=mo({point:function(b,S){var $=x([b,S]);this.stream.point($[0],$[1])}}),g=uo,m,y;function v(){return h=t*r,p=t*i,m=y=null,x}function x(b){var S=b[0]*h,$=b[1]*p;if(o){var E=$*a-S*s;S=S*a+$*s,$=E}return[S+e,$+n]}return x.invert=function(b){var S=b[0]-e,$=b[1]-n;if(o){var E=$*a+S*s;S=S*a-$*s,$=E}return[S/h,$/p]},x.stream=function(b){return m&&y===b?m:m=d(g(y=b))},x.postclip=function(b){return arguments.length?(g=b,u=l=c=f=null,v()):g},x.clipExtent=function(b){return arguments.length?(g=b==null?(u=l=c=f=null,uo):Is(u=+b[0][0],l=+b[0][1],c=+b[1][0],f=+b[1][1]),v()):u==null?null:[[u,l],[c,f]]},x.scale=function(b){return arguments.length?(t=+b,v()):t},x.translate=function(b){return arguments.length?(e=+b[0],n=+b[1],v()):[e,n]},x.angle=function(b){return arguments.length?(o=b%360*at,s=J(o),a=et(o),v()):o*bt},x.reflectX=function(b){return arguments.length?(r=b?-1:1,v()):r<0},x.reflectY=function(b){return arguments.length?(i=b?-1:1,v()):i<0},x.fitExtent=function(b,S){return Xs(x,b,S)},x.fitSize=function(b,S){return Mf(x,b,S)},x.fitWidth=function(b,S){return Pf(x,b,S)},x.fitHeight=function(b,S){return Df(x,b,S)},x}function If(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),e*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}If.invert=function(t,e){var n=e,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-e)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(pt(i)>ot&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function V7(){return Ue(If).scale(175.295)}function Nf(t,e){return[et(e)*J(t),J(e)]}Nf.invert=yo(Zt);function Z7(){return Ue(Nf).scale(249.5).clipAngle(90+ot)}function Ff(t,e){var n=et(e),r=1+et(t)*n;return[n*J(t)/r,J(e)/r]}Ff.invert=yo(function(t){return 2*Wr(t)});function K7(){return Ue(Ff).scale(250).clipAngle(142)}function zf(t,e){return[ys(jc((At+e)/2)),-t]}zf.invert=function(t,e){return[-e,2*Wr(Xm(t))-At]};function Q7(){var t=iy(zf),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function J7(t,e){return t.parent===e.parent?1:2}function tT(t){return t.reduce(eT,0)/t.length}function eT(t,e){return t+e.x}function nT(t){return 1+t.reduce(rT,0)}function rT(t,e){return Math.max(t,e.y)}function iT(t){for(var e;e=t.children;)t=e[0];return t}function oT(t){for(var e;e=t.children;)t=e[e.length-1];return t}function aT(){var t=J7,e=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(h){var p=h.children;p?(h.x=tT(p),h.y=nT(p)):(h.x=a?s+=t(h,a):0,h.y=0,a=h)});var u=iT(o),l=oT(o),c=u.x-t(u,l)/2,f=l.x+t(l,u)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*e,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-c)/(f-c)*e,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function sT(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function uT(){return this.eachAfter(sT)}function lT(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function cT(t,e){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function fT(t,e){for(var n=this,r=[n],i=[],o,a,s,u=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,s=o.length;a<s;++a)r.push(o[a]);for(;n=i.pop();)t.call(e,n,++u,this);return this}function hT(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function pT(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function dT(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function gT(t){for(var e=this,n=mT(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function mT(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function yT(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function bT(){return Array.from(this)}function vT(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function xT(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*_T(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function Zs(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=ST)):e===void 0&&(e=$T);for(var n=new er(t),r,i=[n],o,a,s,u;r=i.pop();)if((a=e(r.data))&&(u=(a=Array.from(a)).length))for(r.children=a,s=u-1;s>=0;--s)i.push(o=a[s]=new er(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(sy)}function wT(){return Zs(this).eachBefore(AT)}function $T(t){return t.children}function ST(t){return Array.isArray(t)?t[1]:null}function AT(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function sy(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function er(t){this.data=t,this.depth=this.height=0,this.parent=null}er.prototype=Zs.prototype={constructor:er,count:uT,each:lT,eachAfter:fT,eachBefore:cT,find:hT,sum:pT,sort:dT,path:gT,ancestors:yT,descendants:bT,leaves:vT,links:xT,copy:wT,[Symbol.iterator]:_T};function Ks(t){return t==null?null:uy(t)}function uy(t){if(typeof t!="function")throw new Error;return t}function nr(){return 0}function Kr(t){return function(){return t}}const MT=1664525,PT=1013904223,ly=4294967296;function Gf(){let t=1;return()=>(t=(MT*t+PT)%ly)/ly}function DT(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function TT(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function LT(t){return cy(t,Gf())}function cy(t,e){for(var n=0,r=(t=TT(Array.from(t),e)).length,i=[],o,a;n<r;)o=t[n],a&&fy(a,o)?++n:(a=ET(i=CT(i,o)),n=0);return a}function CT(t,e){var n,r;if(Of(e,t))return[e];for(n=0;n<t.length;++n)if(Qs(e,t[n])&&Of(So(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Qs(So(t[n],t[r]),e)&&Qs(So(t[n],e),t[r])&&Qs(So(t[r],e),t[n])&&Of(hy(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function Qs(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function fy(t,e){var n=t.r-e.r+Math.max(t.r,e.r,1)*1e-9,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Of(t,e){for(var n=0;n<e.length;++n)if(!fy(t,e[n]))return!1;return!0}function ET(t){switch(t.length){case 1:return RT(t[0]);case 2:return So(t[0],t[1]);case 3:return hy(t[0],t[1],t[2])}}function RT(t){return{x:t.x,y:t.y,r:t.r}}function So(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,l=a-r,c=s-i,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(r+a+l/f*c)/2,r:(f+i+s)/2}}function hy(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,l=n.x,c=n.y,f=n.r,h=r-a,p=r-l,d=i-s,g=i-c,m=u-o,y=f-o,v=r*r+i*i-o*o,x=v-a*a-s*s+u*u,b=v-l*l-c*c+f*f,S=p*d-h*g,$=(d*b-g*x)/(S*2)-r,E=(g*m-d*y)/S,M=(p*x-h*b)/(S*2)-i,w=(h*y-p*m)/S,P=E*E+w*w-1,_=2*(o+$*E+M*w),N=$*$+M*M-o*o,T=-(Math.abs(P)>1e-6?(_+Math.sqrt(_*_-4*P*N))/(2*P):N/_);return{x:r+$+E*T,y:i+M+w*T,r:T}}function py(t,e,n){var r=t.x-e.x,i,o,a=t.y-e.y,s,u,l=r*r+a*a;l?(o=e.r+n.r,o*=o,u=t.r+n.r,u*=u,o>u?(i=(l+u-o)/(2*l),s=Math.sqrt(Math.max(0,u/l-i*i)),n.x=t.x-i*r-s*a,n.y=t.y-i*a+s*r):(i=(l+o-u)/(2*l),s=Math.sqrt(Math.max(0,o/l-i*i)),n.x=e.x+i*r-s*a,n.y=e.y+i*a+s*r)):(n.x=e.x+n.r,n.y=e.y)}function dy(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function gy(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Js(t){this._=t,this.next=null,this.previous=null}function my(t,e){if(!(o=(t=DT(t)).length))return 0;var n,r,i,o,a,s,u,l,c,f,h;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;py(r,n,i=t[2]),n=new Js(n),r=new Js(r),i=new Js(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){py(n._,r._,i=t[u]),i=new Js(i),l=r.next,c=n.previous,f=r._.r,h=n._.r;do if(f<=h){if(dy(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}f+=l._.r,l=l.next}else{if(dy(c._,i._)){n=c,n.next=r,r.previous=n,--u;continue t}h+=c._.r,c=c.previous}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=gy(n);(i=i.next)!==r;)(s=gy(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=cy(n,e),u=0;u<o;++u)n=t[u],n.x-=i.x,n.y-=i.y;return i.r}function kT(t){return my(t,Gf()),t}function IT(t){return Math.sqrt(t.value)}function NT(){var t=null,e=1,n=1,r=nr;function i(o){const a=Gf();return o.x=e/2,o.y=n/2,t?o.eachBefore(yy(t)).eachAfter(Yf(r,.5,a)).eachBefore(by(1)):o.eachBefore(yy(IT)).eachAfter(Yf(nr,1,a)).eachAfter(Yf(r,o.r/Math.min(e,n),a)).eachBefore(by(Math.min(e,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(t=Ks(o),i):t},i.size=function(o){return arguments.length?(e=+o[0],n=+o[1],i):[e,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:Kr(+o),i):r},i}function yy(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Yf(t,e,n){return function(r){if(i=r.children){var i,o,a=i.length,s=t(r)*e||0,u;if(s)for(o=0;o<a;++o)i[o].r+=s;if(u=my(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=u+s}}}function by(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function vy(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ao(t,e,n,r,i){for(var o=t.children,a,s=-1,u=o.length,l=t.value&&(r-e)/t.value;++s<u;)a=o[s],a.y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}function FT(){var t=1,e=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(o(e,s)),r&&a.eachBefore(vy),a}function o(a,s){return function(u){u.children&&Ao(u,u.x0,a*(u.depth+1)/s,u.x1,a*(u.depth+2)/s);var l=u.x0,c=u.y0,f=u.x1-n,h=u.y1-n;f<l&&(l=f=(l+f)/2),h<c&&(c=h=(c+h)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=h}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(t=+a[0],e=+a[1],i):[t,e]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var zT={depth:-1},xy={},Uf={};function GT(t){return t.id}function OT(t){return t.parentId}function YT(){var t=GT,e=OT,n;function r(i){var o=Array.from(i),a=t,s=e,u,l,c,f,h,p,d,g,m=new Map;if(n!=null){const y=o.map((b,S)=>UT(n(b,S,i))),v=y.map(_y),x=new Set(y).add("");for(const b of v)x.has(b)||(x.add(b),y.push(b),v.push(_y(b)),o.push(Uf));a=(b,S)=>y[S],s=(b,S)=>v[S]}for(c=0,u=o.length;c<u;++c)l=o[c],p=o[c]=new er(l),(d=a(l,c,i))!=null&&(d+="")&&(g=p.id=d,m.set(g,m.has(g)?xy:p)),(d=s(l,c,i))!=null&&(d+="")&&(p.parent=d);for(c=0;c<u;++c)if(p=o[c],d=p.parent){if(h=m.get(d),!h)throw new Error("missing: "+d);if(h===xy)throw new Error("ambiguous: "+d);h.children?h.children.push(p):h.children=[p],p.parent=h}else{if(f)throw new Error("multiple roots");f=p}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Uf&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Uf);--y)p.data=null}if(f.parent=zT,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(sy),f.parent=null,u>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=Ks(i),r):t},r.parentId=function(i){return arguments.length?(e=Ks(i),r):e},r.path=function(i){return arguments.length?(n=Ks(i),r):n},r}function UT(t){t=`${t}`;let e=t.length;return Bf(t,e-1)&&!Bf(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function _y(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Bf(t,e););return t.slice(0,e)}function Bf(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function BT(t,e){return t.parent===e.parent?1:2}function Wf(t){var e=t.children;return e?e[0]:t.t}function Hf(t){var e=t.children;return e?e[e.length-1]:t.t}function WT(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function HT(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function XT(t,e,n){return t.a.parent===e.parent?t.a:n}function tu(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}tu.prototype=Object.create(er.prototype);function qT(t){for(var e=new tu(t,0),n,r=[e],i,o,a,s;n=r.pop();)if(o=n._.children)for(n.children=new Array(s=o.length),a=s-1;a>=0;--a)r.push(i=n.children[a]=new tu(o[a],a)),i.parent=n;return(e.parent=new tu(null,0)).children=[e],e}function jT(){var t=BT,e=1,n=1,r=null;function i(l){var c=qT(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)l.eachBefore(u);else{var f=l,h=l,p=l;l.eachBefore(function(v){v.x<f.x&&(f=v),v.x>h.x&&(h=v),v.depth>p.depth&&(p=v)});var d=f===h?1:t(f,h)/2,g=d-f.x,m=e/(h.x+d+g),y=n/(p.depth||1);l.eachBefore(function(v){v.x=(v.x+g)*m,v.y=v.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(c){HT(l);var p=(c[0].z+c[c.length-1].z)/2;h?(l.z=h.z+t(l._,h._),l.m=l.z-p):l.z=p}else h&&(l.z=h.z+t(l._,h._));l.parent.A=s(l,h,l.parent.A||f[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function s(l,c,f){if(c){for(var h=l,p=l,d=c,g=h.parent.children[0],m=h.m,y=p.m,v=d.m,x=g.m,b;d=Hf(d),h=Wf(h),d&&h;)g=Wf(g),p=Hf(p),p.a=l,b=d.z+v-h.z-m+t(d._,h._),b>0&&(WT(XT(d,l,f),l,b),m+=b,y+=b),v+=d.m,m+=h.m,x+=g.m,y+=p.m;d&&!Hf(p)&&(p.t=d,p.m+=v-y),h&&!Wf(g)&&(g.t=h,g.m+=m-x,f=l)}return f}function u(l){l.x*=e,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(t=l,i):t},i.size=function(l){return arguments.length?(r=!1,e=+l[0],n=+l[1],i):r?null:[e,n]},i.nodeSize=function(l){return arguments.length?(r=!0,e=+l[0],n=+l[1],i):r?[e,n]:null},i}function eu(t,e,n,r,i){for(var o=t.children,a,s=-1,u=o.length,l=t.value&&(i-n)/t.value;++s<u;)a=o[s],a.x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*l}var wy=(1+Math.sqrt(5))/2;function $y(t,e,n,r,i,o){for(var a=[],s=e.children,u,l,c=0,f=0,h=s.length,p,d,g=e.value,m,y,v,x,b,S,$;c<h;){p=i-n,d=o-r;do m=s[f++].value;while(!m&&f<h);for(y=v=m,S=Math.max(d/p,p/d)/(g*t),$=m*m*S,b=Math.max(v/$,$/y);f<h;++f){if(m+=l=s[f].value,l<y&&(y=l),l>v&&(v=l),$=m*m*S,x=Math.max(v/$,$/y),x>b){m-=l;break}b=x}a.push(u={value:m,dice:p<d,children:s.slice(c,f)}),u.dice?Ao(u,n,r,i,g?r+=d*m/g:o):eu(u,n,r,g?n+=p*m/g:i,o),g-=m,c=f}return a}const Xf=function t(e){function n(r,i,o,a,s){$y(e,r,i,o,a,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(wy);function Sy(){var t=Xf,e=!1,n=1,r=1,i=[0],o=nr,a=nr,s=nr,u=nr,l=nr;function c(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(f),i=[0],e&&h.eachBefore(vy),h}function f(h){var p=i[h.depth],d=h.x0+p,g=h.y0+p,m=h.x1-p,y=h.y1-p;m<d&&(d=m=(d+m)/2),y<g&&(g=y=(g+y)/2),h.x0=d,h.y0=g,h.x1=m,h.y1=y,h.children&&(p=i[h.depth+1]=o(h)/2,d+=l(h)-p,g+=a(h)-p,m-=s(h)-p,y-=u(h)-p,m<d&&(d=m=(d+m)/2),y<g&&(g=y=(g+y)/2),t(h,d,g,m,y))}return c.round=function(h){return arguments.length?(e=!!h,c):e},c.size=function(h){return arguments.length?(n=+h[0],r=+h[1],c):[n,r]},c.tile=function(h){return arguments.length?(t=uy(h),c):t},c.padding=function(h){return arguments.length?c.paddingInner(h).paddingOuter(h):c.paddingInner()},c.paddingInner=function(h){return arguments.length?(o=typeof h=="function"?h:Kr(+h),c):o},c.paddingOuter=function(h){return arguments.length?c.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):c.paddingTop()},c.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:Kr(+h),c):a},c.paddingRight=function(h){return arguments.length?(s=typeof h=="function"?h:Kr(+h),c):s},c.paddingBottom=function(h){return arguments.length?(u=typeof h=="function"?h:Kr(+h),c):u},c.paddingLeft=function(h){return arguments.length?(l=typeof h=="function"?h:Kr(+h),c):l},c}function VT(t,e,n,r,i){var o=t.children,a,s=o.length,u,l=new Array(s+1);for(l[0]=u=a=0;a<s;++a)l[a+1]=u+=o[a].value;c(0,s,t.value,e,n,r,i);function c(f,h,p,d,g,m,y){if(f>=h-1){var v=o[f];v.x0=d,v.y0=g,v.x1=m,v.y1=y;return}for(var x=l[f],b=p/2+x,S=f+1,$=h-1;S<$;){var E=S+$>>>1;l[E]<b?S=E+1:$=E}b-l[S-1]<l[S]-b&&f+1<S&&--S;var M=l[S]-x,w=p-M;if(m-d>y-g){var P=p?(d*w+m*M)/p:m;c(f,S,M,d,g,P,y),c(S,h,w,P,g,m,y)}else{var _=p?(g*w+y*M)/p:y;c(f,S,M,d,g,m,_),c(S,h,w,d,_,m,y)}}}function ZT(t,e,n,r,i){(t.depth&1?eu:Ao)(t,e,n,r,i)}const KT=function t(e){function n(r,i,o,a,s){if((u=r._squarify)&&u.ratio===e)for(var u,l,c,f,h=-1,p,d=u.length,g=r.value;++h<d;){for(l=u[h],c=l.children,f=l.value=0,p=c.length;f<p;++f)l.value+=c[f].value;l.dice?Ao(l,i,o,a,g?o+=(s-o)*l.value/g:s):eu(l,i,o,g?i+=(a-i)*l.value/g:a,s),g-=l.value}else r._squarify=u=$y(e,r,i,o,a,s),u.ratio=e}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(wy);function QT(t){for(var e=-1,n=t.length,r,i=t[n-1],o=0;++e<n;)r=i,i=t[e],o+=r[1]*i[0]-r[0]*i[1];return o/2}function JT(t){for(var e=-1,n=t.length,r=0,i=0,o,a=t[n-1],s,u=0;++e<n;)o=a,a=t[e],u+=s=o[0]*a[1]-a[0]*o[1],r+=(o[0]+a[0])*s,i+=(o[1]+a[1])*s;return u*=3,[r/u,i/u]}function t9(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function e9(t,e){return t[0]-e[0]||t[1]-e[1]}function Ay(t){const e=t.length,n=[0,1];let r=2,i;for(i=2;i<e;++i){for(;r>1&&t9(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function n9(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e<n;++e)r[e]=[+t[e][0],+t[e][1],e];for(r.sort(e9),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=Ay(r),a=Ay(i),s=a[0]===o[0],u=a[a.length-1]===o[o.length-1],l=[];for(e=o.length-1;e>=0;--e)l.push(t[r[o[e]][2]]);for(e=+s;e<a.length-u;++e)l.push(t[r[a[e]][2]]);return l}function r9(t,e){for(var n=t.length,r=t[n-1],i=e[0],o=e[1],a=r[0],s=r[1],u,l,c=!1,f=0;f<n;++f)r=t[f],u=r[0],l=r[1],l>o!=s>o&&i<(a-u)*(o-l)/(s-l)+u&&(c=!c),a=u,s=l;return c}function i9(t){for(var e=-1,n=t.length,r=t[n-1],i,o,a=r[0],s=r[1],u=0;++e<n;)i=a,o=s,r=t[e],a=r[0],s=r[1],i-=a,o-=s,u+=Math.hypot(i,o);return u}const Nt=Math.random,o9=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,arguments.length===1?(i=r,r=0):i-=r,function(){return e()*i+r}}return n.source=t,n}(Nt),a9=function t(e){function n(r,i){return arguments.length<2&&(i=r,r=0),r=Math.floor(r),i=Math.floor(i)-r,function(){return Math.floor(e()*i+r)}}return n.source=t,n}(Nt),qf=function t(e){function n(r,i){var o,a;return r=r==null?0:+r,i=i==null?1:+i,function(){var s;if(o!=null)s=o,o=null;else do o=e()*2-1,s=e()*2-1,a=o*o+s*s;while(!a||a>1);return r+i*s*Math.sqrt(-2*Math.log(a)/a)}}return n.source=t,n}(Nt),s9=function t(e){var n=qf.source(e);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=t,r}(Nt),My=function t(e){function n(r){return(r=+r)<=0?()=>0:function(){for(var i=0,o=r;o>1;--o)i+=e();return i+o*e()}}return n.source=t,n}(Nt),u9=function t(e){var n=My.source(e);function r(i){if((i=+i)==0)return e;var o=n(i);return function(){return o()/i}}return r.source=t,r}(Nt),l9=function t(e){function n(r){return function(){return-Math.log1p(-e())/r}}return n.source=t,n}(Nt),c9=function t(e){function n(r){if((r=+r)<0)throw new RangeError("invalid alpha");return r=1/-r,function(){return Math.pow(1-e(),r)}}return n.source=t,n}(Nt),f9=function t(e){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+r)}}return n.source=t,n}(Nt),Py=function t(e){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return r===0?()=>1/0:r===1?()=>1:(r=Math.log1p(-r),function(){return 1+Math.floor(Math.log1p(-e())/r)})}return n.source=t,n}(Nt),jf=function t(e){var n=qf.source(e)();function r(i,o){if((i=+i)<0)throw new RangeError("invalid k");if(i===0)return()=>0;if(o=o==null?1:+o,i===1)return()=>-Math.log1p(-e())*o;var a=(i<1?i+1:i)-1/3,s=1/(3*Math.sqrt(a)),u=i<1?()=>Math.pow(e(),1/i):()=>1;return function(){do{do var l=n(),c=1+s*l;while(c<=0);c*=c*c;var f=1-e()}while(f>=1-.0331*l*l*l*l&&Math.log(f)>=.5*l*l+a*(1-c+Math.log(c)));return a*c*u()*o}}return r.source=t,r}(Nt),Dy=function t(e){var n=jf.source(e);function r(i,o){var a=n(i),s=n(o);return function(){var u=a();return u===0?0:u/(u+s())}}return r.source=t,r}(Nt),Ty=function t(e){var n=Py.source(e),r=Dy.source(e);function i(o,a){return o=+o,(a=+a)>=1?()=>o:a<=0?()=>0:function(){for(var s=0,u=o,l=a;u*l>16&&u*(1-l)>16;){var c=Math.floor((u+1)*l),f=r(c,u-c+1)();f<=l?(s+=c,u-=c,l=(l-f)/(1-f)):(u=c-1,l/=f)}for(var h=l<.5,p=h?l:1-l,d=n(p),g=d(),m=0;g<=u;++m)g+=d();return s+(h?m:u-m)}}return i.source=t,i}(Nt),h9=function t(e){function n(r,i,o){var a;return(r=+r)==0?a=s=>-Math.log(s):(r=1/r,a=s=>Math.pow(s,r)),i=i==null?0:+i,o=o==null?1:+o,function(){return i+o*a(-Math.log1p(-e()))}}return n.source=t,n}(Nt),p9=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){return r+i*Math.tan(Math.PI*e())}}return n.source=t,n}(Nt),d9=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){var o=e();return r+i*Math.log(o/(1-o))}}return n.source=t,n}(Nt),g9=function t(e){var n=jf.source(e),r=Ty.source(e);function i(o){return function(){for(var a=0,s=o;s>16;){var u=Math.floor(.875*s),l=n(u)();if(l>s)return a+r(u-1,s/l)();a+=u,s-=l}for(var c=-Math.log1p(-e()),f=0;c<=s;++f)c-=Math.log1p(-e());return a+f}}return i.source=t,i}(Nt),m9=1664525,y9=1013904223,Ly=1/4294967296;function b9(t=Math.random()){let e=(0<=t&&t<1?t/Ly:Math.abs(t))|0;return()=>(e=m9*e+y9|0,Ly*(e>>>0))}function ye(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function nn(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Vf=Symbol("implicit");function Zf(){var t=new Ci,e=[],n=[],r=Vf;function i(o){let a=t.get(o);if(a===void 0){if(r!==Vf)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Ci;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Zf(e,n).unknown(r)},ye.apply(i,arguments),i}function Kf(){var t=Zf().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,s=!1,u=0,l=0,c=.5;delete t.unknown;function f(){var h=e().length,p=i<r,d=p?i:r,g=p?r:i;o=(g-d)/Math.max(1,h-u+l*2),s&&(o=Math.floor(o)),d+=(g-d-o*(h-u))*c,a=o*(1-u),s&&(d=Math.round(d),a=Math.round(a));var m=fn(h).map(function(y){return d+o*y});return n(p?m.reverse():m)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,f()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(s=!!h,f()):s},t.padding=function(h){return arguments.length?(u=Math.min(1,l=+h),f()):u},t.paddingInner=function(h){return arguments.length?(u=Math.min(1,h),f()):u},t.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},t.align=function(h){return arguments.length?(c=Math.max(0,Math.min(1,h)),f()):c},t.copy=function(){return Kf(e(),[r,i]).round(s).paddingInner(u).paddingOuter(l).align(c)},ye.apply(f(),arguments)}function Cy(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Cy(e())},t}function Qf(){return Cy(Kf.apply(null,arguments).paddingInner(1))}function v9(t){return function(){return t}}function nu(t){return+t}var Ey=[0,1];function te(t){return t}function Jf(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:v9(isNaN(e)?NaN:.5)}function x9(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function _9(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Jf(i,r),o=n(a,o)):(r=Jf(r,i),o=n(o,a)),function(s){return o(r(s))}}function w9(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Jf(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=Rn(t,s,1,r)-1;return o[u](i[u](s))}}function Mo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ru(){var t=Ey,e=Ey,n=je,r,i,o,a=te,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==te&&(a=x9(t[0],t[h-1])),s=h>2?w9:_9,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),de)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,nu),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=Xa,c()},f.clamp=function(h){return arguments.length?(a=h?!0:te,c()):a!==te},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function th(){return ru()(te,te)}function Ry(t,e,n,r){var i=$a(t,e,n),o;switch(r=Br(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Wm(i,a))&&(r.precision=o),Hc(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Hm(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Bm(i))&&(r.precision=o-(r.type==="%")*2);break}}return no(r)}function bn(t){var e=t.domain;return t.ticks=function(n){var r=e();return In(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Ry(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=Nn(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function Po(){var t=th();return t.copy=function(){return Mo(t,Po())},ye.apply(t,arguments),bn(t)}function ky(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,nu),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return ky(t).unknown(e)},t=arguments.length?Array.from(t,nu):[0,1],bn(n)}function Iy(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),t[n]=e.floor(i),t[r]=e.ceil(o),t}function Ny(t){return Math.log(t)}function Fy(t){return Math.exp(t)}function $9(t){return-Math.log(-t)}function S9(t){return-Math.exp(-t)}function A9(t){return isFinite(t)?+("1e"+t):t<0?0:t}function M9(t){return t===10?A9:t===Math.E?Math.exp:e=>Math.pow(t,e)}function P9(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function zy(t){return(e,n)=>-t(-e,n)}function eh(t){const e=t(Ny,Fy),n=e.domain;let r=10,i,o;function a(){return i=P9(r),o=M9(r),n()[0]<0?(i=zy(i),o=zy(o),t($9,S9)):t(Ny,Fy),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let h=i(l),p=i(c),d,g;const m=s==null?10:+s;let y=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),l>0){for(;h<=p;++h)for(d=1;d<r;++d)if(g=h<0?d/o(-h):d*o(h),!(g<l)){if(g>c)break;y.push(g)}}else for(;h<=p;++h)for(d=r-1;d>=1;--d)if(g=h>0?d/o(-h):d*o(h),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=In(l,c,m))}else y=In(h,p,Math.min(p-h,m)).map(o);return f?y.reverse():y},e.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=Br(u)).precision==null&&(u.trim=!0),u=no(u)),s===1/0)return u;const l=Math.max(1,r*s/e.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=l?u(c):""}},e.nice=()=>n(Iy(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function Gy(){const t=eh(ru()).domain([1,10]);return t.copy=()=>Mo(t,Gy()).base(t.base()),ye.apply(t,arguments),t}function Oy(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Yy(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nh(t){var e=1,n=t(Oy(e),Yy(e));return n.constant=function(r){return arguments.length?t(Oy(e=+r),Yy(e)):e},bn(n)}function Uy(){var t=nh(ru());return t.copy=function(){return Mo(t,Uy()).constant(t.constant())},ye.apply(t,arguments)}function By(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function D9(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function T9(t){return t<0?-t*t:t*t}function rh(t){var e=t(te,te),n=1;function r(){return n===1?t(te,te):n===.5?t(D9,T9):t(By(n),By(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},bn(e)}function Qr(){var t=rh(ru());return t.copy=function(){return Mo(t,Qr()).exponent(t.exponent())},ye.apply(t,arguments),t}function L9(){return Qr.apply(null,arguments).exponent(.5)}function Wy(t){return Math.sign(t)*t*t}function C9(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Hy(){var t=th(),e=[0,1],n=!1,r;function i(o){var a=C9(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(Wy(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,nu)).map(Wy)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Hy(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ye.apply(i,arguments),bn(i)}function Xy(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a<s;)n[a-1]=$g(t,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:e[Rn(n,a)]}return o.invertExtent=function(a){var s=e.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:t[0],s<n.length?n[s]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let s of a)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(_t),i()},o.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Xy().domain(t).range(e).unknown(r)},ye.apply(o,arguments)}function qy(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[Rn(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return qy().domain([t,e]).range(i).unknown(o)},ye.apply(bn(a),arguments)}function jy(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Rn(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return jy().domain(t).range(e).unknown(n)},ye.apply(i,arguments)}const ih=new Date,oh=new Date;function Dt(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const u=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return u;let l;do u.push(l=new Date(+o)),e(o,s),t(o);while(l<o&&o<a);return u},i.filter=o=>Dt(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(ih.setTime(+o),oh.setTime(+a),t(ih),t(oh),Math.floor(n(ih,oh))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const Jr=Dt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Jr.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Dt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Jr);const Vy=Jr.range,rn=1e3,be=rn*60,on=be*60,an=on*24,ah=an*7,Zy=an*30,sh=an*365,sn=Dt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*rn)},(t,e)=>(e-t)/rn,t=>t.getUTCSeconds()),Ky=sn.range,iu=Dt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*rn)},(t,e)=>{t.setTime(+t+e*be)},(t,e)=>(e-t)/be,t=>t.getMinutes()),E9=iu.range,ou=Dt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*be)},(t,e)=>(e-t)/be,t=>t.getUTCMinutes()),R9=ou.range,au=Dt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*rn-t.getMinutes()*be)},(t,e)=>{t.setTime(+t+e*on)},(t,e)=>(e-t)/on,t=>t.getHours()),k9=au.range,su=Dt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*on)},(t,e)=>(e-t)/on,t=>t.getUTCHours()),I9=su.range,ti=Dt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*be)/an,t=>t.getDate()-1),N9=ti.range,Do=Dt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/an,t=>t.getUTCDate()-1),F9=Do.range,uh=Dt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/an,t=>Math.floor(t/an)),z9=uh.range;function rr(t){return Dt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*be)/ah)}const ei=rr(0),To=rr(1),Qy=rr(2),Jy=rr(3),ir=rr(4),tb=rr(5),eb=rr(6),nb=ei.range,G9=To.range,O9=Qy.range,Y9=Jy.range,U9=ir.range,B9=tb.range,W9=eb.range;function or(t){return Dt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/ah)}const ni=or(0),Lo=or(1),rb=or(2),ib=or(3),ar=or(4),ob=or(5),ab=or(6),sb=ni.range,H9=Lo.range,X9=rb.range,q9=ib.range,j9=ar.range,V9=ob.range,Z9=ab.range,uu=Dt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),K9=uu.range,lu=Dt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),Q9=lu.range,Be=Dt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Be.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Dt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});const J9=Be.range,We=Dt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());We.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Dt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});const tL=We.range;function ub(t,e,n,r,i,o){const a=[[sn,1,rn],[sn,5,5*rn],[sn,15,15*rn],[sn,30,30*rn],[o,1,be],[o,5,5*be],[o,15,15*be],[o,30,30*be],[i,1,on],[i,3,3*on],[i,6,6*on],[i,12,12*on],[r,1,an],[r,2,2*an],[n,1,ah],[e,1,Zy],[e,3,3*Zy],[t,1,sh]];function s(l,c,f){const h=c<l;h&&([l,c]=[c,l]);const p=f&&typeof f.range=="function"?f:u(l,c,f),d=p?p.range(l,+c+1):[];return h?d.reverse():d}function u(l,c,f){const h=Math.abs(c-l)/f,p=va(([,,m])=>m).right(a,h);if(p===a.length)return t.every($a(l/sh,c/sh,f));if(p===0)return Jr.every(Math.max($a(l,c,f),1));const[d,g]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return d.every(g)}return[s,u]}const[lb,cb]=ub(We,lu,ni,uh,su,ou),[fb,hb]=ub(Be,uu,ei,ti,au,iu);function lh(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ch(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Co(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function pb(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=Eo(i),c=Ro(i),f=Eo(o),h=Ro(o),p=Eo(a),d=Ro(a),g=Eo(s),m=Ro(s),y=Eo(u),v=Ro(u),x={a:O,A:G,b:k,B:R,c:null,d:vb,e:vb,f:$L,g:RL,G:IL,H:xL,I:_L,j:wL,L:xb,m:SL,M:AL,p:L,q:z,Q:Mb,s:Pb,S:ML,u:PL,U:DL,V:TL,w:LL,W:CL,x:null,X:null,y:EL,Y:kL,Z:NL,"%":Ab},b={a:X,A:Q,b:Y,B:Z,c:null,d:wb,e:wb,f:OL,g:ZL,G:QL,H:FL,I:zL,j:GL,L:$b,m:YL,M:UL,p:U,q:V,Q:Mb,s:Pb,S:BL,u:WL,U:HL,V:XL,w:qL,W:jL,x:null,X:null,y:VL,Y:KL,Z:JL,"%":Ab},S={a:P,A:_,b:N,B:T,c:A,d:yb,e:yb,f:mL,g:mb,G:gb,H:bb,I:bb,j:hL,L:gL,m:fL,M:pL,p:w,q:cL,Q:bL,s:vL,S:dL,u:oL,U:aL,V:sL,w:iL,W:uL,x:C,X:D,y:mb,Y:gb,Z:lL,"%":yL};x.x=$(n,x),x.X=$(r,x),x.c=$(e,x),b.x=$(n,b),b.X=$(r,b),b.c=$(e,b);function $(q,rt){return function(ut){var H=[],mt=-1,ht=0,Bt=q.length,ee,st,Pt;for(ut instanceof Date||(ut=new Date(+ut));++mt<Bt;)q.charCodeAt(mt)===37&&(H.push(q.slice(ht,mt)),(st=db[ee=q.charAt(++mt)])!=null?ee=q.charAt(++mt):st=ee==="e"?" ":"0",(Pt=rt[ee])&&(ee=Pt(ut,st)),H.push(ee),ht=mt+1);return H.push(q.slice(ht,mt)),H.join("")}}function E(q,rt){return function(ut){var H=Co(1900,void 0,1),mt=M(H,q,ut+="",0),ht,Bt;if(mt!=ut.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(rt&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(ht=ch(Co(H.y,0,1)),Bt=ht.getUTCDay(),ht=Bt>4||Bt===0?Lo.ceil(ht):Lo(ht),ht=Do.offset(ht,(H.V-1)*7),H.y=ht.getUTCFullYear(),H.m=ht.getUTCMonth(),H.d=ht.getUTCDate()+(H.w+6)%7):(ht=lh(Co(H.y,0,1)),Bt=ht.getDay(),ht=Bt>4||Bt===0?To.ceil(ht):To(ht),ht=ti.offset(ht,(H.V-1)*7),H.y=ht.getFullYear(),H.m=ht.getMonth(),H.d=ht.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),Bt="Z"in H?ch(Co(H.y,0,1)).getUTCDay():lh(Co(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(Bt+5)%7:H.w+H.U*7-(Bt+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,ch(H)):lh(H)}}function M(q,rt,ut,H){for(var mt=0,ht=rt.length,Bt=ut.length,ee,st;mt<ht;){if(H>=Bt)return-1;if(ee=rt.charCodeAt(mt++),ee===37){if(ee=rt.charAt(mt++),st=S[ee in db?rt.charAt(mt++):ee],!st||(H=st(q,ut,H))<0)return-1}else if(ee!=ut.charCodeAt(H++))return-1}return H}function w(q,rt,ut){var H=l.exec(rt.slice(ut));return H?(q.p=c.get(H[0].toLowerCase()),ut+H[0].length):-1}function P(q,rt,ut){var H=p.exec(rt.slice(ut));return H?(q.w=d.get(H[0].toLowerCase()),ut+H[0].length):-1}function _(q,rt,ut){var H=f.exec(rt.slice(ut));return H?(q.w=h.get(H[0].toLowerCase()),ut+H[0].length):-1}function N(q,rt,ut){var H=y.exec(rt.slice(ut));return H?(q.m=v.get(H[0].toLowerCase()),ut+H[0].length):-1}function T(q,rt,ut){var H=g.exec(rt.slice(ut));return H?(q.m=m.get(H[0].toLowerCase()),ut+H[0].length):-1}function A(q,rt,ut){return M(q,e,rt,ut)}function C(q,rt,ut){return M(q,n,rt,ut)}function D(q,rt,ut){return M(q,r,rt,ut)}function O(q){return a[q.getDay()]}function G(q){return o[q.getDay()]}function k(q){return u[q.getMonth()]}function R(q){return s[q.getMonth()]}function L(q){return i[+(q.getHours()>=12)]}function z(q){return 1+~~(q.getMonth()/3)}function X(q){return a[q.getUTCDay()]}function Q(q){return o[q.getUTCDay()]}function Y(q){return u[q.getUTCMonth()]}function Z(q){return s[q.getUTCMonth()]}function U(q){return i[+(q.getUTCHours()>=12)]}function V(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var rt=$(q+="",x);return rt.toString=function(){return q},rt},parse:function(q){var rt=E(q+="",!1);return rt.toString=function(){return q},rt},utcFormat:function(q){var rt=$(q+="",b);return rt.toString=function(){return q},rt},utcParse:function(q){var rt=E(q+="",!0);return rt.toString=function(){return q},rt}}}var db={"-":"",_:" ",0:"0"},It=/^\s*\d+/,eL=/^%/,nL=/[\\^$*+?|[\]().{}]/g;function gt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function rL(t){return t.replace(nL,"\\$&")}function Eo(t){return new RegExp("^(?:"+t.map(rL).join("|")+")","i")}function Ro(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function iL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function oL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function aL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function sL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function uL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function gb(t,e,n){var r=It.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function mb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function lL(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function cL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function fL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function yb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function hL(t,e,n){var r=It.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function bb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function pL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function dL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function gL(t,e,n){var r=It.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function mL(t,e,n){var r=It.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yL(t,e,n){var r=eL.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function bL(t,e,n){var r=It.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function vL(t,e,n){var r=It.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function vb(t,e){return gt(t.getDate(),e,2)}function xL(t,e){return gt(t.getHours(),e,2)}function _L(t,e){return gt(t.getHours()%12||12,e,2)}function wL(t,e){return gt(1+ti.count(Be(t),t),e,3)}function xb(t,e){return gt(t.getMilliseconds(),e,3)}function $L(t,e){return xb(t,e)+"000"}function SL(t,e){return gt(t.getMonth()+1,e,2)}function AL(t,e){return gt(t.getMinutes(),e,2)}function ML(t,e){return gt(t.getSeconds(),e,2)}function PL(t){var e=t.getDay();return e===0?7:e}function DL(t,e){return gt(ei.count(Be(t)-1,t),e,2)}function _b(t){var e=t.getDay();return e>=4||e===0?ir(t):ir.ceil(t)}function TL(t,e){return t=_b(t),gt(ir.count(Be(t),t)+(Be(t).getDay()===4),e,2)}function LL(t){return t.getDay()}function CL(t,e){return gt(To.count(Be(t)-1,t),e,2)}function EL(t,e){return gt(t.getFullYear()%100,e,2)}function RL(t,e){return t=_b(t),gt(t.getFullYear()%100,e,2)}function kL(t,e){return gt(t.getFullYear()%1e4,e,4)}function IL(t,e){var n=t.getDay();return t=n>=4||n===0?ir(t):ir.ceil(t),gt(t.getFullYear()%1e4,e,4)}function NL(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gt(e/60|0,"0",2)+gt(e%60,"0",2)}function wb(t,e){return gt(t.getUTCDate(),e,2)}function FL(t,e){return gt(t.getUTCHours(),e,2)}function zL(t,e){return gt(t.getUTCHours()%12||12,e,2)}function GL(t,e){return gt(1+Do.count(We(t),t),e,3)}function $b(t,e){return gt(t.getUTCMilliseconds(),e,3)}function OL(t,e){return $b(t,e)+"000"}function YL(t,e){return gt(t.getUTCMonth()+1,e,2)}function UL(t,e){return gt(t.getUTCMinutes(),e,2)}function BL(t,e){return gt(t.getUTCSeconds(),e,2)}function WL(t){var e=t.getUTCDay();return e===0?7:e}function HL(t,e){return gt(ni.count(We(t)-1,t),e,2)}function Sb(t){var e=t.getUTCDay();return e>=4||e===0?ar(t):ar.ceil(t)}function XL(t,e){return t=Sb(t),gt(ar.count(We(t),t)+(We(t).getUTCDay()===4),e,2)}function qL(t){return t.getUTCDay()}function jL(t,e){return gt(Lo.count(We(t)-1,t),e,2)}function VL(t,e){return gt(t.getUTCFullYear()%100,e,2)}function ZL(t,e){return t=Sb(t),gt(t.getUTCFullYear()%100,e,2)}function KL(t,e){return gt(t.getUTCFullYear()%1e4,e,4)}function QL(t,e){var n=t.getUTCDay();return t=n>=4||n===0?ar(t):ar.ceil(t),gt(t.getUTCFullYear()%1e4,e,4)}function JL(){return"+0000"}function Ab(){return"%"}function Mb(t){return+t}function Pb(t){return Math.floor(+t/1e3)}var ri,fh,Db,cu,hh;Tb({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Tb(t){return ri=pb(t),fh=ri.format,Db=ri.parse,cu=ri.utcFormat,hh=ri.utcParse,ri}var Lb="%Y-%m-%dT%H:%M:%S.%LZ";function tC(t){return t.toISOString()}var eC=Date.prototype.toISOString?tC:cu(Lb);const nC=eC;function rC(t){var e=new Date(t);return isNaN(e)?null:e}var iC=+new Date("2000-01-01T00:00:00.000Z")?rC:hh(Lb);const oC=iC;function aC(t){return new Date(t)}function sC(t){return t instanceof Date?+t:+new Date(+t)}function ph(t,e,n,r,i,o,a,s,u,l){var c=th(),f=c.invert,h=c.domain,p=l(".%L"),d=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),v=l("%b %d"),x=l("%B"),b=l("%Y");function S($){return(u($)<$?p:s($)<$?d:a($)<$?g:o($)<$?m:r($)<$?i($)<$?y:v:n($)<$?x:b)($)}return c.invert=function($){return new Date(f($))},c.domain=function($){return arguments.length?h(Array.from($,sC)):h().map(aC)},c.ticks=function($){var E=h();return t(E[0],E[E.length-1],$??10)},c.tickFormat=function($,E){return E==null?S:l(E)},c.nice=function($){var E=h();return(!$||typeof $.range!="function")&&($=e(E[0],E[E.length-1],$??10)),$?h(Iy(E,$)):c},c.copy=function(){return Mo(c,ph(t,e,n,r,i,o,a,s,u,l))},c}function uC(){return ye.apply(ph(fb,hb,Be,uu,ei,ti,au,iu,sn,fh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function lC(){return ye.apply(ph(lb,cb,We,lu,ni,Do,su,ou,sn,cu).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function fu(){var t=0,e=1,n,r,i,o,a=te,s=!1,u;function l(f){return f==null||isNaN(f=+f)?u:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),l):[t,e]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(a=f,l):a};function c(f){return function(h){var p,d;return arguments.length?([p,d]=h,a=f(p,d),l):[a(0),a(1)]}}return l.range=c(je),l.rangeRound=c(Xa),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),l}}function vn(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Cb(){var t=bn(fu()(te));return t.copy=function(){return vn(t,Cb())},nn.apply(t,arguments)}function Eb(){var t=eh(fu()).domain([1,10]);return t.copy=function(){return vn(t,Eb()).base(t.base())},nn.apply(t,arguments)}function Rb(){var t=nh(fu());return t.copy=function(){return vn(t,Rb()).constant(t.constant())},nn.apply(t,arguments)}function dh(){var t=rh(fu());return t.copy=function(){return vn(t,dh()).exponent(t.exponent())},nn.apply(t,arguments)}function cC(){return dh.apply(null,arguments).exponent(.5)}function kb(){var t=[],e=te;function n(r){if(r!=null&&!isNaN(r=+r))return e((Rn(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(_t),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>ki(t,o/r))},n.copy=function(){return kb(e).domain(t)},nn.apply(n,arguments)}function hu(){var t=0,e=.5,n=1,r=1,i,o,a,s,u,l=te,c,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+c(g))-o)*(r*g<r*o?s:u),l(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([t,e,n]=g,i=c(t=+t),o=c(e=+e),a=c(n=+n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,p):[t,e,n]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(l=g,p):l};function d(g){return function(m){var y,v,x;return arguments.length?([y,v,x]=m,l=I0(g,[y,v,x]),p):[l(0),l(.5),l(1)]}}return p.range=d(je),p.rangeRound=d(Xa),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return c=g,i=g(t),o=g(e),a=g(n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,p}}function Ib(){var t=bn(hu()(te));return t.copy=function(){return vn(t,Ib())},nn.apply(t,arguments)}function Nb(){var t=eh(hu()).domain([.1,1,10]);return t.copy=function(){return vn(t,Nb()).base(t.base())},nn.apply(t,arguments)}function Fb(){var t=nh(hu());return t.copy=function(){return vn(t,Fb()).constant(t.constant())},nn.apply(t,arguments)}function gh(){var t=rh(hu());return t.copy=function(){return vn(t,gh()).exponent(t.exponent())},nn.apply(t,arguments)}function fC(){return gh.apply(null,arguments).exponent(.5)}function ct(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}const hC=ct("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),pC=ct("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),dC=ct("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),gC=ct("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),mC=ct("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),yC=ct("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),bC=ct("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),vC=ct("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),xC=ct("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),_C=ct("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),wC=ct("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),vt=t=>x0(t[t.length-1]);var zb=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(ct);const $C=vt(zb);var Gb=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(ct);const SC=vt(Gb);var Ob=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(ct);const AC=vt(Ob);var Yb=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(ct);const MC=vt(Yb);var Ub=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(ct);const PC=vt(Ub);var Bb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(ct);const DC=vt(Bb);var Wb=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(ct);const TC=vt(Wb);var Hb=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(ct);const LC=vt(Hb);var Xb=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(ct);const CC=vt(Xb);var qb=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(ct);const EC=vt(qb);var jb=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(ct);const RC=vt(jb);var Vb=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(ct);const kC=vt(Vb);var Zb=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(ct);const IC=vt(Zb);var Kb=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(ct);const NC=vt(Kb);var Qb=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(ct);const FC=vt(Qb);var Jb=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(ct);const zC=vt(Jb);var tv=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(ct);const GC=vt(tv);var ev=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(ct);const OC=vt(ev);var nv=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(ct);const YC=vt(nv);var rv=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(ct);const UC=vt(rv);var iv=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(ct);const BC=vt(iv);var ov=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(ct);const WC=vt(ov);var av=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(ct);const HC=vt(av);var sv=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(ct);const XC=vt(sv);var uv=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(ct);const qC=vt(uv);var lv=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(ct);const jC=vt(lv);var cv=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(ct);const VC=vt(cv);function ZC(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const KC=ja(Pe(300,.5,0),Pe(-240,.5,1));var QC=ja(Pe(-100,.75,.35),Pe(80,1.5,.8)),JC=ja(Pe(260,.75,.35),Pe(80,1.5,.8)),pu=Pe();function tE(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return pu.h=360*t-100,pu.s=1.5-1.5*e,pu.l=.8-.9*e,pu+""}var du=Cr(),eE=Math.PI/3,nE=Math.PI*2/3;function rE(t){var e;return t=(.5-t)*Math.PI,du.r=255*(e=Math.sin(t))*e,du.g=255*(e=Math.sin(t+eE))*e,du.b=255*(e=Math.sin(t+nE))*e,du+""}function iE(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function gu(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const oE=gu(ct("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var aE=gu(ct("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),sE=gu(ct("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),uE=gu(ct("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function lt(t){return function(){return t}}const fv=Math.abs,Yt=Math.atan2,un=Math.cos,lE=Math.max,ii=Math.min,oe=Math.sin,xt=Math.sqrt,Ut=1e-12,xn=Math.PI,mu=xn/2,_n=2*xn;function cE(t){return t>1?0:t<-1?xn:Math.acos(t)}function hv(t){return t>=1?mu:t<=-1?-mu:Math.asin(t)}function ko(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Qi(e)}function fE(t){return t.innerRadius}function hE(t){return t.outerRadius}function pE(t){return t.startAngle}function dE(t){return t.endAngle}function gE(t){return t&&t.padAngle}function mE(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,f=s-o,h=f*u-c*l;if(!(h*h<Ut))return h=(c*(e-o)-f*(t-i))/h,[t+h*u,e+h*l]}function yu(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/xt(s*s+u*u),c=l*u,f=-l*s,h=t+c,p=e+f,d=n+c,g=r+f,m=(h+d)/2,y=(p+g)/2,v=d-h,x=g-p,b=v*v+x*x,S=i-o,$=h*g-d*p,E=(x<0?-1:1)*xt(lE(0,S*S*b-$*$)),M=($*x-v*E)/b,w=(-$*v-x*E)/b,P=($*x+v*E)/b,_=(-$*v+x*E)/b,N=M-m,T=w-y,A=P-m,C=_-y;return N*N+T*T>A*A+C*C&&(M=P,w=_),{cx:M,cy:w,x01:-c,y01:-f,x11:M*(i/S-1),y11:w*(i/S-1)}}function bu(){var t=fE,e=hE,n=lt(0),r=null,i=pE,o=dE,a=gE,s=null,u=ko(l);function l(){var c,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-mu,g=o.apply(this,arguments)-mu,m=fv(g-d),y=g>d;if(s||(s=c=u()),p<h&&(f=p,p=h,h=f),!(p>Ut))s.moveTo(0,0);else if(m>_n-Ut)s.moveTo(p*un(d),p*oe(d)),s.arc(0,0,p,d,g,!y),h>Ut&&(s.moveTo(h*un(g),h*oe(g)),s.arc(0,0,h,g,d,y));else{var v=d,x=g,b=d,S=g,$=m,E=m,M=a.apply(this,arguments)/2,w=M>Ut&&(r?+r.apply(this,arguments):xt(h*h+p*p)),P=ii(fv(p-h)/2,+n.apply(this,arguments)),_=P,N=P,T,A;if(w>Ut){var C=hv(w/h*oe(M)),D=hv(w/p*oe(M));($-=C*2)>Ut?(C*=y?1:-1,b+=C,S-=C):($=0,b=S=(d+g)/2),(E-=D*2)>Ut?(D*=y?1:-1,v+=D,x-=D):(E=0,v=x=(d+g)/2)}var O=p*un(v),G=p*oe(v),k=h*un(S),R=h*oe(S);if(P>Ut){var L=p*un(x),z=p*oe(x),X=h*un(b),Q=h*oe(b),Y;if(m<xn)if(Y=mE(O,G,X,Q,L,z,k,R)){var Z=O-Y[0],U=G-Y[1],V=L-Y[0],q=z-Y[1],rt=1/oe(cE((Z*V+U*q)/(xt(Z*Z+U*U)*xt(V*V+q*q)))/2),ut=xt(Y[0]*Y[0]+Y[1]*Y[1]);_=ii(P,(h-ut)/(rt-1)),N=ii(P,(p-ut)/(rt+1))}else _=N=0}E>Ut?N>Ut?(T=yu(X,Q,O,G,p,N,y),A=yu(L,z,k,R,p,N,y),s.moveTo(T.cx+T.x01,T.cy+T.y01),N<P?s.arc(T.cx,T.cy,N,Yt(T.y01,T.x01),Yt(A.y01,A.x01),!y):(s.arc(T.cx,T.cy,N,Yt(T.y01,T.x01),Yt(T.y11,T.x11),!y),s.arc(0,0,p,Yt(T.cy+T.y11,T.cx+T.x11),Yt(A.cy+A.y11,A.cx+A.x11),!y),s.arc(A.cx,A.cy,N,Yt(A.y11,A.x11),Yt(A.y01,A.x01),!y))):(s.moveTo(O,G),s.arc(0,0,p,v,x,!y)):s.moveTo(O,G),!(h>Ut)||!($>Ut)?s.lineTo(k,R):_>Ut?(T=yu(k,R,L,z,h,-_,y),A=yu(O,G,X,Q,h,-_,y),s.lineTo(T.cx+T.x01,T.cy+T.y01),_<P?s.arc(T.cx,T.cy,_,Yt(T.y01,T.x01),Yt(A.y01,A.x01),!y):(s.arc(T.cx,T.cy,_,Yt(T.y01,T.x01),Yt(T.y11,T.x11),!y),s.arc(0,0,h,Yt(T.cy+T.y11,T.cx+T.x11),Yt(A.cy+A.y11,A.cx+A.x11),y),s.arc(A.cx,A.cy,_,Yt(A.y11,A.x11),Yt(A.y01,A.x01),!y))):s.arc(0,0,h,S,b,y)}if(s.closePath(),c)return s=null,c+""||null}return l.centroid=function(){var c=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-xn/2;return[un(f)*c,oe(f)*c]},l.innerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:lt(+c),l):t},l.outerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:lt(+c),l):e},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:lt(+c),l):n},l.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:lt(+c),l):r},l.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:lt(+c),l):i},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:lt(+c),l):o},l.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:lt(+c),l):a},l.context=function(c){return arguments.length?(s=c??null,l):s},l}var yE=Array.prototype.slice;function vu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pv(t){this._context=t}pv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function xu(t){return new pv(t)}function mh(t){return t[0]}function yh(t){return t[1]}function _u(t,e){var n=lt(!0),r=null,i=xu,o=null,a=ko(s);t=typeof t=="function"?t:t===void 0?mh:lt(t),e=typeof e=="function"?e:e===void 0?yh:lt(e);function s(u){var l,c=(u=vu(u)).length,f,h=!1,p;for(r==null&&(o=i(p=a())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(f,l,u),+e(f,l,u));if(p)return o=null,p+""||null}return s.x=function(u){return arguments.length?(t=typeof u=="function"?u:lt(+u),s):t},s.y=function(u){return arguments.length?(e=typeof u=="function"?u:lt(+u),s):e},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:lt(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),s):r},s}function bh(t,e,n){var r=null,i=lt(!0),o=null,a=xu,s=null,u=ko(l);t=typeof t=="function"?t:t===void 0?mh:lt(+t),e=typeof e=="function"?e:lt(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?yh:lt(+n);function l(f){var h,p,d,g=(f=vu(f)).length,m,y=!1,v,x=new Array(g),b=new Array(g);for(o==null&&(s=a(v=u())),h=0;h<=g;++h){if(!(h<g&&i(m=f[h],h,f))===y)if(y=!y)p=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=h-1;d>=p;--d)s.point(x[d],b[d]);s.lineEnd(),s.areaEnd()}y&&(x[h]=+t(m,h,f),b[h]=+e(m,h,f),s.point(r?+r(m,h,f):x[h],n?+n(m,h,f):b[h]))}if(v)return s=null,v+""||null}function c(){return _u().defined(i).curve(a).context(o)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),r=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),l):t},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:lt(+f),l):r},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),n=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),l):e},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:lt(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(n)},l.lineX1=function(){return c().x(r).y(e)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:lt(!!f),l):i},l.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),l):a},l.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),l):o},l}function bE(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function vE(t){return t}function dv(){var t=vE,e=bE,n=null,r=lt(0),i=lt(_n),o=lt(0);function a(s){var u,l=(s=vu(s)).length,c,f,h=0,p=new Array(l),d=new Array(l),g=+r.apply(this,arguments),m=Math.min(_n,Math.max(-_n,i.apply(this,arguments)-g)),y,v=Math.min(Math.abs(m)/l,o.apply(this,arguments)),x=v*(m<0?-1:1),b;for(u=0;u<l;++u)(b=d[p[u]=u]=+t(s[u],u,s))>0&&(h+=b);for(e!=null?p.sort(function(S,$){return e(d[S],d[$])}):n!=null&&p.sort(function(S,$){return n(s[S],s[$])}),u=0,f=h?(m-l*x)/h:0;u<l;++u,g=y)c=p[u],b=d[c],y=g+(b>0?b*f:0)+x,d[c]={data:s[c],index:u,value:b,startAngle:g,endAngle:y,padAngle:v};return d}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:lt(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,n=null,a):e},a.sort=function(s){return arguments.length?(n=s,e=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:lt(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:lt(+s),a):o},a}var gv=vh(xu);function mv(t){this._curve=t}mv.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function vh(t){function e(n){return new mv(t(n))}return e._curve=t,e}function Io(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(vh(n)):e()._curve},t}function yv(){return Io(_u().curve(gv))}function bv(){var t=bh().curve(gv),e=t.curve,n=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 Io(n())},delete t.lineX0,t.lineEndAngle=function(){return Io(r())},delete t.lineX1,t.lineInnerRadius=function(){return Io(i())},delete t.lineY0,t.lineOuterRadius=function(){return Io(o())},delete t.lineY1,t.curve=function(a){return arguments.length?e(vh(a)):e()._curve},t}function No(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}class vv{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}class xE{constructor(e){this._context=e}lineStart(){this._point=0}lineEnd(){}point(e,n){if(e=+e,n=+n,this._point===0)this._point=1;else{const r=No(this._x0,this._y0),i=No(this._x0,this._y0=(this._y0+n)/2),o=No(e,this._y0),a=No(e,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=e,this._y0=n}}function xv(t){return new vv(t,!0)}function _v(t){return new vv(t,!1)}function _E(t){return new xE(t)}function wE(t){return t.source}function $E(t){return t.target}function wu(t){let e=wE,n=$E,r=mh,i=yh,o=null,a=null,s=ko(u);function u(){let l;const c=yE.call(arguments),f=e.apply(this,c),h=n.apply(this,c);if(o==null&&(a=t(l=s())),a.lineStart(),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=h,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),l)return a=null,l+""||null}return u.source=function(l){return arguments.length?(e=l,u):e},u.target=function(l){return arguments.length?(n=l,u):n},u.x=function(l){return arguments.length?(r=typeof l=="function"?l:lt(+l),u):r},u.y=function(l){return arguments.length?(i=typeof l=="function"?l:lt(+l),u):i},u.context=function(l){return arguments.length?(l==null?o=a=null:a=t(o=l),u):o},u}function SE(){return wu(xv)}function AE(){return wu(_v)}function ME(){const t=wu(_E);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const PE=xt(3),wv={draw(t,e){const n=xt(e+ii(e/28,.75))*.59436,r=n/2,i=r*PE;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},$u={draw(t,e){const n=xt(e/xn);t.moveTo(n,0),t.arc(0,0,n,0,_n)}},$v={draw(t,e){const n=xt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Sv=xt(1/3),DE=Sv*2,Av={draw(t,e){const n=xt(e/DE),r=n*Sv;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Mv={draw(t,e){const n=xt(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},Pv={draw(t,e){const n=xt(e-ii(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},Dv={draw(t,e){const n=xt(e),r=-n/2;t.rect(r,r,n,n)}},Tv={draw(t,e){const n=xt(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},TE=.8908130915292852,Lv=oe(xn/10)/oe(7*xn/10),LE=oe(_n/10)*Lv,CE=-un(_n/10)*Lv,Cv={draw(t,e){const n=xt(e*TE),r=LE*n,i=CE*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=_n*o/5,s=un(a),u=oe(a);t.lineTo(u*n,-s*n),t.lineTo(s*r-u*i,u*r+s*i)}t.closePath()}},xh=xt(3),Ev={draw(t,e){const n=-xt(e/(xh*3));t.moveTo(0,n*2),t.lineTo(-xh*n,-n),t.lineTo(xh*n,-n),t.closePath()}},EE=xt(3),Rv={draw(t,e){const n=xt(e)*.6824,r=n/2,i=n*EE/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},ve=-.5,xe=xt(3)/2,_h=1/xt(12),RE=(_h/2+1)*3,kv={draw(t,e){const n=xt(e/RE),r=n/2,i=n*_h,o=r,a=n*_h+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(ve*r-xe*i,xe*r+ve*i),t.lineTo(ve*o-xe*a,xe*o+ve*a),t.lineTo(ve*s-xe*u,xe*s+ve*u),t.lineTo(ve*r+xe*i,ve*i-xe*r),t.lineTo(ve*o+xe*a,ve*a-xe*o),t.lineTo(ve*s+xe*u,ve*u-xe*s),t.closePath()}},wh={draw(t,e){const n=xt(e-ii(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},Iv=[$u,$v,Av,Dv,Cv,Ev,kv],kE=[$u,Pv,wh,Rv,wv,Tv,Mv];function IE(t,e){let n=null,r=ko(i);t=typeof t=="function"?t:lt(t||$u),e=typeof e=="function"?e:lt(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:lt(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function wn(){}function Su(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Au(t){this._context=t}Au.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:Su(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Su(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function NE(t){return new Au(t)}function Nv(t){this._context=t}Nv.prototype={areaStart:wn,areaEnd:wn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Su(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function FE(t){return new Nv(t)}function Fv(t){this._context=t}Fv.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Su(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zE(t){return new Fv(t)}function zv(t,e){this._basis=new Au(t),this._beta=e}zv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,a=e[n]-i,s=-1,u;++s<=n;)u=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+u*o),this._beta*e[s]+(1-this._beta)*(i+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const GE=function t(e){function n(r){return e===1?new Au(r):new zv(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function Mu(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function $h(t,e){this._context=t,this._k=(1-e)/6}$h.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:Mu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Mu(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const OE=function t(e){function n(r){return new $h(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Sh(t,e){this._context=t,this._k=(1-e)/6}Sh.prototype={areaStart:wn,areaEnd:wn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Mu(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const YE=function t(e){function n(r){return new Sh(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Ah(t,e){this._context=t,this._k=(1-e)/6}Ah.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Mu(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const UE=function t(e){function n(r){return new Ah(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Mh(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Ut){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Ut){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Gv(t,e){this._context=t,this._alpha=e}Gv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Mh(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const BE=function t(e){function n(r){return e?new Gv(r,e):new $h(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Ov(t,e){this._context=t,this._alpha=e}Ov.prototype={areaStart:wn,areaEnd:wn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Mh(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const WE=function t(e){function n(r){return e?new Ov(r,e):new Sh(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Yv(t,e){this._context=t,this._alpha=e}Yv.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Mh(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const HE=function t(e){function n(r){return e?new Yv(r,e):new Ah(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Uv(t){this._context=t}Uv.prototype={areaStart:wn,areaEnd:wn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function XE(t){return new Uv(t)}function Bv(t){return t<0?-1:1}function Wv(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Bv(o)+Bv(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Hv(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Ph(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Pu(t){this._context=t}Pu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ph(this,this._t0,Hv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ph(this,Hv(this,n=Wv(this,t,e)),n);break;default:Ph(this,this._t0,n=Wv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function Xv(t){this._context=new qv(t)}(Xv.prototype=Object.create(Pu.prototype)).point=function(t,e){Pu.prototype.point.call(this,e,t)};function qv(t){this._context=t}qv.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function qE(t){return new Pu(t)}function jE(t){return new Xv(t)}function jv(t){this._context=t}jv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=Vv(t),i=Vv(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Vv(t){var e,n=t.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/o[e-1],o[e]-=r,a[e]-=r*a[e-1];for(i[n-1]=a[n-1]/o[n-1],e=n-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function VE(t){return new jv(t)}function Du(t,e){this._context=t,this._t=e}Du.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function ZE(t){return new Du(t,.5)}function KE(t){return new Du(t,0)}function QE(t){return new Du(t,1)}function oi(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n<a;++n)for(i=o,o=t[e[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function ai(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function JE(t,e){return t[e]}function tR(t){const e=[];return e.key=t,e}function eR(){var t=lt([]),e=ai,n=oi,r=JE;function i(o){var a=Array.from(t.apply(this,arguments),tR),s,u=a.length,l=-1,c;for(const f of o)for(s=0,++l;s<u;++s)(a[s][l]=[0,+r(f,a[s].key,l,o)]).data=f;for(s=0,c=vu(e(a));s<u;++s)a[c[s]].index=s;return n(a,c),a}return i.keys=function(o){return arguments.length?(t=typeof o=="function"?o:lt(Array.from(o)),i):t},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:lt(+o),i):r},i.order=function(o){return arguments.length?(e=o==null?ai:typeof o=="function"?o:lt(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(n=o??oi,i):n},i}function nR(t,e){if((r=t.length)>0){for(var n,r,i=0,o=t[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=t[n][i][1]||0;if(a)for(n=0;n<r;++n)t[n][i][1]/=a}oi(t,e)}}function rR(t,e){if((u=t.length)>0)for(var n,r=0,i,o,a,s,u,l=t[e[0]].length;r<l;++r)for(a=s=0,n=0;n<u;++n)(o=(i=t[e[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=o):o<0?(i[1]=s,i[0]=s+=o):(i[0]=0,i[1]=o)}function iR(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=t[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}oi(t,e)}}function oR(t,e){if(!(!((a=t.length)>0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,u=0,l=0;s<a;++s){for(var c=t[e[s]],f=c[r][1]||0,h=c[r-1][1]||0,p=(f-h)/2,d=0;d<s;++d){var g=t[e[d]],m=g[r][1]||0,y=g[r-1][1]||0;p+=m-y}u+=f,l+=p*f}i[r-1][1]+=i[r-1][0]=n,u&&(n-=l/u)}i[r-1][1]+=i[r-1][0]=n,oi(t,e)}}function Zv(t){var e=t.map(aR);return ai(t).sort(function(n,r){return e[n]-e[r]})}function aR(t){for(var e=-1,n=0,r=t.length,i,o=-1/0;++e<r;)(i=+t[e][1])>o&&(o=i,n=e);return n}function Kv(t){var e=t.map(Qv);return ai(t).sort(function(n,r){return e[n]-e[r]})}function Qv(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function sR(t){return Kv(t).reverse()}function uR(t){var e=t.length,n,r,i=t.map(Qv),o=Zv(t),a=0,s=0,u=[],l=[];for(n=0;n<e;++n)r=o[n],a<s?(a+=i[r],u.push(r)):(s+=i[r],l.push(r));return l.reverse().concat(u)}function lR(t){return ai(t).reverse()}const Tu=t=>()=>t;function cR(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function He(t,e,n){this.k=t,this.x=e,this.y=n}He.prototype={constructor:He,scale:function(t){return t===1?this:new He(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new He(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Lu=new He(1,0,0);Jv.prototype=He.prototype;function Jv(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Lu;return t.__zoom}function Dh(t){t.stopImmediatePropagation()}function Fo(t){t.preventDefault(),t.stopImmediatePropagation()}function fR(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function hR(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function tx(){return this.__zoom||Lu}function pR(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function dR(){return navigator.maxTouchPoints||"ontouchstart"in this}function gR(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(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 Th(){var t=fR,e=hR,n=gR,r=pR,i=dR,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,u=C0,l=Fn("start","zoom","end"),c,f,h,p=500,d=150,g=0,m=10;function y(A){A.property("__zoom",tx).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",w).on("dblclick.zoom",P).filter(i).on("touchstart.zoom",_).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(A,C,D,O){var G=A.selection?A.selection():A;G.property("__zoom",tx),A!==G?S(A,C,D,O):G.interrupt().each(function(){$(this,arguments).event(O).start().zoom(null,typeof C=="function"?C.apply(this,arguments):C).end()})},y.scaleBy=function(A,C,D,O){y.scaleTo(A,function(){var G=this.__zoom.k,k=typeof C=="function"?C.apply(this,arguments):C;return G*k},D,O)},y.scaleTo=function(A,C,D,O){y.transform(A,function(){var G=e.apply(this,arguments),k=this.__zoom,R=D==null?b(G):typeof D=="function"?D.apply(this,arguments):D,L=k.invert(R),z=typeof C=="function"?C.apply(this,arguments):C;return n(x(v(k,z),R,L),G,a)},D,O)},y.translateBy=function(A,C,D,O){y.transform(A,function(){return n(this.__zoom.translate(typeof C=="function"?C.apply(this,arguments):C,typeof D=="function"?D.apply(this,arguments):D),e.apply(this,arguments),a)},null,O)},y.translateTo=function(A,C,D,O,G){y.transform(A,function(){var k=e.apply(this,arguments),R=this.__zoom,L=O==null?b(k):typeof O=="function"?O.apply(this,arguments):O;return n(Lu.translate(L[0],L[1]).scale(R.k).translate(typeof C=="function"?-C.apply(this,arguments):-C,typeof D=="function"?-D.apply(this,arguments):-D),k,a)},O,G)};function v(A,C){return C=Math.max(o[0],Math.min(o[1],C)),C===A.k?A:new He(C,A.x,A.y)}function x(A,C,D){var O=C[0]-D[0]*A.k,G=C[1]-D[1]*A.k;return O===A.x&&G===A.y?A:new He(A.k,O,G)}function b(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function S(A,C,D,O){A.on("start.zoom",function(){$(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(O).end()}).tween("zoom",function(){var G=this,k=arguments,R=$(G,k).event(O),L=e.apply(G,k),z=D==null?b(L):typeof D=="function"?D.apply(G,k):D,X=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),Q=G.__zoom,Y=typeof C=="function"?C.apply(G,k):C,Z=u(Q.invert(z).concat(X/Q.k),Y.invert(z).concat(X/Y.k));return function(U){if(U===1)U=Y;else{var V=Z(U),q=X/V[2];U=new He(q,z[0]-V[0]*q,z[1]-V[1]*q)}R.zoom(null,U)}})}function $(A,C,D){return!D&&A.__zooming||new E(A,C)}function E(A,C){this.that=A,this.args=C,this.active=0,this.sourceEvent=null,this.extent=e.apply(A,C),this.taps=0}E.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,C){return this.mouse&&A!=="mouse"&&(this.mouse[1]=C.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=C.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=C.invert(this.touch1[0])),this.that.__zoom=C,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var C=j(this.that).datum();l.call(A,this.that,new cR(A,{sourceEvent:this.sourceEvent,target:y,type:A,transform:this.that.__zoom,dispatch:l}),C)}};function M(A,...C){if(!t.apply(this,arguments))return;var D=$(this,C).event(A),O=this.__zoom,G=Math.max(o[0],Math.min(o[1],O.k*Math.pow(2,r.apply(this,arguments)))),k=ue(A);if(D.wheel)(D.mouse[0][0]!==k[0]||D.mouse[0][1]!==k[1])&&(D.mouse[1]=O.invert(D.mouse[0]=k)),clearTimeout(D.wheel);else{if(O.k===G)return;D.mouse=[k,O.invert(k)],Hn(this),D.start()}Fo(A),D.wheel=setTimeout(R,d),D.zoom("mouse",n(x(v(O,G),D.mouse[0],D.mouse[1]),D.extent,a));function R(){D.wheel=null,D.end()}}function w(A,...C){if(h||!t.apply(this,arguments))return;var D=A.currentTarget,O=$(this,C,!0).event(A),G=j(A.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",X,!0),k=ue(A,D),R=A.clientX,L=A.clientY;Ra(A.view),Dh(A),O.mouse=[k,this.__zoom.invert(k)],Hn(this),O.start();function z(Q){if(Fo(Q),!O.moved){var Y=Q.clientX-R,Z=Q.clientY-L;O.moved=Y*Y+Z*Z>g}O.event(Q).zoom("mouse",n(x(O.that.__zoom,O.mouse[0]=ue(Q,D),O.mouse[1]),O.extent,a))}function X(Q){G.on("mousemove.zoom mouseup.zoom",null),ka(Q.view,O.moved),Fo(Q),O.event(Q).end()}}function P(A,...C){if(t.apply(this,arguments)){var D=this.__zoom,O=ue(A.changedTouches?A.changedTouches[0]:A,this),G=D.invert(O),k=D.k*(A.shiftKey?.5:2),R=n(x(v(D,k),O,G),e.apply(this,C),a);Fo(A),s>0?j(this).transition().duration(s).call(S,R,O,A):j(this).call(y.transform,R,O,A)}}function _(A,...C){if(t.apply(this,arguments)){var D=A.touches,O=D.length,G=$(this,C,A.changedTouches.length===O).event(A),k,R,L,z;for(Dh(A),R=0;R<O;++R)L=D[R],z=ue(L,this),z=[z,this.__zoom.invert(z),L.identifier],G.touch0?!G.touch1&&G.touch0[2]!==z[2]&&(G.touch1=z,G.taps=0):(G.touch0=z,k=!0,G.taps=1+!!c);c&&(c=clearTimeout(c)),k&&(G.taps<2&&(f=z[0],c=setTimeout(function(){c=null},p)),Hn(this),G.start())}}function N(A,...C){if(this.__zooming){var D=$(this,C).event(A),O=A.changedTouches,G=O.length,k,R,L,z;for(Fo(A),k=0;k<G;++k)R=O[k],L=ue(R,this),D.touch0&&D.touch0[2]===R.identifier?D.touch0[0]=L:D.touch1&&D.touch1[2]===R.identifier&&(D.touch1[0]=L);if(R=D.that.__zoom,D.touch1){var X=D.touch0[0],Q=D.touch0[1],Y=D.touch1[0],Z=D.touch1[1],U=(U=Y[0]-X[0])*U+(U=Y[1]-X[1])*U,V=(V=Z[0]-Q[0])*V+(V=Z[1]-Q[1])*V;R=v(R,Math.sqrt(U/V)),L=[(X[0]+Y[0])/2,(X[1]+Y[1])/2],z=[(Q[0]+Z[0])/2,(Q[1]+Z[1])/2]}else if(D.touch0)L=D.touch0[0],z=D.touch0[1];else return;D.zoom("touch",n(x(R,L,z),D.extent,a))}}function T(A,...C){if(this.__zooming){var D=$(this,C).event(A),O=A.changedTouches,G=O.length,k,R;for(Dh(A),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),k=0;k<G;++k)R=O[k],D.touch0&&D.touch0[2]===R.identifier?delete D.touch0:D.touch1&&D.touch1[2]===R.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(R=ue(R,this),Math.hypot(f[0]-R[0],f[1]-R[1])<m)){var L=j(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return y.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:Tu(+A),y):r},y.filter=function(A){return arguments.length?(t=typeof A=="function"?A:Tu(!!A),y):t},y.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Tu(!!A),y):i},y.extent=function(A){return arguments.length?(e=typeof A=="function"?A:Tu([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),y):e},y.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],y):[o[0],o[1]]},y.translateExtent=function(A){return arguments.length?(a[0][0]=+A[0][0],a[1][0]=+A[1][0],a[0][1]=+A[0][1],a[1][1]=+A[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(A){return arguments.length?(n=A,y):n},y.duration=function(A){return arguments.length?(s=+A,y):s},y.interpolate=function(A){return arguments.length?(u=A,y):u},y.on=function(){var A=l.on.apply(l,arguments);return A===l?y:A},y.clickDistance=function(A){return arguments.length?(g=(A=+A)*A,y):Math.sqrt(g)},y.tapDistance=function(A){return arguments.length?(m=+A,y):m},y}const Lh=Object.freeze(Object.defineProperty({__proto__:null,Adder:Tt,Delaunay:Gc,FormatSpecifier:ps,InternMap:Ci,InternSet:kn,Node:er,Path:Qi,Voronoi:vm,ZoomTransform:He,active:v4,arc:bu,area:bh,areaRadial:bv,ascending:_t,autoType:BP,axisBottom:Eg,axisLeft:Rg,axisRight:f5,axisTop:c5,bin:_g,bisect:Rn,bisectCenter:s3,bisectLeft:a3,bisectRight:ag,bisector:va,blob:XP,blur:u3,blur2:sg,blurImage:l3,brush:E4,brushSelection:T4,brushX:L4,brushY:C4,buffer:jP,chord:k4,chordDirected:N4,chordTranspose:I4,cluster:aT,color:pn,contourDensity:uP,contours:kc,count:_a,create:X6,creator:La,cross:m3,csv:KP,csvFormat:EP,csvFormatBody:RP,csvFormatRow:IP,csvFormatRows:kP,csvFormatValue:NP,csvParse:$m,csvParseRows:CP,cubehelix:Pe,cumsum:y3,curveBasis:NE,curveBasisClosed:FE,curveBasisOpen:zE,curveBumpX:xv,curveBumpY:_v,curveBundle:GE,curveCardinal:OE,curveCardinalClosed:YE,curveCardinalOpen:UE,curveCatmullRom:BE,curveCatmullRomClosed:WE,curveCatmullRomOpen:HE,curveLinear:xu,curveLinearClosed:XE,curveMonotoneX:qE,curveMonotoneY:jE,curveNatural:VE,curveStep:ZE,curveStepAfter:QE,curveStepBefore:KE,descending:ig,deviation:cg,difference:Q3,disjoint:J3,dispatch:Fn,drag:Hg,dragDisable:Ra,dragEnable:ka,dsv:ZP,dsvFormat:ls,easeBack:J0,easeBackIn:f4,easeBackInOut:J0,easeBackOut:h4,easeBounce:Vi,easeBounceIn:l4,easeBounceInOut:c4,easeBounceOut:Vi,easeCircle:Q0,easeCircleIn:JM,easeCircleInOut:Q0,easeCircleOut:t4,easeCubic:ji,easeCubicIn:HM,easeCubicInOut:ji,easeCubicOut:XM,easeElastic:Zi,easeElasticIn:p4,easeElasticInOut:d4,easeElasticOut:Zi,easeExp:K0,easeExpIn:KM,easeExpInOut:K0,easeExpOut:QM,easeLinear:UM,easePoly:q0,easePolyIn:qM,easePolyInOut:q0,easePolyOut:jM,easeQuad:X0,easeQuadIn:BM,easeQuadInOut:X0,easeQuadOut:WM,easeSin:Z0,easeSinIn:VM,easeSinInOut:Z0,easeSinOut:ZM,every:X3,extent:Li,fcumsum:v3,filter:j3,flatGroup:x3,flatRollup:_3,forceCenter:oD,forceCollide:Dm,forceLink:AD,forceManyBody:Em,forceRadial:RD,forceSimulation:Cm,forceX:Rm,forceY:km,get format(){return no},formatDefaultLocale:Um,formatLocale:Ym,get formatPrefix(){return Hc},formatSpecifier:Br,fsum:b3,geoAlbers:ny,geoAlbersUsa:z7,geoArea:BD,geoAzimuthalEqualArea:G7,geoAzimuthalEqualAreaRaw:Cf,geoAzimuthalEquidistant:O7,geoAzimuthalEquidistantRaw:Ef,geoBounds:qD,geoCentroid:JD,geoCircle:t7,geoClipAntimeridian:cf,geoClipCircle:S1,geoClipExtent:s7,geoClipRectangle:Is,geoConicConformal:U7,geoConicConformalRaw:oy,geoConicEqualArea:qs,geoConicEqualAreaRaw:ey,geoConicEquidistant:W7,geoConicEquidistantRaw:ay,geoContains:d7,geoDistance:zs,geoEqualEarth:X7,geoEqualEarthRaw:Rf,geoEquirectangular:B7,geoEquirectangularRaw:vo,geoGnomonic:q7,geoGnomonicRaw:kf,geoGraticule:k1,geoGraticule10:g7,geoIdentity:j7,geoInterpolate:m7,geoLength:A1,geoMercator:Y7,geoMercatorRaw:bo,geoNaturalEarth1:V7,geoNaturalEarth1Raw:If,geoOrthographic:Z7,geoOrthographicRaw:Nf,geoPath:D7,geoProjection:Ue,geoProjectionMutator:Tf,geoRotation:m1,geoStereographic:K7,geoStereographicRaw:Ff,geoStream:Te,geoTransform:T7,geoTransverseMercator:Q7,geoTransverseMercatorRaw:zf,gray:h8,greatest:wg,greatestIndex:Y3,group:dg,groupSort:S3,groups:gg,hcl:Ua,hierarchy:Zs,histogram:_g,hsl:za,html:rD,image:JP,index:w3,indexes:$3,interpolate:je,interpolateArray:b8,interpolateBasis:m0,interpolateBasisClosed:y0,interpolateBlues:WC,interpolateBrBG:$C,interpolateBuGn:EC,interpolateBuPu:RC,interpolateCividis:ZC,interpolateCool:JC,interpolateCubehelix:R8,interpolateCubehelixDefault:KC,interpolateCubehelixLong:ja,interpolateDate:$0,interpolateDiscrete:_8,interpolateGnBu:kC,interpolateGreens:HC,interpolateGreys:XC,interpolateHcl:C8,interpolateHclLong:E8,interpolateHsl:D8,interpolateHslLong:T8,interpolateHue:w8,interpolateInferno:sE,interpolateLab:L8,interpolateMagma:aE,interpolateNumber:de,interpolateNumberArray:oc,interpolateObject:S0,interpolateOrRd:IC,interpolateOranges:VC,interpolatePRGn:SC,interpolatePiYG:AC,interpolatePlasma:uE,interpolatePuBu:FC,interpolatePuBuGn:NC,interpolatePuOr:MC,interpolatePuRd:zC,interpolatePurples:qC,interpolateRainbow:tE,interpolateRdBu:PC,interpolateRdGy:DC,interpolateRdPu:GC,interpolateRdYlBu:TC,interpolateRdYlGn:LC,interpolateReds:jC,interpolateRgb:Yi,interpolateRgbBasis:x0,interpolateRgbBasisClosed:y8,interpolateRound:Xa,interpolateSinebow:rE,interpolateSpectral:CC,interpolateString:uc,interpolateTransformCss:D0,interpolateTransformSvg:T0,interpolateTurbo:iE,interpolateViridis:oE,interpolateWarm:QC,interpolateYlGn:YC,interpolateYlGnBu:OC,interpolateYlOrBr:UC,interpolateYlOrRd:BC,interpolateZoom:C0,interrupt:Hn,intersection:t5,interval:z8,isoFormat:nC,isoParse:oC,json:eD,lab:Ya,lch:p8,least:O3,leastIndex:Ag,line:_u,lineRadial:yv,link:wu,linkHorizontal:SE,linkRadial:ME,linkVertical:AE,local:Bg,map:V3,matcher:Wl,max:Ei,maxIndex:Fl,mean:E3,median:R3,medianIndex:k3,merge:Gl,min:Sa,minIndex:zl,mode:N3,namespace:Ni,namespaces:Ul,nice:Il,now:Xi,pack:NT,packEnclose:LT,packSiblings:kT,pairs:F3,partition:FT,path:Rc,pathRound:G4,permute:xg,pie:dv,piecewise:I0,pointRadial:No,pointer:ue,pointers:j6,polygonArea:QT,polygonCentroid:JT,polygonContains:r9,polygonHull:n9,polygonLength:i9,precisionFixed:Bm,precisionPrefix:Wm,precisionRound:Hm,quadtree:fs,quantile:ki,quantileIndex:Sg,quantileSorted:$g,quantize:k8,quickselect:Aa,radialArea:bv,radialLine:yv,randomBates:u9,randomBernoulli:f9,randomBeta:Dy,randomBinomial:Ty,randomCauchy:p9,randomExponential:l9,randomGamma:jf,randomGeometric:Py,randomInt:a9,randomIrwinHall:My,randomLcg:b9,randomLogNormal:s9,randomLogistic:d9,randomNormal:qf,randomPareto:c9,randomPoisson:g9,randomUniform:o9,randomWeibull:h9,range:fn,rank:G3,reduce:Z3,reverse:K3,rgb:Cr,ribbon:q4,ribbonArrow:j4,rollup:yg,rollups:bg,scaleBand:Kf,scaleDiverging:Ib,scaleDivergingLog:Nb,scaleDivergingPow:gh,scaleDivergingSqrt:fC,scaleDivergingSymlog:Fb,scaleIdentity:ky,scaleImplicit:Vf,scaleLinear:Po,scaleLog:Gy,scaleOrdinal:Zf,scalePoint:Qf,scalePow:Qr,scaleQuantile:Xy,scaleQuantize:qy,scaleRadial:Hy,scaleSequential:Cb,scaleSequentialLog:Eb,scaleSequentialPow:dh,scaleSequentialQuantile:kb,scaleSequentialSqrt:cC,scaleSequentialSymlog:Rb,scaleSqrt:L9,scaleSymlog:Uy,scaleThreshold:jy,scaleTime:uC,scaleUtc:lC,scan:U3,schemeAccent:pC,schemeBlues:ov,schemeBrBG:zb,schemeBuGn:qb,schemeBuPu:jb,schemeCategory10:hC,schemeDark2:dC,schemeGnBu:Vb,schemeGreens:av,schemeGreys:sv,schemeObservable10:gC,schemeOrRd:Zb,schemeOranges:cv,schemePRGn:Gb,schemePaired:mC,schemePastel1:yC,schemePastel2:bC,schemePiYG:Ob,schemePuBu:Qb,schemePuBuGn:Kb,schemePuOr:Yb,schemePuRd:Jb,schemePurples:uv,schemeRdBu:Ub,schemeRdGy:Bb,schemeRdPu:tv,schemeRdYlBu:Wb,schemeRdYlGn:Hb,schemeReds:lv,schemeSet1:vC,schemeSet2:xC,schemeSet3:_C,schemeSpectral:Xb,schemeTableau10:wC,schemeYlGn:nv,schemeYlGnBu:ev,schemeYlOrBr:rv,schemeYlOrRd:iv,select:j,selectAll:V6,selection:Gn,selector:Ca,selectorAll:Bl,shuffle:B3,shuffler:Mg,some:q3,sort:El,stack:eR,stackOffsetDiverging:rR,stackOffsetExpand:nR,stackOffsetNone:oi,stackOffsetSilhouette:iR,stackOffsetWiggle:oR,stackOrderAppearance:Zv,stackOrderAscending:Kv,stackOrderDescending:sR,stackOrderInsideOut:uR,stackOrderNone:ai,stackOrderReverse:lR,stratify:YT,style:zn,subset:n5,sum:Pg,superset:Tg,svg:iD,symbol:IE,symbolAsterisk:wv,symbolCircle:$u,symbolCross:$v,symbolDiamond:Av,symbolDiamond2:Mv,symbolPlus:Pv,symbolSquare:Dv,symbolSquare2:Tv,symbolStar:Cv,symbolTimes:wh,symbolTriangle:Ev,symbolTriangle2:Rv,symbolWye:kv,symbolX:wh,symbols:Iv,symbolsFill:Iv,symbolsStroke:kE,text:cs,thresholdFreedmanDiaconis:L3,thresholdScott:C3,thresholdSturges:Nl,tickFormat:Ry,tickIncrement:Nn,tickStep:$a,ticks:In,timeDay:ti,timeDays:N9,get timeFormat(){return fh},timeFormatDefaultLocale:Tb,timeFormatLocale:pb,timeFriday:tb,timeFridays:B9,timeHour:au,timeHours:k9,timeInterval:Dt,timeMillisecond:Jr,timeMilliseconds:Vy,timeMinute:iu,timeMinutes:E9,timeMonday:To,timeMondays:G9,timeMonth:uu,timeMonths:K9,get timeParse(){return Db},timeSaturday:eb,timeSaturdays:W9,timeSecond:sn,timeSeconds:Ky,timeSunday:ei,timeSundays:nb,timeThursday:ir,timeThursdays:U9,timeTickInterval:hb,timeTicks:fb,timeTuesday:Qy,timeTuesdays:O9,timeWednesday:Jy,timeWednesdays:Y9,timeWeek:ei,timeWeeks:nb,timeYear:Be,timeYears:J9,timeout:fc,timer:Qa,timerFlush:z0,transition:W0,transpose:Dg,tree:jT,treemap:Sy,treemapBinary:VT,treemapDice:Ao,treemapResquarify:KT,treemapSlice:eu,treemapSliceDice:ZT,treemapSquarify:Xf,tsv:QP,tsvFormat:zP,tsvFormatBody:GP,tsvFormatRow:YP,tsvFormatRows:OP,tsvFormatValue:UP,tsvParse:Sm,tsvParseRows:FP,union:r5,unixDay:uh,unixDays:z9,utcDay:Do,utcDays:F9,get utcFormat(){return cu},utcFriday:ob,utcFridays:V9,utcHour:su,utcHours:I9,utcMillisecond:Jr,utcMilliseconds:Vy,utcMinute:ou,utcMinutes:R9,utcMonday:Lo,utcMondays:H9,utcMonth:lu,utcMonths:Q9,get utcParse(){return hh},utcSaturday:ab,utcSaturdays:Z9,utcSecond:sn,utcSeconds:Ky,utcSunday:ni,utcSundays:sb,utcThursday:ar,utcThursdays:j9,utcTickInterval:cb,utcTicks:lb,utcTuesday:rb,utcTuesdays:X9,utcWednesday:ib,utcWednesdays:q9,utcWeek:ni,utcWeeks:sb,utcYear:We,utcYears:tL,variance:lg,window:Hl,xml:nD,zip:H3,zoom:Th,zoomIdentity:Lu,zoomTransform:Jv},Symbol.toStringTag,{value:"Module"}));function ex(t){try{return t.node().getBBox()}catch(e){throw new Error(e)}}function mR(t,e){function n(i){var s;const o=document.createElementNS("http://www.w3.org/1999/xhtml","div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>";const a=document.createDocumentFragment();for(;a&&((s=o==null?void 0:o.firstChild)!=null&&s.firstChild);)a.appendChild(o.firstChild.firstChild);return a}const r=t.node();for(;r.hasChildNodes();)r.removeChild(r.firstChild);t.node().appendChild(n(e))}function zo(t){return t.substring(0,4)!=="ease"?ji:Lh[t]??ji}function Cu({axisWidth:t,innerRadius:e,outerRadius:n,padAngle:r,cornerRadius:i}){const o=Po().domain([0,1]).range([0,t/2]),a=o(n);return bu().innerRadius(o(e)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const Ch=(t,e)=>e instanceof Function?e(t):no(e)(t);function nx(t,e=10){var i;const n=document.createElement("canvas").getContext("2d");return(((i=n==null?void 0:n.measureText(t))==null?void 0:i.width)??0)*e/10}function yR(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function bR(t){const e=t.filter(n=>n.value!=null&&n.visible!=!1).map(n=>n.value);return yR(e)}function Ct(t,e){const n=e.colors[e.colorScheme];return t==="series"?n.series[0]:t=="none"?"none":n[t]!=null?n[t]:n.primary}function $n({datum:t,colorType:e,fullChartParams:n}){return e==="series"?t.color?t.color:n.colors[n.colorScheme].series[0]:e=="none"?"none":n.colors[n.colorScheme][e]!=null?n.colors[n.colorScheme][e]:n.colors[n.colorScheme].primary}function it(t,e,n){const r=n?`--${n}`:"";return`orbcharts-${t}__${e}${r}`}function Sn(t,e){const r=Math.random().toString(36).substr(2,5);return it(t,e,r)}function Eh(t,e){let n=new dt(()=>{});return t.each(function(){const r=Ku(this,e);n=Qu(n,r)}),n}const sr=({selection:t,pluginName:e,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=it(e,"series"),u=it(e,"axes"),l=it(e,"graphic"),c=r.pipe(F((d,g)=>t.selectAll(`g.${s}`).data(d,m=>m).join(m=>m.append("g").classed(s,!0).each((y,v,x)=>{j(x[v]).selectAll(`g.${u}`).data([v]).join(b=>b.append("g").classed(u,!0).attr("clip-path",`url(#${n})`).each((S,$,E)=>{j(E[$]).selectAll("defs").data([$]).join("defs"),j(E[$]).selectAll("g").data([$]).join("g").classed(l,!0)}),b=>b,b=>b.remove())}),m=>m,m=>m.remove())),St(1));B({seriesSelection:c,gridContainerPosition:i}).pipe(W(async d=>d)).subscribe(d=>{d.seriesSelection.transition().attr("transform",(g,m)=>{const y=d.gridContainerPosition[m]??d.gridContainerPosition[0],v=y.translate,x=y.scale;return`translate(${v[0]}, ${v[1]}) scale(${x[0]}, ${x[1]})`})});const f=B({seriesSelection:c,gridAxesTransform:o}).pipe(W(async d=>d),F(d=>d.seriesSelection.select(`g.${u}`).style("transform",d.gridAxesTransform.value)),St(1)),h=f.pipe(F(d=>d.select("defs")),St(1)),p=B({axesSelection:f,gridGraphicTransform:a}).pipe(W(async d=>d),F(d=>{const g=d.axesSelection.select(`g.${l}`);return g.transition().duration(50).style("transform",d.gridGraphicTransform.value),g}),St(1));return{seriesSelection$:c,axesSelection$:f,defsSelection$:h,graphicGSelection$:p}},rx=({fullDataFormatter$:t,gridAxesSize$:e,computedData$:n,fullChartParams$:r,gridContainerPosition$:i,layout$:o})=>{const a=new nt,s=B({fullDataFormatter:t,gridAxesSize:e,computedData:n}).pipe(W(async h=>h),F(h=>{const p=h.computedData[0]?h.computedData[0].length-1:0,d=h.fullDataFormatter.grid.groupAxis.scaleDomain[0]-h.fullDataFormatter.grid.groupAxis.scalePadding,g=h.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?p+h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[1]+h.fullDataFormatter.grid.groupAxis.scalePadding;return[d,g]}),St(1)),u=B({fullDataFormatter:t,computedData:n}).pipe(W(async h=>h),F(h=>h.fullDataFormatter.grid.seriesDirection==="row"?(h.computedData[0]??[]).map(p=>p.groupLabel):h.computedData.map(p=>p[0].groupLabel))),l=B({groupScaleDomain:s,groupLabels:u}).pipe(W(async h=>h),F(h=>h.groupLabels.filter((p,d)=>d>=h.groupScaleDomain[0]&&d<=h.groupScaleDomain[1]))),c=i.pipe(F(h=>h.reduce((d,g)=>g.columnIndex>d?g.columnIndex:d,0)+1),tt()),f=i.pipe(F(h=>h.reduce((d,g)=>g.rowIndex>d?g.rowIndex:d,0)+1),tt());return new dt(h=>{B({dataFormatter:t,axisSize:e,fullChartParams:r,scaleRangeGroupLabels:l,groupScaleDomain:s,columnAmount:c,rowAmount:f,layout:o}).pipe(I(a),W(async p=>p)).subscribe(p=>{const d=p.dataFormatter.grid.valueAxis.position==="right"||p.dataFormatter.grid.valueAxis.position==="bottom",g=ng({axisLabels:p.scaleRangeGroupLabels,axisWidth:p.axisSize.width,padding:p.dataFormatter.grid.groupAxis.scalePadding,reverse:d}),m=v=>p.dataFormatter.grid.groupAxis.position==="bottom"||p.dataFormatter.grid.groupAxis.position==="top"?v.offsetX-p.fullChartParams.padding.left:v.offsetY-p.fullChartParams.padding.top,y=v=>{const x={offsetX:v.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:v.offsetY*p.rowAmount%p.layout.rootHeight},b=m(x),S=g(b),$=Math.ceil(p.groupScaleDomain[0]),E=S+$;return{groupIndex:E,groupLabel:p.scaleRangeGroupLabels[E]??""}};return h.next(y),function(){a.next(void 0)}})})},vR=({rootSelection:t,fullDataFormatter$:e,gridAxesSize$:n,computedData$:r,fullChartParams$:i,gridContainerPosition$:o,layout$:a})=>{const s=Eh(t,"mousemove"),u=B({fullDataFormatter:e,gridAxesSize:n,computedData:r}).pipe(W(async v=>v),F(v=>{const x=v.computedData[0]?v.computedData[0].length-1:0,b=v.fullDataFormatter.grid.groupAxis.scaleDomain[0]-v.fullDataFormatter.grid.groupAxis.scalePadding,S=v.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?x+v.fullDataFormatter.grid.groupAxis.scalePadding:v.fullDataFormatter.grid.groupAxis.scaleDomain[1]+v.fullDataFormatter.grid.groupAxis.scalePadding;return[b,S]}),St(1)),l=B({fullDataFormatter:e,computedData:r}).pipe(W(async v=>v),F(v=>v.fullDataFormatter.grid.seriesDirection==="row"?(v.computedData[0]??[]).map(x=>x.groupLabel):v.computedData.map(x=>x[0].groupLabel))),c=B({groupScaleDomain:u,groupLabels:l}).pipe(W(async v=>v),F(v=>v.groupLabels.filter((x,b)=>b>=v.groupScaleDomain[0]&&b<=v.groupScaleDomain[1]))),f=e.pipe(F(v=>v.grid.valueAxis.position==="right"||v.grid.valueAxis.position==="bottom")),h=B({reverse:f,gridAxesSize:n,scaleRangeGroupLabels:c,fullDataFormatter:e}).pipe(W(async v=>v),F(v=>ng({axisLabels:v.scaleRangeGroupLabels,axisWidth:v.gridAxesSize.width,padding:v.fullDataFormatter.grid.groupAxis.scalePadding,reverse:v.reverse}))),p=o.pipe(F(v=>v.reduce((b,S)=>S.columnIndex>b?S.columnIndex:b,0)+1),tt()),d=o.pipe(F(v=>v.reduce((b,S)=>S.rowIndex>b?S.rowIndex:b,0)+1),tt()),g=B({fullDataFormatter:e,fullChartParams:i,rootMousemove:s,columnAmount:p,rowAmount:d,layout:a}).pipe(W(async v=>v),F(v=>{const x={offsetX:v.rootMousemove.offsetX*v.columnAmount%v.layout.rootWidth,offsetY:v.rootMousemove.offsetY*v.rowAmount%v.layout.rootHeight};return v.fullDataFormatter.grid.groupAxis.position==="bottom"||v.fullDataFormatter.grid.groupAxis.position==="top"?x.offsetX-v.fullChartParams.padding.left:x.offsetY-v.fullChartParams.padding.top})),m=B({xIndexScale:h,axisValue:g,groupScaleDomain:u}).pipe(W(async v=>v),F(v=>{const x=v.xIndexScale(v.axisValue),b=Math.ceil(v.groupScaleDomain[0]);return x+b})),y=B({groupIndex:m,groupLabels:l}).pipe(W(async v=>v),F(v=>v.groupLabels[v.groupIndex]??""));return B({groupIndex:m,groupLabel:y}).pipe(W(async v=>v),F(v=>({groupIndex:v.groupIndex,groupLabel:v.groupLabel})))};function xR(t="curveLinear"){return _u().x(e=>e.axisX).y(e=>e.axisY).curve(Lh[t])}function _R(t){let e=[[]],n=0;for(let r in t){if(t[r].visible==!1||t[r].value===void 0||t[r].value===null){e[n].length&&(n++,e[n]=[]);continue}e[n].push(t[r])}return e}function wR({selection:t,pathClassName:e,segmentData:n,linePath:r,params:i}){return t.selectAll("path").data(n,(a,s)=>a.length?`${a[0].id}_${a[a.length-1].id}`:s).join(a=>a.append("path").classed(e,!0).attr("fill","none").attr("pointer-events","visibleStroke").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),a=>a,a=>a.remove()).attr("stroke-width",i.lineWidth).attr("stroke",(a,s)=>a[0]&&a[0].color).attr("d",a=>r(a))}function $R({selection:t,seriesLabel:e,fullChartParams:n}){if(t.interrupt("highlight"),!e){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{r===e?j(o[i]).style("opacity",1):j(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function SR({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{j(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(zo(r)).tween("tween",(l,c,f)=>h=>{const p=l.width*h;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const ix=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,allContainerPosition$:y,layout$:v,event$:x})=>{const b=new nt,S=Sn(t,"clipPath-box"),$=it(t,"path"),{seriesSelection$:E,axesSelection$:M,defsSelection$:w,graphicGSelection$:P}=sr({selection:e,pluginName:t,clipPathID:S,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),_=new dt(G=>{const k=l.pipe(I(b)).subscribe(R=>{if(!R)return;const L=xR(R.lineCurve);G.next(L)});return()=>{k.unsubscribe()}}),N=f.pipe(F(G=>G.transitionDuration),tt()),T=f.pipe(F(G=>G.transitionEase),tt());B({defsSelection:w,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:T}).pipe(I(b),W(async G=>G)).subscribe(G=>{const R=[{id:S,width:G.axisSize.width,height:G.axisSize.height}].concat(G.seriesLabels.map(L=>({id:`orbcharts__clipPath_${L}`,width:G.axisSize.width,height:G.axisSize.height})));SR({defsSelection:G.defsSelection,clipPathData:R,transitionDuration:G.transitionDuration,transitionEase:G.transitionEase})});const A=n.pipe(F(G=>{const k=new Map;return G.flat().forEach(R=>k.set(R.id,R)),k})),C=rx({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:y,layout$:v}),D=f.pipe(I(b),F(G=>G.highlightTarget),tt()),O=B({graphicGSelection:P,visibleComputedLayoutData:o,linePath:_,params:l}).pipe(I(b),W(async G=>G),F(G=>{let k=[];return G.graphicGSelection.each((R,L,z)=>{const X=_R(G.visibleComputedLayoutData[L]??[]);k[L]=wR({selection:j(z[L]),pathClassName:$,linePath:G.linePath,segmentData:X,params:G.params})}),k}));return B({pathSelectionArr:O,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:D,gridGroupPositionFn:C}).pipe(I(b),W(async G=>G)).subscribe(G=>{G.pathSelectionArr.forEach(k=>{k.on("mouseover",(R,L)=>{R.stopPropagation();const z=L[0]?L[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=G.gridGroupPositionFn(R),U=G.GroupDataMap.get(Q).find(V=>V.seriesLabel===z)??L[0];x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:G.highlightTarget,datum:U,gridIndex:U.gridIndex,series:G.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:G.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:R,data:G.computedData})}).on("mousemove",(R,L)=>{R.stopPropagation();const z=L[0]?L[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=G.gridGroupPositionFn(R),U=G.GroupDataMap.get(Q).find(V=>V.seriesLabel===z)??L[0];x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:G.highlightTarget,datum:U,gridIndex:U.gridIndex,series:G.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:G.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:R,data:G.computedData})}).on("mouseout",(R,L)=>{R.stopPropagation();const z=L[0]?L[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=G.gridGroupPositionFn(R),U=G.GroupDataMap.get(Q).find(V=>V.seriesLabel===z)??L[0];x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:G.highlightTarget,datum:U,gridIndex:U.gridIndex,series:G.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:G.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:R,data:G.computedData})}).on("click",(R,L)=>{R.stopPropagation();const z=L[0]?L[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=G.gridGroupPositionFn(R),U=G.GroupDataMap.get(Q).find(V=>V.seriesLabel===z)??L[0];x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:G.highlightTarget,datum:U,gridIndex:U.gridIndex,series:G.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:G.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:R,data:G.computedData})})})}),f.pipe(I(b),hi(G=>G.highlightTarget==="series"),W(G=>B({graphicGSelection:P,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(b),W(async k=>k)))).subscribe(G=>{const k=G.gridHighlight[0]?G.gridHighlight[0].seriesLabel:null;$R({selection:G.graphicGSelection,seriesLabel:k,fullChartParams:G.fullChartParams})}),()=>{b.next(void 0)}},ox="Lines",AR=se(ox,lr)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=ix(ox,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,allContainerPosition$:r.gridContainerPosition$,layout$:r.layout$,event$:i.event$});return()=>{o.next(void 0),a()}});function MR(t="curveLinear",e){return bh().x(n=>n.axisX).y0(n=>e).y1(n=>n.axisY).curve(Lh[t])}function PR(t){let e=[[]],n=0;for(let r in t){if(t[r].visible==!1||t[r].value===void 0||t[r].value===null){e[n].length&&(n++,e[n]=[]);continue}e[n].push(t[r])}return e}function DR({selection:t,pathClassName:e,segmentData:n,areaPath:r,linearGradientIds:i,params:o}){return t.selectAll("path").data(n,(s,u)=>s.length?`${s[0].id}_${s[s.length-1].id}`:u).join(s=>s.append("path").classed(e,!0).attr("fill","none").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),s=>s,s=>s.remove()).attr("fill",(s,u)=>s[0]?`url(#${i[s[0].seriesIndex]})`:"").attr("d",s=>r(s))}function TR({selection:t,seriesLabel:e,fullChartParams:n}){if(t.interrupt("highlight"),!e){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{r===e?j(o[i]).style("opacity",1):j(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function LR({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
|
13
|
+
`)}function l(f){return f.map(c).join(t)}function c(f){return f==null?"":f instanceof Date?b4(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:u,formatRow:l,formatValue:c}}var nr=ds(","),Km=nr.parse,x4=nr.parseRows,v4=nr.format,_4=nr.formatBody,w4=nr.formatRows,$4=nr.formatRow,S4=nr.formatValue,rr=ds(" "),Qm=rr.parse,A4=rr.parseRows,T4=rr.format,P4=rr.formatBody,M4=rr.formatRows,D4=rr.formatRow,C4=rr.formatValue;function L4(t){for(var e in t){var n=t[e].trim(),r,i;if(!n)n=null;else if(n==="true")n=!0;else if(n==="false")n=!1;else if(n==="NaN")n=NaN;else if(!isNaN(r=+n))n=r;else if(i=n.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/))k4&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;t[e]=n}return t}const k4=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function R4(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function E4(t,e){return fetch(t,e).then(R4)}function I4(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function N4(t,e){return fetch(t,e).then(I4)}function B4(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function gs(t,e){return fetch(t,e).then(B4)}function Jm(t){return function(e,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),gs(e,n).then(function(i){return t(i,r)})}}function F4(t,e,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=ds(t);return gs(e,n).then(function(o){return i.parse(o,r)})}var O4=Jm(Km),G4=Jm(Qm);function z4(t,e){return new Promise(function(n,r){var i=new Image;for(var o in e)i[o]=e[o];i.onerror=r,i.onload=function(){n(i)},i.src=t})}function Y4(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(!(t.status===204||t.status===205))return t.json()}function U4(t,e){return fetch(t,e).then(Y4)}function qc(t){return(e,n)=>gs(e,n).then(r=>new DOMParser().parseFromString(r,t))}const W4=qc("application/xml");var H4=qc("text/html"),X4=qc("image/svg+xml");function j4(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var o,a=n.length,s,u=0,l=0;for(o=0;o<a;++o)s=n[o],u+=s.x,l+=s.y;for(u=(u/a-t)*r,l=(l/a-e)*r,o=0;o<a;++o)s=n[o],s.x-=u,s.y-=l}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(t=+o,i):t},i.y=function(o){return arguments.length?(e=+o,i):e},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function V4(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return t1(this.cover(e,n),e,n,t)}function t1(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o=t._root,a={data:r},s=t._x0,u=t._y0,l=t._x1,c=t._y1,f,h,p,d,g,m,y,b;if(!o)return t._root=a,t;for(;o.length;)if((g=e>=(f=(s+l)/2))?s=f:l=f,(m=n>=(h=(u+c)/2))?u=h:c=h,i=o,!(o=o[y=m<<1|g]))return i[y]=a,t;if(p=+t._x.call(null,o.data),d=+t._y.call(null,o.data),e===p&&n===d)return a.next=o,i?i[y]=a:t._root=a,t;do i=i?i[y]=new Array(4):t._root=new Array(4),(g=e>=(f=(s+l)/2))?s=f:l=f,(m=n>=(h=(u+c)/2))?u=h:c=h;while((y=m<<1|g)===(b=(d>=h)<<1|p>=f));return i[b]=o,i[y]=a,t}function q4(t){var e,n,r=t.length,i,o,a=new Array(r),s=new Array(r),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=i,s[n]=o,i<u&&(u=i),i>c&&(c=i),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<r;++n)t1(this,a[n],s[n],t[n]);return this}function Z4(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a=i-n||1,s=this._root,u,l;n>t||t>=i||r>e||e>=o;)switch(l=(e<r)<<1|t<n,u=new Array(4),u[l]=s,s=u,a*=2,l){case 0:i=n+a,o=r+a;break;case 1:n=i-a,o=r+a;break;case 2:i=n+a,r=o-a;break;case 3:n=i-a,r=o-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function K4(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function Q4(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]]}function Xt(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function J4(t,e,n){var r,i=this._x0,o=this._y0,a,s,u,l,c=this._x1,f=this._y1,h=[],p=this._root,d,g;for(p&&h.push(new Xt(p,i,o,c,f)),n==null?n=1/0:(i=t-n,o=e-n,c=t+n,f=e+n,n*=n);d=h.pop();)if(!(!(p=d.node)||(a=d.x0)>c||(s=d.y0)>f||(u=d.x1)<i||(l=d.y1)<o))if(p.length){var m=(a+u)/2,y=(s+l)/2;h.push(new Xt(p[3],m,y,u,l),new Xt(p[2],a,y,m,l),new Xt(p[1],m,s,u,y),new Xt(p[0],a,s,m,y)),(g=(e>=y)<<1|t>=m)&&(d=h[h.length-1],h[h.length-1]=h[h.length-1-g],h[h.length-1-g]=d)}else{var b=t-+this._x.call(null,p.data),v=e-+this._y.call(null,p.data),x=b*b+v*v;if(x<n){var S=Math.sqrt(n=x);i=t-S,o=e-S,c=t+S,f=e+S,r=p.data}}return r}function tD(t){if(isNaN(c=+this._x.call(null,t))||isNaN(f=+this._y.call(null,t)))return this;var e,n=this._root,r,i,o,a=this._x0,s=this._y0,u=this._x1,l=this._y1,c,f,h,p,d,g,m,y;if(!n)return this;if(n.length)for(;;){if((d=c>=(h=(a+u)/2))?a=h:u=h,(g=f>=(p=(s+l)/2))?s=p:l=p,e=n,!(n=n[m=g<<1|d]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,y=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function eD(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function nD(){return this._root}function rD(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function iD(t){var e=[],n,r=this._root,i,o,a,s,u;for(r&&e.push(new Xt(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,o=n.x0,a=n.y0,s=n.x1,u=n.y1)&&r.length){var l=(o+s)/2,c=(a+u)/2;(i=r[3])&&e.push(new Xt(i,l,c,s,u)),(i=r[2])&&e.push(new Xt(i,o,c,l,u)),(i=r[1])&&e.push(new Xt(i,l,a,s,c)),(i=r[0])&&e.push(new Xt(i,o,a,l,c))}return this}function oD(t){var e=[],n=[],r;for(this._root&&e.push(new Xt(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var o,a=r.x0,s=r.y0,u=r.x1,l=r.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&e.push(new Xt(o,a,s,c,f)),(o=i[1])&&e.push(new Xt(o,c,s,u,f)),(o=i[2])&&e.push(new Xt(o,a,f,c,l)),(o=i[3])&&e.push(new Xt(o,c,f,u,l))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function aD(t){return t[0]}function sD(t){return arguments.length?(this._x=t,this):this._x}function uD(t){return t[1]}function lD(t){return arguments.length?(this._y=t,this):this._y}function ms(t,e,n){var r=new Zc(e??aD,n??uD,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function Zc(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function e1(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var jt=ms.prototype=Zc.prototype;jt.copy=function(){var t=new Zc(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=e1(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=e1(r));return t},jt.add=V4,jt.addAll=q4,jt.cover=Z4,jt.data=K4,jt.extent=Q4,jt.find=J4,jt.remove=tD,jt.removeAll=eD,jt.root=nD,jt.size=rD,jt.visit=iD,jt.visitAfter=oD,jt.x=sD,jt.y=lD;function Lt(t){return function(){return t}}function _n(t){return(t()-.5)*1e-6}function cD(t){return t.x+t.vx}function fD(t){return t.y+t.vy}function n1(t){var e,n,r,i=1,o=1;typeof t!="function"&&(t=Lt(t==null?1:+t));function a(){for(var l,c=e.length,f,h,p,d,g,m,y=0;y<o;++y)for(f=ms(e,cD,fD).visitAfter(s),l=0;l<c;++l)h=e[l],g=n[h.index],m=g*g,p=h.x+h.vx,d=h.y+h.vy,f.visit(b);function b(v,x,S,$,R){var T=v.data,w=v.r,P=g+w;if(T){if(T.index>h.index){var _=p-T.x-T.vx,N=d-T.y-T.vy,D=_*_+N*N;D<P*P&&(_===0&&(_=_n(r),D+=_*_),N===0&&(N=_n(r),D+=N*N),D=(P-(D=Math.sqrt(D)))/D*i,h.vx+=(_*=D)*(P=(w*=w)/(m+w)),h.vy+=(N*=D)*P,T.vx-=_*(P=1-P),T.vy-=N*P)}return}return x>p+P||$<p-P||S>d+P||R<d-P}}function s(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(e){var l,c=e.length,f;for(n=new Array(c),l=0;l<c;++l)f=e[l],n[f.index]=+t(f,l,e)}}return a.initialize=function(l,c){e=l,r=c,u()},a.iterations=function(l){return arguments.length?(o=+l,a):o},a.strength=function(l){return arguments.length?(i=+l,a):i},a.radius=function(l){return arguments.length?(t=typeof l=="function"?l:Lt(+l),u(),a):t},a}function hD(t){return t.index}function r1(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function pD(t){var e=hD,n=f,r,i=Lt(30),o,a,s,u,l,c=1;t==null&&(t=[]);function f(m){return 1/Math.min(s[m.source.index],s[m.target.index])}function h(m){for(var y=0,b=t.length;y<c;++y)for(var v=0,x,S,$,R,T,w,P;v<b;++v)x=t[v],S=x.source,$=x.target,R=$.x+$.vx-S.x-S.vx||_n(l),T=$.y+$.vy-S.y-S.vy||_n(l),w=Math.sqrt(R*R+T*T),w=(w-o[v])/w*m*r[v],R*=w,T*=w,$.vx-=R*(P=u[v]),$.vy-=T*P,S.vx+=R*(P=1-P),S.vy+=T*P}function p(){if(a){var m,y=a.length,b=t.length,v=new Map(a.map((S,$)=>[e(S,$,a),S])),x;for(m=0,s=new Array(y);m<b;++m)x=t[m],x.index=m,typeof x.source!="object"&&(x.source=r1(v,x.source)),typeof x.target!="object"&&(x.target=r1(v,x.target)),s[x.source.index]=(s[x.source.index]||0)+1,s[x.target.index]=(s[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=t[m],u[m]=s[x.source.index]/(s[x.source.index]+s[x.target.index]);r=new Array(b),d(),o=new Array(b),g()}}function d(){if(a)for(var m=0,y=t.length;m<y;++m)r[m]=+n(t[m],m,t)}function g(){if(a)for(var m=0,y=t.length;m<y;++m)o[m]=+i(t[m],m,t)}return h.initialize=function(m,y){a=m,l=y,p()},h.links=function(m){return arguments.length?(t=m,p(),h):t},h.id=function(m){return arguments.length?(e=m,h):e},h.iterations=function(m){return arguments.length?(c=+m,h):c},h.strength=function(m){return arguments.length?(n=typeof m=="function"?m:Lt(+m),d(),h):n},h.distance=function(m){return arguments.length?(i=typeof m=="function"?m:Lt(+m),g(),h):i},h}const dD=1664525,gD=1013904223,i1=4294967296;function mD(){let t=1;return()=>(t=(dD*t+gD)%i1)/i1}function yD(t){return t.x}function bD(t){return t.y}var xD=10,vD=Math.PI*(3-Math.sqrt(5));function o1(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=rs(f),l=Un("tick","end"),c=mD();t==null&&(t=[]);function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(g){var m,y=t.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(o-n)*i,s.forEach(function(x){x(n)}),m=0;m<y;++m)b=t[m],b.fx==null?b.x+=b.vx*=a:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=a:(b.y=b.fy,b.vy=0);return e}function p(){for(var g=0,m=t.length,y;g<m;++g){if(y=t[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=xD*Math.sqrt(.5+g),v=g*vD;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function d(g){return g.initialize&&g.initialize(t,c),g}return p(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(g){return arguments.length?(t=g,p(),s.forEach(d),e):t},alpha:function(g){return arguments.length?(n=+g,e):n},alphaMin:function(g){return arguments.length?(r=+g,e):r},alphaDecay:function(g){return arguments.length?(i=+g,e):+i},alphaTarget:function(g){return arguments.length?(o=+g,e):o},velocityDecay:function(g){return arguments.length?(a=1-g,e):1-a},randomSource:function(g){return arguments.length?(c=g,s.forEach(d),e):c},force:function(g,m){return arguments.length>1?(m==null?s.delete(g):s.set(g,d(m)),e):s.get(g)},find:function(g,m,y){var b=0,v=t.length,x,S,$,R,T;for(y==null?y=1/0:y*=y,b=0;b<v;++b)R=t[b],x=g-R.x,S=m-R.y,$=x*x+S*S,$<y&&(T=R,y=$);return T},on:function(g,m){return arguments.length>1?(l.on(g,m),e):l.on(g)}}}function a1(){var t,e,n,r,i=Lt(-30),o,a=1,s=1/0,u=.81;function l(p){var d,g=t.length,m=ms(t,yD,bD).visitAfter(f);for(r=p,d=0;d<g;++d)e=t[d],m.visit(h)}function c(){if(t){var p,d=t.length,g;for(o=new Array(d),p=0;p<d;++p)g=t[p],o[g.index]=+i(g,p,t)}}function f(p){var d=0,g,m,y=0,b,v,x;if(p.length){for(b=v=x=0;x<4;++x)(g=p[x])&&(m=Math.abs(g.value))&&(d+=g.value,y+=m,b+=m*g.x,v+=m*g.y);p.x=b/y,p.y=v/y}else{g=p,g.x=g.data.x,g.y=g.data.y;do d+=o[g.data.index];while(g=g.next)}p.value=d}function h(p,d,g,m){if(!p.value)return!0;var y=p.x-e.x,b=p.y-e.y,v=m-d,x=y*y+b*b;if(v*v/u<x)return x<s&&(y===0&&(y=_n(n),x+=y*y),b===0&&(b=_n(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)),e.vx+=y*p.value*r/x,e.vy+=b*p.value*r/x),!0;if(p.length||x>=s)return;(p.data!==e||p.next)&&(y===0&&(y=_n(n),x+=y*y),b===0&&(b=_n(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)));do p.data!==e&&(v=o[p.data.index]*r/x,e.vx+=y*v,e.vy+=b*v);while(p=p.next)}return l.initialize=function(p,d){t=p,n=d,c()},l.strength=function(p){return arguments.length?(i=typeof p=="function"?p:Lt(+p),c(),l):i},l.distanceMin=function(p){return arguments.length?(a=p*p,l):Math.sqrt(a)},l.distanceMax=function(p){return arguments.length?(s=p*p,l):Math.sqrt(s)},l.theta=function(p){return arguments.length?(u=p*p,l):Math.sqrt(u)},l}function _D(t,e,n){var r,i=Lt(.1),o,a;typeof t!="function"&&(t=Lt(+t)),e==null&&(e=0),n==null&&(n=0);function s(l){for(var c=0,f=r.length;c<f;++c){var h=r[c],p=h.x-e||1e-6,d=h.y-n||1e-6,g=Math.sqrt(p*p+d*d),m=(a[c]-g)*o[c]*l/g;h.vx+=p*m,h.vy+=d*m}}function u(){if(r){var l,c=r.length;for(o=new Array(c),a=new Array(c),l=0;l<c;++l)a[l]=+t(r[l],l,r),o[l]=isNaN(a[l])?0:+i(r[l],l,r)}}return s.initialize=function(l){r=l,u()},s.strength=function(l){return arguments.length?(i=typeof l=="function"?l:Lt(+l),u(),s):i},s.radius=function(l){return arguments.length?(t=typeof l=="function"?l:Lt(+l),u(),s):t},s.x=function(l){return arguments.length?(e=+l,s):e},s.y=function(l){return arguments.length?(n=+l,s):n},s}function s1(t){var e=Lt(.1),n,r,i;typeof t!="function"&&(t=Lt(t==null?0:+t));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(i[u]-c.x)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(e=typeof s=="function"?s:Lt(+s),a(),o):e},o.x=function(s){return arguments.length?(t=typeof s=="function"?s:Lt(+s),a(),o):t},o}function u1(t){var e=Lt(.1),n,r,i;typeof t!="function"&&(t=Lt(t==null?0:+t));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(i[u]-c.y)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++s)r[s]=isNaN(i[s]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(e=typeof s=="function"?s:Lt(+s),a(),o):e},o.y=function(s){return arguments.length?(t=typeof s=="function"?s:Lt(+s),a(),o):t},o}function wD(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ys(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Jr(t){return t=ys(Math.abs(t)),t?t[1]:NaN}function $D(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function SD(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var AD=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ti(t){if(!(e=AD.exec(t)))throw new Error("invalid format: "+t);var e;return new bs({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ti.prototype=bs.prototype;function bs(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}bs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function TD(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var l1;function PD(t,e){var n=ys(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(l1=Math.max(-8,Math.min(8,Math.floor(i/3)))*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")+ys(t,Math.max(0,e+o-1))[0]}function c1(t,e){var n=ys(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const f1={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:wD,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>c1(t*100,e),r:c1,s:PD,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function h1(t){return t}var p1=Array.prototype.map,d1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function g1(t){var e=t.grouping===void 0||t.thousands===void 0?h1:$D(p1.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?h1:SD(p1.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=ti(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,S=f.type;S==="n"?(b=!0,S="g"):f1[S]||(v===void 0&&(v=12),x=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var $=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",R=g==="$"?r:/[%p]/.test(S)?a:"",T=f1[S],w=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(_){var N=$,D=R,A,L,M;if(S==="c")D=T(_)+D,_="";else{_=+_;var G=_<0||1/_<0;if(_=isNaN(_)?u:T(Math.abs(_),v),x&&(_=TD(_)),G&&+_==0&&d!=="+"&&(G=!1),N=(G?d==="("?d:s:d==="-"||d==="("?"":d)+N,D=(S==="s"?d1[8+l1/3]:"")+D+(G&&d==="("?")":""),w){for(A=-1,L=_.length;++A<L;)if(M=_.charCodeAt(A),48>M||M>57){D=(M===46?i+_.slice(A+1):_.slice(A))+D,_=_.slice(0,A);break}}}b&&!m&&(_=e(_,1/0));var O=N.length+_.length+D.length,E=O<y?new Array(y-O+1).join(h):"";switch(b&&m&&(_=e(E+_,E.length?y-D.length:1/0),E=""),p){case"<":_=N+_+D+E;break;case"=":_=N+E+_+D;break;case"^":_=E.slice(0,O=E.length>>1)+N+_+D+E.slice(O);break;default:_=E+N+_+D;break}return o(_)}return P.toString=function(){return f+""},P}function c(f,h){var p=l((f=ti(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Jr(h)/3)))*3,g=Math.pow(10,-d),m=d1[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var xs,uo,Kc;m1({thousands:",",grouping:[3],currency:["$",""]});function m1(t){return xs=g1(t),uo=xs.format,Kc=xs.formatPrefix,xs}function y1(t){return Math.max(0,-Jr(Math.abs(t)))}function b1(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jr(e)/3)))*3-Jr(Math.abs(t)))}function x1(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Jr(e)-Jr(t))+1}var it=1e-6,lo=1e-12,ft=Math.PI,At=ft/2,vs=ft/4,Vt=ft*2,bt=180/ft,at=ft/180,pt=Math.abs,ei=Math.atan,qt=Math.atan2,et=Math.cos,_s=Math.ceil,v1=Math.exp,Qc=Math.hypot,ws=Math.log,Jc=Math.pow,J=Math.sin,me=Math.sign||function(t){return t>0?1:t<0?-1:0},It=Math.sqrt,tf=Math.tan;function _1(t){return t>1?0:t<-1?ft:Math.acos(t)}function Zt(t){return t>1?At:t<-1?-At:Math.asin(t)}function w1(t){return(t=J(t/2))*t}function wt(){}function $s(t,e){t&&S1.hasOwnProperty(t.type)&&S1[t.type](t,e)}var $1={Feature:function(t,e){$s(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)$s(n[r].geometry,e)}},S1={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ef(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ef(n[r],e,0)},Polygon:function(t,e){A1(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)A1(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)$s(n[r],e)}};function ef(t,e,n){var r=-1,i=t.length-n,o;for(e.lineStart();++r<i;)o=t[r],e.point(o[0],o[1],o[2]);e.lineEnd()}function A1(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ef(t[n],e,1);e.polygonEnd()}function Ce(t,e){t&&$1.hasOwnProperty(t.type)?$1[t.type](t,e):$s(t,e)}var Ss=new Ct,As=new Ct,T1,P1,nf,rf,of,ze={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){Ss=new Ct,ze.lineStart=MD,ze.lineEnd=DD},polygonEnd:function(){var t=+Ss;As.add(t<0?Vt+t:t),this.lineStart=this.lineEnd=this.point=wt},sphere:function(){As.add(Vt)}};function MD(){ze.point=CD}function DD(){M1(T1,P1)}function CD(t,e){ze.point=M1,T1=t,P1=e,t*=at,e*=at,nf=t,rf=et(e=e/2+vs),of=J(e)}function M1(t,e){t*=at,e*=at,e=e/2+vs;var n=t-nf,r=n>=0?1:-1,i=r*n,o=et(e),a=J(e),s=of*a,u=rf*o+s*et(i),l=s*r*J(i);Ss.add(qt(l,u)),nf=t,rf=o,of=a}function LD(t){return As=new Ct,Ce(t,ze),As*2}function Ts(t){return[qt(t[1],t[0]),Zt(t[2])]}function ir(t){var e=t[0],n=t[1],r=et(n);return[r*et(e),r*J(e),J(n)]}function Ps(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ni(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function af(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ms(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ds(t){var e=It(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var $t,oe,Tt,ce,or,D1,C1,ri,co,wn,en,nn={point:sf,lineStart:k1,lineEnd:R1,polygonStart:function(){nn.point=E1,nn.lineStart=kD,nn.lineEnd=RD,co=new Ct,ze.polygonStart()},polygonEnd:function(){ze.polygonEnd(),nn.point=sf,nn.lineStart=k1,nn.lineEnd=R1,Ss<0?($t=-(Tt=180),oe=-(ce=90)):co>it?ce=90:co<-it&&(oe=-90),en[0]=$t,en[1]=Tt},sphere:function(){$t=-(Tt=180),oe=-(ce=90)}};function sf(t,e){wn.push(en=[$t=t,Tt=t]),e<oe&&(oe=e),e>ce&&(ce=e)}function L1(t,e){var n=ir([t*at,e*at]);if(ri){var r=ni(ri,n),i=[r[1],-r[0],0],o=ni(i,r);Ds(o),o=Ts(o);var a=t-or,s=a>0?1:-1,u=o[0]*bt*s,l,c=pt(a)>180;c^(s*or<u&&u<s*t)?(l=o[1]*bt,l>ce&&(ce=l)):(u=(u+360)%360-180,c^(s*or<u&&u<s*t)?(l=-o[1]*bt,l<oe&&(oe=l)):(e<oe&&(oe=e),e>ce&&(ce=e))),c?t<or?fe($t,t)>fe($t,Tt)&&(Tt=t):fe(t,Tt)>fe($t,Tt)&&($t=t):Tt>=$t?(t<$t&&($t=t),t>Tt&&(Tt=t)):t>or?fe($t,t)>fe($t,Tt)&&(Tt=t):fe(t,Tt)>fe($t,Tt)&&($t=t)}else wn.push(en=[$t=t,Tt=t]);e<oe&&(oe=e),e>ce&&(ce=e),ri=n,or=t}function k1(){nn.point=L1}function R1(){en[0]=$t,en[1]=Tt,nn.point=sf,ri=null}function E1(t,e){if(ri){var n=t-or;co.add(pt(n)>180?n+(n>0?360:-360):n)}else D1=t,C1=e;ze.point(t,e),L1(t,e)}function kD(){ze.lineStart()}function RD(){E1(D1,C1),ze.lineEnd(),pt(co)>it&&($t=-(Tt=180)),en[0]=$t,en[1]=Tt,ri=null}function fe(t,e){return(e-=t)<0?e+360:e}function ED(t,e){return t[0]-e[0]}function I1(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function ID(t){var e,n,r,i,o,a,s;if(ce=Tt=-($t=oe=1/0),wn=[],Ce(t,nn),n=wn.length){for(wn.sort(ED),e=1,r=wn[0],o=[r];e<n;++e)i=wn[e],I1(r,i[0])||I1(r,i[1])?(fe(r[0],i[1])>fe(r[0],r[1])&&(r[1]=i[1]),fe(i[0],r[1])>fe(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(s=fe(r[1],i[0]))>a&&(a=s,$t=i[0],Tt=r[1])}return wn=en=null,$t===1/0||oe===1/0?[[NaN,NaN],[NaN,NaN]]:[[$t,oe],[Tt,ce]]}var fo,Cs,Ls,ks,Rs,Es,Is,Ns,uf,lf,cf,N1,B1,Kt,Qt,Jt,Le={sphere:wt,point:ff,lineStart:F1,lineEnd:O1,polygonStart:function(){Le.lineStart=FD,Le.lineEnd=OD},polygonEnd:function(){Le.lineStart=F1,Le.lineEnd=O1}};function ff(t,e){t*=at,e*=at;var n=et(e);ho(n*et(t),n*J(t),J(e))}function ho(t,e,n){++fo,Ls+=(t-Ls)/fo,ks+=(e-ks)/fo,Rs+=(n-Rs)/fo}function F1(){Le.point=ND}function ND(t,e){t*=at,e*=at;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),Le.point=BD,ho(Kt,Qt,Jt)}function BD(t,e){t*=at,e*=at;var n=et(e),r=n*et(t),i=n*J(t),o=J(e),a=qt(It((a=Qt*o-Jt*i)*a+(a=Jt*r-Kt*o)*a+(a=Kt*i-Qt*r)*a),Kt*r+Qt*i+Jt*o);Cs+=a,Es+=a*(Kt+(Kt=r)),Is+=a*(Qt+(Qt=i)),Ns+=a*(Jt+(Jt=o)),ho(Kt,Qt,Jt)}function O1(){Le.point=ff}function FD(){Le.point=GD}function OD(){G1(N1,B1),Le.point=ff}function GD(t,e){N1=t,B1=e,t*=at,e*=at,Le.point=G1;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),ho(Kt,Qt,Jt)}function G1(t,e){t*=at,e*=at;var n=et(e),r=n*et(t),i=n*J(t),o=J(e),a=Qt*o-Jt*i,s=Jt*r-Kt*o,u=Kt*i-Qt*r,l=Qc(a,s,u),c=Zt(l),f=l&&-c/l;uf.add(f*a),lf.add(f*s),cf.add(f*u),Cs+=c,Es+=c*(Kt+(Kt=r)),Is+=c*(Qt+(Qt=i)),Ns+=c*(Jt+(Jt=o)),ho(Kt,Qt,Jt)}function zD(t){fo=Cs=Ls=ks=Rs=Es=Is=Ns=0,uf=new Ct,lf=new Ct,cf=new Ct,Ce(t,Le);var e=+uf,n=+lf,r=+cf,i=Qc(e,n,r);return i<lo&&(e=Es,n=Is,r=Ns,Cs<it&&(e=Ls,n=ks,r=Rs),i=Qc(e,n,r),i<lo)?[NaN,NaN]:[qt(n,e)*bt,Zt(r/i)*bt]}function ii(t){return function(){return t}}function hf(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function pf(t,e){return pt(t)>ft&&(t-=Math.round(t/Vt)*Vt),[t,e]}pf.invert=pf;function df(t,e,n){return(t%=Vt)?e||n?hf(Y1(t),U1(e,n)):Y1(t):e||n?U1(e,n):pf}function z1(t){return function(e,n){return e+=t,pt(e)>ft&&(e-=Math.round(e/Vt)*Vt),[e,n]}}function Y1(t){var e=z1(t);return e.invert=z1(-t),e}function U1(t,e){var n=et(t),r=J(t),i=et(e),o=J(e);function a(s,u){var l=et(u),c=et(s)*l,f=J(s)*l,h=J(u),p=h*n+c*r;return[qt(f*i-p*o,c*n-h*r),Zt(p*i+f*o)]}return a.invert=function(s,u){var l=et(u),c=et(s)*l,f=J(s)*l,h=J(u),p=h*i-f*o;return[qt(f*i+h*o,c*n+p*r),Zt(p*n-c*r)]},a}function W1(t){t=df(t[0]*at,t[1]*at,t.length>2?t[2]*at:0);function e(n){return n=t(n[0]*at,n[1]*at),n[0]*=bt,n[1]*=bt,n}return e.invert=function(n){return n=t.invert(n[0]*at,n[1]*at),n[0]*=bt,n[1]*=bt,n},e}function H1(t,e,n,r,i,o){if(n){var a=et(e),s=J(e),u=r*n;i==null?(i=e+r*Vt,o=e-u/2):(i=X1(a,i),o=X1(a,o),(r>0?i<o:i>o)&&(i+=r*Vt));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Ts([a,-s*et(c),-s*J(c)]),t.point(l[0],l[1])}}function X1(t,e){e=ir(e),e[0]-=t,Ds(e);var n=_1(-e[1]);return((-e[2]<0?-n:n)+Vt-it)%Vt}function YD(){var t=ii([0,0]),e=ii(90),n=ii(2),r,i,o={point:a};function a(u,l){r.push(u=i(u,l)),u[0]*=bt,u[1]*=bt}function s(){var u=t.apply(this,arguments),l=e.apply(this,arguments)*at,c=n.apply(this,arguments)*at;return r=[],i=df(-u[0]*at,-u[1]*at,0).invert,H1(o,l,c,1),u={type:"Polygon",coordinates:[r]},r=i=null,u}return s.center=function(u){return arguments.length?(t=typeof u=="function"?u:ii([+u[0],+u[1]]),s):t},s.radius=function(u){return arguments.length?(e=typeof u=="function"?u:ii(+u),s):e},s.precision=function(u){return arguments.length?(n=typeof u=="function"?u:ii(+u),s):n},s}function j1(){var t=[],e;return{point:function(n,r,i){e.push([n,r,i])},lineStart:function(){t.push(e=[])},lineEnd:wt,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Bs(t,e){return pt(t[0]-e[0])<it&&pt(t[1]-e[1])<it}function Fs(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function V1(t,e,n,r,i){var o=[],a=[],s,u;if(t.forEach(function(d){if(!((g=d.length-1)<=0)){var g,m=d[0],y=d[g],b;if(Bs(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),s=0;s<g;++s)i.point((m=d[s])[0],m[1]);i.lineEnd();return}y[0]+=2*it}o.push(b=new Fs(m,d,null,!0)),a.push(b.o=new Fs(m,null,b,!1)),o.push(b=new Fs(y,d,null,!1)),a.push(b.o=new Fs(y,null,b,!0))}}),!!o.length){for(a.sort(e),q1(o),q1(a),s=0,u=a.length;s<u;++s)a[s].e=n=!n;for(var l=o[0],c,f;;){for(var h=l,p=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,u=c.length;s<u;++s)i.point((f=c[s])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(c=h.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);i.lineEnd()}}}function q1(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function gf(t){return pt(t[0])<=ft?t[0]:me(t[0])*((pt(t[0])+ft)%Vt-ft)}function Z1(t,e){var n=gf(e),r=e[1],i=J(r),o=[J(n),-et(n),0],a=0,s=0,u=new Ct;i===1?r=At+it:i===-1&&(r=-At-it);for(var l=0,c=t.length;l<c;++l)if(h=(f=t[l]).length)for(var f,h,p=f[h-1],d=gf(p),g=p[1]/2+vs,m=J(g),y=et(g),b=0;b<h;++b,d=x,m=$,y=R,p=v){var v=f[b],x=gf(v),S=v[1]/2+vs,$=J(S),R=et(S),T=x-d,w=T>=0?1:-1,P=w*T,_=P>ft,N=m*$;if(u.add(qt(N*w*J(P),y*R+N*et(P))),a+=_?T+w*Vt:T,_^d>=n^x>=n){var D=ni(ir(p),ir(v));Ds(D);var A=ni(o,D);Ds(A);var L=(_^T>=0?-1:1)*Zt(A[2]);(r>L||r===L&&(D[0]||D[1]))&&(s+=_^T>=0?1:-1)}}return(a<-it||a<it&&u<-lo)^s&1}function K1(t,e,n,r){return function(i){var o=e(i),a=j1(),s=e(a),u=!1,l,c,f,h={point:p,lineStart:g,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=b,h.lineEnd=v,c=[],l=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,c=Hl(c);var x=Z1(l,r);c.length?(u||(i.polygonStart(),u=!0),V1(c,WD,x,n,i)):x&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),c=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(x,S){t(x,S)&&i.point(x,S)}function d(x,S){o.point(x,S)}function g(){h.point=d,o.lineStart()}function m(){h.point=p,o.lineEnd()}function y(x,S){f.push([x,S]),s.point(x,S)}function b(){s.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),s.lineEnd();var x=s.clean(),S=a.result(),$,R=S.length,T,w,P;if(f.pop(),l.push(f),f=null,!!R){if(x&1){if(w=S[0],(T=w.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),$=0;$<T;++$)i.point((P=w[$])[0],P[1]);i.lineEnd()}return}R>1&&x&2&&S.push(S.pop().concat(S.shift())),c.push(S.filter(UD))}}return h}}function UD(t){return t.length>1}function WD(t,e){return((t=t.x)[0]<0?t[1]-At-it:At-t[1])-((e=e.x)[0]<0?e[1]-At-it:At-e[1])}const mf=K1(function(){return!0},HD,jD,[-ft,-At]);function HD(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var s=o>0?ft:-ft,u=pt(o-e);pt(u-ft)<it?(t.point(e,n=(n+a)/2>0?At:-At),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),i=0):r!==s&&u>=ft&&(pt(e-r)<it&&(e-=r*it),pt(o-s)<it&&(o-=s*it),n=XD(e,n,o,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),i=0),t.point(e=o,n=a),r=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-i}}}function XD(t,e,n,r){var i,o,a=J(t-n);return pt(a)>it?ei((J(e)*(o=et(r))*J(n)-J(r)*(i=et(e))*J(t))/(i*o*a)):(e+r)/2}function jD(t,e,n,r){var i;if(t==null)i=n*At,r.point(-ft,i),r.point(0,i),r.point(ft,i),r.point(ft,0),r.point(ft,-i),r.point(0,-i),r.point(-ft,-i),r.point(-ft,0),r.point(-ft,i);else if(pt(t[0]-e[0])>it){var o=t[0]<e[0]?ft:-ft;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function Q1(t){var e=et(t),n=2*at,r=e>0,i=pt(e)>it;function o(c,f,h,p){H1(p,t,n,h,c,f)}function a(c,f){return et(c)*et(f)>e}function s(c){var f,h,p,d,g;return{lineStart:function(){d=p=!1,g=1},point:function(m,y){var b=[m,y],v,x=a(m,y),S=r?x?0:l(m,y):x?l(m+(m<0?ft:-ft),y):0;if(!f&&(d=p=x)&&c.lineStart(),x!==p&&(v=u(f,b),(!v||Bs(f,v)||Bs(b,v))&&(b[2]=1)),x!==p)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(i&&f&&r^x){var $;!(S&h)&&($=u(b,f,!0))&&(g=0,r?(c.lineStart(),c.point($[0][0],$[0][1]),c.point($[1][0],$[1][1]),c.lineEnd()):(c.point($[1][0],$[1][1]),c.lineEnd(),c.lineStart(),c.point($[0][0],$[0][1],3)))}x&&(!f||!Bs(f,b))&&c.point(b[0],b[1]),f=b,p=x,h=S},lineEnd:function(){p&&c.lineEnd(),f=null},clean:function(){return g|(d&&p)<<1}}}function u(c,f,h){var p=ir(c),d=ir(f),g=[1,0,0],m=ni(p,d),y=Ps(m,m),b=m[0],v=y-b*b;if(!v)return!h&&c;var x=e*y/v,S=-e*b/v,$=ni(g,m),R=Ms(g,x),T=Ms(m,S);af(R,T);var w=$,P=Ps(R,w),_=Ps(w,w),N=P*P-_*(Ps(R,R)-1);if(!(N<0)){var D=It(N),A=Ms(w,(-P-D)/_);if(af(A,R),A=Ts(A),!h)return A;var L=c[0],M=f[0],G=c[1],O=f[1],E;M<L&&(E=L,L=M,M=E);var k=M-L,C=pt(k-ft)<it,F=C||k<it;if(!C&&O<G&&(E=G,G=O,O=E),F?C?G+O>0^A[1]<(pt(A[0]-L)<it?G:O):G<=A[1]&&A[1]<=O:k>ft^(L<=A[0]&&A[0]<=M)){var X=Ms(w,(-P+D)/_);return af(X,R),[A,Ts(X)]}}}function l(c,f){var h=r?t:ft-t,p=0;return c<-h?p|=1:c>h&&(p|=2),f<-h?p|=4:f>h&&(p|=8),p}return K1(a,s,o,r?[0,-t]:[-ft,t-ft])}function VD(t,e,n,r,i,o){var a=t[0],s=t[1],u=e[0],l=e[1],c=0,f=1,h=u-a,p=l-s,d;if(d=n-a,!(!h&&d>0)){if(d/=h,h<0){if(d<c)return;d<f&&(f=d)}else if(h>0){if(d>f)return;d>c&&(c=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>f)return;d>c&&(c=d)}else if(h>0){if(d<c)return;d<f&&(f=d)}if(d=r-s,!(!p&&d>0)){if(d/=p,p<0){if(d<c)return;d<f&&(f=d)}else if(p>0){if(d>f)return;d>c&&(c=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>f)return;d>c&&(c=d)}else if(p>0){if(d<c)return;d<f&&(f=d)}return c>0&&(t[0]=a+c*h,t[1]=s+c*p),f<1&&(e[0]=a+f*h,e[1]=s+f*p),!0}}}}}var po=1e9,Os=-po;function Gs(t,e,n,r){function i(l,c){return t<=l&&l<=n&&e<=c&&c<=r}function o(l,c,f,h){var p=0,d=0;if(l==null||(p=a(l,f))!==(d=a(c,f))||u(l,c)<0^f>0)do h.point(p===0||p===3?t:n,p>1?r:e);while((p=(p+f+4)%4)!==d);else h.point(c[0],c[1])}function a(l,c){return pt(l[0]-t)<it?c>0?0:3:pt(l[0]-n)<it?c>0?2:1:pt(l[1]-e)<it?c>0?1:0:c>0?3:2}function s(l,c){return u(l.x,c.x)}function u(l,c){var f=a(l,1),h=a(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=j1(),h,p,d,g,m,y,b,v,x,S,$,R={point:T,lineStart:N,lineEnd:D,polygonStart:P,polygonEnd:_};function T(L,M){i(L,M)&&c.point(L,M)}function w(){for(var L=0,M=0,G=p.length;M<G;++M)for(var O=p[M],E=1,k=O.length,C=O[0],F,X,Q=C[0],z=C[1];E<k;++E)F=Q,X=z,C=O[E],Q=C[0],z=C[1],X<=r?z>r&&(Q-F)*(r-X)>(z-X)*(t-F)&&++L:z<=r&&(Q-F)*(r-X)<(z-X)*(t-F)&&--L;return L}function P(){c=f,h=[],p=[],$=!0}function _(){var L=w(),M=$&&L,G=(h=Hl(h)).length;(M||G)&&(l.polygonStart(),M&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),G&&V1(h,s,L,o,l),l.polygonEnd()),c=l,h=p=d=null}function N(){R.point=A,p&&p.push(d=[]),S=!0,x=!1,b=v=NaN}function D(){h&&(A(g,m),y&&x&&f.rejoin(),h.push(f.result())),R.point=T,x&&c.lineEnd()}function A(L,M){var G=i(L,M);if(p&&d.push([L,M]),S)g=L,m=M,y=G,S=!1,G&&(c.lineStart(),c.point(L,M));else if(G&&x)c.point(L,M);else{var O=[b=Math.max(Os,Math.min(po,b)),v=Math.max(Os,Math.min(po,v))],E=[L=Math.max(Os,Math.min(po,L)),M=Math.max(Os,Math.min(po,M))];VD(O,E,t,e,n,r)?(x||(c.lineStart(),c.point(O[0],O[1])),c.point(E[0],E[1]),G||c.lineEnd(),$=!1):G&&(c.lineStart(),c.point(L,M),$=!1)}b=L,v=M,x=G}return R}}function qD(){var t=0,e=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=Gs(t,e,n,r)(o=s)},extent:function(s){return arguments.length?(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1],i=o=null,a):[[t,e],[n,r]]}}}var yf,bf,zs,Ys,oi={sphere:wt,point:wt,lineStart:ZD,lineEnd:wt,polygonStart:wt,polygonEnd:wt};function ZD(){oi.point=QD,oi.lineEnd=KD}function KD(){oi.point=oi.lineEnd=wt}function QD(t,e){t*=at,e*=at,bf=t,zs=J(e),Ys=et(e),oi.point=JD}function JD(t,e){t*=at,e*=at;var n=J(e),r=et(e),i=pt(t-bf),o=et(i),a=J(i),s=r*a,u=Ys*n-zs*r*o,l=zs*n+Ys*r*o;yf.add(qt(It(s*s+u*u),l)),bf=t,zs=n,Ys=r}function J1(t){return yf=new Ct,Ce(t,oi),+yf}var xf=[null,null],t7={type:"LineString",coordinates:xf};function Us(t,e){return xf[0]=t,xf[1]=e,J1(t7)}var ty={Feature:function(t,e){return Ws(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(Ws(n[r].geometry,e))return!0;return!1}},ey={Sphere:function(){return!0},Point:function(t,e){return ny(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(ny(n[r],e))return!0;return!1},LineString:function(t,e){return ry(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(ry(n[r],e))return!0;return!1},Polygon:function(t,e){return iy(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(iy(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(Ws(n[r],e))return!0;return!1}};function Ws(t,e){return t&&ey.hasOwnProperty(t.type)?ey[t.type](t,e):!1}function ny(t,e){return Us(t,e)===0}function ry(t,e){for(var n,r,i,o=0,a=t.length;o<a;o++){if(r=Us(t[o],e),r===0||o>0&&(i=Us(t[o],t[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<lo*i))return!0;n=r}return!1}function iy(t,e){return!!Z1(t.map(e7),oy(e))}function e7(t){return t=t.map(oy),t.pop(),t}function oy(t){return[t[0]*at,t[1]*at]}function n7(t,e){return(t&&ty.hasOwnProperty(t.type)?ty[t.type]:Ws)(t,e)}function ay(t,e,n){var r=mn(t,e-it,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function sy(t,e,n){var r=mn(t,e-it,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function uy(){var t,e,n,r,i,o,a,s,u=10,l=u,c=90,f=360,h,p,d,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return mn(_s(r/c)*c,n,c).map(d).concat(mn(_s(s/f)*f,a,f).map(g)).concat(mn(_s(e/u)*u,t,u).filter(function(v){return pt(v%c)>it}).map(h)).concat(mn(_s(o/l)*l,i,l).filter(function(v){return pt(v%f)>it}).map(p))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(g(a).slice(1),d(n).reverse().slice(1),g(s).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(r=+v[0][0],n=+v[1][0],s=+v[0][1],a=+v[1][1],r>n&&(v=r,r=n,n=v),s>a&&(v=s,s=a,a=v),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(v){return arguments.length?(e=+v[0][0],t=+v[1][0],o=+v[0][1],i=+v[1][1],e>t&&(v=e,e=t,t=v),o>i&&(v=o,o=i,i=v),y.precision(m)):[[e,o],[t,i]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,h=ay(o,i,90),p=sy(e,t,m),d=ay(s,a,90),g=sy(r,n,m),y):m},y.extentMajor([[-180,-90+it],[180,90-it]]).extentMinor([[-180,-80-it],[180,80+it]])}function r7(){return uy()()}function i7(t,e){var n=t[0]*at,r=t[1]*at,i=e[0]*at,o=e[1]*at,a=et(r),s=J(r),u=et(o),l=J(o),c=a*et(n),f=a*J(n),h=u*et(i),p=u*J(i),d=2*Zt(It(w1(o-r)+a*u*w1(i-n))),g=J(d),m=d?function(y){var b=J(y*=d)/g,v=J(d-y)/g,x=v*c+b*h,S=v*f+b*p,$=v*s+b*l;return[qt(S,x)*bt,qt($,It(x*x+S*S))*bt]}:function(){return[n*bt,r*bt]};return m.distance=d,m}const go=t=>t;var vf=new Ct,_f=new Ct,ly,cy,wf,$f,rn={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){rn.lineStart=o7,rn.lineEnd=s7},polygonEnd:function(){rn.lineStart=rn.lineEnd=rn.point=wt,vf.add(pt(_f)),_f=new Ct},result:function(){var t=vf/2;return vf=new Ct,t}};function o7(){rn.point=a7}function a7(t,e){rn.point=fy,ly=wf=t,cy=$f=e}function fy(t,e){_f.add($f*t-wf*e),wf=t,$f=e}function s7(){fy(ly,cy)}var ai=1/0,Hs=ai,mo=-ai,Xs=mo,js={point:u7,lineStart:wt,lineEnd:wt,polygonStart:wt,polygonEnd:wt,result:function(){var t=[[ai,Hs],[mo,Xs]];return mo=Xs=-(Hs=ai=1/0),t}};function u7(t,e){t<ai&&(ai=t),t>mo&&(mo=t),e<Hs&&(Hs=e),e>Xs&&(Xs=e)}var Sf=0,Af=0,yo=0,Vs=0,qs=0,si=0,Tf=0,Pf=0,bo=0,hy,py,Ye,Ue,ye={point:ar,lineStart:dy,lineEnd:gy,polygonStart:function(){ye.lineStart=f7,ye.lineEnd=h7},polygonEnd:function(){ye.point=ar,ye.lineStart=dy,ye.lineEnd=gy},result:function(){var t=bo?[Tf/bo,Pf/bo]:si?[Vs/si,qs/si]:yo?[Sf/yo,Af/yo]:[NaN,NaN];return Sf=Af=yo=Vs=qs=si=Tf=Pf=bo=0,t}};function ar(t,e){Sf+=t,Af+=e,++yo}function dy(){ye.point=l7}function l7(t,e){ye.point=c7,ar(Ye=t,Ue=e)}function c7(t,e){var n=t-Ye,r=e-Ue,i=It(n*n+r*r);Vs+=i*(Ye+t)/2,qs+=i*(Ue+e)/2,si+=i,ar(Ye=t,Ue=e)}function gy(){ye.point=ar}function f7(){ye.point=p7}function h7(){my(hy,py)}function p7(t,e){ye.point=my,ar(hy=Ye=t,py=Ue=e)}function my(t,e){var n=t-Ye,r=e-Ue,i=It(n*n+r*r);Vs+=i*(Ye+t)/2,qs+=i*(Ue+e)/2,si+=i,i=Ue*t-Ye*e,Tf+=i*(Ye+t),Pf+=i*(Ue+e),bo+=i*3,ar(Ye=t,Ue=e)}function yy(t){this._context=t}yy.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(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Vt);break}}},result:wt};var Mf=new Ct,Df,by,xy,xo,vo,_o={point:wt,lineStart:function(){_o.point=d7},lineEnd:function(){Df&&vy(by,xy),_o.point=wt},polygonStart:function(){Df=!0},polygonEnd:function(){Df=null},result:function(){var t=+Mf;return Mf=new Ct,t}};function d7(t,e){_o.point=vy,by=xo=t,xy=vo=e}function vy(t,e){xo-=t,vo-=e,Mf.add(It(xo*xo+vo*vo)),xo=t,vo=e}let _y,Zs,wy,$y;class Sy{constructor(e){this._append=e==null?Ay:g7(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==wy||this._append!==Zs){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,wy=r,Zs=this._append,$y=this._,this._=i}this._+=$y;break}}}result(){const e=this._;return this._="",e.length?e:null}}function Ay(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function g7(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return Ay;if(e!==_y){const n=10**e;_y=e,Zs=function(i){let o=1;this._+=i[0];for(const a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Zs}function m7(t,e){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Ce(s,i(o))),o.result()}return a.area=function(s){return Ce(s,i(rn)),rn.result()},a.measure=function(s){return Ce(s,i(_o)),_o.result()},a.bounds=function(s){return Ce(s,i(js)),js.result()},a.centroid=function(s){return Ce(s,i(ye)),ye.result()},a.projection=function(s){return arguments.length?(i=s==null?(t=null,go):(t=s).stream,a):t},a.context=function(s){return arguments.length?(o=s==null?(e=null,new Sy(n)):new yy(e=s),typeof r!="function"&&o.pointRadius(r),a):e},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const u=Math.floor(s);if(!(u>=0))throw new RangeError(`invalid digits: ${s}`);n=u}return e===null&&(o=new Sy(n)),a},a.projection(t).digits(n).context(e)}function y7(t){return{stream:wo(t)}}function wo(t){return function(e){var n=new Cf;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Cf(){}Cf.prototype={constructor:Cf,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Lf(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Ce(n,t.stream(js)),e(js.result()),r!=null&&t.clipExtent(r),t}function Ks(t,e,n){return Lf(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+e[0][0]+(i-a*(r[1][0]+r[0][0]))/2,u=+e[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([s,u])},n)}function kf(t,e,n){return Ks(t,[[0,0],e],n)}function Rf(t,e,n){return Lf(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];t.scale(150*o).translate([a,s])},n)}function Ef(t,e,n){return Lf(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,s])},n)}var Ty=16,b7=et(30*at);function Py(t,e){return+e?v7(t,e):x7(t)}function x7(t){return wo({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function v7(t,e){function n(r,i,o,a,s,u,l,c,f,h,p,d,g,m){var y=l-r,b=c-i,v=y*y+b*b;if(v>4*e&&g--){var x=a+h,S=s+p,$=u+d,R=It(x*x+S*S+$*$),T=Zt($/=R),w=pt(pt($)-1)<it||pt(o-f)<it?(o+f)/2:qt(S,x),P=t(w,T),_=P[0],N=P[1],D=_-r,A=N-i,L=b*D-y*A;(L*L/v>e||pt((y*D+b*A)/v-.5)>.3||a*h+s*p+u*d<b7)&&(n(r,i,o,a,s,u,_,N,w,x/=R,S/=R,$,g,m),m.point(_,N),n(_,N,w,x,S,$,l,c,f,h,p,d,g,m))}}return function(r){var i,o,a,s,u,l,c,f,h,p,d,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){r.polygonStart(),m.lineStart=S},polygonEnd:function(){r.polygonEnd(),m.lineStart=b}};function y(T,w){T=t(T,w),r.point(T[0],T[1])}function b(){f=NaN,m.point=v,r.lineStart()}function v(T,w){var P=ir([T,w]),_=t(T,w);n(f,h,c,p,d,g,f=_[0],h=_[1],c=T,p=P[0],d=P[1],g=P[2],Ty,r),r.point(f,h)}function x(){m.point=y,r.lineEnd()}function S(){b(),m.point=$,m.lineEnd=R}function $(T,w){v(i=T,w),o=f,a=h,s=p,u=d,l=g,m.point=v}function R(){n(f,h,c,p,d,g,o,a,i,s,u,l,Ty,r),m.lineEnd=x,x()}return m}}var _7=wo({point:function(t,e){this.stream.point(t*at,e*at)}});function w7(t){return wo({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function $7(t,e,n,r,i){function o(a,s){return a*=r,s*=i,[e+t*a,n-t*s]}return o.invert=function(a,s){return[(a-e)/t*r,(n-s)/t*i]},o}function My(t,e,n,r,i,o){if(!o)return $7(t,e,n,r,i);var a=et(o),s=J(o),u=a*t,l=s*t,c=a/t,f=s/t,h=(s*n-a*e)/t,p=(s*e+a*n)/t;function d(g,m){return g*=r,m*=i,[u*g-l*m+e,n-l*g-u*m]}return d.invert=function(g,m){return[r*(c*g-f*m+h),i*(p-f*g-c*m)]},d}function We(t){return If(function(){return t})()}function If(t){var e,n=150,r=480,i=250,o=0,a=0,s=0,u=0,l=0,c,f=0,h=1,p=1,d=null,g=mf,m=null,y,b,v,x=go,S=.5,$,R,T,w,P;function _(L){return T(L[0]*at,L[1]*at)}function N(L){return L=T.invert(L[0],L[1]),L&&[L[0]*bt,L[1]*bt]}_.stream=function(L){return w&&P===L?w:w=_7(w7(c)(g($(x(P=L)))))},_.preclip=function(L){return arguments.length?(g=L,d=void 0,A()):g},_.postclip=function(L){return arguments.length?(x=L,m=y=b=v=null,A()):x},_.clipAngle=function(L){return arguments.length?(g=+L?Q1(d=L*at):(d=null,mf),A()):d*bt},_.clipExtent=function(L){return arguments.length?(x=L==null?(m=y=b=v=null,go):Gs(m=+L[0][0],y=+L[0][1],b=+L[1][0],v=+L[1][1]),A()):m==null?null:[[m,y],[b,v]]},_.scale=function(L){return arguments.length?(n=+L,D()):n},_.translate=function(L){return arguments.length?(r=+L[0],i=+L[1],D()):[r,i]},_.center=function(L){return arguments.length?(o=L[0]%360*at,a=L[1]%360*at,D()):[o*bt,a*bt]},_.rotate=function(L){return arguments.length?(s=L[0]%360*at,u=L[1]%360*at,l=L.length>2?L[2]%360*at:0,D()):[s*bt,u*bt,l*bt]},_.angle=function(L){return arguments.length?(f=L%360*at,D()):f*bt},_.reflectX=function(L){return arguments.length?(h=L?-1:1,D()):h<0},_.reflectY=function(L){return arguments.length?(p=L?-1:1,D()):p<0},_.precision=function(L){return arguments.length?($=Py(R,S=L*L),A()):It(S)},_.fitExtent=function(L,M){return Ks(_,L,M)},_.fitSize=function(L,M){return kf(_,L,M)},_.fitWidth=function(L,M){return Rf(_,L,M)},_.fitHeight=function(L,M){return Ef(_,L,M)};function D(){var L=My(n,0,0,h,p,f).apply(null,e(o,a)),M=My(n,r-L[0],i-L[1],h,p,f);return c=df(s,u,l),R=hf(e,M),T=hf(c,R),$=Py(R,S),A()}function A(){return w=P=null,_}return function(){return e=t.apply(this,arguments),_.invert=e.invert&&N,D()}}function Nf(t){var e=0,n=ft/3,r=If(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*at,n=o[1]*at):[e*bt,n*bt]},i}function S7(t){var e=et(t);function n(r,i){return[r*e,J(i)/e]}return n.invert=function(r,i){return[r/e,Zt(i*e)]},n}function Dy(t,e){var n=J(t),r=(n+J(e))/2;if(pt(r)<it)return S7(t);var i=1+n*(2*r-n),o=It(i)/r;function a(s,u){var l=It(i-2*r*J(u))/r;return[l*J(s*=r),o-l*et(s)]}return a.invert=function(s,u){var l=o-u,c=qt(s,pt(l))*me(l);return l*r<0&&(c-=ft*me(s)*me(l)),[c/r,Zt((i-(s*s+l*l)*r*r)/(2*r))]},a}function Qs(){return Nf(Dy).scale(155.424).center([0,33.6442])}function Cy(){return Qs().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function A7(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function T7(){var t,e,n=Cy(),r,i=Qs().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=Qs().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,u,l={point:function(h,p){u=[h,p]}};function c(h){var p=h[0],d=h[1];return u=null,r.point(p,d),u||(o.point(p,d),u)||(s.point(p,d),u)}c.invert=function(h){var p=n.scale(),d=n.translate(),g=(h[0]-d[0])/p,m=(h[1]-d[1])/p;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?a:n).invert(h)},c.stream=function(h){return t&&e===h?t:t=A7([n.stream(e=h),i.stream(h),a.stream(h)])},c.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),a.precision(h),f()):n.precision()},c.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),a.scale(h),c.translate(n.translate())):n.scale()},c.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),d=+h[0],g=+h[1];return r=n.translate(h).clipExtent([[d-.455*p,g-.238*p],[d+.455*p,g+.238*p]]).stream(l),o=i.translate([d-.307*p,g+.201*p]).clipExtent([[d-.425*p+it,g+.12*p+it],[d-.214*p-it,g+.234*p-it]]).stream(l),s=a.translate([d-.205*p,g+.212*p]).clipExtent([[d-.214*p+it,g+.166*p+it],[d-.115*p-it,g+.234*p-it]]).stream(l),f()},c.fitExtent=function(h,p){return Ks(c,h,p)},c.fitSize=function(h,p){return kf(c,h,p)},c.fitWidth=function(h,p){return Rf(c,h,p)},c.fitHeight=function(h,p){return Ef(c,h,p)};function f(){return t=e=null,c}return c.scale(1070)}function Ly(t){return function(e,n){var r=et(e),i=et(n),o=t(r*i);return o===1/0?[2,0]:[o*i*J(e),o*J(n)]}}function $o(t){return function(e,n){var r=It(e*e+n*n),i=t(r),o=J(i),a=et(i);return[qt(e*o,r*a),Zt(r&&n*o/r)]}}var Bf=Ly(function(t){return It(2/(1+t))});Bf.invert=$o(function(t){return 2*Zt(t/2)});function P7(){return We(Bf).scale(124.75).clipAngle(180-.001)}var Ff=Ly(function(t){return(t=_1(t))&&t/J(t)});Ff.invert=$o(function(t){return t});function M7(){return We(Ff).scale(79.4188).clipAngle(180-.001)}function So(t,e){return[t,ws(tf((At+e)/2))]}So.invert=function(t,e){return[t,2*ei(v1(e))-At]};function D7(){return ky(So).scale(961/Vt)}function ky(t){var e=We(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,a=null,s,u,l;e.scale=function(f){return arguments.length?(r(f),c()):r()},e.translate=function(f){return arguments.length?(i(f),c()):i()},e.center=function(f){return arguments.length?(n(f),c()):n()},e.clipExtent=function(f){return arguments.length?(f==null?a=s=u=l=null:(a=+f[0][0],s=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):a==null?null:[[a,s],[u,l]]};function c(){var f=ft*r(),h=e(W1(e.rotate()).invert([0,0]));return o(a==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:t===So?[[Math.max(h[0]-f,a),s],[Math.min(h[0]+f,u),l]]:[[a,Math.max(h[1]-f,s)],[u,Math.min(h[1]+f,l)]])}return c()}function Js(t){return tf((At+t)/2)}function Ry(t,e){var n=et(t),r=t===e?J(t):ws(n/et(e))/ws(Js(e)/Js(t)),i=n*Jc(Js(t),r)/r;if(!r)return So;function o(a,s){i>0?s<-At+it&&(s=-At+it):s>At-it&&(s=At-it);var u=i/Jc(Js(s),r);return[u*J(r*a),i-u*et(r*a)]}return o.invert=function(a,s){var u=i-s,l=me(r)*It(a*a+u*u),c=qt(a,pt(u))*me(u);return u*r<0&&(c-=ft*me(a)*me(u)),[c/r,2*ei(Jc(i/l,1/r))-At]},o}function C7(){return Nf(Ry).scale(109.5).parallels([30,30])}function Ao(t,e){return[t,e]}Ao.invert=Ao;function L7(){return We(Ao).scale(152.63)}function Ey(t,e){var n=et(t),r=t===e?J(t):(n-et(e))/(e-t),i=n/r+t;if(pt(r)<it)return Ao;function o(a,s){var u=i-s,l=r*a;return[u*J(l),i-u*et(l)]}return o.invert=function(a,s){var u=i-s,l=qt(a,pt(u))*me(u);return u*r<0&&(l-=ft*me(a)*me(u)),[l/r,i-me(r)*It(a*a+u*u)]},o}function k7(){return Nf(Ey).scale(131.154).center([0,13.9389])}var To=1.340264,Po=-.081106,Mo=893e-6,Do=.003796,tu=It(3)/2,R7=12;function Of(t,e){var n=Zt(tu*J(e)),r=n*n,i=r*r*r;return[t*et(n)/(tu*(To+3*Po*r+i*(7*Mo+9*Do*r))),n*(To+Po*r+i*(Mo+Do*r))]}Of.invert=function(t,e){for(var n=e,r=n*n,i=r*r*r,o=0,a,s,u;o<R7&&(s=n*(To+Po*r+i*(Mo+Do*r))-e,u=To+3*Po*r+i*(7*Mo+9*Do*r),n-=a=s/u,r=n*n,i=r*r*r,!(pt(a)<lo));++o);return[tu*t*(To+3*Po*r+i*(7*Mo+9*Do*r))/et(n),Zt(J(n)/tu)]};function E7(){return We(Of).scale(177.158)}function Gf(t,e){var n=et(e),r=et(t)*n;return[n*J(t)/r,J(e)/r]}Gf.invert=$o(ei);function I7(){return We(Gf).scale(144.049).clipAngle(60)}function N7(){var t=1,e=0,n=0,r=1,i=1,o=0,a,s,u=null,l,c,f,h=1,p=1,d=wo({point:function(x,S){var $=v([x,S]);this.stream.point($[0],$[1])}}),g=go,m,y;function b(){return h=t*r,p=t*i,m=y=null,v}function v(x){var S=x[0]*h,$=x[1]*p;if(o){var R=$*a-S*s;S=S*a+$*s,$=R}return[S+e,$+n]}return v.invert=function(x){var S=x[0]-e,$=x[1]-n;if(o){var R=$*a+S*s;S=S*a-$*s,$=R}return[S/h,$/p]},v.stream=function(x){return m&&y===x?m:m=d(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,go):Gs(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(t=+x,b()):t},v.translate=function(x){return arguments.length?(e=+x[0],n=+x[1],b()):[e,n]},v.angle=function(x){return arguments.length?(o=x%360*at,s=J(o),a=et(o),b()):o*bt},v.reflectX=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.reflectY=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.fitExtent=function(x,S){return Ks(v,x,S)},v.fitSize=function(x,S){return kf(v,x,S)},v.fitWidth=function(x,S){return Rf(v,x,S)},v.fitHeight=function(x,S){return Ef(v,x,S)},v}function zf(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),e*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}zf.invert=function(t,e){var n=e,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-e)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(pt(i)>it&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function B7(){return We(zf).scale(175.295)}function Yf(t,e){return[et(e)*J(t),J(e)]}Yf.invert=$o(Zt);function F7(){return We(Yf).scale(249.5).clipAngle(90+it)}function Uf(t,e){var n=et(e),r=1+et(t)*n;return[n*J(t)/r,J(e)/r]}Uf.invert=$o(function(t){return 2*ei(t)});function O7(){return We(Uf).scale(250).clipAngle(142)}function Wf(t,e){return[ws(tf((At+e)/2)),-t]}Wf.invert=function(t,e){return[-e,2*ei(v1(t))-At]};function G7(){var t=ky(Wf),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function z7(t,e){return t.parent===e.parent?1:2}function Y7(t){return t.reduce(U7,0)/t.length}function U7(t,e){return t+e.x}function W7(t){return 1+t.reduce(H7,0)}function H7(t,e){return Math.max(t,e.y)}function X7(t){for(var e;e=t.children;)t=e[0];return t}function j7(t){for(var e;e=t.children;)t=e[e.length-1];return t}function V7(){var t=z7,e=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(h){var p=h.children;p?(h.x=Y7(p),h.y=W7(p)):(h.x=a?s+=t(h,a):0,h.y=0,a=h)});var u=X7(o),l=j7(o),c=u.x-t(u,l)/2,f=l.x+t(l,u)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*e,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-c)/(f-c)*e,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function q7(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function Z7(){return this.eachAfter(q7)}function K7(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function Q7(t,e){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function J7(t,e){for(var n=this,r=[n],i=[],o,a,s,u=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,s=o.length;a<s;++a)r.push(o[a]);for(;n=i.pop();)t.call(e,n,++u,this);return this}function tC(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function eC(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function nC(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function rC(t){for(var e=this,n=iC(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function iC(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function oC(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function aC(){return Array.from(this)}function sC(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function uC(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*lC(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function eu(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=hC)):e===void 0&&(e=fC);for(var n=new sr(t),r,i=[n],o,a,s,u;r=i.pop();)if((a=e(r.data))&&(u=(a=Array.from(a)).length))for(r.children=a,s=u-1;s>=0;--s)i.push(o=a[s]=new sr(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(Iy)}function cC(){return eu(this).eachBefore(pC)}function fC(t){return t.children}function hC(t){return Array.isArray(t)?t[1]:null}function pC(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Iy(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function sr(t){this.data=t,this.depth=this.height=0,this.parent=null}sr.prototype=eu.prototype={constructor:sr,count:Z7,each:K7,eachAfter:J7,eachBefore:Q7,find:tC,sum:eC,sort:nC,path:rC,ancestors:oC,descendants:aC,leaves:sC,links:uC,copy:cC,[Symbol.iterator]:lC};function nu(t){return t==null?null:Ny(t)}function Ny(t){if(typeof t!="function")throw new Error;return t}function ur(){return 0}function ui(t){return function(){return t}}const dC=1664525,gC=1013904223,By=4294967296;function Hf(){let t=1;return()=>(t=(dC*t+gC)%By)/By}function mC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function yC(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function bC(t){return Fy(t,Hf())}function Fy(t,e){for(var n=0,r=(t=yC(Array.from(t),e)).length,i=[],o,a;n<r;)o=t[n],a&&Oy(a,o)?++n:(a=vC(i=xC(i,o)),n=0);return a}function xC(t,e){var n,r;if(Xf(e,t))return[e];for(n=0;n<t.length;++n)if(ru(e,t[n])&&Xf(Co(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(ru(Co(t[n],t[r]),e)&&ru(Co(t[n],e),t[r])&&ru(Co(t[r],e),t[n])&&Xf(Gy(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function ru(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function Oy(t,e){var n=t.r-e.r+Math.max(t.r,e.r,1)*1e-9,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Xf(t,e){for(var n=0;n<e.length;++n)if(!Oy(t,e[n]))return!1;return!0}function vC(t){switch(t.length){case 1:return _C(t[0]);case 2:return Co(t[0],t[1]);case 3:return Gy(t[0],t[1],t[2])}}function _C(t){return{x:t.x,y:t.y,r:t.r}}function Co(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,l=a-r,c=s-i,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(r+a+l/f*c)/2,r:(f+i+s)/2}}function Gy(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,l=n.x,c=n.y,f=n.r,h=r-a,p=r-l,d=i-s,g=i-c,m=u-o,y=f-o,b=r*r+i*i-o*o,v=b-a*a-s*s+u*u,x=b-l*l-c*c+f*f,S=p*d-h*g,$=(d*x-g*v)/(S*2)-r,R=(g*m-d*y)/S,T=(p*v-h*x)/(S*2)-i,w=(h*y-p*m)/S,P=R*R+w*w-1,_=2*(o+$*R+T*w),N=$*$+T*T-o*o,D=-(Math.abs(P)>1e-6?(_+Math.sqrt(_*_-4*P*N))/(2*P):N/_);return{x:r+$+R*D,y:i+T+w*D,r:D}}function zy(t,e,n){var r=t.x-e.x,i,o,a=t.y-e.y,s,u,l=r*r+a*a;l?(o=e.r+n.r,o*=o,u=t.r+n.r,u*=u,o>u?(i=(l+u-o)/(2*l),s=Math.sqrt(Math.max(0,u/l-i*i)),n.x=t.x-i*r-s*a,n.y=t.y-i*a+s*r):(i=(l+o-u)/(2*l),s=Math.sqrt(Math.max(0,o/l-i*i)),n.x=e.x+i*r-s*a,n.y=e.y+i*a+s*r)):(n.x=e.x+n.r,n.y=e.y)}function Yy(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Uy(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function iu(t){this._=t,this.next=null,this.previous=null}function Wy(t,e){if(!(o=(t=mC(t)).length))return 0;var n,r,i,o,a,s,u,l,c,f,h;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;zy(r,n,i=t[2]),n=new iu(n),r=new iu(r),i=new iu(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){zy(n._,r._,i=t[u]),i=new iu(i),l=r.next,c=n.previous,f=r._.r,h=n._.r;do if(f<=h){if(Yy(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}f+=l._.r,l=l.next}else{if(Yy(c._,i._)){n=c,n.next=r,r.previous=n,--u;continue t}h+=c._.r,c=c.previous}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Uy(n);(i=i.next)!==r;)(s=Uy(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Fy(n,e),u=0;u<o;++u)n=t[u],n.x-=i.x,n.y-=i.y;return i.r}function wC(t){return Wy(t,Hf()),t}function $C(t){return Math.sqrt(t.value)}function SC(){var t=null,e=1,n=1,r=ur;function i(o){const a=Hf();return o.x=e/2,o.y=n/2,t?o.eachBefore(Hy(t)).eachAfter(jf(r,.5,a)).eachBefore(Xy(1)):o.eachBefore(Hy($C)).eachAfter(jf(ur,1,a)).eachAfter(jf(r,o.r/Math.min(e,n),a)).eachBefore(Xy(Math.min(e,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(t=nu(o),i):t},i.size=function(o){return arguments.length?(e=+o[0],n=+o[1],i):[e,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:ui(+o),i):r},i}function Hy(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function jf(t,e,n){return function(r){if(i=r.children){var i,o,a=i.length,s=t(r)*e||0,u;if(s)for(o=0;o<a;++o)i[o].r+=s;if(u=Wy(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=u+s}}}function Xy(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function jy(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Lo(t,e,n,r,i){for(var o=t.children,a,s=-1,u=o.length,l=t.value&&(r-e)/t.value;++s<u;)a=o[s],a.y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}function AC(){var t=1,e=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(o(e,s)),r&&a.eachBefore(jy),a}function o(a,s){return function(u){u.children&&Lo(u,u.x0,a*(u.depth+1)/s,u.x1,a*(u.depth+2)/s);var l=u.x0,c=u.y0,f=u.x1-n,h=u.y1-n;f<l&&(l=f=(l+f)/2),h<c&&(c=h=(c+h)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=h}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(t=+a[0],e=+a[1],i):[t,e]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var TC={depth:-1},Vy={},Vf={};function PC(t){return t.id}function MC(t){return t.parentId}function DC(){var t=PC,e=MC,n;function r(i){var o=Array.from(i),a=t,s=e,u,l,c,f,h,p,d,g,m=new Map;if(n!=null){const y=o.map((x,S)=>CC(n(x,S,i))),b=y.map(qy),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(qy(x)),o.push(Vf));a=(x,S)=>y[S],s=(x,S)=>b[S]}for(c=0,u=o.length;c<u;++c)l=o[c],p=o[c]=new sr(l),(d=a(l,c,i))!=null&&(d+="")&&(g=p.id=d,m.set(g,m.has(g)?Vy:p)),(d=s(l,c,i))!=null&&(d+="")&&(p.parent=d);for(c=0;c<u;++c)if(p=o[c],d=p.parent){if(h=m.get(d),!h)throw new Error("missing: "+d);if(h===Vy)throw new Error("ambiguous: "+d);h.children?h.children.push(p):h.children=[p],p.parent=h}else{if(f)throw new Error("multiple roots");f=p}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Vf&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Vf);--y)p.data=null}if(f.parent=TC,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(Iy),f.parent=null,u>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=nu(i),r):t},r.parentId=function(i){return arguments.length?(e=nu(i),r):e},r.path=function(i){return arguments.length?(n=nu(i),r):n},r}function CC(t){t=`${t}`;let e=t.length;return qf(t,e-1)&&!qf(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function qy(t){let e=t.length;if(e<2)return"";for(;--e>1&&!qf(t,e););return t.slice(0,e)}function qf(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function LC(t,e){return t.parent===e.parent?1:2}function Zf(t){var e=t.children;return e?e[0]:t.t}function Kf(t){var e=t.children;return e?e[e.length-1]:t.t}function kC(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function RC(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function EC(t,e,n){return t.a.parent===e.parent?t.a:n}function ou(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}ou.prototype=Object.create(sr.prototype);function IC(t){for(var e=new ou(t,0),n,r=[e],i,o,a,s;n=r.pop();)if(o=n._.children)for(n.children=new Array(s=o.length),a=s-1;a>=0;--a)r.push(i=n.children[a]=new ou(o[a],a)),i.parent=n;return(e.parent=new ou(null,0)).children=[e],e}function NC(){var t=LC,e=1,n=1,r=null;function i(l){var c=IC(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)l.eachBefore(u);else{var f=l,h=l,p=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>h.x&&(h=b),b.depth>p.depth&&(p=b)});var d=f===h?1:t(f,h)/2,g=d-f.x,m=e/(h.x+d+g),y=n/(p.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,h=l.i?f[l.i-1]:null;if(c){RC(l);var p=(c[0].z+c[c.length-1].z)/2;h?(l.z=h.z+t(l._,h._),l.m=l.z-p):l.z=p}else h&&(l.z=h.z+t(l._,h._));l.parent.A=s(l,h,l.parent.A||f[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function s(l,c,f){if(c){for(var h=l,p=l,d=c,g=h.parent.children[0],m=h.m,y=p.m,b=d.m,v=g.m,x;d=Kf(d),h=Zf(h),d&&h;)g=Zf(g),p=Kf(p),p.a=l,x=d.z+b-h.z-m+t(d._,h._),x>0&&(kC(EC(d,l,f),l,x),m+=x,y+=x),b+=d.m,m+=h.m,v+=g.m,y+=p.m;d&&!Kf(p)&&(p.t=d,p.m+=b-y),h&&!Zf(g)&&(g.t=h,g.m+=m-v,f=l)}return f}function u(l){l.x*=e,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(t=l,i):t},i.size=function(l){return arguments.length?(r=!1,e=+l[0],n=+l[1],i):r?null:[e,n]},i.nodeSize=function(l){return arguments.length?(r=!0,e=+l[0],n=+l[1],i):r?[e,n]:null},i}function au(t,e,n,r,i){for(var o=t.children,a,s=-1,u=o.length,l=t.value&&(i-n)/t.value;++s<u;)a=o[s],a.x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*l}var Zy=(1+Math.sqrt(5))/2;function Ky(t,e,n,r,i,o){for(var a=[],s=e.children,u,l,c=0,f=0,h=s.length,p,d,g=e.value,m,y,b,v,x,S,$;c<h;){p=i-n,d=o-r;do m=s[f++].value;while(!m&&f<h);for(y=b=m,S=Math.max(d/p,p/d)/(g*t),$=m*m*S,x=Math.max(b/$,$/y);f<h;++f){if(m+=l=s[f].value,l<y&&(y=l),l>b&&(b=l),$=m*m*S,v=Math.max(b/$,$/y),v>x){m-=l;break}x=v}a.push(u={value:m,dice:p<d,children:s.slice(c,f)}),u.dice?Lo(u,n,r,i,g?r+=d*m/g:o):au(u,n,r,g?n+=p*m/g:i,o),g-=m,c=f}return a}const Qf=function t(e){function n(r,i,o,a,s){Ky(e,r,i,o,a,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(Zy);function Qy(){var t=Qf,e=!1,n=1,r=1,i=[0],o=ur,a=ur,s=ur,u=ur,l=ur;function c(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(f),i=[0],e&&h.eachBefore(jy),h}function f(h){var p=i[h.depth],d=h.x0+p,g=h.y0+p,m=h.x1-p,y=h.y1-p;m<d&&(d=m=(d+m)/2),y<g&&(g=y=(g+y)/2),h.x0=d,h.y0=g,h.x1=m,h.y1=y,h.children&&(p=i[h.depth+1]=o(h)/2,d+=l(h)-p,g+=a(h)-p,m-=s(h)-p,y-=u(h)-p,m<d&&(d=m=(d+m)/2),y<g&&(g=y=(g+y)/2),t(h,d,g,m,y))}return c.round=function(h){return arguments.length?(e=!!h,c):e},c.size=function(h){return arguments.length?(n=+h[0],r=+h[1],c):[n,r]},c.tile=function(h){return arguments.length?(t=Ny(h),c):t},c.padding=function(h){return arguments.length?c.paddingInner(h).paddingOuter(h):c.paddingInner()},c.paddingInner=function(h){return arguments.length?(o=typeof h=="function"?h:ui(+h),c):o},c.paddingOuter=function(h){return arguments.length?c.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):c.paddingTop()},c.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:ui(+h),c):a},c.paddingRight=function(h){return arguments.length?(s=typeof h=="function"?h:ui(+h),c):s},c.paddingBottom=function(h){return arguments.length?(u=typeof h=="function"?h:ui(+h),c):u},c.paddingLeft=function(h){return arguments.length?(l=typeof h=="function"?h:ui(+h),c):l},c}function BC(t,e,n,r,i){var o=t.children,a,s=o.length,u,l=new Array(s+1);for(l[0]=u=a=0;a<s;++a)l[a+1]=u+=o[a].value;c(0,s,t.value,e,n,r,i);function c(f,h,p,d,g,m,y){if(f>=h-1){var b=o[f];b.x0=d,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=p/2+v,S=f+1,$=h-1;S<$;){var R=S+$>>>1;l[R]<x?S=R+1:$=R}x-l[S-1]<l[S]-x&&f+1<S&&--S;var T=l[S]-v,w=p-T;if(m-d>y-g){var P=p?(d*w+m*T)/p:m;c(f,S,T,d,g,P,y),c(S,h,w,P,g,m,y)}else{var _=p?(g*w+y*T)/p:y;c(f,S,T,d,g,m,_),c(S,h,w,d,_,m,y)}}}function FC(t,e,n,r,i){(t.depth&1?au:Lo)(t,e,n,r,i)}const OC=function t(e){function n(r,i,o,a,s){if((u=r._squarify)&&u.ratio===e)for(var u,l,c,f,h=-1,p,d=u.length,g=r.value;++h<d;){for(l=u[h],c=l.children,f=l.value=0,p=c.length;f<p;++f)l.value+=c[f].value;l.dice?Lo(l,i,o,a,g?o+=(s-o)*l.value/g:s):au(l,i,o,g?i+=(a-i)*l.value/g:a,s),g-=l.value}else r._squarify=u=Ky(e,r,i,o,a,s),u.ratio=e}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(Zy);function GC(t){for(var e=-1,n=t.length,r,i=t[n-1],o=0;++e<n;)r=i,i=t[e],o+=r[1]*i[0]-r[0]*i[1];return o/2}function zC(t){for(var e=-1,n=t.length,r=0,i=0,o,a=t[n-1],s,u=0;++e<n;)o=a,a=t[e],u+=s=o[0]*a[1]-a[0]*o[1],r+=(o[0]+a[0])*s,i+=(o[1]+a[1])*s;return u*=3,[r/u,i/u]}function YC(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function UC(t,e){return t[0]-e[0]||t[1]-e[1]}function Jy(t){const e=t.length,n=[0,1];let r=2,i;for(i=2;i<e;++i){for(;r>1&&YC(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function WC(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e<n;++e)r[e]=[+t[e][0],+t[e][1],e];for(r.sort(UC),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=Jy(r),a=Jy(i),s=a[0]===o[0],u=a[a.length-1]===o[o.length-1],l=[];for(e=o.length-1;e>=0;--e)l.push(t[r[o[e]][2]]);for(e=+s;e<a.length-u;++e)l.push(t[r[a[e]][2]]);return l}function HC(t,e){for(var n=t.length,r=t[n-1],i=e[0],o=e[1],a=r[0],s=r[1],u,l,c=!1,f=0;f<n;++f)r=t[f],u=r[0],l=r[1],l>o!=s>o&&i<(a-u)*(o-l)/(s-l)+u&&(c=!c),a=u,s=l;return c}function XC(t){for(var e=-1,n=t.length,r=t[n-1],i,o,a=r[0],s=r[1],u=0;++e<n;)i=a,o=s,r=t[e],a=r[0],s=r[1],i-=a,o-=s,u+=Math.hypot(i,o);return u}const Bt=Math.random,jC=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,arguments.length===1?(i=r,r=0):i-=r,function(){return e()*i+r}}return n.source=t,n}(Bt),VC=function t(e){function n(r,i){return arguments.length<2&&(i=r,r=0),r=Math.floor(r),i=Math.floor(i)-r,function(){return Math.floor(e()*i+r)}}return n.source=t,n}(Bt),Jf=function t(e){function n(r,i){var o,a;return r=r==null?0:+r,i=i==null?1:+i,function(){var s;if(o!=null)s=o,o=null;else do o=e()*2-1,s=e()*2-1,a=o*o+s*s;while(!a||a>1);return r+i*s*Math.sqrt(-2*Math.log(a)/a)}}return n.source=t,n}(Bt),qC=function t(e){var n=Jf.source(e);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=t,r}(Bt),tb=function t(e){function n(r){return(r=+r)<=0?()=>0:function(){for(var i=0,o=r;o>1;--o)i+=e();return i+o*e()}}return n.source=t,n}(Bt),ZC=function t(e){var n=tb.source(e);function r(i){if((i=+i)==0)return e;var o=n(i);return function(){return o()/i}}return r.source=t,r}(Bt),KC=function t(e){function n(r){return function(){return-Math.log1p(-e())/r}}return n.source=t,n}(Bt),QC=function t(e){function n(r){if((r=+r)<0)throw new RangeError("invalid alpha");return r=1/-r,function(){return Math.pow(1-e(),r)}}return n.source=t,n}(Bt),JC=function t(e){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+r)}}return n.source=t,n}(Bt),eb=function t(e){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return r===0?()=>1/0:r===1?()=>1:(r=Math.log1p(-r),function(){return 1+Math.floor(Math.log1p(-e())/r)})}return n.source=t,n}(Bt),th=function t(e){var n=Jf.source(e)();function r(i,o){if((i=+i)<0)throw new RangeError("invalid k");if(i===0)return()=>0;if(o=o==null?1:+o,i===1)return()=>-Math.log1p(-e())*o;var a=(i<1?i+1:i)-1/3,s=1/(3*Math.sqrt(a)),u=i<1?()=>Math.pow(e(),1/i):()=>1;return function(){do{do var l=n(),c=1+s*l;while(c<=0);c*=c*c;var f=1-e()}while(f>=1-.0331*l*l*l*l&&Math.log(f)>=.5*l*l+a*(1-c+Math.log(c)));return a*c*u()*o}}return r.source=t,r}(Bt),nb=function t(e){var n=th.source(e);function r(i,o){var a=n(i),s=n(o);return function(){var u=a();return u===0?0:u/(u+s())}}return r.source=t,r}(Bt),rb=function t(e){var n=eb.source(e),r=nb.source(e);function i(o,a){return o=+o,(a=+a)>=1?()=>o:a<=0?()=>0:function(){for(var s=0,u=o,l=a;u*l>16&&u*(1-l)>16;){var c=Math.floor((u+1)*l),f=r(c,u-c+1)();f<=l?(s+=c,u-=c,l=(l-f)/(1-f)):(u=c-1,l/=f)}for(var h=l<.5,p=h?l:1-l,d=n(p),g=d(),m=0;g<=u;++m)g+=d();return s+(h?m:u-m)}}return i.source=t,i}(Bt),t9=function t(e){function n(r,i,o){var a;return(r=+r)==0?a=s=>-Math.log(s):(r=1/r,a=s=>Math.pow(s,r)),i=i==null?0:+i,o=o==null?1:+o,function(){return i+o*a(-Math.log1p(-e()))}}return n.source=t,n}(Bt),e9=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){return r+i*Math.tan(Math.PI*e())}}return n.source=t,n}(Bt),n9=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){var o=e();return r+i*Math.log(o/(1-o))}}return n.source=t,n}(Bt),r9=function t(e){var n=th.source(e),r=rb.source(e);function i(o){return function(){for(var a=0,s=o;s>16;){var u=Math.floor(.875*s),l=n(u)();if(l>s)return a+r(u-1,s/l)();a+=u,s-=l}for(var c=-Math.log1p(-e()),f=0;c<=s;++f)c-=Math.log1p(-e());return a+f}}return i.source=t,i}(Bt),i9=1664525,o9=1013904223,ib=1/4294967296;function a9(t=Math.random()){let e=(0<=t&&t<1?t/ib:Math.abs(t))|0;return()=>(e=i9*e+o9|0,ib*(e>>>0))}function be(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function on(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const eh=Symbol("implicit");function nh(){var t=new Bi,e=[],n=[],r=eh;function i(o){let a=t.get(o);if(a===void 0){if(r!==eh)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Bi;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return nh(e,n).unknown(r)},be.apply(i,arguments),i}function rh(){var t=nh().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,s=!1,u=0,l=0,c=.5;delete t.unknown;function f(){var h=e().length,p=i<r,d=p?i:r,g=p?r:i;o=(g-d)/Math.max(1,h-u+l*2),s&&(o=Math.floor(o)),d+=(g-d-o*(h-u))*c,a=o*(1-u),s&&(d=Math.round(d),a=Math.round(a));var m=mn(h).map(function(y){return d+o*y});return n(p?m.reverse():m)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,f()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(s=!!h,f()):s},t.padding=function(h){return arguments.length?(u=Math.min(1,l=+h),f()):u},t.paddingInner=function(h){return arguments.length?(u=Math.min(1,h),f()):u},t.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},t.align=function(h){return arguments.length?(c=Math.max(0,Math.min(1,h)),f()):c},t.copy=function(){return rh(e(),[r,i]).round(s).paddingInner(u).paddingOuter(l).align(c)},be.apply(f(),arguments)}function ob(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return ob(e())},t}function ih(){return ob(rh.apply(null,arguments).paddingInner(1))}function s9(t){return function(){return t}}function su(t){return+t}var ab=[0,1];function te(t){return t}function oh(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:s9(isNaN(e)?NaN:.5)}function u9(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function l9(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=oh(i,r),o=n(a,o)):(r=oh(r,i),o=n(o,a)),function(s){return o(r(s))}}function c9(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=oh(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=On(t,s,1,r)-1;return o[u](i[u](s))}}function ko(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function uu(){var t=ab,e=ab,n=Ze,r,i,o,a=te,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==te&&(a=u9(t[0],t[h-1])),s=h>2?c9:l9,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),ge)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,su),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=Ka,c()},f.clamp=function(h){return arguments.length?(a=h?!0:te,c()):a!==te},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function ah(){return uu()(te,te)}function sb(t,e,n,r){var i=Ma(t,e,n),o;switch(r=ti(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=b1(i,a))&&(r.precision=o),Kc(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=x1(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=y1(i))&&(r.precision=o-(r.type==="%")*2);break}}return uo(r)}function $n(t){var e=t.domain;return t.ticks=function(n){var r=e();return zn(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return sb(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=Yn(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function Ro(){var t=ah();return t.copy=function(){return ko(t,Ro())},be.apply(t,arguments),$n(t)}function ub(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,su),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return ub(t).unknown(e)},t=arguments.length?Array.from(t,su):[0,1],$n(n)}function lb(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),t[n]=e.floor(i),t[r]=e.ceil(o),t}function cb(t){return Math.log(t)}function fb(t){return Math.exp(t)}function f9(t){return-Math.log(-t)}function h9(t){return-Math.exp(-t)}function p9(t){return isFinite(t)?+("1e"+t):t<0?0:t}function d9(t){return t===10?p9:t===Math.E?Math.exp:e=>Math.pow(t,e)}function g9(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function hb(t){return(e,n)=>-t(-e,n)}function sh(t){const e=t(cb,fb),n=e.domain;let r=10,i,o;function a(){return i=g9(r),o=d9(r),n()[0]<0?(i=hb(i),o=hb(o),t(f9,h9)):t(cb,fb),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let h=i(l),p=i(c),d,g;const m=s==null?10:+s;let y=[];if(!(r%1)&&p-h<m){if(h=Math.floor(h),p=Math.ceil(p),l>0){for(;h<=p;++h)for(d=1;d<r;++d)if(g=h<0?d/o(-h):d*o(h),!(g<l)){if(g>c)break;y.push(g)}}else for(;h<=p;++h)for(d=r-1;d>=1;--d)if(g=h>0?d/o(-h):d*o(h),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=zn(l,c,m))}else y=zn(h,p,Math.min(p-h,m)).map(o);return f?y.reverse():y},e.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=ti(u)).precision==null&&(u.trim=!0),u=uo(u)),s===1/0)return u;const l=Math.max(1,r*s/e.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=l?u(c):""}},e.nice=()=>n(lb(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function pb(){const t=sh(uu()).domain([1,10]);return t.copy=()=>ko(t,pb()).base(t.base()),be.apply(t,arguments),t}function db(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function gb(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function uh(t){var e=1,n=t(db(e),gb(e));return n.constant=function(r){return arguments.length?t(db(e=+r),gb(e)):e},$n(n)}function mb(){var t=uh(uu());return t.copy=function(){return ko(t,mb()).constant(t.constant())},be.apply(t,arguments)}function yb(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function m9(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function y9(t){return t<0?-t*t:t*t}function lh(t){var e=t(te,te),n=1;function r(){return n===1?t(te,te):n===.5?t(m9,y9):t(yb(n),yb(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},$n(e)}function li(){var t=lh(uu());return t.copy=function(){return ko(t,li()).exponent(t.exponent())},be.apply(t,arguments),t}function b9(){return li.apply(null,arguments).exponent(.5)}function bb(t){return Math.sign(t)*t*t}function x9(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function xb(){var t=ah(),e=[0,1],n=!1,r;function i(o){var a=x9(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(bb(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,su)).map(bb)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return xb(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},be.apply(i,arguments),$n(i)}function vb(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a<s;)n[a-1]=Kg(t,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:e[On(n,a)]}return o.invertExtent=function(a){var s=e.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:t[0],s<n.length?n[s]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let s of a)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(_t),i()},o.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return vb().domain(t).range(e).unknown(r)},be.apply(o,arguments)}function _b(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[On(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return _b().domain([t,e]).range(i).unknown(o)},be.apply($n(a),arguments)}function wb(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[On(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return wb().domain(t).range(e).unknown(n)},be.apply(i,arguments)}const ch=new Date,fh=new Date;function Mt(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const u=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return u;let l;do u.push(l=new Date(+o)),e(o,s),t(o);while(l<o&&o<a);return u},i.filter=o=>Mt(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(ch.setTime(+o),fh.setTime(+a),t(ch),t(fh),Math.floor(n(ch,fh))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const ci=Mt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);ci.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Mt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):ci);const $b=ci.range,an=1e3,xe=an*60,sn=xe*60,un=sn*24,hh=un*7,Sb=un*30,ph=un*365,ln=Mt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*an)},(t,e)=>(e-t)/an,t=>t.getUTCSeconds()),Ab=ln.range,lu=Mt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*an)},(t,e)=>{t.setTime(+t+e*xe)},(t,e)=>(e-t)/xe,t=>t.getMinutes()),v9=lu.range,cu=Mt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*xe)},(t,e)=>(e-t)/xe,t=>t.getUTCMinutes()),_9=cu.range,fu=Mt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*an-t.getMinutes()*xe)},(t,e)=>{t.setTime(+t+e*sn)},(t,e)=>(e-t)/sn,t=>t.getHours()),w9=fu.range,hu=Mt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*sn)},(t,e)=>(e-t)/sn,t=>t.getUTCHours()),$9=hu.range,fi=Mt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*xe)/un,t=>t.getDate()-1),S9=fi.range,Eo=Mt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/un,t=>t.getUTCDate()-1),A9=Eo.range,dh=Mt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/un,t=>Math.floor(t/un)),T9=dh.range;function lr(t){return Mt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*xe)/hh)}const hi=lr(0),Io=lr(1),Tb=lr(2),Pb=lr(3),cr=lr(4),Mb=lr(5),Db=lr(6),Cb=hi.range,P9=Io.range,M9=Tb.range,D9=Pb.range,C9=cr.range,L9=Mb.range,k9=Db.range;function fr(t){return Mt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/hh)}const pi=fr(0),No=fr(1),Lb=fr(2),kb=fr(3),hr=fr(4),Rb=fr(5),Eb=fr(6),Ib=pi.range,R9=No.range,E9=Lb.range,I9=kb.range,N9=hr.range,B9=Rb.range,F9=Eb.range,pu=Mt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),O9=pu.range,du=Mt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),G9=du.range,He=Mt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());He.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Mt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});const z9=He.range,Xe=Mt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Xe.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Mt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});const Y9=Xe.range;function Nb(t,e,n,r,i,o){const a=[[ln,1,an],[ln,5,5*an],[ln,15,15*an],[ln,30,30*an],[o,1,xe],[o,5,5*xe],[o,15,15*xe],[o,30,30*xe],[i,1,sn],[i,3,3*sn],[i,6,6*sn],[i,12,12*sn],[r,1,un],[r,2,2*un],[n,1,hh],[e,1,Sb],[e,3,3*Sb],[t,1,ph]];function s(l,c,f){const h=c<l;h&&([l,c]=[c,l]);const p=f&&typeof f.range=="function"?f:u(l,c,f),d=p?p.range(l,+c+1):[];return h?d.reverse():d}function u(l,c,f){const h=Math.abs(c-l)/f,p=Sa(([,,m])=>m).right(a,h);if(p===a.length)return t.every(Ma(l/ph,c/ph,f));if(p===0)return ci.every(Math.max(Ma(l,c,f),1));const[d,g]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return d.every(g)}return[s,u]}const[Bb,Fb]=Nb(Xe,du,pi,dh,hu,cu),[Ob,Gb]=Nb(He,pu,hi,fi,fu,lu);function gh(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function mh(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Bo(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function zb(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=Fo(i),c=Oo(i),f=Fo(o),h=Oo(o),p=Fo(a),d=Oo(a),g=Fo(s),m=Oo(s),y=Fo(u),b=Oo(u),v={a:G,A:O,b:E,B:k,c:null,d:jb,e:jb,f:fL,g:_L,G:$L,H:uL,I:lL,j:cL,L:Vb,m:hL,M:pL,p:C,q:F,Q:tx,s:ex,S:dL,u:gL,U:mL,V:yL,w:bL,W:xL,x:null,X:null,y:vL,Y:wL,Z:SL,"%":Jb},x={a:X,A:Q,b:z,B:Z,c:null,d:Zb,e:Zb,f:ML,g:FL,G:GL,H:AL,I:TL,j:PL,L:Kb,m:DL,M:CL,p:Y,q,Q:tx,s:ex,S:LL,u:kL,U:RL,V:EL,w:IL,W:NL,x:null,X:null,y:BL,Y:OL,Z:zL,"%":Jb},S={a:P,A:_,b:N,B:D,c:A,d:Hb,e:Hb,f:iL,g:Wb,G:Ub,H:Xb,I:Xb,j:tL,L:rL,m:J9,M:eL,p:w,q:Q9,Q:aL,s:sL,S:nL,u:j9,U:V9,V:q9,w:X9,W:Z9,x:L,X:M,y:Wb,Y:Ub,Z:K9,"%":oL};v.x=$(n,v),v.X=$(r,v),v.c=$(e,v),x.x=$(n,x),x.X=$(r,x),x.c=$(e,x);function $(j,rt){return function(ut){var H=[],mt=-1,ht=0,Ut=j.length,ee,st,Pt;for(ut instanceof Date||(ut=new Date(+ut));++mt<Ut;)j.charCodeAt(mt)===37&&(H.push(j.slice(ht,mt)),(st=Yb[ee=j.charAt(++mt)])!=null?ee=j.charAt(++mt):st=ee==="e"?" ":"0",(Pt=rt[ee])&&(ee=Pt(ut,st)),H.push(ee),ht=mt+1);return H.push(j.slice(ht,mt)),H.join("")}}function R(j,rt){return function(ut){var H=Bo(1900,void 0,1),mt=T(H,j,ut+="",0),ht,Ut;if(mt!=ut.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(rt&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(ht=mh(Bo(H.y,0,1)),Ut=ht.getUTCDay(),ht=Ut>4||Ut===0?No.ceil(ht):No(ht),ht=Eo.offset(ht,(H.V-1)*7),H.y=ht.getUTCFullYear(),H.m=ht.getUTCMonth(),H.d=ht.getUTCDate()+(H.w+6)%7):(ht=gh(Bo(H.y,0,1)),Ut=ht.getDay(),ht=Ut>4||Ut===0?Io.ceil(ht):Io(ht),ht=fi.offset(ht,(H.V-1)*7),H.y=ht.getFullYear(),H.m=ht.getMonth(),H.d=ht.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),Ut="Z"in H?mh(Bo(H.y,0,1)).getUTCDay():gh(Bo(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(Ut+5)%7:H.w+H.U*7-(Ut+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,mh(H)):gh(H)}}function T(j,rt,ut,H){for(var mt=0,ht=rt.length,Ut=ut.length,ee,st;mt<ht;){if(H>=Ut)return-1;if(ee=rt.charCodeAt(mt++),ee===37){if(ee=rt.charAt(mt++),st=S[ee in Yb?rt.charAt(mt++):ee],!st||(H=st(j,ut,H))<0)return-1}else if(ee!=ut.charCodeAt(H++))return-1}return H}function w(j,rt,ut){var H=l.exec(rt.slice(ut));return H?(j.p=c.get(H[0].toLowerCase()),ut+H[0].length):-1}function P(j,rt,ut){var H=p.exec(rt.slice(ut));return H?(j.w=d.get(H[0].toLowerCase()),ut+H[0].length):-1}function _(j,rt,ut){var H=f.exec(rt.slice(ut));return H?(j.w=h.get(H[0].toLowerCase()),ut+H[0].length):-1}function N(j,rt,ut){var H=y.exec(rt.slice(ut));return H?(j.m=b.get(H[0].toLowerCase()),ut+H[0].length):-1}function D(j,rt,ut){var H=g.exec(rt.slice(ut));return H?(j.m=m.get(H[0].toLowerCase()),ut+H[0].length):-1}function A(j,rt,ut){return T(j,e,rt,ut)}function L(j,rt,ut){return T(j,n,rt,ut)}function M(j,rt,ut){return T(j,r,rt,ut)}function G(j){return a[j.getDay()]}function O(j){return o[j.getDay()]}function E(j){return u[j.getMonth()]}function k(j){return s[j.getMonth()]}function C(j){return i[+(j.getHours()>=12)]}function F(j){return 1+~~(j.getMonth()/3)}function X(j){return a[j.getUTCDay()]}function Q(j){return o[j.getUTCDay()]}function z(j){return u[j.getUTCMonth()]}function Z(j){return s[j.getUTCMonth()]}function Y(j){return i[+(j.getUTCHours()>=12)]}function q(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var rt=$(j+="",v);return rt.toString=function(){return j},rt},parse:function(j){var rt=R(j+="",!1);return rt.toString=function(){return j},rt},utcFormat:function(j){var rt=$(j+="",x);return rt.toString=function(){return j},rt},utcParse:function(j){var rt=R(j+="",!0);return rt.toString=function(){return j},rt}}}var Yb={"-":"",_:" ",0:"0"},Nt=/^\s*\d+/,U9=/^%/,W9=/[\\^$*+?|[\]().{}]/g;function gt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function H9(t){return t.replace(W9,"\\$&")}function Fo(t){return new RegExp("^(?:"+t.map(H9).join("|")+")","i")}function Oo(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function X9(t,e,n){var r=Nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function j9(t,e,n){var r=Nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function V9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function q9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Z9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Ub(t,e,n){var r=Nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Wb(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function K9(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Q9(t,e,n){var r=Nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function J9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Hb(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function tL(t,e,n){var r=Nt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Xb(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function eL(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function nL(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function rL(t,e,n){var r=Nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function iL(t,e,n){var r=Nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function oL(t,e,n){var r=U9.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function aL(t,e,n){var r=Nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function sL(t,e,n){var r=Nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function jb(t,e){return gt(t.getDate(),e,2)}function uL(t,e){return gt(t.getHours(),e,2)}function lL(t,e){return gt(t.getHours()%12||12,e,2)}function cL(t,e){return gt(1+fi.count(He(t),t),e,3)}function Vb(t,e){return gt(t.getMilliseconds(),e,3)}function fL(t,e){return Vb(t,e)+"000"}function hL(t,e){return gt(t.getMonth()+1,e,2)}function pL(t,e){return gt(t.getMinutes(),e,2)}function dL(t,e){return gt(t.getSeconds(),e,2)}function gL(t){var e=t.getDay();return e===0?7:e}function mL(t,e){return gt(hi.count(He(t)-1,t),e,2)}function qb(t){var e=t.getDay();return e>=4||e===0?cr(t):cr.ceil(t)}function yL(t,e){return t=qb(t),gt(cr.count(He(t),t)+(He(t).getDay()===4),e,2)}function bL(t){return t.getDay()}function xL(t,e){return gt(Io.count(He(t)-1,t),e,2)}function vL(t,e){return gt(t.getFullYear()%100,e,2)}function _L(t,e){return t=qb(t),gt(t.getFullYear()%100,e,2)}function wL(t,e){return gt(t.getFullYear()%1e4,e,4)}function $L(t,e){var n=t.getDay();return t=n>=4||n===0?cr(t):cr.ceil(t),gt(t.getFullYear()%1e4,e,4)}function SL(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gt(e/60|0,"0",2)+gt(e%60,"0",2)}function Zb(t,e){return gt(t.getUTCDate(),e,2)}function AL(t,e){return gt(t.getUTCHours(),e,2)}function TL(t,e){return gt(t.getUTCHours()%12||12,e,2)}function PL(t,e){return gt(1+Eo.count(Xe(t),t),e,3)}function Kb(t,e){return gt(t.getUTCMilliseconds(),e,3)}function ML(t,e){return Kb(t,e)+"000"}function DL(t,e){return gt(t.getUTCMonth()+1,e,2)}function CL(t,e){return gt(t.getUTCMinutes(),e,2)}function LL(t,e){return gt(t.getUTCSeconds(),e,2)}function kL(t){var e=t.getUTCDay();return e===0?7:e}function RL(t,e){return gt(pi.count(Xe(t)-1,t),e,2)}function Qb(t){var e=t.getUTCDay();return e>=4||e===0?hr(t):hr.ceil(t)}function EL(t,e){return t=Qb(t),gt(hr.count(Xe(t),t)+(Xe(t).getUTCDay()===4),e,2)}function IL(t){return t.getUTCDay()}function NL(t,e){return gt(No.count(Xe(t)-1,t),e,2)}function BL(t,e){return gt(t.getUTCFullYear()%100,e,2)}function FL(t,e){return t=Qb(t),gt(t.getUTCFullYear()%100,e,2)}function OL(t,e){return gt(t.getUTCFullYear()%1e4,e,4)}function GL(t,e){var n=t.getUTCDay();return t=n>=4||n===0?hr(t):hr.ceil(t),gt(t.getUTCFullYear()%1e4,e,4)}function zL(){return"+0000"}function Jb(){return"%"}function tx(t){return+t}function ex(t){return Math.floor(+t/1e3)}var di,yh,nx,gu,bh;rx({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function rx(t){return di=zb(t),yh=di.format,nx=di.parse,gu=di.utcFormat,bh=di.utcParse,di}var ix="%Y-%m-%dT%H:%M:%S.%LZ";function YL(t){return t.toISOString()}var UL=Date.prototype.toISOString?YL:gu(ix);const WL=UL;function HL(t){var e=new Date(t);return isNaN(e)?null:e}var XL=+new Date("2000-01-01T00:00:00.000Z")?HL:bh(ix);const jL=XL;function VL(t){return new Date(t)}function qL(t){return t instanceof Date?+t:+new Date(+t)}function xh(t,e,n,r,i,o,a,s,u,l){var c=ah(),f=c.invert,h=c.domain,p=l(".%L"),d=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function S($){return(u($)<$?p:s($)<$?d:a($)<$?g:o($)<$?m:r($)<$?i($)<$?y:b:n($)<$?v:x)($)}return c.invert=function($){return new Date(f($))},c.domain=function($){return arguments.length?h(Array.from($,qL)):h().map(VL)},c.ticks=function($){var R=h();return t(R[0],R[R.length-1],$??10)},c.tickFormat=function($,R){return R==null?S:l(R)},c.nice=function($){var R=h();return(!$||typeof $.range!="function")&&($=e(R[0],R[R.length-1],$??10)),$?h(lb(R,$)):c},c.copy=function(){return ko(c,xh(t,e,n,r,i,o,a,s,u,l))},c}function ZL(){return be.apply(xh(Ob,Gb,He,pu,hi,fi,fu,lu,ln,yh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function KL(){return be.apply(xh(Bb,Fb,Xe,du,pi,Eo,hu,cu,ln,gu).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function mu(){var t=0,e=1,n,r,i,o,a=te,s=!1,u;function l(f){return f==null||isNaN(f=+f)?u:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),l):[t,e]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(a=f,l):a};function c(f){return function(h){var p,d;return arguments.length?([p,d]=h,a=f(p,d),l):[a(0),a(1)]}}return l.range=c(Ze),l.rangeRound=c(Ka),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),l}}function Sn(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ox(){var t=$n(mu()(te));return t.copy=function(){return Sn(t,ox())},on.apply(t,arguments)}function ax(){var t=sh(mu()).domain([1,10]);return t.copy=function(){return Sn(t,ax()).base(t.base())},on.apply(t,arguments)}function sx(){var t=uh(mu());return t.copy=function(){return Sn(t,sx()).constant(t.constant())},on.apply(t,arguments)}function vh(){var t=lh(mu());return t.copy=function(){return Sn(t,vh()).exponent(t.exponent())},on.apply(t,arguments)}function QL(){return vh.apply(null,arguments).exponent(.5)}function ux(){var t=[],e=te;function n(r){if(r!=null&&!isNaN(r=+r))return e((On(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(_t),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Gi(t,o/r))},n.copy=function(){return ux(e).domain(t)},on.apply(n,arguments)}function yu(){var t=0,e=.5,n=1,r=1,i,o,a,s,u,l=te,c,f=!1,h;function p(g){return isNaN(g=+g)?h:(g=.5+((g=+c(g))-o)*(r*g<r*o?s:u),l(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([t,e,n]=g,i=c(t=+t),o=c(e=+e),a=c(n=+n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,p):[t,e,n]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(l=g,p):l};function d(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=lm(g,[y,b,v]),p):[l(0),l(.5),l(1)]}}return p.range=d(Ze),p.rangeRound=d(Ka),p.unknown=function(g){return arguments.length?(h=g,p):h},function(g){return c=g,i=g(t),o=g(e),a=g(n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,p}}function lx(){var t=$n(yu()(te));return t.copy=function(){return Sn(t,lx())},on.apply(t,arguments)}function cx(){var t=sh(yu()).domain([.1,1,10]);return t.copy=function(){return Sn(t,cx()).base(t.base())},on.apply(t,arguments)}function fx(){var t=uh(yu());return t.copy=function(){return Sn(t,fx()).constant(t.constant())},on.apply(t,arguments)}function _h(){var t=lh(yu());return t.copy=function(){return Sn(t,_h()).exponent(t.exponent())},on.apply(t,arguments)}function JL(){return _h.apply(null,arguments).exponent(.5)}function ct(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}const tk=ct("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ek=ct("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),nk=ct("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),rk=ct("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),ik=ct("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),ok=ct("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),ak=ct("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),sk=ct("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),uk=ct("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),lk=ct("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),ck=ct("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),xt=t=>V0(t[t.length-1]);var hx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(ct);const fk=xt(hx);var px=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(ct);const hk=xt(px);var dx=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(ct);const pk=xt(dx);var gx=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(ct);const dk=xt(gx);var mx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(ct);const gk=xt(mx);var yx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(ct);const mk=xt(yx);var bx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(ct);const yk=xt(bx);var xx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(ct);const bk=xt(xx);var vx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(ct);const xk=xt(vx);var _x=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(ct);const vk=xt(_x);var wx=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(ct);const _k=xt(wx);var $x=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(ct);const wk=xt($x);var Sx=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(ct);const $k=xt(Sx);var Ax=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(ct);const Sk=xt(Ax);var Tx=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(ct);const Ak=xt(Tx);var Px=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(ct);const Tk=xt(Px);var Mx=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(ct);const Pk=xt(Mx);var Dx=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(ct);const Mk=xt(Dx);var Cx=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(ct);const Dk=xt(Cx);var Lx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(ct);const Ck=xt(Lx);var kx=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(ct);const Lk=xt(kx);var Rx=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(ct);const kk=xt(Rx);var Ex=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(ct);const Rk=xt(Ex);var Ix=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(ct);const Ek=xt(Ix);var Nx=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(ct);const Ik=xt(Nx);var Bx=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(ct);const Nk=xt(Bx);var Fx=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(ct);const Bk=xt(Fx);function Fk(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const Ok=Ja(Me(300,.5,0),Me(-240,.5,1));var Gk=Ja(Me(-100,.75,.35),Me(80,1.5,.8)),zk=Ja(Me(260,.75,.35),Me(80,1.5,.8)),bu=Me();function Yk(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return bu.h=360*t-100,bu.s=1.5-1.5*e,bu.l=.8-.9*e,bu+""}var xu=Yr(),Uk=Math.PI/3,Wk=Math.PI*2/3;function Hk(t){var e;return t=(.5-t)*Math.PI,xu.r=255*(e=Math.sin(t))*e,xu.g=255*(e=Math.sin(t+Uk))*e,xu.b=255*(e=Math.sin(t+Wk))*e,xu+""}function Xk(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function vu(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const jk=vu(ct("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Vk=vu(ct("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qk=vu(ct("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Zk=vu(ct("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function lt(t){return function(){return t}}const Ox=Math.abs,zt=Math.atan2,cn=Math.cos,Kk=Math.max,gi=Math.min,ae=Math.sin,vt=Math.sqrt,Yt=1e-12,An=Math.PI,_u=An/2,Tn=2*An;function Qk(t){return t>1?0:t<-1?An:Math.acos(t)}function Gx(t){return t>=1?_u:t<=-1?-_u:Math.asin(t)}function Go(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new io(e)}function Jk(t){return t.innerRadius}function tR(t){return t.outerRadius}function eR(t){return t.startAngle}function nR(t){return t.endAngle}function rR(t){return t&&t.padAngle}function iR(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,f=s-o,h=f*u-c*l;if(!(h*h<Yt))return h=(c*(e-o)-f*(t-i))/h,[t+h*u,e+h*l]}function wu(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/vt(s*s+u*u),c=l*u,f=-l*s,h=t+c,p=e+f,d=n+c,g=r+f,m=(h+d)/2,y=(p+g)/2,b=d-h,v=g-p,x=b*b+v*v,S=i-o,$=h*g-d*p,R=(v<0?-1:1)*vt(Kk(0,S*S*x-$*$)),T=($*v-b*R)/x,w=(-$*b-v*R)/x,P=($*v+b*R)/x,_=(-$*b+v*R)/x,N=T-m,D=w-y,A=P-m,L=_-y;return N*N+D*D>A*A+L*L&&(T=P,w=_),{cx:T,cy:w,x01:-c,y01:-f,x11:T*(i/S-1),y11:w*(i/S-1)}}function $u(){var t=Jk,e=tR,n=lt(0),r=null,i=eR,o=nR,a=rR,s=null,u=Go(l);function l(){var c,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-_u,g=o.apply(this,arguments)-_u,m=Ox(g-d),y=g>d;if(s||(s=c=u()),p<h&&(f=p,p=h,h=f),!(p>Yt))s.moveTo(0,0);else if(m>Tn-Yt)s.moveTo(p*cn(d),p*ae(d)),s.arc(0,0,p,d,g,!y),h>Yt&&(s.moveTo(h*cn(g),h*ae(g)),s.arc(0,0,h,g,d,y));else{var b=d,v=g,x=d,S=g,$=m,R=m,T=a.apply(this,arguments)/2,w=T>Yt&&(r?+r.apply(this,arguments):vt(h*h+p*p)),P=gi(Ox(p-h)/2,+n.apply(this,arguments)),_=P,N=P,D,A;if(w>Yt){var L=Gx(w/h*ae(T)),M=Gx(w/p*ae(T));($-=L*2)>Yt?(L*=y?1:-1,x+=L,S-=L):($=0,x=S=(d+g)/2),(R-=M*2)>Yt?(M*=y?1:-1,b+=M,v-=M):(R=0,b=v=(d+g)/2)}var G=p*cn(b),O=p*ae(b),E=h*cn(S),k=h*ae(S);if(P>Yt){var C=p*cn(v),F=p*ae(v),X=h*cn(x),Q=h*ae(x),z;if(m<An)if(z=iR(G,O,X,Q,C,F,E,k)){var Z=G-z[0],Y=O-z[1],q=C-z[0],j=F-z[1],rt=1/ae(Qk((Z*q+Y*j)/(vt(Z*Z+Y*Y)*vt(q*q+j*j)))/2),ut=vt(z[0]*z[0]+z[1]*z[1]);_=gi(P,(h-ut)/(rt-1)),N=gi(P,(p-ut)/(rt+1))}else _=N=0}R>Yt?N>Yt?(D=wu(X,Q,G,O,p,N,y),A=wu(C,F,E,k,p,N,y),s.moveTo(D.cx+D.x01,D.cy+D.y01),N<P?s.arc(D.cx,D.cy,N,zt(D.y01,D.x01),zt(A.y01,A.x01),!y):(s.arc(D.cx,D.cy,N,zt(D.y01,D.x01),zt(D.y11,D.x11),!y),s.arc(0,0,p,zt(D.cy+D.y11,D.cx+D.x11),zt(A.cy+A.y11,A.cx+A.x11),!y),s.arc(A.cx,A.cy,N,zt(A.y11,A.x11),zt(A.y01,A.x01),!y))):(s.moveTo(G,O),s.arc(0,0,p,b,v,!y)):s.moveTo(G,O),!(h>Yt)||!($>Yt)?s.lineTo(E,k):_>Yt?(D=wu(E,k,C,F,h,-_,y),A=wu(G,O,X,Q,h,-_,y),s.lineTo(D.cx+D.x01,D.cy+D.y01),_<P?s.arc(D.cx,D.cy,_,zt(D.y01,D.x01),zt(A.y01,A.x01),!y):(s.arc(D.cx,D.cy,_,zt(D.y01,D.x01),zt(D.y11,D.x11),!y),s.arc(0,0,h,zt(D.cy+D.y11,D.cx+D.x11),zt(A.cy+A.y11,A.cx+A.x11),y),s.arc(A.cx,A.cy,_,zt(A.y11,A.x11),zt(A.y01,A.x01),!y))):s.arc(0,0,h,S,x,y)}if(s.closePath(),c)return s=null,c+""||null}return l.centroid=function(){var c=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-An/2;return[cn(f)*c,ae(f)*c]},l.innerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:lt(+c),l):t},l.outerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:lt(+c),l):e},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:lt(+c),l):n},l.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:lt(+c),l):r},l.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:lt(+c),l):i},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:lt(+c),l):o},l.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:lt(+c),l):a},l.context=function(c){return arguments.length?(s=c??null,l):s},l}var oR=Array.prototype.slice;function Su(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function zx(t){this._context=t}zx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Au(t){return new zx(t)}function wh(t){return t[0]}function $h(t){return t[1]}function Tu(t,e){var n=lt(!0),r=null,i=Au,o=null,a=Go(s);t=typeof t=="function"?t:t===void 0?wh:lt(t),e=typeof e=="function"?e:e===void 0?$h:lt(e);function s(u){var l,c=(u=Su(u)).length,f,h=!1,p;for(r==null&&(o=i(p=a())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(f,l,u),+e(f,l,u));if(p)return o=null,p+""||null}return s.x=function(u){return arguments.length?(t=typeof u=="function"?u:lt(+u),s):t},s.y=function(u){return arguments.length?(e=typeof u=="function"?u:lt(+u),s):e},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:lt(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),s):r},s}function Sh(t,e,n){var r=null,i=lt(!0),o=null,a=Au,s=null,u=Go(l);t=typeof t=="function"?t:t===void 0?wh:lt(+t),e=typeof e=="function"?e:lt(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?$h:lt(+n);function l(f){var h,p,d,g=(f=Su(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(o==null&&(s=a(b=u())),h=0;h<=g;++h){if(!(h<g&&i(m=f[h],h,f))===y)if(y=!y)p=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=h-1;d>=p;--d)s.point(v[d],x[d]);s.lineEnd(),s.areaEnd()}y&&(v[h]=+t(m,h,f),x[h]=+e(m,h,f),s.point(r?+r(m,h,f):v[h],n?+n(m,h,f):x[h]))}if(b)return s=null,b+""||null}function c(){return Tu().defined(i).curve(a).context(o)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),r=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),l):t},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:lt(+f),l):r},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),n=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),l):e},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:lt(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(n)},l.lineX1=function(){return c().x(r).y(e)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:lt(!!f),l):i},l.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),l):a},l.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),l):o},l}function aR(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function sR(t){return t}function Yx(){var t=sR,e=aR,n=null,r=lt(0),i=lt(Tn),o=lt(0);function a(s){var u,l=(s=Su(s)).length,c,f,h=0,p=new Array(l),d=new Array(l),g=+r.apply(this,arguments),m=Math.min(Tn,Math.max(-Tn,i.apply(this,arguments)-g)),y,b=Math.min(Math.abs(m)/l,o.apply(this,arguments)),v=b*(m<0?-1:1),x;for(u=0;u<l;++u)(x=d[p[u]=u]=+t(s[u],u,s))>0&&(h+=x);for(e!=null?p.sort(function(S,$){return e(d[S],d[$])}):n!=null&&p.sort(function(S,$){return n(s[S],s[$])}),u=0,f=h?(m-l*v)/h:0;u<l;++u,g=y)c=p[u],x=d[c],y=g+(x>0?x*f:0)+v,d[c]={data:s[c],index:u,value:x,startAngle:g,endAngle:y,padAngle:b};return d}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:lt(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,n=null,a):e},a.sort=function(s){return arguments.length?(n=s,e=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:lt(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:lt(+s),a):o},a}var Ux=Ah(Au);function Wx(t){this._curve=t}Wx.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function Ah(t){function e(n){return new Wx(t(n))}return e._curve=t,e}function zo(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Ah(n)):e()._curve},t}function Hx(){return zo(Tu().curve(Ux))}function Xx(){var t=Sh().curve(Ux),e=t.curve,n=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 zo(n())},delete t.lineX0,t.lineEndAngle=function(){return zo(r())},delete t.lineX1,t.lineInnerRadius=function(){return zo(i())},delete t.lineY0,t.lineOuterRadius=function(){return zo(o())},delete t.lineY1,t.curve=function(a){return arguments.length?e(Ah(a)):e()._curve},t}function Yo(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}class jx{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}class uR{constructor(e){this._context=e}lineStart(){this._point=0}lineEnd(){}point(e,n){if(e=+e,n=+n,this._point===0)this._point=1;else{const r=Yo(this._x0,this._y0),i=Yo(this._x0,this._y0=(this._y0+n)/2),o=Yo(e,this._y0),a=Yo(e,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=e,this._y0=n}}function Vx(t){return new jx(t,!0)}function qx(t){return new jx(t,!1)}function lR(t){return new uR(t)}function cR(t){return t.source}function fR(t){return t.target}function Pu(t){let e=cR,n=fR,r=wh,i=$h,o=null,a=null,s=Go(u);function u(){let l;const c=oR.call(arguments),f=e.apply(this,c),h=n.apply(this,c);if(o==null&&(a=t(l=s())),a.lineStart(),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=h,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),l)return a=null,l+""||null}return u.source=function(l){return arguments.length?(e=l,u):e},u.target=function(l){return arguments.length?(n=l,u):n},u.x=function(l){return arguments.length?(r=typeof l=="function"?l:lt(+l),u):r},u.y=function(l){return arguments.length?(i=typeof l=="function"?l:lt(+l),u):i},u.context=function(l){return arguments.length?(l==null?o=a=null:a=t(o=l),u):o},u}function hR(){return Pu(Vx)}function pR(){return Pu(qx)}function dR(){const t=Pu(lR);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const gR=vt(3),Zx={draw(t,e){const n=vt(e+gi(e/28,.75))*.59436,r=n/2,i=r*gR;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},Mu={draw(t,e){const n=vt(e/An);t.moveTo(n,0),t.arc(0,0,n,0,Tn)}},Kx={draw(t,e){const n=vt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Qx=vt(1/3),mR=Qx*2,Jx={draw(t,e){const n=vt(e/mR),r=n*Qx;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},tv={draw(t,e){const n=vt(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},ev={draw(t,e){const n=vt(e-gi(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},nv={draw(t,e){const n=vt(e),r=-n/2;t.rect(r,r,n,n)}},rv={draw(t,e){const n=vt(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},yR=.8908130915292852,iv=ae(An/10)/ae(7*An/10),bR=ae(Tn/10)*iv,xR=-cn(Tn/10)*iv,ov={draw(t,e){const n=vt(e*yR),r=bR*n,i=xR*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=Tn*o/5,s=cn(a),u=ae(a);t.lineTo(u*n,-s*n),t.lineTo(s*r-u*i,u*r+s*i)}t.closePath()}},Th=vt(3),av={draw(t,e){const n=-vt(e/(Th*3));t.moveTo(0,n*2),t.lineTo(-Th*n,-n),t.lineTo(Th*n,-n),t.closePath()}},vR=vt(3),sv={draw(t,e){const n=vt(e)*.6824,r=n/2,i=n*vR/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},ve=-.5,_e=vt(3)/2,Ph=1/vt(12),_R=(Ph/2+1)*3,uv={draw(t,e){const n=vt(e/_R),r=n/2,i=n*Ph,o=r,a=n*Ph+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(ve*r-_e*i,_e*r+ve*i),t.lineTo(ve*o-_e*a,_e*o+ve*a),t.lineTo(ve*s-_e*u,_e*s+ve*u),t.lineTo(ve*r+_e*i,ve*i-_e*r),t.lineTo(ve*o+_e*a,ve*a-_e*o),t.lineTo(ve*s+_e*u,ve*u-_e*s),t.closePath()}},Mh={draw(t,e){const n=vt(e-gi(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},lv=[Mu,Kx,Jx,nv,ov,av,uv],wR=[Mu,ev,Mh,sv,Zx,rv,tv];function $R(t,e){let n=null,r=Go(i);t=typeof t=="function"?t:lt(t||Mu),e=typeof e=="function"?e:lt(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:lt(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Pn(){}function Du(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Cu(t){this._context=t}Cu.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:Du(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Du(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function SR(t){return new Cu(t)}function cv(t){this._context=t}cv.prototype={areaStart:Pn,areaEnd:Pn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Du(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function AR(t){return new cv(t)}function fv(t){this._context=t}fv.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Du(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function TR(t){return new fv(t)}function hv(t,e){this._basis=new Cu(t),this._beta=e}hv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,a=e[n]-i,s=-1,u;++s<=n;)u=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+u*o),this._beta*e[s]+(1-this._beta)*(i+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const PR=function t(e){function n(r){return e===1?new Cu(r):new hv(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function Lu(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Dh(t,e){this._context=t,this._k=(1-e)/6}Dh.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:Lu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Lu(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const MR=function t(e){function n(r){return new Dh(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Ch(t,e){this._context=t,this._k=(1-e)/6}Ch.prototype={areaStart:Pn,areaEnd:Pn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Lu(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const DR=function t(e){function n(r){return new Ch(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Lh(t,e){this._context=t,this._k=(1-e)/6}Lh.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Lu(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const CR=function t(e){function n(r){return new Lh(r,e)}return n.tension=function(r){return t(+r)},n}(0);function kh(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Yt){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Yt){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function pv(t,e){this._context=t,this._alpha=e}pv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:kh(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const LR=function t(e){function n(r){return e?new pv(r,e):new Dh(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function dv(t,e){this._context=t,this._alpha=e}dv.prototype={areaStart:Pn,areaEnd:Pn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:kh(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const kR=function t(e){function n(r){return e?new dv(r,e):new Ch(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function gv(t,e){this._context=t,this._alpha=e}gv.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kh(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const RR=function t(e){function n(r){return e?new gv(r,e):new Lh(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function mv(t){this._context=t}mv.prototype={areaStart:Pn,areaEnd:Pn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function ER(t){return new mv(t)}function yv(t){return t<0?-1:1}function bv(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(yv(o)+yv(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function xv(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Rh(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function ku(t){this._context=t}ku.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Rh(this,this._t0,xv(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Rh(this,xv(this,n=bv(this,t,e)),n);break;default:Rh(this,this._t0,n=bv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function vv(t){this._context=new _v(t)}(vv.prototype=Object.create(ku.prototype)).point=function(t,e){ku.prototype.point.call(this,e,t)};function _v(t){this._context=t}_v.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function IR(t){return new ku(t)}function NR(t){return new vv(t)}function wv(t){this._context=t}wv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=$v(t),i=$v(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function $v(t){var e,n=t.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/o[e-1],o[e]-=r,a[e]-=r*a[e-1];for(i[n-1]=a[n-1]/o[n-1],e=n-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function BR(t){return new wv(t)}function Ru(t,e){this._context=t,this._t=e}Ru.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function FR(t){return new Ru(t,.5)}function OR(t){return new Ru(t,0)}function GR(t){return new Ru(t,1)}function mi(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n<a;++n)for(i=o,o=t[e[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function yi(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function zR(t,e){return t[e]}function YR(t){const e=[];return e.key=t,e}function UR(){var t=lt([]),e=yi,n=mi,r=zR;function i(o){var a=Array.from(t.apply(this,arguments),YR),s,u=a.length,l=-1,c;for(const f of o)for(s=0,++l;s<u;++s)(a[s][l]=[0,+r(f,a[s].key,l,o)]).data=f;for(s=0,c=Su(e(a));s<u;++s)a[c[s]].index=s;return n(a,c),a}return i.keys=function(o){return arguments.length?(t=typeof o=="function"?o:lt(Array.from(o)),i):t},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:lt(+o),i):r},i.order=function(o){return arguments.length?(e=o==null?yi:typeof o=="function"?o:lt(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(n=o??mi,i):n},i}function WR(t,e){if((r=t.length)>0){for(var n,r,i=0,o=t[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=t[n][i][1]||0;if(a)for(n=0;n<r;++n)t[n][i][1]/=a}mi(t,e)}}function HR(t,e){if((u=t.length)>0)for(var n,r=0,i,o,a,s,u,l=t[e[0]].length;r<l;++r)for(a=s=0,n=0;n<u;++n)(o=(i=t[e[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=o):o<0?(i[1]=s,i[0]=s+=o):(i[0]=0,i[1]=o)}function XR(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=t[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}mi(t,e)}}function jR(t,e){if(!(!((a=t.length)>0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,u=0,l=0;s<a;++s){for(var c=t[e[s]],f=c[r][1]||0,h=c[r-1][1]||0,p=(f-h)/2,d=0;d<s;++d){var g=t[e[d]],m=g[r][1]||0,y=g[r-1][1]||0;p+=m-y}u+=f,l+=p*f}i[r-1][1]+=i[r-1][0]=n,u&&(n-=l/u)}i[r-1][1]+=i[r-1][0]=n,mi(t,e)}}function Sv(t){var e=t.map(VR);return yi(t).sort(function(n,r){return e[n]-e[r]})}function VR(t){for(var e=-1,n=0,r=t.length,i,o=-1/0;++e<r;)(i=+t[e][1])>o&&(o=i,n=e);return n}function Av(t){var e=t.map(Tv);return yi(t).sort(function(n,r){return e[n]-e[r]})}function Tv(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function qR(t){return Av(t).reverse()}function ZR(t){var e=t.length,n,r,i=t.map(Tv),o=Sv(t),a=0,s=0,u=[],l=[];for(n=0;n<e;++n)r=o[n],a<s?(a+=i[r],u.push(r)):(s+=i[r],l.push(r));return l.reverse().concat(u)}function KR(t){return yi(t).reverse()}const Eu=t=>()=>t;function QR(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function je(t,e,n){this.k=t,this.x=e,this.y=n}je.prototype={constructor:je,scale:function(t){return t===1?this:new je(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new je(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Iu=new je(1,0,0);Pv.prototype=je.prototype;function Pv(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Iu;return t.__zoom}function Eh(t){t.stopImmediatePropagation()}function Uo(t){t.preventDefault(),t.stopImmediatePropagation()}function JR(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function tE(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Mv(){return this.__zoom||Iu}function eE(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function nE(){return navigator.maxTouchPoints||"ontouchstart"in this}function rE(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(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 Ih(){var t=JR,e=tE,n=rE,r=eE,i=nE,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,u=om,l=Un("start","zoom","end"),c,f,h,p=500,d=150,g=0,m=10;function y(A){A.property("__zoom",Mv).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",w).on("dblclick.zoom",P).filter(i).on("touchstart.zoom",_).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(A,L,M,G){var O=A.selection?A.selection():A;O.property("__zoom",Mv),A!==O?S(A,L,M,G):O.interrupt().each(function(){$(this,arguments).event(G).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},y.scaleBy=function(A,L,M,G){y.scaleTo(A,function(){var O=this.__zoom.k,E=typeof L=="function"?L.apply(this,arguments):L;return O*E},M,G)},y.scaleTo=function(A,L,M,G){y.transform(A,function(){var O=e.apply(this,arguments),E=this.__zoom,k=M==null?x(O):typeof M=="function"?M.apply(this,arguments):M,C=E.invert(k),F=typeof L=="function"?L.apply(this,arguments):L;return n(v(b(E,F),k,C),O,a)},M,G)},y.translateBy=function(A,L,M,G){y.transform(A,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),e.apply(this,arguments),a)},null,G)},y.translateTo=function(A,L,M,G,O){y.transform(A,function(){var E=e.apply(this,arguments),k=this.__zoom,C=G==null?x(E):typeof G=="function"?G.apply(this,arguments):G;return n(Iu.translate(C[0],C[1]).scale(k.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),E,a)},G,O)};function b(A,L){return L=Math.max(o[0],Math.min(o[1],L)),L===A.k?A:new je(L,A.x,A.y)}function v(A,L,M){var G=L[0]-M[0]*A.k,O=L[1]-M[1]*A.k;return G===A.x&&O===A.y?A:new je(A.k,G,O)}function x(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function S(A,L,M,G){A.on("start.zoom",function(){$(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(G).end()}).tween("zoom",function(){var O=this,E=arguments,k=$(O,E).event(G),C=e.apply(O,E),F=M==null?x(C):typeof M=="function"?M.apply(O,E):M,X=Math.max(C[1][0]-C[0][0],C[1][1]-C[0][1]),Q=O.__zoom,z=typeof L=="function"?L.apply(O,E):L,Z=u(Q.invert(F).concat(X/Q.k),z.invert(F).concat(X/z.k));return function(Y){if(Y===1)Y=z;else{var q=Z(Y),j=X/q[2];Y=new je(j,F[0]-q[0]*j,F[1]-q[1]*j)}k.zoom(null,Y)}})}function $(A,L,M){return!M&&A.__zooming||new R(A,L)}function R(A,L){this.that=A,this.args=L,this.active=0,this.sourceEvent=null,this.extent=e.apply(A,L),this.taps=0}R.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,L){return this.mouse&&A!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var L=V(this.that).datum();l.call(A,this.that,new QR(A,{sourceEvent:this.sourceEvent,target:y,type:A,transform:this.that.__zoom,dispatch:l}),L)}};function T(A,...L){if(!t.apply(this,arguments))return;var M=$(this,L).event(A),G=this.__zoom,O=Math.max(o[0],Math.min(o[1],G.k*Math.pow(2,r.apply(this,arguments)))),E=le(A);if(M.wheel)(M.mouse[0][0]!==E[0]||M.mouse[0][1]!==E[1])&&(M.mouse[1]=G.invert(M.mouse[0]=E)),clearTimeout(M.wheel);else{if(G.k===O)return;M.mouse=[E,G.invert(E)],Kn(this),M.start()}Uo(A),M.wheel=setTimeout(k,d),M.zoom("mouse",n(v(b(G,O),M.mouse[0],M.mouse[1]),M.extent,a));function k(){M.wheel=null,M.end()}}function w(A,...L){if(h||!t.apply(this,arguments))return;var M=A.currentTarget,G=$(this,L,!0).event(A),O=V(A.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",X,!0),E=le(A,M),k=A.clientX,C=A.clientY;Fa(A.view),Eh(A),G.mouse=[E,this.__zoom.invert(E)],Kn(this),G.start();function F(Q){if(Uo(Q),!G.moved){var z=Q.clientX-k,Z=Q.clientY-C;G.moved=z*z+Z*Z>g}G.event(Q).zoom("mouse",n(v(G.that.__zoom,G.mouse[0]=le(Q,M),G.mouse[1]),G.extent,a))}function X(Q){O.on("mousemove.zoom mouseup.zoom",null),Oa(Q.view,G.moved),Uo(Q),G.event(Q).end()}}function P(A,...L){if(t.apply(this,arguments)){var M=this.__zoom,G=le(A.changedTouches?A.changedTouches[0]:A,this),O=M.invert(G),E=M.k*(A.shiftKey?.5:2),k=n(v(b(M,E),G,O),e.apply(this,L),a);Uo(A),s>0?V(this).transition().duration(s).call(S,k,G,A):V(this).call(y.transform,k,G,A)}}function _(A,...L){if(t.apply(this,arguments)){var M=A.touches,G=M.length,O=$(this,L,A.changedTouches.length===G).event(A),E,k,C,F;for(Eh(A),k=0;k<G;++k)C=M[k],F=le(C,this),F=[F,this.__zoom.invert(F),C.identifier],O.touch0?!O.touch1&&O.touch0[2]!==F[2]&&(O.touch1=F,O.taps=0):(O.touch0=F,E=!0,O.taps=1+!!c);c&&(c=clearTimeout(c)),E&&(O.taps<2&&(f=F[0],c=setTimeout(function(){c=null},p)),Kn(this),O.start())}}function N(A,...L){if(this.__zooming){var M=$(this,L).event(A),G=A.changedTouches,O=G.length,E,k,C,F;for(Uo(A),E=0;E<O;++E)k=G[E],C=le(k,this),M.touch0&&M.touch0[2]===k.identifier?M.touch0[0]=C:M.touch1&&M.touch1[2]===k.identifier&&(M.touch1[0]=C);if(k=M.that.__zoom,M.touch1){var X=M.touch0[0],Q=M.touch0[1],z=M.touch1[0],Z=M.touch1[1],Y=(Y=z[0]-X[0])*Y+(Y=z[1]-X[1])*Y,q=(q=Z[0]-Q[0])*q+(q=Z[1]-Q[1])*q;k=b(k,Math.sqrt(Y/q)),C=[(X[0]+z[0])/2,(X[1]+z[1])/2],F=[(Q[0]+Z[0])/2,(Q[1]+Z[1])/2]}else if(M.touch0)C=M.touch0[0],F=M.touch0[1];else return;M.zoom("touch",n(v(k,C,F),M.extent,a))}}function D(A,...L){if(this.__zooming){var M=$(this,L).event(A),G=A.changedTouches,O=G.length,E,k;for(Eh(A),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),E=0;E<O;++E)k=G[E],M.touch0&&M.touch0[2]===k.identifier?delete M.touch0:M.touch1&&M.touch1[2]===k.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(k=le(k,this),Math.hypot(f[0]-k[0],f[1]-k[1])<m)){var C=V(this).on("dblclick.zoom");C&&C.apply(this,arguments)}}}return y.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:Eu(+A),y):r},y.filter=function(A){return arguments.length?(t=typeof A=="function"?A:Eu(!!A),y):t},y.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Eu(!!A),y):i},y.extent=function(A){return arguments.length?(e=typeof A=="function"?A:Eu([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),y):e},y.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],y):[o[0],o[1]]},y.translateExtent=function(A){return arguments.length?(a[0][0]=+A[0][0],a[1][0]=+A[1][0],a[0][1]=+A[0][1],a[1][1]=+A[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(A){return arguments.length?(n=A,y):n},y.duration=function(A){return arguments.length?(s=+A,y):s},y.interpolate=function(A){return arguments.length?(u=A,y):u},y.on=function(){var A=l.on.apply(l,arguments);return A===l?y:A},y.clickDistance=function(A){return arguments.length?(g=(A=+A)*A,y):Math.sqrt(g)},y.tapDistance=function(A){return arguments.length?(m=+A,y):m},y}const Nh=Object.freeze(Object.defineProperty({__proto__:null,Adder:Ct,Delaunay:Hc,FormatSpecifier:bs,InternMap:Bi,InternSet:Gn,Node:sr,Path:io,Voronoi:jm,ZoomTransform:je,active:sM,arc:$u,area:Sh,areaRadial:Xx,ascending:_t,autoType:L4,axisBottom:a0,axisLeft:s0,axisRight:J3,axisTop:Q3,bin:qg,bisect:On,bisectCenter:qT,bisectLeft:VT,bisectRight:Eg,bisector:Sa,blob:E4,blur:ZT,blur2:Ig,blurImage:KT,brush:vM,brushSelection:yM,brushX:bM,brushY:xM,buffer:N4,chord:wM,chordDirected:SM,chordTranspose:$M,cluster:V7,color:bn,contourDensity:ZM,contours:Gc,count:Ta,create:E6,creator:Ia,cross:i3,csv:O4,csvFormat:v4,csvFormatBody:_4,csvFormatRow:$4,csvFormatRows:w4,csvFormatValue:S4,csvParse:Km,csvParseRows:x4,cubehelix:Me,cumsum:o3,curveBasis:SR,curveBasisClosed:AR,curveBasisOpen:TR,curveBumpX:Vx,curveBumpY:qx,curveBundle:PR,curveCardinal:MR,curveCardinalClosed:DR,curveCardinalOpen:CR,curveCatmullRom:LR,curveCatmullRomClosed:kR,curveCatmullRomOpen:RR,curveLinear:Au,curveLinearClosed:ER,curveMonotoneX:IR,curveMonotoneY:NR,curveNatural:BR,curveStep:FR,curveStepAfter:GR,curveStepBefore:OR,descending:kg,deviation:Fg,difference:G3,disjoint:z3,dispatch:Un,drag:x0,dragDisable:Fa,dragEnable:Oa,dsv:F4,dsvFormat:ds,easeBack:Pm,easeBackIn:J8,easeBackInOut:Pm,easeBackOut:tM,easeBounce:eo,easeBounceIn:K8,easeBounceInOut:Q8,easeBounceOut:eo,easeCircle:Tm,easeCircleIn:z8,easeCircleInOut:Tm,easeCircleOut:Y8,easeCubic:to,easeCubicIn:R8,easeCubicInOut:to,easeCubicOut:E8,easeElastic:no,easeElasticIn:eM,easeElasticInOut:nM,easeElasticOut:no,easeExp:Am,easeExpIn:O8,easeExpInOut:Am,easeExpOut:G8,easeLinear:C8,easePoly:_m,easePolyIn:I8,easePolyInOut:_m,easePolyOut:N8,easeQuad:vm,easeQuadIn:L8,easeQuadInOut:vm,easeQuadOut:k8,easeSin:Sm,easeSinIn:B8,easeSinInOut:Sm,easeSinOut:F8,every:E3,extent:Ni,fcumsum:s3,filter:N3,flatGroup:u3,flatRollup:l3,forceCenter:j4,forceCollide:n1,forceLink:pD,forceManyBody:a1,forceRadial:_D,forceSimulation:o1,forceX:s1,forceY:u1,get format(){return uo},formatDefaultLocale:m1,formatLocale:g1,get formatPrefix(){return Kc},formatSpecifier:ti,fsum:a3,geoAlbers:Cy,geoAlbersUsa:T7,geoArea:LD,geoAzimuthalEqualArea:P7,geoAzimuthalEqualAreaRaw:Bf,geoAzimuthalEquidistant:M7,geoAzimuthalEquidistantRaw:Ff,geoBounds:ID,geoCentroid:zD,geoCircle:YD,geoClipAntimeridian:mf,geoClipCircle:Q1,geoClipExtent:qD,geoClipRectangle:Gs,geoConicConformal:C7,geoConicConformalRaw:Ry,geoConicEqualArea:Qs,geoConicEqualAreaRaw:Dy,geoConicEquidistant:k7,geoConicEquidistantRaw:Ey,geoContains:n7,geoDistance:Us,geoEqualEarth:E7,geoEqualEarthRaw:Of,geoEquirectangular:L7,geoEquirectangularRaw:Ao,geoGnomonic:I7,geoGnomonicRaw:Gf,geoGraticule:uy,geoGraticule10:r7,geoIdentity:N7,geoInterpolate:i7,geoLength:J1,geoMercator:D7,geoMercatorRaw:So,geoNaturalEarth1:B7,geoNaturalEarth1Raw:zf,geoOrthographic:F7,geoOrthographicRaw:Yf,geoPath:m7,geoProjection:We,geoProjectionMutator:If,geoRotation:W1,geoStereographic:O7,geoStereographicRaw:Uf,geoStream:Ce,geoTransform:y7,geoTransverseMercator:G7,geoTransverseMercatorRaw:Wf,gray:tP,greatest:Zg,greatestIndex:D3,group:Yg,groupSort:h3,groups:Ug,hcl:ja,hierarchy:eu,histogram:qg,hsl:Ua,html:H4,image:z4,index:c3,indexes:f3,interpolate:Ze,interpolateArray:aP,interpolateBasis:W0,interpolateBasisClosed:H0,interpolateBlues:kk,interpolateBrBG:fk,interpolateBuGn:vk,interpolateBuPu:_k,interpolateCividis:Fk,interpolateCool:zk,interpolateCubehelix:_P,interpolateCubehelixDefault:Ok,interpolateCubehelixLong:Ja,interpolateDate:K0,interpolateDiscrete:lP,interpolateGnBu:wk,interpolateGreens:Rk,interpolateGreys:Ek,interpolateHcl:xP,interpolateHclLong:vP,interpolateHsl:mP,interpolateHslLong:yP,interpolateHue:cP,interpolateInferno:qk,interpolateLab:bP,interpolateMagma:Vk,interpolateNumber:ge,interpolateNumberArray:fc,interpolateObject:Q0,interpolateOrRd:$k,interpolateOranges:Bk,interpolatePRGn:hk,interpolatePiYG:pk,interpolatePlasma:Zk,interpolatePuBu:Ak,interpolatePuBuGn:Sk,interpolatePuOr:dk,interpolatePuRd:Tk,interpolatePurples:Ik,interpolateRainbow:Yk,interpolateRdBu:gk,interpolateRdGy:mk,interpolateRdPu:Pk,interpolateRdYlBu:yk,interpolateRdYlGn:bk,interpolateReds:Nk,interpolateRgb:ji,interpolateRgbBasis:V0,interpolateRgbBasisClosed:oP,interpolateRound:Ka,interpolateSinebow:Hk,interpolateSpectral:xk,interpolateString:dc,interpolateTransformCss:nm,interpolateTransformSvg:rm,interpolateTurbo:Xk,interpolateViridis:jk,interpolateWarm:Gk,interpolateYlGn:Dk,interpolateYlGnBu:Mk,interpolateYlOrBr:Ck,interpolateYlOrRd:Lk,interpolateZoom:om,interrupt:Kn,intersection:Y3,interval:TP,isoFormat:WL,isoParse:jL,json:U4,lab:Xa,lch:eP,least:M3,leastIndex:Jg,line:Tu,lineRadial:Hx,link:Pu,linkHorizontal:hR,linkRadial:dR,linkVertical:pR,local:y0,map:B3,matcher:Zl,max:Fi,maxIndex:Ul,mean:v3,median:_3,medianIndex:w3,merge:Hl,min:Da,minIndex:Wl,mode:S3,namespace:Yi,namespaces:Vl,nice:zl,now:Qi,pack:SC,packEnclose:bC,packSiblings:wC,pairs:A3,partition:AC,path:Oc,pathRound:PM,permute:Vg,pie:Yx,piecewise:lm,pointRadial:Yo,pointer:le,pointers:N6,polygonArea:GC,polygonCentroid:zC,polygonContains:HC,polygonHull:WC,polygonLength:XC,precisionFixed:y1,precisionPrefix:b1,precisionRound:x1,quadtree:ms,quantile:Gi,quantileIndex:Qg,quantileSorted:Kg,quantize:wP,quickselect:Ca,radialArea:Xx,radialLine:Hx,randomBates:ZC,randomBernoulli:JC,randomBeta:nb,randomBinomial:rb,randomCauchy:e9,randomExponential:KC,randomGamma:th,randomGeometric:eb,randomInt:VC,randomIrwinHall:tb,randomLcg:a9,randomLogNormal:qC,randomLogistic:n9,randomNormal:Jf,randomPareto:QC,randomPoisson:r9,randomUniform:jC,randomWeibull:t9,range:mn,rank:P3,reduce:F3,reverse:O3,rgb:Yr,ribbon:IM,ribbonArrow:NM,rollup:Hg,rollups:Xg,scaleBand:rh,scaleDiverging:lx,scaleDivergingLog:cx,scaleDivergingPow:_h,scaleDivergingSqrt:JL,scaleDivergingSymlog:fx,scaleIdentity:ub,scaleImplicit:eh,scaleLinear:Ro,scaleLog:pb,scaleOrdinal:nh,scalePoint:ih,scalePow:li,scaleQuantile:vb,scaleQuantize:_b,scaleRadial:xb,scaleSequential:ox,scaleSequentialLog:ax,scaleSequentialPow:vh,scaleSequentialQuantile:ux,scaleSequentialSqrt:QL,scaleSequentialSymlog:sx,scaleSqrt:b9,scaleSymlog:mb,scaleThreshold:wb,scaleTime:ZL,scaleUtc:KL,scan:C3,schemeAccent:ek,schemeBlues:Rx,schemeBrBG:hx,schemeBuGn:_x,schemeBuPu:wx,schemeCategory10:tk,schemeDark2:nk,schemeGnBu:$x,schemeGreens:Ex,schemeGreys:Ix,schemeObservable10:rk,schemeOrRd:Sx,schemeOranges:Fx,schemePRGn:px,schemePaired:ik,schemePastel1:ok,schemePastel2:ak,schemePiYG:dx,schemePuBu:Tx,schemePuBuGn:Ax,schemePuOr:gx,schemePuRd:Px,schemePurples:Nx,schemeRdBu:mx,schemeRdGy:yx,schemeRdPu:Mx,schemeRdYlBu:bx,schemeRdYlGn:xx,schemeReds:Bx,schemeSet1:sk,schemeSet2:uk,schemeSet3:lk,schemeSpectral:vx,schemeTableau10:ck,schemeYlGn:Cx,schemeYlGnBu:Dx,schemeYlOrBr:Lx,schemeYlOrRd:kx,select:V,selectAll:B6,selection:Hn,selector:Na,selectorAll:ql,shuffle:L3,shuffler:t0,some:I3,sort:Fl,stack:UR,stackOffsetDiverging:HR,stackOffsetExpand:WR,stackOffsetNone:mi,stackOffsetSilhouette:XR,stackOffsetWiggle:jR,stackOrderAppearance:Sv,stackOrderAscending:Av,stackOrderDescending:qR,stackOrderInsideOut:ZR,stackOrderNone:yi,stackOrderReverse:KR,stratify:DC,style:Wn,subset:W3,sum:e0,superset:r0,svg:X4,symbol:$R,symbolAsterisk:Zx,symbolCircle:Mu,symbolCross:Kx,symbolDiamond:Jx,symbolDiamond2:tv,symbolPlus:ev,symbolSquare:nv,symbolSquare2:rv,symbolStar:ov,symbolTimes:Mh,symbolTriangle:av,symbolTriangle2:sv,symbolWye:uv,symbolX:Mh,symbols:lv,symbolsFill:lv,symbolsStroke:wR,text:gs,thresholdFreedmanDiaconis:b3,thresholdScott:x3,thresholdSturges:Yl,tickFormat:sb,tickIncrement:Yn,tickStep:Ma,ticks:zn,timeDay:fi,timeDays:S9,get timeFormat(){return yh},timeFormatDefaultLocale:rx,timeFormatLocale:zb,timeFriday:Mb,timeFridays:L9,timeHour:fu,timeHours:w9,timeInterval:Mt,timeMillisecond:ci,timeMilliseconds:$b,timeMinute:lu,timeMinutes:v9,timeMonday:Io,timeMondays:P9,timeMonth:pu,timeMonths:O9,get timeParse(){return nx},timeSaturday:Db,timeSaturdays:k9,timeSecond:ln,timeSeconds:Ab,timeSunday:hi,timeSundays:Cb,timeThursday:cr,timeThursdays:C9,timeTickInterval:Gb,timeTicks:Ob,timeTuesday:Tb,timeTuesdays:M9,timeWednesday:Pb,timeWednesdays:D9,timeWeek:hi,timeWeeks:Cb,timeYear:He,timeYears:z9,timeout:yc,timer:rs,timerFlush:hm,transition:bm,transpose:n0,tree:NC,treemap:Qy,treemapBinary:BC,treemapDice:Lo,treemapResquarify:OC,treemapSlice:au,treemapSliceDice:FC,treemapSquarify:Qf,tsv:G4,tsvFormat:T4,tsvFormatBody:P4,tsvFormatRow:D4,tsvFormatRows:M4,tsvFormatValue:C4,tsvParse:Qm,tsvParseRows:A4,union:H3,unixDay:dh,unixDays:T9,utcDay:Eo,utcDays:A9,get utcFormat(){return gu},utcFriday:Rb,utcFridays:B9,utcHour:hu,utcHours:$9,utcMillisecond:ci,utcMilliseconds:$b,utcMinute:cu,utcMinutes:_9,utcMonday:No,utcMondays:R9,utcMonth:du,utcMonths:G9,get utcParse(){return bh},utcSaturday:Eb,utcSaturdays:F9,utcSecond:ln,utcSeconds:Ab,utcSunday:pi,utcSundays:Ib,utcThursday:hr,utcThursdays:N9,utcTickInterval:Fb,utcTicks:Bb,utcTuesday:Lb,utcTuesdays:E9,utcWednesday:kb,utcWednesdays:I9,utcWeek:pi,utcWeeks:Ib,utcYear:Xe,utcYears:Y9,variance:Bg,window:Kl,xml:W4,zip:R3,zoom:Ih,zoomIdentity:Iu,zoomTransform:Pv},Symbol.toStringTag,{value:"Module"}));function Dv(t){try{return t.node().getBBox()}catch(e){throw new Error(e)}}function iE(t,e){function n(i){var s;const o=document.createElementNS("http://www.w3.org/1999/xhtml","div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>";const a=document.createDocumentFragment();for(;a&&((s=o==null?void 0:o.firstChild)!=null&&s.firstChild);)a.appendChild(o.firstChild.firstChild);return a}const r=t.node();for(;r.hasChildNodes();)r.removeChild(r.firstChild);t.node().appendChild(n(e))}function Wo(t){return t.substring(0,4)!=="ease"?to:Nh[t]??to}function Nu({axisWidth:t,innerRadius:e,outerRadius:n,padAngle:r,cornerRadius:i}){const o=Ro().domain([0,1]).range([0,t/2]),a=o(n);return $u().innerRadius(o(e)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const Bh=(t,e)=>e instanceof Function?e(t):uo(e)(t);function Cv(t,e=10){var i;const n=document.createElement("canvas").getContext("2d");return(((i=n==null?void 0:n.measureText(t))==null?void 0:i.width)??0)*e/10}function oE(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function aE(t){const e=t.filter(n=>n.value!=null&&n.visible!=!1).map(n=>n.value);return oE(e)}function kt(t,e){const n=e.colors[e.colorScheme];return t==="series"?n.series[0]:t=="none"?"none":n[t]!=null?n[t]:n.primary}function Mn({datum:t,colorType:e,fullChartParams:n}){return e==="series"?t.color?t.color:n.colors[n.colorScheme].series[0]:e=="none"?"none":n.colors[n.colorScheme][e]!=null?n.colors[n.colorScheme][e]:n.colors[n.colorScheme].primary}function ot(t,e,n){const r=n?`--${n}`:"";return`orbcharts-${t}__${e}${r}`}function Dn(t,e){const r=Math.random().toString(36).substr(2,5);return ot(t,e,r)}function Fh(t,e){let n=new dt(()=>{});return t.each(function(){const r=rl(this,e);n=il(n,r)}),n}const pr=({selection:t,pluginName:e,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=ot(e,"series"),u=ot(e,"axes"),l=ot(e,"graphic"),c=r.pipe(B((d,g)=>t.selectAll(`g.${s}`).data(d,m=>m).join(m=>m.append("g").classed(s,!0).each((y,b,v)=>{V(v[b]).selectAll(`g.${u}`).data([b]).join(x=>x.append("g").classed(u,!0).attr("clip-path",`url(#${n})`).each((S,$,R)=>{V(R[$]).selectAll("defs").data([$]).join("defs"),V(R[$]).selectAll("g").data([$]).join("g").classed(l,!0)}),x=>x,x=>x.remove())}),m=>m,m=>m.remove())),St(1));U({seriesSelection:c,gridContainerPosition:i}).pipe(W(async d=>d)).subscribe(d=>{d.seriesSelection.transition().attr("transform",(g,m)=>{const y=d.gridContainerPosition[m]??d.gridContainerPosition[0],b=y.translate,v=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${v[0]}, ${v[1]})`})});const f=U({seriesSelection:c,gridAxesTransform:o}).pipe(W(async d=>d),B(d=>d.seriesSelection.select(`g.${u}`).style("transform",d.gridAxesTransform.value)),St(1)),h=f.pipe(B(d=>d.select("defs")),St(1)),p=U({axesSelection:f,gridGraphicTransform:a}).pipe(W(async d=>d),B(d=>{const g=d.axesSelection.select(`g.${l}`);return g.transition().duration(50).style("transform",d.gridGraphicTransform.value),g}),St(1));return{seriesSelection$:c,axesSelection$:f,defsSelection$:h,graphicGSelection$:p}},Lv=({fullDataFormatter$:t,gridAxesSize$:e,computedData$:n,fullChartParams$:r,gridContainerPosition$:i,layout$:o})=>{const a=new nt,s=U({fullDataFormatter:t,gridAxesSize:e,computedData:n}).pipe(W(async h=>h),B(h=>{const p=h.computedData[0]?h.computedData[0].length-1:0,d=h.fullDataFormatter.grid.groupAxis.scaleDomain[0]-h.fullDataFormatter.grid.groupAxis.scalePadding,g=h.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?p+h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[1]+h.fullDataFormatter.grid.groupAxis.scalePadding;return[d,g]}),St(1)),u=U({fullDataFormatter:t,computedData:n}).pipe(W(async h=>h),B(h=>h.fullDataFormatter.grid.seriesDirection==="row"?(h.computedData[0]??[]).map(p=>p.groupLabel):h.computedData.map(p=>p[0].groupLabel))),l=U({groupScaleDomain:s,groupLabels:u}).pipe(W(async h=>h),B(h=>h.groupLabels.filter((p,d)=>d>=h.groupScaleDomain[0]&&d<=h.groupScaleDomain[1]))),c=i.pipe(B(h=>h.reduce((d,g)=>g.columnIndex>d?g.columnIndex:d,0)+1),tt()),f=i.pipe(B(h=>h.reduce((d,g)=>g.rowIndex>d?g.rowIndex:d,0)+1),tt());return new dt(h=>{U({dataFormatter:t,axisSize:e,fullChartParams:r,scaleRangeGroupLabels:l,groupLabels:u,groupScaleDomain:s,columnAmount:c,rowAmount:f,layout:o}).pipe(I(a),W(async p=>p)).subscribe(p=>{const d=p.dataFormatter.grid.valueAxis.position==="right"||p.dataFormatter.grid.valueAxis.position==="bottom",g=Pg({axisLabels:p.scaleRangeGroupLabels,axisWidth:p.axisSize.width,padding:p.dataFormatter.grid.groupAxis.scalePadding,reverse:d}),m=b=>p.dataFormatter.grid.groupAxis.position==="bottom"||p.dataFormatter.grid.groupAxis.position==="top"?b.offsetX-p.fullChartParams.padding.left:b.offsetY-p.fullChartParams.padding.top,y=b=>{const v={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},x=m(v),S=g(x),$=Math.ceil(p.groupScaleDomain[0]),R=S+$;return{groupIndex:R,groupLabel:p.groupLabels[R]??""}};return h.next(y),function(){a.next(void 0)}})})},sE=({rootSelection:t,fullDataFormatter$:e,gridAxesSize$:n,computedData$:r,fullChartParams$:i,gridContainerPosition$:o,layout$:a})=>{const s=Fh(t,"mousemove"),u=U({fullDataFormatter:e,gridAxesSize:n,computedData:r}).pipe(W(async b=>b),B(b=>{const v=b.computedData[0]?b.computedData[0].length-1:0,x=b.fullDataFormatter.grid.groupAxis.scaleDomain[0]-b.fullDataFormatter.grid.groupAxis.scalePadding,S=b.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?v+b.fullDataFormatter.grid.groupAxis.scalePadding:b.fullDataFormatter.grid.groupAxis.scaleDomain[1]+b.fullDataFormatter.grid.groupAxis.scalePadding;return[x,S]}),St(1)),l=U({fullDataFormatter:e,computedData:r}).pipe(W(async b=>b),B(b=>b.fullDataFormatter.grid.seriesDirection==="row"?(b.computedData[0]??[]).map(v=>v.groupLabel):b.computedData.map(v=>v[0].groupLabel))),c=U({groupScaleDomain:u,groupLabels:l}).pipe(W(async b=>b),B(b=>b.groupLabels.filter((v,x)=>x>=b.groupScaleDomain[0]&&x<=b.groupScaleDomain[1]))),f=e.pipe(B(b=>b.grid.valueAxis.position==="right"||b.grid.valueAxis.position==="bottom")),h=U({reverse:f,gridAxesSize:n,scaleRangeGroupLabels:c,fullDataFormatter:e}).pipe(W(async b=>b),B(b=>Pg({axisLabels:b.scaleRangeGroupLabels,axisWidth:b.gridAxesSize.width,padding:b.fullDataFormatter.grid.groupAxis.scalePadding,reverse:b.reverse}))),p=o.pipe(B(b=>b.reduce((x,S)=>S.columnIndex>x?S.columnIndex:x,0)+1),tt()),d=o.pipe(B(b=>b.reduce((x,S)=>S.rowIndex>x?S.rowIndex:x,0)+1),tt()),g=U({fullDataFormatter:e,fullChartParams:i,rootMousemove:s,columnAmount:p,rowAmount:d,layout:a}).pipe(W(async b=>b),B(b=>{const v={offsetX:b.rootMousemove.offsetX*b.columnAmount%b.layout.rootWidth,offsetY:b.rootMousemove.offsetY*b.rowAmount%b.layout.rootHeight};return b.fullDataFormatter.grid.groupAxis.position==="bottom"||b.fullDataFormatter.grid.groupAxis.position==="top"?v.offsetX-b.fullChartParams.padding.left:v.offsetY-b.fullChartParams.padding.top})),m=U({xIndexScale:h,axisValue:g,groupScaleDomain:u}).pipe(W(async b=>b),B(b=>{const v=b.xIndexScale(b.axisValue),x=Math.ceil(b.groupScaleDomain[0]);return v+x})),y=U({groupIndex:m,groupLabels:l}).pipe(W(async b=>b),B(b=>b.groupLabels[b.groupIndex]??""));return U({groupIndex:m,groupLabel:y}).pipe(W(async b=>b),B(b=>({groupIndex:b.groupIndex,groupLabel:b.groupLabel})))};function uE(t="curveLinear"){return Tu().x(e=>e.axisX).y(e=>e.axisY).curve(Nh[t])}function lE(t){let e=[[]],n=0;for(let r in t){if(t[r].visible==!1||t[r].value===void 0||t[r].value===null){e[n].length&&(n++,e[n]=[]);continue}e[n].push(t[r])}return e}function cE({selection:t,pathClassName:e,segmentData:n,linePath:r,params:i}){return t.selectAll("path").data(n,(a,s)=>a.length?`${a[0].id}_${a[a.length-1].id}`:s).join(a=>a.append("path").classed(e,!0).attr("fill","none").attr("pointer-events","visibleStroke").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),a=>a,a=>a.remove()).attr("stroke-width",i.lineWidth).attr("stroke",(a,s)=>a[0]&&a[0].color).attr("d",a=>r(a))}function fE({selection:t,seriesLabel:e,fullChartParams:n}){if(t.interrupt("highlight"),!e){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{r===e?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function hE({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{V(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(Wo(r)).tween("tween",(l,c,f)=>h=>{const p=l.width*h;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const kv=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,allContainerPosition$:y,layout$:b,event$:v})=>{const x=new nt,S=Dn(t,"clipPath-box"),$=ot(t,"path"),{seriesSelection$:R,axesSelection$:T,defsSelection$:w,graphicGSelection$:P}=pr({selection:e,pluginName:t,clipPathID:S,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),_=new dt(O=>{const E=l.pipe(I(x)).subscribe(k=>{if(!k)return;const C=uE(k.lineCurve);O.next(C)});return()=>{E.unsubscribe()}}),N=f.pipe(B(O=>O.transitionDuration),tt()),D=f.pipe(B(O=>O.transitionEase),tt());U({defsSelection:w,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:D}).pipe(I(x),W(async O=>O)).subscribe(O=>{const k=[{id:S,width:O.axisSize.width,height:O.axisSize.height}].concat(O.seriesLabels.map(C=>({id:`orbcharts__clipPath_${C}`,width:O.axisSize.width,height:O.axisSize.height})));hE({defsSelection:O.defsSelection,clipPathData:k,transitionDuration:O.transitionDuration,transitionEase:O.transitionEase})});const A=n.pipe(B(O=>{const E=new Map;return O.flat().forEach(k=>E.set(k.id,k)),E})),L=Lv({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:y,layout$:b}),M=f.pipe(I(x),B(O=>O.highlightTarget),tt()),G=U({graphicGSelection:P,visibleComputedLayoutData:o,linePath:_,params:l}).pipe(I(x),W(async O=>O),B(O=>{let E=[];return O.graphicGSelection.each((k,C,F)=>{const X=lE(O.visibleComputedLayoutData[C]??[]);E[C]=cE({selection:V(F[C]),pathClassName:$,linePath:O.linePath,segmentData:X,params:O.params})}),E}));return U({pathSelectionArr:G,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:M,gridGroupPositionFn:L}).pipe(I(x),W(async O=>O)).subscribe(O=>{O.pathSelectionArr.forEach(E=>{E.on("mouseover",(k,C)=>{k.stopPropagation();const F=C[0]?C[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=O.gridGroupPositionFn(k),Y=O.GroupDataMap.get(Q).find(q=>q.seriesLabel===F)??C[0];v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:O.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:O.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:O.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:k,data:O.computedData})}).on("mousemove",(k,C)=>{k.stopPropagation();const F=C[0]?C[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=O.gridGroupPositionFn(k),Y=O.GroupDataMap.get(Q).find(q=>q.seriesLabel===F)??C[0];v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:O.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:O.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:O.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:k,data:O.computedData})}).on("mouseout",(k,C)=>{k.stopPropagation();const F=C[0]?C[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=O.gridGroupPositionFn(k),Y=O.GroupDataMap.get(Q).find(q=>q.seriesLabel===F)??C[0];v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:O.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:O.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:O.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:k,data:O.computedData})}).on("click",(k,C)=>{k.stopPropagation();const F=C[0]?C[0].seriesLabel:"",{groupIndex:X,groupLabel:Q}=O.gridGroupPositionFn(k),Y=O.GroupDataMap.get(Q).find(q=>q.seriesLabel===F)??C[0];v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:O.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:O.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:O.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:k,data:O.computedData})})})}),f.pipe(I(x),$i(O=>O.highlightTarget==="series"),W(O=>U({graphicGSelection:P,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(x),W(async E=>E)))).subscribe(O=>{const E=O.gridHighlight[0]?O.gridHighlight[0].seriesLabel:null;fE({selection:O.graphicGSelection,seriesLabel:E,fullChartParams:O.fullChartParams})}),()=>{x.next(void 0)}},pE=0,Cn=2,dE=3,Rv=4,ke=5,Ev=6,Oh=7,Bu=8,gE=9,Iv="Lines",mE=ue({name:Iv,defaultParams:gr,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=kv(Iv,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,allContainerPosition$:r.gridContainerPosition$,layout$:r.layout$,event$:i.event$});return()=>{o.next(void 0),a()}});function yE(t="curveLinear",e){return Sh().x(n=>n.axisX).y0(n=>e).y1(n=>n.axisY).curve(Nh[t])}function bE(t){let e=[[]],n=0;for(let r in t){if(t[r].visible==!1||t[r].value===void 0||t[r].value===null){e[n].length&&(n++,e[n]=[]);continue}e[n].push(t[r])}return e}function xE({selection:t,pathClassName:e,segmentData:n,areaPath:r,linearGradientIds:i,params:o}){return t.selectAll("path").data(n,(s,u)=>s.length?`${s[0].id}_${s[s.length-1].id}`:u).join(s=>s.append("path").classed(e,!0).attr("fill","none").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),s=>s,s=>s.remove()).attr("fill",(s,u)=>s[0]?`url(#${i[s[0].seriesIndex]})`:"").attr("d",s=>r(s))}function vE({selection:t,seriesLabel:e,fullChartParams:n}){if(t.interrupt("highlight"),!e){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{r===e?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function _E({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
|
10
14
|
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
11
15
|
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
12
|
-
`})}function CR({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{j(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(zo(r)).tween("tween",(l,c,f)=>h=>{const p=l.width*h;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const ax=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,layout$:y,event$:v})=>{const x=new nt,b=Sn(t,"clipPath-box"),S=it(t,"path"),{seriesSelection$:$,axesSelection$:E,defsSelection$:M,graphicGSelection$:w}=sr({selection:e,pluginName:t,clipPathID:b,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),P=p.pipe(I(x),F(k=>-k.translate[1]/k.scale[1])),_=new dt(k=>{const R=B({fullParams:l,valueAxisStart:P}).pipe(I(x)).subscribe(L=>{const z=MR(L.fullParams.lineCurve,L.valueAxisStart);k.next(z)});return()=>{R.unsubscribe()}}),N=f.pipe(F(k=>k.transitionDuration),tt()),T=f.pipe(F(k=>k.transitionEase),tt());B({defsSelection:M,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:T}).pipe(I(x),W(async k=>k)).subscribe(k=>{const L=[{id:b,width:k.axisSize.width,height:k.axisSize.height}].concat(k.seriesLabels.map(z=>({id:`orbcharts__clipPath_${z}`,width:k.axisSize.width,height:k.axisSize.height})));CR({defsSelection:k.defsSelection,clipPathData:L,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase})});const A=n.pipe(F(k=>{const R=new Map;return k.flat().forEach(L=>R.set(L.id,L)),R})),C=rx({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:m,layout$:y}),D=f.pipe(I(x),F(k=>k.highlightTarget),tt()),O=a.pipe(I(x),F(k=>k.map((R,L)=>Sn(t,`lineargradient-${R}`)))),G=B({graphicGSelection:w,defsSelection:M,visibleComputedLayoutData:o,linearGradientIds:O,areaPath:_,params:l}).pipe(I(x),W(async k=>k),F(k=>{let R=[];return k.graphicGSelection.each((L,z,X)=>{const Q=PR(k.visibleComputedLayoutData[z]??[]);R[z]=DR({selection:j(X[z]),pathClassName:S,areaPath:k.areaPath,segmentData:Q,linearGradientIds:k.linearGradientIds,params:k.params}),LR({defsSelection:k.defsSelection,computedData:k.visibleComputedLayoutData,linearGradientIds:k.linearGradientIds,params:k.params})}),R}));return B({pathSelectionArr:G,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:D,gridGroupPositionFn:C}).pipe(I(x),W(async k=>k)).subscribe(k=>{k.pathSelectionArr.forEach(R=>{R.on("mouseover",(L,z)=>{const X=z[0]?z[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(L),V=k.GroupDataMap.get(Y).find(q=>q.seriesLabel===X)??z[0];v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:k.highlightTarget,datum:V,gridIndex:V.gridIndex,series:k.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:k.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:L,data:k.computedData})}).on("mousemove",(L,z)=>{const X=z[0]?z[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(L),V=k.GroupDataMap.get(Y).find(q=>q.seriesLabel===X)??z[0];v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:k.highlightTarget,datum:V,gridIndex:V.gridIndex,series:k.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:k.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:L,data:k.computedData})}).on("mouseout",(L,z)=>{const X=z[0]?z[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(L),V=k.GroupDataMap.get(Y).find(q=>q.seriesLabel===X)??z[0];v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:k.highlightTarget,datum:V,gridIndex:V.gridIndex,series:k.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:k.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:L,data:k.computedData})}).on("click",(L,z)=>{const X=z[0]?z[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(L),V=k.GroupDataMap.get(Y).find(q=>q.seriesLabel===X)??z[0];v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:k.highlightTarget,datum:V,gridIndex:V.gridIndex,series:k.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:k.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:L,data:k.computedData})})})}),f.pipe(I(x),hi(k=>k.highlightTarget==="series"),W(k=>B({graphicGSelection:w,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(x),W(async R=>R)))).subscribe(k=>{const R=k.gridHighlight[0]?k.gridHighlight[0].seriesLabel:null;TR({selection:k.graphicGSelection,seriesLabel:R,fullChartParams:k.fullChartParams})}),()=>{x.next(void 0)}},sx="LineAreas",ER=se(sx,op)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ax(sx,{selection:t,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedLayoutData$:n.computedLayoutData$,visibleComputedLayoutData$:n.visibleComputedLayoutData$,seriesLabels$:n.seriesLabels$,SeriesDataMap$:n.SeriesDataMap$,GroupDataMap$:n.GroupDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridGraphicTransform$:n.gridGraphicTransform$,gridAxesSize$:n.gridAxesSize$,gridHighlight$:n.gridHighlight$,gridContainerPosition$:n.gridContainerPosition$,allContainerPosition$:n.gridContainerPosition$,layout$:n.layout$,event$:r.event$});return()=>{i.next(void 0),o()}}),ux=.3;function lx({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((e>1?t/(e-1):t)-i)/n-r;return a>1?a:1}function RR(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Qf().domain(e).range([-i/2+r,i/2-r])}function kR(t,e){return t<=1?0:e/(t-1)*ux}function IR(t,e){return t<=1?e:e*(1-ux)}function NR({graphicGSelection:t,rectClassName:e,visibleComputedLayoutData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:u,transformedBarRadius:l,delayGroup:c,transitionItem:f,isSeriesSeprate:h}){const p=u/2;return t.each((g,m,y)=>{j(y[m]).selectAll(`rect.${e}`).data(n[m]??[],v=>v.id).join(v=>v.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",x=>0),v=>v,v=>v.remove()).attr("transform",(v,x)=>`translate(${(v?v.axisX:0)-p}, 0)`).attr("fill",v=>v.color).attr("y",v=>v.axisY<r[m]?v.axisY:r[m]).attr("x",v=>h?0:o(v.seriesLabel)).attr("width",u).attr("rx",l[m][0]??1).attr("ry",l[m][1]??1).transition().duration(f).ease(zo(s.transitionEase)).delay((v,x)=>v.groupIndex*c).attr("height",v=>Math.abs(v.axisYFromZero))}),t.selectAll(`rect.${e}`)}function FR({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{j(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function zR({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?j(o[i]).style("opacity",1):j(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Rh=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:y,event$:v})=>{const x=new nt,b=Sn(t,"clipPath-box"),S=it(t,"rect"),{seriesSelection$:$,axesSelection$:E,defsSelection$:M,graphicGSelection$:w}=sr({selection:e,pluginName:t,clipPathID:b,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),P=o.pipe(I(x),F(R=>R.map(L=>L[0]?L[0].axisY-L[0].axisYFromZero:0)),tt()),_=B({computedData:n,visibleComputedData:i,params:l,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async R=>R),F(R=>R.params.barWidth?R.params.barWidth:R.isSeriesSeprate?lx({axisWidth:R.gridAxesSize.width,groupAmount:R.computedData[0]?R.computedData[0].length:0,barAmountOfGroup:1,barPadding:R.params.barPadding,barGroupPadding:R.params.barGroupPadding}):lx({axisWidth:R.gridAxesSize.width,groupAmount:R.computedData[0]?R.computedData[0].length:0,barAmountOfGroup:R.visibleComputedData.length,barPadding:R.params.barPadding,barGroupPadding:R.params.barGroupPadding})),tt()),N=B({computedData:n,barWidth:_,params:l,gridGraphicReverseScale:p}).pipe(I(x),W(async R=>R),F(R=>{const L=R.barWidth/2,z=R.params.barRadius===!0?L:R.params.barRadius===!1?0:typeof R.params.barRadius=="number"?R.params.barRadius:0;return R.computedData.map((X,Q)=>{const Y=R.gridGraphicReverseScale[Q]??R.gridGraphicReverseScale[0];let Z=z*Y[0],U=z*Y[1];if(Z>L){const V=L/Z;Z=Z*V,U=U*V}return[Z,U]})})),T=i.pipe(I(x),F(R=>{const L=new Set;return R.forEach(z=>{z.forEach(X=>{L.add(X.groupLabel)})}),Array.from(L)})),A=B({seriesLabels:a,barWidth:_,params:l}).pipe(I(x),W(async R=>R),F(R=>RR(R.barWidth,R.seriesLabels,R.params))),C=c.pipe(I(x),F(R=>R.transitionDuration),tt()),D=new dt(R=>{B({groupLabels:T,transitionDuration:C}).pipe(W(async L=>L)).subscribe(L=>{const z=kR(L.groupLabels.length,L.transitionDuration);R.next(z)})}).pipe(I(x),tt()),O=new dt(R=>{B({groupLabels:T,transitionDuration:C}).pipe(W(async L=>L)).subscribe(L=>{const z=IR(L.groupLabels.length,L.transitionDuration);R.next(z)})}).pipe(I(x),tt());B({defsSelection:M,gridAxesSize:d}).pipe(I(x),W(async R=>R)).subscribe(R=>{const L=[{id:b,width:R.gridAxesSize.width,height:R.gridAxesSize.height}];FR({defsSelection:R.defsSelection,clipPathData:L})});const G=c.pipe(I(x),F(R=>R.highlightTarget),tt()),k=B({graphicGSelection:w,visibleComputedLayoutData:o,zeroYArr:P,groupLabels:T,barScale:A,params:l,chartParams:c,highlightTarget:G,barWidth:_,transformedBarRadius:N,delayGroup:D,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async R=>R),F(R=>NR({graphicGSelection:R.graphicGSelection,rectClassName:S,visibleComputedLayoutData:R.visibleComputedLayoutData,zeroYArr:R.zeroYArr,groupLabels:R.groupLabels,barScale:R.barScale,params:R.params,chartParams:R.chartParams,barWidth:R.barWidth,transformedBarRadius:R.transformedBarRadius,delayGroup:R.delayGroup,transitionItem:R.transitionItem,isSeriesSeprate:R.isSeriesSeprate})));return B({barSelection:k,computedData:n,highlightTarget:G,SeriesDataMap:s,GroupDataMap:u}).pipe(I(x),W(async R=>R)).subscribe(R=>{R.barSelection.on("mouseover",(L,z)=>{L.stopPropagation(),v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:R.highlightTarget,datum:z,gridIndex:z.gridIndex,series:R.SeriesDataMap.get(z.seriesLabel),seriesIndex:z.seriesIndex,seriesLabel:z.seriesLabel,groups:R.GroupDataMap.get(z.groupLabel),groupIndex:z.groupIndex,groupLabel:z.groupLabel,event:L,data:R.computedData})}).on("mousemove",(L,z)=>{L.stopPropagation(),v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:R.highlightTarget,datum:z,gridIndex:z.gridIndex,series:R.SeriesDataMap.get(z.seriesLabel),seriesIndex:z.seriesIndex,seriesLabel:z.seriesLabel,groups:R.GroupDataMap.get(z.groupLabel),groupIndex:z.groupIndex,groupLabel:z.groupLabel,event:L,data:R.computedData})}).on("mouseout",(L,z)=>{L.stopPropagation(),v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:R.highlightTarget,datum:z,gridIndex:z.gridIndex,series:R.SeriesDataMap.get(z.seriesLabel),seriesIndex:z.seriesIndex,seriesLabel:z.seriesLabel,groups:R.GroupDataMap.get(z.groupLabel),groupIndex:z.groupIndex,groupLabel:z.groupLabel,event:L,data:R.computedData})}).on("click",(L,z)=>{L.stopPropagation(),v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:R.highlightTarget,datum:z,gridIndex:z.gridIndex,series:R.SeriesDataMap.get(z.seriesLabel),seriesIndex:z.seriesIndex,seriesLabel:z.seriesLabel,groups:R.GroupDataMap.get(z.groupLabel),groupIndex:z.groupIndex,groupLabel:z.groupLabel,event:L,data:R.computedData})})}),B({barSelection:k,highlight:g.pipe(F(R=>R.map(L=>L.id))),fullChartParams:c}).pipe(I(x),W(async R=>R)).subscribe(R=>{zR({selection:R.barSelection,ids:R.highlight,fullChartParams:R.fullChartParams})}),()=>{x.next(void 0)}},cx="Bars",GR=se(cx,Yo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Rh(cx,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),fx="BarsPN",OR=se(fx,Yo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Rh(fx,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:Xo(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),hx=.3;function YR({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function UR(t,e){return t<=1?0:e/(t-1)*hx}function BR(t,e){return t<=1?e:e*(1-hx)}function WR({graphicGSelection:t,rectClassName:e,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:u,delayGroup:l,transitionItem:c,isSeriesSeprate:f}){const h=s/2;return t.each((d,g,m)=>{j(m[g]).selectAll(`rect.${e}`).data(n[g]??[],y=>y.id).join(y=>y.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",v=>0),y=>y,y=>y.remove()).attr("transform",(y,v)=>`translate(${(y?y.axisX:0)-h}, 0)`).attr("fill",y=>y.color).attr("y",y=>r).attr("x",y=>0).attr("width",s).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(c).ease(zo(a.transitionEase)).delay((y,v)=>y.groupIndex*l).attr("y",y=>y._barStartY).attr("height",y=>Math.abs(y._barHeight))}),t.selectAll(`rect.${e}`)}function HR({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{j(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function XR({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?j(o[i]).style("opacity",1):j(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const px=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridGraphicReverseScale$:d,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:y,isSeriesSeprate$:v,event$:x})=>{const b=new nt,S=Sn(t,"clipPath-box"),$=it(t,"rect"),{seriesSelection$:E,axesSelection$:M,defsSelection$:w,graphicGSelection$:P}=sr({selection:e,pluginName:t,clipPathID:S,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),_=o.pipe(I(b),F(Y=>Y[0]&&Y[0][0]?Y[0][0].axisY-Y[0][0].axisYFromZero:0),tt()),N=B({computedData:n,params:l,axisSize:g,isSeriesSeprate:v}).pipe(I(b),W(async Y=>Y),F(Y=>Y.params.barWidth?Y.params.barWidth:YR({axisWidth:Y.axisSize.width,groupAmount:Y.computedData[0]?Y.computedData[0].length:0,barGroupPadding:Y.params.barGroupPadding})),tt()),T=B({computedData:n,barWidth:N,params:l,gridGraphicReverseScale:d}).pipe(I(b),W(async Y=>Y),F(Y=>{const Z=Y.barWidth/2,U=Y.params.barRadius===!0?Z:Y.params.barRadius===!1?0:typeof Y.params.barRadius=="number"?Y.params.barRadius:0;return Y.computedData.map((V,q)=>{const rt=Y.gridGraphicReverseScale[q]??Y.gridGraphicReverseScale[0],ut=U*rt[0],H=U*rt[1];return[ut,H]})})),A=i.pipe(I(b),F(Y=>{const Z=new Set;return Y.forEach(U=>{U.forEach(V=>{Z.add(V.groupLabel)})}),Array.from(Z)}),St(1)),C=f.pipe(I(b),F(Y=>Y.transitionDuration),tt()),D=new dt(Y=>{B({groupLabels:A,transitionDuration:C}).pipe(W(async Z=>Z)).subscribe(Z=>{const U=UR(Z.groupLabels.length,Z.transitionDuration);Y.next(U)})}).pipe(I(b),tt()),O=new dt(Y=>{B({groupLabels:A,transitionDuration:C}).pipe(W(async Z=>Z)).subscribe(Z=>{const U=BR(Z.groupLabels.length,Z.transitionDuration);Y.next(U)})}).pipe(I(b),tt()),G=B({computedData:n,dataFormatter:c}).pipe(I(b),W(async Y=>Y),F(Y=>{const Z=Y.computedData[0]?Y.computedData[0].length-1:0,U=Y.dataFormatter.grid.groupAxis.scaleDomain[0],V=Y.dataFormatter.grid.groupAxis.scaleDomain[1]==="max"?Z:Y.dataFormatter.grid.groupAxis.scaleDomain[1];return[U,V]})),k=B({visibleComputedLayoutData:o,groupScaleDomain:G}).pipe(I(b),W(async Y=>Y),F(Y=>{const Z=Y.groupScaleDomain[0],U=Y.groupScaleDomain[1],q=Y.visibleComputedLayoutData.map(mt=>mt.filter((ht,Bt)=>ht.groupIndex>=Z&&ht.groupIndex<=U)).flat();if(q.length<=1)return 1;const rt=q.reduce((mt,ht)=>ht.value>mt.value?ht:mt,q[0]),ut=rt.groupIndex,H=q.filter(mt=>mt.groupIndex===ut).reduce((mt,ht)=>mt+ht.value,0);return rt.value/H})),R=B({computedLayoutData:r,yRatio:k,zeroY:_}).pipe(I(b),F(Y=>{let Z=Y.computedLayoutData[0]?Y.computedLayoutData[0].map(()=>Y.zeroY):[];return Y.computedLayoutData.map((U,V)=>U.map((q,rt)=>{const ut=Z[rt];let H=0;return q.visible&&(H=q.axisYFromZero*Y.yRatio,Z[rt]=Z[rt]+H),{...q,_barStartY:ut,_barHeight:H}}))})),L=B({computedLayoutData:r,zeroY:_}).pipe(I(b),F(Y=>Y.computedLayoutData.map((Z,U)=>Z.map((V,q)=>({...V,_barStartY:Y.zeroY,_barHeight:V.axisYFromZero}))))),z=v.pipe(W(Y=>Gp(()=>Y,L,R)));B({defsSelection:w,gridAxesSize:g}).pipe(I(b),W(async Y=>Y)).subscribe(Y=>{const Z=[{id:S,width:Y.gridAxesSize.width,height:Y.gridAxesSize.height}];HR({defsSelection:Y.defsSelection,clipPathData:Z})});const X=f.pipe(I(b),F(Y=>Y.highlightTarget),tt()),Q=B({graphicGSelection:P,graphicData:z,zeroY:_,groupLabels:A,params:l,chartParams:f,highlightTarget:X,barWidth:N,transformedBarRadius:T,delayGroup:D,transitionItem:O,isSeriesSeprate:v}).pipe(I(b),W(async Y=>Y),F(Y=>WR({graphicGSelection:Y.graphicGSelection,rectClassName:$,barData:Y.graphicData,zeroY:Y.zeroY,groupLabels:Y.groupLabels,params:Y.params,chartParams:Y.chartParams,barWidth:Y.barWidth,transformedBarRadius:Y.transformedBarRadius,delayGroup:Y.delayGroup,transitionItem:Y.transitionItem,isSeriesSeprate:Y.isSeriesSeprate})));return B({barSelection:Q,computedData:n,highlightTarget:X,SeriesDataMap:s,GroupDataMap:u}).subscribe(Y=>{Y.barSelection.on("mouseover",(Z,U)=>{Z.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:Y.highlightTarget,datum:U,gridIndex:U.gridIndex,series:Y.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:Y.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:Z,data:Y.computedData})}).on("mousemove",(Z,U)=>{Z.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:Y.highlightTarget,datum:U,gridIndex:U.gridIndex,series:Y.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:Y.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:Z,data:Y.computedData})}).on("mouseout",(Z,U)=>{Z.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:Y.highlightTarget,datum:U,gridIndex:U.gridIndex,series:Y.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:Y.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:Z,data:Y.computedData})}).on("click",(Z,U)=>{Z.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:Y.highlightTarget,datum:U,gridIndex:U.gridIndex,series:Y.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:Y.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:Z,data:Y.computedData})})}),B({barSelection:Q,highlight:m.pipe(F(Y=>Y.map(Z=>Z.id))),fullChartParams:f}).pipe(I(b),W(async Y=>Y)).subscribe(Y=>{XR({selection:Y.barSelection,ids:Y.highlight,fullChartParams:Y.fullChartParams})}),()=>{b.next(void 0)}},dx="BarStack",qR=se(dx,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=px(dx,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),gx=.3;function mx({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=(t/(e-1)-i)/n-r;return a>1?a:1}function jR(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Qf().domain(e).range([-i/2+r,i/2-r])}function VR(t,e){return t<=1?0:e/(t-1)*gx}function ZR(t,e){return t<=1?e:e*(1-gx)}function KR({graphicGSelection:t,pathGClassName:e,pathClassName:n,visibleComputedLayoutData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:u,chartParams:l,barWidth:c,delayGroup:f,transitionItem:h,isSeriesSeprate:p}){const d=c/2;return t.each((m,y,v)=>{j(v[y]).selectAll(`g.${e}`).data(r[y]??[]).join(b=>{const S=b.append("g").classed(e,!0).attr("cursor","pointer");return S.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",$=>{const E=-d,M=o[y],w=o[y];return`M${E},${M} L${E+c/2},${w} ${E+c},${M}`}),S},b=>b,b=>b.remove()).attr("transform",b=>`translate(${p?0:s(b.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",b=>Math.abs(b.axisYFromZero)).attr("y",b=>b.axisY<o[y]?b.axisY:o[y]).attr("x",b=>p?0:s(b.seriesLabel)).style("fill",b=>`url(#${i[b.seriesIndex]})`).attr("stroke",b=>b.color).attr("transform",b=>`translate(${b?b.axisX:0}, 0)`).transition().duration(h).ease(zo(l.transitionEase)).delay((b,S)=>b.groupIndex*f).attr("d",b=>{const S=-d,$=o[y],E=b.axisY;return`M${S},${$} L${S+c/2},${E} ${S+c},${$}`})}),t.selectAll(`path.${n}`)}function QR({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
|
16
|
+
`})}function wE({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{V(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(Wo(r)).tween("tween",(l,c,f)=>h=>{const p=l.width*h;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const Nv=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,layout$:y,event$:b})=>{const v=new nt,x=Dn(t,"clipPath-box"),S=ot(t,"path"),{seriesSelection$:$,axesSelection$:R,defsSelection$:T,graphicGSelection$:w}=pr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),P=p.pipe(I(v),B(E=>-E.translate[1]/E.scale[1])),_=new dt(E=>{const k=U({fullParams:l,valueAxisStart:P}).pipe(I(v)).subscribe(C=>{const F=yE(C.fullParams.lineCurve,C.valueAxisStart);E.next(F)});return()=>{k.unsubscribe()}}),N=f.pipe(B(E=>E.transitionDuration),tt()),D=f.pipe(B(E=>E.transitionEase),tt());U({defsSelection:T,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:D}).pipe(I(v),W(async E=>E)).subscribe(E=>{const C=[{id:x,width:E.axisSize.width,height:E.axisSize.height}].concat(E.seriesLabels.map(F=>({id:`orbcharts__clipPath_${F}`,width:E.axisSize.width,height:E.axisSize.height})));wE({defsSelection:E.defsSelection,clipPathData:C,transitionDuration:E.transitionDuration,transitionEase:E.transitionEase})});const A=n.pipe(B(E=>{const k=new Map;return E.flat().forEach(C=>k.set(C.id,C)),k})),L=Lv({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:m,layout$:y}),M=f.pipe(I(v),B(E=>E.highlightTarget),tt()),G=a.pipe(I(v),B(E=>E.map((k,C)=>Dn(t,`lineargradient-${k}`)))),O=U({graphicGSelection:w,defsSelection:T,visibleComputedLayoutData:o,linearGradientIds:G,areaPath:_,params:l}).pipe(I(v),W(async E=>E),B(E=>{let k=[];return E.graphicGSelection.each((C,F,X)=>{const Q=bE(E.visibleComputedLayoutData[F]??[]);k[F]=xE({selection:V(X[F]),pathClassName:S,areaPath:E.areaPath,segmentData:Q,linearGradientIds:E.linearGradientIds,params:E.params}),_E({defsSelection:E.defsSelection,computedData:E.visibleComputedLayoutData,linearGradientIds:E.linearGradientIds,params:E.params})}),k}));return U({pathSelectionArr:O,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:M,gridGroupPositionFn:L}).pipe(I(v),W(async E=>E)).subscribe(E=>{E.pathSelectionArr.forEach(k=>{k.on("mouseover",(C,F)=>{const X=F[0]?F[0].seriesLabel:"",{groupIndex:Q,groupLabel:z}=E.gridGroupPositionFn(C),q=E.GroupDataMap.get(z).find(j=>j.seriesLabel===X)??F[0];b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:q,gridIndex:q.gridIndex,series:E.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:E.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:C,data:E.computedData})}).on("mousemove",(C,F)=>{const X=F[0]?F[0].seriesLabel:"",{groupIndex:Q,groupLabel:z}=E.gridGroupPositionFn(C),q=E.GroupDataMap.get(z).find(j=>j.seriesLabel===X)??F[0];b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:q,gridIndex:q.gridIndex,series:E.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:E.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:C,data:E.computedData})}).on("mouseout",(C,F)=>{const X=F[0]?F[0].seriesLabel:"",{groupIndex:Q,groupLabel:z}=E.gridGroupPositionFn(C),q=E.GroupDataMap.get(z).find(j=>j.seriesLabel===X)??F[0];b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:q,gridIndex:q.gridIndex,series:E.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:E.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:C,data:E.computedData})}).on("click",(C,F)=>{const X=F[0]?F[0].seriesLabel:"",{groupIndex:Q,groupLabel:z}=E.gridGroupPositionFn(C),q=E.GroupDataMap.get(z).find(j=>j.seriesLabel===X)??F[0];b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:q,gridIndex:q.gridIndex,series:E.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:E.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:C,data:E.computedData})})})}),f.pipe(I(v),$i(E=>E.highlightTarget==="series"),W(E=>U({graphicGSelection:w,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(v),W(async k=>k)))).subscribe(E=>{const k=E.gridHighlight[0]?E.gridHighlight[0].seriesLabel:null;vE({selection:E.graphicGSelection,seriesLabel:k,fullChartParams:E.fullChartParams})}),()=>{v.next(void 0)}},Bv="LineAreas",$E=ue({name:Bv,defaultParams:hp,layerIndex:Rv,validator:(t,{validateColumns:e})=>e(t,{lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=Nv(Bv,{selection:t,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedLayoutData$:n.computedLayoutData$,visibleComputedLayoutData$:n.visibleComputedLayoutData$,seriesLabels$:n.seriesLabels$,SeriesDataMap$:n.SeriesDataMap$,GroupDataMap$:n.GroupDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridGraphicTransform$:n.gridGraphicTransform$,gridAxesSize$:n.gridAxesSize$,gridHighlight$:n.gridHighlight$,gridContainerPosition$:n.gridContainerPosition$,allContainerPosition$:n.gridContainerPosition$,layout$:n.layout$,event$:r.event$});return()=>{i.next(void 0),o()}}),Fv=.3;function Ov({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((e>1?t/(e-1):t)-i)/n-r;return a>1?a:1}function SE(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return ih().domain(e).range([-i/2+r,i/2-r])}function AE(t,e){return t<=1?0:e/(t-1)*Fv}function TE(t,e){return t<=1?e:e*(1-Fv)}function PE({graphicGSelection:t,rectClassName:e,visibleComputedLayoutData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:u,transformedBarRadius:l,delayGroup:c,transitionItem:f,isSeriesSeprate:h}){const p=u/2;return t.each((g,m,y)=>{V(y[m]).selectAll(`rect.${e}`).data(n[m]??[],b=>b.id).join(b=>b.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",v=>0),b=>b,b=>b.remove()).attr("transform",(b,v)=>`translate(${(b?b.axisX:0)-p}, 0)`).attr("fill",b=>b.color).attr("y",b=>b.axisY<r[m]?b.axisY:r[m]).attr("x",b=>h?0:o(b.seriesLabel)).attr("width",u).attr("rx",l[m][0]??1).attr("ry",l[m][1]??1).transition().duration(f).ease(Wo(s.transitionEase)).delay((b,v)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero))}),t.selectAll(`rect.${e}`)}function ME({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{V(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function DE({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Gh=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:y,event$:b})=>{const v=new nt,x=Dn(t,"clipPath-box"),S=ot(t,"rect"),{seriesSelection$:$,axesSelection$:R,defsSelection$:T,graphicGSelection$:w}=pr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),P=o.pipe(I(v),B(k=>k.map(C=>C[0]?C[0].axisY-C[0].axisYFromZero:0)),tt()),_=U({computedData:n,visibleComputedData:i,params:l,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(v),W(async k=>k),B(k=>k.params.barWidth?k.params.barWidth:k.isSeriesSeprate?Ov({axisWidth:k.gridAxesSize.width,groupAmount:k.computedData[0]?k.computedData[0].length:0,barAmountOfGroup:1,barPadding:k.params.barPadding,barGroupPadding:k.params.barGroupPadding}):Ov({axisWidth:k.gridAxesSize.width,groupAmount:k.computedData[0]?k.computedData[0].length:0,barAmountOfGroup:k.visibleComputedData.length,barPadding:k.params.barPadding,barGroupPadding:k.params.barGroupPadding})),tt()),N=U({computedData:n,barWidth:_,params:l,gridGraphicReverseScale:p}).pipe(I(v),W(async k=>k),B(k=>{const C=k.barWidth/2,F=k.params.barRadius===!0?C:k.params.barRadius===!1?0:typeof k.params.barRadius=="number"?k.params.barRadius:0;return k.computedData.map((X,Q)=>{const z=k.gridGraphicReverseScale[Q]??k.gridGraphicReverseScale[0];let Z=F*z[0],Y=F*z[1];if(Z>C){const q=C/Z;Z=Z*q,Y=Y*q}return[Z,Y]})})),D=i.pipe(I(v),B(k=>{const C=new Set;return k.forEach(F=>{F.forEach(X=>{C.add(X.groupLabel)})}),Array.from(C)})),A=U({seriesLabels:a,barWidth:_,params:l}).pipe(I(v),W(async k=>k),B(k=>SE(k.barWidth,k.seriesLabels,k.params))),L=c.pipe(I(v),B(k=>k.transitionDuration),tt()),M=new dt(k=>{U({groupLabels:D,transitionDuration:L}).pipe(W(async C=>C)).subscribe(C=>{const F=AE(C.groupLabels.length,C.transitionDuration);k.next(F)})}).pipe(I(v),tt()),G=new dt(k=>{U({groupLabels:D,transitionDuration:L}).pipe(W(async C=>C)).subscribe(C=>{const F=TE(C.groupLabels.length,C.transitionDuration);k.next(F)})}).pipe(I(v),tt());U({defsSelection:T,gridAxesSize:d}).pipe(I(v),W(async k=>k)).subscribe(k=>{const C=[{id:x,width:k.gridAxesSize.width,height:k.gridAxesSize.height}];ME({defsSelection:k.defsSelection,clipPathData:C})});const O=c.pipe(I(v),B(k=>k.highlightTarget),tt()),E=U({graphicGSelection:w,visibleComputedLayoutData:o,zeroYArr:P,groupLabels:D,barScale:A,params:l,chartParams:c,highlightTarget:O,barWidth:_,transformedBarRadius:N,delayGroup:M,transitionItem:G,isSeriesSeprate:y}).pipe(I(v),W(async k=>k),B(k=>PE({graphicGSelection:k.graphicGSelection,rectClassName:S,visibleComputedLayoutData:k.visibleComputedLayoutData,zeroYArr:k.zeroYArr,groupLabels:k.groupLabels,barScale:k.barScale,params:k.params,chartParams:k.chartParams,barWidth:k.barWidth,transformedBarRadius:k.transformedBarRadius,delayGroup:k.delayGroup,transitionItem:k.transitionItem,isSeriesSeprate:k.isSeriesSeprate})));return U({barSelection:E,computedData:n,highlightTarget:O,SeriesDataMap:s,GroupDataMap:u}).pipe(I(v),W(async k=>k)).subscribe(k=>{k.barSelection.on("mouseover",(C,F)=>{C.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:k.highlightTarget,datum:F,gridIndex:F.gridIndex,series:k.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:k.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:C,data:k.computedData})}).on("mousemove",(C,F)=>{C.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:k.highlightTarget,datum:F,gridIndex:F.gridIndex,series:k.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:k.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:C,data:k.computedData})}).on("mouseout",(C,F)=>{C.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:k.highlightTarget,datum:F,gridIndex:F.gridIndex,series:k.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:k.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:C,data:k.computedData})}).on("click",(C,F)=>{C.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:k.highlightTarget,datum:F,gridIndex:F.gridIndex,series:k.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:k.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:C,data:k.computedData})})}),U({barSelection:E,highlight:g.pipe(B(k=>k.map(C=>C.id))),fullChartParams:c}).pipe(I(v),W(async k=>k)).subscribe(k=>{DE({selection:k.barSelection,ids:k.highlight,fullChartParams:k.fullChartParams})}),()=>{v.next(void 0)}},Gv="Bars",CE=ue({name:Gv,defaultParams:jo,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Gh(Gv,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),zv="BarsPN",LE=ue({name:zv,defaultParams:jo,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Gh(zv,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:Qo(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),Yv=.3;function kE({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function RE(t,e){return t<=1?0:e/(t-1)*Yv}function EE(t,e){return t<=1?e:e*(1-Yv)}function IE({graphicGSelection:t,rectClassName:e,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:u,delayGroup:l,transitionItem:c,isSeriesSeprate:f}){const h=s/2;return t.each((d,g,m)=>{V(m[g]).selectAll(`rect.${e}`).data(n[g]??[],y=>y.id).join(y=>y.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",b=>0),y=>y,y=>y.remove()).attr("transform",(y,b)=>`translate(${(y?y.axisX:0)-h}, 0)`).attr("fill",y=>y.color).attr("y",y=>r).attr("x",y=>0).attr("width",s).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(c).ease(Wo(a.transitionEase)).delay((y,b)=>y.groupIndex*l).attr("y",y=>y._barStartY).attr("height",y=>Math.abs(y._barHeight))}),t.selectAll(`rect.${e}`)}function NE({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{V(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function BE({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Uv=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridGraphicReverseScale$:d,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:y,isSeriesSeprate$:b,event$:v})=>{const x=new nt,S=Dn(t,"clipPath-box"),$=ot(t,"rect"),{seriesSelection$:R,axesSelection$:T,defsSelection$:w,graphicGSelection$:P}=pr({selection:e,pluginName:t,clipPathID:S,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),_=o.pipe(I(x),B(z=>z[0]&&z[0][0]?z[0][0].axisY-z[0][0].axisYFromZero:0),tt()),N=U({computedData:n,params:l,axisSize:g,isSeriesSeprate:b}).pipe(I(x),W(async z=>z),B(z=>z.params.barWidth?z.params.barWidth:kE({axisWidth:z.axisSize.width,groupAmount:z.computedData[0]?z.computedData[0].length:0,barGroupPadding:z.params.barGroupPadding})),tt()),D=U({computedData:n,barWidth:N,params:l,gridGraphicReverseScale:d}).pipe(I(x),W(async z=>z),B(z=>{const Z=z.barWidth/2,Y=z.params.barRadius===!0?Z:z.params.barRadius===!1?0:typeof z.params.barRadius=="number"?z.params.barRadius:0;return z.computedData.map((q,j)=>{const rt=z.gridGraphicReverseScale[j]??z.gridGraphicReverseScale[0],ut=Y*rt[0],H=Y*rt[1];return[ut,H]})})),A=i.pipe(I(x),B(z=>{const Z=new Set;return z.forEach(Y=>{Y.forEach(q=>{Z.add(q.groupLabel)})}),Array.from(Z)}),St(1)),L=f.pipe(I(x),B(z=>z.transitionDuration),tt()),M=new dt(z=>{U({groupLabels:A,transitionDuration:L}).pipe(W(async Z=>Z)).subscribe(Z=>{const Y=RE(Z.groupLabels.length,Z.transitionDuration);z.next(Y)})}).pipe(I(x),tt()),G=new dt(z=>{U({groupLabels:A,transitionDuration:L}).pipe(W(async Z=>Z)).subscribe(Z=>{const Y=EE(Z.groupLabels.length,Z.transitionDuration);z.next(Y)})}).pipe(I(x),tt()),O=U({computedData:n,dataFormatter:c}).pipe(I(x),W(async z=>z),B(z=>{const Z=z.computedData[0]?z.computedData[0].length-1:0,Y=z.dataFormatter.grid.groupAxis.scaleDomain[0],q=z.dataFormatter.grid.groupAxis.scaleDomain[1]==="max"?Z:z.dataFormatter.grid.groupAxis.scaleDomain[1];return[Y,q]})),E=U({visibleComputedLayoutData:o,groupScaleDomain:O}).pipe(I(x),W(async z=>z),B(z=>{const Z=z.groupScaleDomain[0],Y=z.groupScaleDomain[1],j=z.visibleComputedLayoutData.map(mt=>mt.filter((ht,Ut)=>ht.groupIndex>=Z&&ht.groupIndex<=Y)).flat();if(j.length<=1)return 1;const rt=j.reduce((mt,ht)=>ht.value>mt.value?ht:mt,j[0]),ut=rt.groupIndex,H=j.filter(mt=>mt.groupIndex===ut).reduce((mt,ht)=>mt+ht.value,0);return rt.value/H})),k=U({computedLayoutData:r,yRatio:E,zeroY:_}).pipe(I(x),B(z=>{let Z=z.computedLayoutData[0]?z.computedLayoutData[0].map(()=>z.zeroY):[];return z.computedLayoutData.map((Y,q)=>Y.map((j,rt)=>{const ut=Z[rt];let H=0;return j.visible&&(H=j.axisYFromZero*z.yRatio,Z[rt]=Z[rt]+H),{...j,_barStartY:ut,_barHeight:H}}))})),C=U({computedLayoutData:r,zeroY:_}).pipe(I(x),B(z=>z.computedLayoutData.map((Z,Y)=>Z.map((q,j)=>({...q,_barStartY:z.zeroY,_barHeight:q.axisYFromZero}))))),F=b.pipe(W(z=>Xp(()=>z,C,k)));U({defsSelection:w,gridAxesSize:g}).pipe(I(x),W(async z=>z)).subscribe(z=>{const Z=[{id:S,width:z.gridAxesSize.width,height:z.gridAxesSize.height}];NE({defsSelection:z.defsSelection,clipPathData:Z})});const X=f.pipe(I(x),B(z=>z.highlightTarget),tt()),Q=U({graphicGSelection:P,graphicData:F,zeroY:_,groupLabels:A,params:l,chartParams:f,highlightTarget:X,barWidth:N,transformedBarRadius:D,delayGroup:M,transitionItem:G,isSeriesSeprate:b}).pipe(I(x),W(async z=>z),B(z=>IE({graphicGSelection:z.graphicGSelection,rectClassName:$,barData:z.graphicData,zeroY:z.zeroY,groupLabels:z.groupLabels,params:z.params,chartParams:z.chartParams,barWidth:z.barWidth,transformedBarRadius:z.transformedBarRadius,delayGroup:z.delayGroup,transitionItem:z.transitionItem,isSeriesSeprate:z.isSeriesSeprate})));return U({barSelection:Q,computedData:n,highlightTarget:X,SeriesDataMap:s,GroupDataMap:u}).subscribe(z=>{z.barSelection.on("mouseover",(Z,Y)=>{Z.stopPropagation(),v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:z.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:z.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:z.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:Z,data:z.computedData})}).on("mousemove",(Z,Y)=>{Z.stopPropagation(),v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:z.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:z.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:z.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:Z,data:z.computedData})}).on("mouseout",(Z,Y)=>{Z.stopPropagation(),v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:z.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:z.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:z.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:Z,data:z.computedData})}).on("click",(Z,Y)=>{Z.stopPropagation(),v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:z.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:z.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,groups:z.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:Z,data:z.computedData})})}),U({barSelection:Q,highlight:m.pipe(B(z=>z.map(Z=>Z.id))),fullChartParams:f}).pipe(I(x),W(async z=>z)).subscribe(z=>{BE({selection:z.barSelection,ids:z.highlight,fullChartParams:z.fullChartParams})}),()=>{x.next(void 0)}},Wv="BarStack",FE=ue({name:Wv,defaultParams:dp,layerIndex:5,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Uv(Wv,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),Hv=.3;function Xv({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=(t/(e-1)-i)/n-r;return a>1?a:1}function OE(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return ih().domain(e).range([-i/2+r,i/2-r])}function GE(t,e){return t<=1?0:e/(t-1)*Hv}function zE(t,e){return t<=1?e:e*(1-Hv)}function YE({graphicGSelection:t,pathGClassName:e,pathClassName:n,visibleComputedLayoutData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:u,chartParams:l,barWidth:c,delayGroup:f,transitionItem:h,isSeriesSeprate:p}){const d=c/2;return t.each((m,y,b)=>{V(b[y]).selectAll(`g.${e}`).data(r[y]??[]).join(x=>{const S=x.append("g").classed(e,!0).attr("cursor","pointer");return S.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",$=>{const R=-d,T=o[y],w=o[y];return`M${R},${T} L${R+c/2},${w} ${R+c},${T}`}),S},x=>x,x=>x.remove()).attr("transform",x=>`translate(${p?0:s(x.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",x=>Math.abs(x.axisYFromZero)).attr("y",x=>x.axisY<o[y]?x.axisY:o[y]).attr("x",x=>p?0:s(x.seriesLabel)).style("fill",x=>`url(#${i[x.seriesIndex]})`).attr("stroke",x=>x.color).attr("transform",x=>`translate(${x?x.axisX:0}, 0)`).transition().duration(h).ease(Wo(l.transitionEase)).delay((x,S)=>x.groupIndex*f).attr("d",x=>{const S=-d,$=o[y],R=x.axisY;return`M${S},${$} L${S+c/2},${R} ${S+c},${$}`})}),t.selectAll(`path.${n}`)}function UE({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
|
13
17
|
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
14
18
|
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
15
|
-
`})}function JR({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{j(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function tk({selection:t,ids:e,fullChartParams:n}){t.interrupt("highlight");const r=()=>{t.transition("highlight").duration(200).style("opacity",1)};if(!e.length){r();return}t.each((i,o,a)=>{e.includes(i.id)?j(a[o]).style("opacity",1):j(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const yx=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:u,GroupDataMap$:l,fullParams$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:y,event$:v})=>{const x=new nt,b=Sn(t,"clipPath-box"),S=it(t,"pathG"),$=it(t,"path"),{seriesSelection$:E,axesSelection$:M,defsSelection$:w,graphicGSelection$:P}=sr({selection:e,pluginName:t,clipPathID:b,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(x),F(L=>-L.translate[1]/L.scale[1]));const _=o.pipe(F(L=>L.map(z=>z[0]?z[0].axisY-z[0].axisYFromZero:0)),tt()),N=B({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async L=>L),F(L=>L.params.barWidth?L.params.barWidth:L.isSeriesSeprate?mx({axisWidth:L.gridAxesSize.width,groupAmount:L.computedData[0]?L.computedData[0].length:0,barAmountOfGroup:1,barPadding:L.params.barPadding,barGroupPadding:L.params.barGroupPadding}):mx({axisWidth:L.gridAxesSize.width,groupAmount:L.computedData[0]?L.computedData[0].length:0,barAmountOfGroup:L.visibleComputedData.length,barPadding:L.params.barPadding,barGroupPadding:L.params.barGroupPadding}))),T=i.pipe(I(x),F(L=>{const z=new Set;return L.forEach(X=>{X.forEach(Q=>{z.add(Q.groupLabel)})}),Array.from(z)})),A=new dt(L=>{B({seriesLabels:s,barWidth:N,params:c}).pipe(I(x),W(async z=>z)).subscribe(z=>{const X=jR(z.barWidth,z.seriesLabels,z.params);L.next(X)})}),C=f.pipe(I(x),F(L=>L.transitionDuration),tt()),D=new dt(L=>{B({groupLabels:T,transitionDuration:C}).pipe(W(async z=>z)).subscribe(z=>{const X=VR(z.groupLabels.length,z.transitionDuration);L.next(X)})}).pipe(I(x),tt()),O=new dt(L=>{B({groupLabels:T,transitionDuration:C}).pipe(W(async z=>z)).subscribe(z=>{const X=ZR(z.groupLabels.length,z.transitionDuration);L.next(X)})}).pipe(I(x),tt());B({defsSelection:w,gridAxesSize:d}).pipe(I(x),W(async L=>L)).subscribe(L=>{const z=[{id:b,width:L.gridAxesSize.width,height:L.gridAxesSize.height}];JR({defsSelection:L.defsSelection,clipPathData:z})});const G=f.pipe(I(x),F(L=>L.highlightTarget),tt()),k=s.pipe(I(x),F(L=>L.map((z,X)=>Sn(t,`lineargradient-${z}`)))),R=B({graphicGSelection:P,defsSelection:w,computedData:n,visibleComputedLayoutData:o,linearGradientIds:k,zeroYArr:_,groupLabels:T,barScale:A,params:c,chartParams:f,barWidth:N,delayGroup:D,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async L=>L),F(L=>(QR({defsSelection:L.defsSelection,computedData:L.computedData,linearGradientIds:L.linearGradientIds,params:L.params}),KR({graphicGSelection:L.graphicGSelection,pathGClassName:S,pathClassName:$,visibleComputedLayoutData:L.visibleComputedLayoutData,linearGradientIds:L.linearGradientIds,zeroYArr:L.zeroYArr,groupLabels:L.groupLabels,barScale:L.barScale,params:L.params,chartParams:L.chartParams,barWidth:L.barWidth,delayGroup:L.delayGroup,transitionItem:L.transitionItem,isSeriesSeprate:L.isSeriesSeprate}))));return B({barSelection:R,computedData:n,highlightTarget:G,SeriesDataMap:u,GroupDataMap:l}).subscribe(L=>{L.barSelection.on("mouseover",(z,X)=>{z.stopPropagation(),v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:L.highlightTarget,datum:X,gridIndex:X.gridIndex,series:L.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:L.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:z,data:L.computedData})}).on("mousemove",(z,X)=>{z.stopPropagation(),v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:L.highlightTarget,datum:X,gridIndex:X.gridIndex,series:L.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:L.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:z,data:L.computedData})}).on("mouseout",(z,X)=>{z.stopPropagation(),v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:L.highlightTarget,datum:X,gridIndex:X.gridIndex,series:L.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:L.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:z,data:L.computedData})}).on("click",(z,X)=>{z.stopPropagation(),v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:L.highlightTarget,datum:X,gridIndex:X.gridIndex,series:L.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:L.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:z,data:L.computedData})})}),B({barSelection:R,highlight:g.pipe(F(L=>L.map(z=>z.id))),fullChartParams:f}).pipe(I(x),W(async L=>L)).subscribe(L=>{tk({selection:L.barSelection,ids:L.highlight,fullChartParams:L.fullChartParams})}),()=>{x.next(void 0)}},bx="BarsTriangle",ek=se(bx,up)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=yx(bx,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,fullDataFormatter$:r.fullDataFormatter$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}});function nk({graphicGSelection:t,circleGClassName:e,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let u=0;return t.each((c,f,h)=>{j(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(u=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,g)=>{j(g[d]).selectAll("circle").data([p]).join(m=>m.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,v)=>d*u).attr("opacity",1),m=>m.transition().duration(50).attr("opacity",1),m=>m.remove()).attr("r",i.radius).attr("fill",(m,y)=>$n({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,y)=>$n({datum:m,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function rk({selection:t,ids:e,onlyShowHighlighted:n,fullChartParams:r}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}t.each((i,o,a)=>{e.includes(i.id)?j(a[o]).style("opacity",1).transition("highlight").duration(200):j(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function ik({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{j(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const vx=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,event$:y})=>{const v=new nt,x=Sn(t,"clipPath-box"),b=it(t,"circleG"),S=it(t,"circle"),{seriesSelection$:$,axesSelection$:E,defsSelection$:M,graphicGSelection$:w}=sr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),P=B({computedData:n,gridGraphicReverseScale:p}).pipe(I(v),W(async A=>A),F(A=>A.computedData.map((C,D)=>A.gridGraphicReverseScale[D])));B({defsSelection:M,gridAxesSize:d}).pipe(I(v),W(async A=>A)).subscribe(A=>{const C=[{id:x,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];ik({defsSelection:A.defsSelection,clipPathData:C})});const _=c.pipe(I(v),F(A=>A.highlightTarget),tt()),N=B({graphicGSelection:w,visibleComputedLayoutData:o,graphicReverseScale:P,fullChartParams:c,fullParams:l}).pipe(I(v),W(async A=>A),F(A=>nk({graphicGSelection:A.graphicGSelection,circleGClassName:b,circleClassName:S,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));B({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:_}).pipe(I(v),W(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(C,D)=>{C.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:D,gridIndex:D.gridIndex,series:A.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:A.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:C,data:A.computedData})}).on("mousemove",(C,D)=>{C.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:D,gridIndex:D.gridIndex,series:A.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:A.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:C})}).on("mouseout",(C,D)=>{C.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:D,gridIndex:D.gridIndex,series:A.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:A.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:C,data:A.computedData})}).on("click",(C,D)=>{C.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:D,gridIndex:D.gridIndex,series:A.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:A.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:C,data:A.computedData})})});const T=l.pipe(I(v),F(A=>A.onlyShowHighlighted),tt());return B({graphicSelection:N,highlight:g.pipe(F(A=>A.map(C=>C.id))),onlyShowHighlighted:T,fullChartParams:c}).pipe(I(v),W(async A=>A)).subscribe(A=>{rk({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{v.next(void 0)}},xx="Dots",ok=se(xx,ap)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=vx(xx,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,event$:n.event$});return()=>{i.next(void 0),o()}}),ak={listRectWidth:14,listRectHeight:14,listRectRadius:0};function _x(t,e){const n=t<e.colors[e.colorScheme].series.length?t:t%e.colors[e.colorScheme].series.length;return e.colors[e.colorScheme].series[n]}const Eu=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=it(t,"root-position"),u=it(t,"legend-card"),l=it(t,"legend-list"),c=it(t,"legend-item"),f=new nt,h=B({seriesLabels:n,fullChartParams:o}).pipe(I(f),W(async w=>w),F(w=>{const P=new Map;let _=0;return w.seriesLabels.forEach((N,T)=>{if(!P.has(N)){const A=_x(_,w.fullChartParams);P.set(N,A),_++}}),P})),p=n.pipe(I(f),F(w=>{const P=new Set;let _=[];return w.forEach(N=>{P.has(N)?_.push(!1):_.push(!0),P.add(N)}),_})),d=r.pipe(I(f),F(w=>w.position==="bottom"||w.position==="top"?"row":"column")),g=B({fullParams:r,layout:i}).pipe(I(f),W(async w=>w),F(w=>{const P=w.fullParams.padding*2+w.fullParams.gap*2;return w.fullParams.position==="bottom"||w.fullParams.position==="top"?w.layout.rootWidth-P:w.layout.rootHeight-P})),y=B({layout:i,fullParams:r}).pipe(I(f),W(async w=>w),F(w=>{let P=0,_=0;return w.fullParams.position==="bottom"?(_=w.layout.rootHeight,w.fullParams.justify==="start"?P=0:w.fullParams.justify==="center"?P=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(P=w.layout.rootWidth)):w.fullParams.position==="right"?(P=w.layout.rootWidth,w.fullParams.justify==="start"?_=0:w.fullParams.justify==="center"?_=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(_=w.layout.rootHeight)):w.fullParams.position==="top"?(_=0,w.fullParams.justify==="start"?P=0:w.fullParams.justify==="center"?P=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(P=w.layout.rootWidth)):w.fullParams.position==="left"&&(P=0,w.fullParams.justify==="start"?_=0:w.fullParams.justify==="center"?_=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(_=w.layout.rootHeight)),{x:P,y:_}})).pipe(I(f),F(w=>e.selectAll(`g.${s}`).data([w]).join(P=>P.append("g").classed(s,!0).attr("transform",_=>`translate(${_.x}, ${_.y})`),P=>P.transition().attr("transform",_=>`translate(${_.x}, ${_.y})`),P=>P.remove()))),v=r.pipe(I(f),F(w=>w.seriesList[0]?w.seriesList[0]:ak)),x=B({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:v,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),W(async w=>w),F(w=>w.seriesLabels.reduce((P,_,N)=>{if(!w.visibleList[N])return P;const T=nx(_,w.textSizePx),A=w.textSizePx*1.5+T,C=w.SeriesLabelColorMap.get(_),D=P[0]&&P[0][0]?P[P.length-1][P[P.length-1].length-1]:null,{translateX:O,translateY:G,lineIndex:k,itemIndex:R}=((z,X,Q)=>{let Y=0,Z=0,U=0,V=0;if(z.lineDirection==="column"){let q=Q?Q.translateY+z.textSizePx+z.fullParams.gap:0;if(q+z.textSizePx>z.lineMaxSize){U=Q.lineIndex+1,V=0,Z=0;const rt=X[X.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);Y=Q.translateX+rt+z.fullParams.gap}else U=Q?Q.lineIndex:0,V=Q?Q.itemIndex+1:0,Z=q,Y=Q?Q.translateX:0}else{let q=Q?Q.translateX+Q.itemWidth+z.fullParams.gap:0;q+A>z.lineMaxSize?(U=Q.lineIndex+1,V=0,Y=0):(U=Q?Q.lineIndex:0,V=Q?Q.itemIndex+1:0,Y=q),Z=(z.textSizePx+z.fullParams.gap)*U}return{translateX:Y,translateY:Z,lineIndex:U,itemIndex:V}})(w,P,D);P[k]||(P[k]=[]);const L=w.fullParams.seriesList[R]?w.fullParams.seriesList[R]:w.defaultListStyle;return P[k].push({id:_,seriesLabel:_,seriesIndex:N,lineIndex:k,itemIndex:R,text:_,itemWidth:A,translateX:O,translateY:G,color:C,listRectWidth:L.listRectWidth,listRectHeight:L.listRectHeight,listRectRadius:L.listRectRadius}),P},[])),St(1)),b=B({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:x,textSizePx:a}).pipe(I(f),W(async w=>w),F(w=>{const{width:P,height:_}=((N,T)=>{let A=0,C=0;if(!T.length||!T[0].length)return{width:A,height:C};const D=T[0][T[0].length-1];return N.lineDirection==="column"?(A=T.reduce((O,G)=>{const k=G.reduce((R,L)=>L.itemWidth>R?L.itemWidth:R,0);return O+k},0),A+=N.fullParams.gap*(T.length-1),C=D.translateY+N.textSizePx):(A=D.translateX+D.itemWidth,C=N.textSizePx*T.length+N.fullParams.gap*(T.length-1)),{width:A,height:C}})(w,w.lengendItems);return{direction:w.lineDirection,width:P,height:_,translateX:w.fullParams.gap,translateY:w.fullParams.gap}}),St(1)),S=B({fullParams:r,lengendList:b}).pipe(I(f),W(async w=>w),F(w=>{const P=w.lengendList.width+w.fullParams.gap*2,_=w.lengendList.height+w.fullParams.gap*2;let N=0,T=0;return w.fullParams.position==="left"?w.fullParams.justify==="start"?(N=w.fullParams.padding,T=w.fullParams.padding):w.fullParams.justify==="center"?(N=w.fullParams.padding,T=-_/2):w.fullParams.justify==="end"&&(N=w.fullParams.padding,T=-_-w.fullParams.padding):w.fullParams.position==="right"?w.fullParams.justify==="start"?(N=-P-w.fullParams.padding,T=w.fullParams.padding):w.fullParams.justify==="center"?(N=-P-w.fullParams.padding,T=-_/2):w.fullParams.justify==="end"&&(N=-P-w.fullParams.padding,T=-_-w.fullParams.padding):w.fullParams.position==="top"?w.fullParams.justify==="start"?(N=w.fullParams.padding,T=w.fullParams.padding):w.fullParams.justify==="center"?(N=-P/2,T=w.fullParams.padding):w.fullParams.justify==="end"&&(N=-P-w.fullParams.padding,T=w.fullParams.padding):w.fullParams.justify==="start"?(N=w.fullParams.padding,T=-_-w.fullParams.padding):w.fullParams.justify==="center"?(N=-P/2,T=-_-w.fullParams.padding):w.fullParams.justify==="end"&&(N=-P-w.fullParams.padding,T=-_-w.fullParams.padding),{width:P,height:_,translateX:N,translateY:T}})),$=B({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:S}).pipe(I(f),W(async w=>w),F(w=>w.rootPositionSelection.selectAll("g").data([w.legendCard]).join(P=>P.append("g").classed(u,!0).attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.transition().attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.remove()).each((P,_,N)=>{j(N[_]).selectAll("rect").data([P]).join("rect").attr("width",T=>T.width).attr("height",T=>T.height).attr("fill",Ct(w.fullParams.backgroundFill,w.fullChartParams)).attr("stroke",Ct(w.fullParams.backgroundStroke,w.fullChartParams))}))),E=B({lengendCardSelection:$,fullParams:r,lengendList:b}).pipe(I(f),W(async w=>w),F(w=>w.lengendCardSelection.selectAll("g").data([w.lengendList]).join(P=>P.append("g").classed(l,!0).attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.transition().attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.remove())));return B({lengendListSelection:E,fullParams:r,fullChartParams:o,lengendItems:x,textSizePx:a}).pipe(I(f),W(async w=>w),F(w=>{const P=w.lengendItems[0]?w.lengendItems.flat():[];return w.lengendListSelection.selectAll(`g.${c}`).data(P).join(_=>_.append("g").classed(c,!0).attr("cursor","default"),_=>_,_=>_.remove()).attr("transform",(_,N)=>`translate(${_.translateX}, ${_.translateY})`).each((_,N,T)=>{const A=w.textSizePx/2,C=-_.listRectWidth/2,D=-_.listRectHeight/2;j(T[N]).selectAll("rect").data([_]).join("rect").attr("x",A).attr("y",A).attr("width",O=>O.listRectWidth).attr("height",O=>O.listRectHeight).attr("transform",O=>`translate(${C}, ${D})`).attr("fill",O=>O.color).attr("rx",O=>O.listRectRadius),j(T[N]).selectAll("text").data([_]).join(O=>O.append("text").attr("dominant-baseline","hanging"),O=>O,O=>O.remove()).attr("x",w.textSizePx*1.5).attr("font-size",w.fullChartParams.styles.textSize).attr("fill",O=>w.fullParams.textColorType==="series"?_x(O.seriesIndex,w.fullChartParams):Ct(w.fullParams.textColorType,w.fullChartParams)).text(O=>O.text)})})).subscribe(),()=>{e.select(`g.${s}`).remove(),f.next(void 0)}},wx="GridLegend",sk=se(wx,fp)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),F(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),F(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Eu(wx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}});function uk(t,{text:e,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(t==null||e==null){console.error("selection or text is not defined");return}n==null&&(n=t.node().getBBox().width/2);function a(p){let d;return i?d=p.split(""):d=p.split(/\s+/g),d[d.length-1]||d.pop(),d[0]||d.shift(),d}function s(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function u(p){var g;const d=document.createElement("canvas").getContext("2d");return((g=d==null?void 0:d.measureText(p))==null?void 0:g.width)??0}function l(p){const d=u(p.trim());return Math.sqrt(d*r)}function c(p,d){let g={width:0,text:""},m=1/0;const y=[];let v=" ";i&&(v="");for(let x=0,b=p.length;x<b;++x){const S=(g.text?g.text+v:"")+p[x],$=u(S);(m+$)/2<d?(g.width=m=$,g.text=S):(m=u(p[x]),g={width:m,text:p[x]},y.push(g))}return y}function f(p){let d=0;for(let g=0,m=p.length;g<m;++g){const y=(Math.abs(g-m/2+.5)+.5)*r,v=p[g].width/2;d=Math.max(d,Math.sqrt(v**2+y**2))}return d}function h(p,d){o>0&&(d=s(d,o));const g=a(d),m=l(d),y=c(g,m),v=f(y);let x=p.select("text");x.size()||(x=p.append("text")),x.attr("transform",`translate(0,0) scale(${n/v})`);const b=x.selectAll("tspan").data(y),S=b.enter().append("tspan").attr("x",0).merge(b).attr("y",($,E)=>(E-y.length/2+.8)*r).text($=>$.text);return b.exit().remove(),b.merge(S)}return h(t,e)}function $x(t,{textArr:e,textSizePx:n,groupAxisPosition:r}){t.text(null);const i=Number(t.attr("x"));let o=Number(t.attr("y"));r==="top"&&(o-=(e.length-1)*n),t.selectAll("tspan").data(e).join("tspan").attr("x",i).attr("y",(a,s)=>o+s*n).text(a=>a)}function Sx(t,{textArr:e,textSizePx:n,quadrant:r}){t.selectAll("tspan").data(e).join("tspan").attr("x",0).attr("y",(i,o)=>r==1||r==2?-(e.length-1-o)*n:o*n).text(i=>i)}const lk=6;function ck(t,e){return t.map((n,r)=>{const i=Ch(n,e),o=i.split(`
|
16
|
-
`);return{text:i,textArr:o}})}function fk({selection:t,groupingLabelClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,textReverseTransform:s}){const u=n.tickPadding+n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="top"?(f=-l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="left"?(c=-u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)):o.grid.groupAxis.position==="right"&&(c=u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{j(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",Ct(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.groupAxis.label)}).attr("transform",h=>`translate(${i.width}, 0)`)}function hk({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:u,groupLabelData:l,textReverseTransformWithRotate:c,textSizePx:f}){const h=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),p=Math.floor(u[1])-Math.ceil(u[0])+1;let d=0,g=0;o.grid.groupAxis.position==="left"?(d=0,g=-n.tickPadding):o.grid.groupAxis.position==="right"?(d=0,g=n.tickPadding):o.grid.groupAxis.position==="bottom"?(d=n.tickPadding,g=0):o.grid.groupAxis.position==="top"&&(d=-n.tickPadding,g=-0);const m=Eg(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?i.height:-lk).tickSizeOuter(0).tickFormat(x=>{var b;return((b=l[x])==null?void 0:b.text)??""}).tickPadding(d),y=h.transition().duration(100).call(m).on("end",(x,b)=>{y.selectAll(".tick text").each((S,$,E)=>{var w;const M=((w=l[S])==null?void 0:w.textArr)??[];$x(j(E[$]),{textArr:M,textSizePx:f,groupAxisPosition:o.grid.groupAxis.position})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),h.selectAll("text").attr("font-size",a.styles.textSize).attr("fill",Ct(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",g).style("transform",c).attr("dy",0),h}const Ax=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c,textSizePx$:f})=>{const h=new nt,p=it(t,"container"),d=it(t,"xAxisG"),g=it(t,"xAxis"),m=it(t,"groupingLabel"),y=B({computedData:n.pipe(tt((_,N)=>_.length===N.length)),isSeriesSeprate:c}).pipe(I(h),W(async _=>_),F(_=>_.isSeriesSeprate?_.computedData:[_.computedData[0]]),F((_,N)=>e.selectAll(`g.${p}`).data(_,T=>T[0]?T[0].seriesIndex:N).join("g").classed(p,!0))),v=y.pipe(I(h),F((_,N)=>_.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));B({containerSelection:y,gridContainerPosition:l}).pipe(I(h),W(async _=>_)).subscribe(_=>{_.containerSelection.attr("transform",(N,T)=>{const A=_.gridContainerPosition[T]??_.gridContainerPosition[0],C=A.translate,D=A.scale;return`translate(${C[0]}, ${C[1]}) scale(${D[0]}, ${D[1]})`})}),B({axisSelection:v,gridAxesTransform:a}).pipe(I(h),W(async _=>_)).subscribe(_=>{_.axisSelection.style("transform",_.gridAxesTransform.value)});const x=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(h),W(async _=>_),F(_=>{const N=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,T=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,A=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${N} ${T} ${A}`}),tt()),b=B({textReverseTransform:x,fullParams:r}).pipe(I(h),W(async _=>_),F(_=>`${_.textReverseTransform} rotate(${_.fullParams.tickTextRotate}deg)`)),S=B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(h),W(async _=>_),F(_=>{const N=_.computedData[0]?_.computedData[0].length-1:0,T=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,A=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?N+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding;return[T,A]}),St(1)),$=B({groupScaleDomain:S,gridAxesSize:u}).pipe(I(h),W(async _=>_),F(_=>Po().domain(_.groupScaleDomain).range([0,_.gridAxesSize.width]))),E=n.pipe(F(_=>(_[0]??[]).map(N=>N.groupLabel))),M=B({fullDataFormatter:i,fullParams:r}).pipe(I(h),W(async _=>_),F(_=>{let N="middle",T="hanging";return _.fullDataFormatter.grid.groupAxis.position==="bottom"?(N=_.fullParams.tickTextRotate?"end":"middle",T="hanging"):_.fullDataFormatter.grid.groupAxis.position==="top"?(N=_.fullParams.tickTextRotate?"start":"middle",T="auto"):_.fullDataFormatter.grid.groupAxis.position==="left"?(N="end",T="middle"):_.fullDataFormatter.grid.groupAxis.position==="right"&&(N="start",T="middle"),{textAnchor:N,dominantBaseline:T}})),w=i.pipe(I(h),F(_=>{let N="start",T="hanging";return _.grid.groupAxis.position==="bottom"?T="hanging":_.grid.groupAxis.position==="top"?T="auto":_.grid.groupAxis.position==="left"?N="end":_.grid.groupAxis.position==="right"&&(N="start"),_.grid.valueAxis.position==="left"?N="start":_.grid.valueAxis.position==="right"?N="end":_.grid.valueAxis.position==="bottom"?T="auto":_.grid.valueAxis.position==="top"&&(T="hanging"),{textAnchor:N,dominantBaseline:T}})),P=B({groupLabels:E,fullParams:r}).pipe(I(h),W(async _=>_),F(_=>ck(_.groupLabels,_.fullParams.tickFormat)));return B({axisSelection:v,fullParams:r,tickTextAlign:M,axisLabelAlign:w,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:S,groupLabelData:P,textReverseTransform:x,textReverseTransformWithRotate:b,textSizePx:f}).pipe(I(h),W(async _=>_)).subscribe(_=>{hk({selection:_.axisSelection,xAxisClassName:g,fullParams:_.fullParams,tickTextAlign:_.tickTextAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,groupScale:_.groupScale,groupScaleDomain:_.groupScaleDomain,groupLabelData:_.groupLabelData,textReverseTransformWithRotate:_.textReverseTransformWithRotate,textSizePx:_.textSizePx}),fk({selection:_.axisSelection,groupingLabelClassName:m,fullParams:_.fullParams,axisLabelAlign:_.axisLabelAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,textReverseTransform:_.textReverseTransform})}),()=>{h.next(void 0)}},Mx="GroupAxis",pk=se(Mx,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=Ax(Mx,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),o()}}),dk=6;function gk({selection:t,textClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,textReverseTransform:s}){const u=n.tickPadding-n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=-l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="top"?(f=l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="left"?(c=u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)):o.grid.groupAxis.position==="right"&&(c=-u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{j(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",Ct(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.valueAxis.label)}).attr("transform",h=>`translate(0, ${i.height})`)}function mk({selection:t,yAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:u,minAndMax:l}){const c=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),f=l[1]-l[0];let h=0,p=0;o.grid.valueAxis.position==="left"?(h=n.tickPadding,p=0):o.grid.valueAxis.position==="right"?(h=-n.tickPadding,p=0):o.grid.valueAxis.position==="bottom"?(h=0,p=n.tickPadding):o.grid.valueAxis.position==="top"&&(h=0,p=-n.tickPadding);const d=Rg(s).scale(s).ticks(f>n.ticks?n.ticks:l[0]===0&&l[1]===0?1:Math.ceil(f)).tickFormat(y=>Ch(y,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:dk).tickPadding(h),g=c.transition().duration(100).call(d);g.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",Ct(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",p);return m.style("transform",u),(o.grid.valueAxis.position==="bottom"||o.grid.valueAxis.position==="top")&&m.attr("dy",0),c}const si=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new nt,h=it(t,"container"),p=it(t,"yAxisG"),d=it(t,"yAxis"),g=it(t,"text"),m=B({computedData:n.pipe(tt((M,w)=>M.length===w.length)),isSeriesSeprate:c}).pipe(I(f),W(async M=>M),F(M=>M.isSeriesSeprate?M.computedData:[M.computedData[0]]),F((M,w)=>e.selectAll(`g.${h}`).data(M,P=>P[0]?P[0].seriesIndex:w).join("g").classed(h,!0))),y=m.pipe(I(f),F((M,w)=>M.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async M=>M)).subscribe(M=>{M.containerSelection.attr("transform",(w,P)=>{const _=M.gridContainerPosition[P]??M.gridContainerPosition[0],N=_.translate,T=_.scale;return`translate(${N[0]}, ${N[1]}) scale(${T[0]}, ${T[1]})`})}),B({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async M=>M)).subscribe(M=>{M.axisSelection.style("transform",M.gridAxesTransform.value)});const v=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async M=>M),F(M=>{const w=`rotateX(${M.gridAxesReverseTransform.rotateX}deg) rotateY(${M.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${M.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/M.gridContainerPosition[0].scale[0]}, ${1/M.gridContainerPosition[0].scale[1]})`;return`${w} ${P} ${_}`}),tt()),x=B({textReverseTransform:v,fullParams:r}).pipe(I(f),W(async M=>M),F(M=>`${M.textReverseTransform} rotate(${M.fullParams.tickTextRotate}deg)`)),b=new dt(M=>{B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async w=>w)).subscribe(w=>{const P=w.computedData[0]?w.computedData[0].length-1:0,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,N=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?P+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding,T=w.computedData.map((C,D)=>C.filter((O,G)=>G>=_&&G<=N)),A=bR(T.flat());A[0]===A[1]&&(A[0]=A[1]-1),M.next(A)})}),S=new dt(M=>{B({fullDataFormatter:i,gridAxesSize:u,minAndMax:b}).pipe(I(f),W(async w=>w)).subscribe(w=>{const P=eg({maxValue:w.minAndMax[1],minValue:w.minAndMax[0],axisWidth:w.gridAxesSize.height,scaleDomain:w.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:w.fullDataFormatter.grid.valueAxis.scaleRange});M.next(P)})}),$=B({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async M=>M),F(M=>{let w="start",P="hanging";return M.fullDataFormatter.grid.valueAxis.position==="left"?(w="end",P="middle"):M.fullDataFormatter.grid.valueAxis.position==="right"?(w="start",P="middle"):M.fullDataFormatter.grid.valueAxis.position==="bottom"?(w=M.fullParams.tickTextRotate?"end":"middle",P="hanging"):M.fullDataFormatter.grid.valueAxis.position==="top"&&(w=M.fullParams.tickTextRotate?"start":"middle",P="auto"),{textAnchor:w,dominantBaseline:P}})),E=i.pipe(I(f),F(M=>{let w="start",P="hanging";return M.grid.groupAxis.position==="bottom"?P="auto":M.grid.groupAxis.position==="top"?P="hanging":M.grid.groupAxis.position==="left"?w="start":M.grid.groupAxis.position==="right"&&(w="end"),M.grid.valueAxis.position==="left"?w="end":M.grid.valueAxis.position==="right"?w="start":M.grid.valueAxis.position==="bottom"?P="hanging":M.grid.valueAxis.position==="top"&&(P="auto"),{textAnchor:w,dominantBaseline:P}}));return B({axisSelection:y,fullParams:r,tickTextAlign:$,axisLabelAlign:E,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:S,textReverseTransform:v,textReverseTransformWithRotate:x,minAndMax:b}).pipe(I(f),W(async M=>M)).subscribe(M=>{mk({selection:M.axisSelection,yAxisClassName:d,fullParams:M.fullParams,tickTextAlign:M.tickTextAlign,gridAxesSize:M.gridAxesSize,fullDataFormatter:M.fullDataFormatter,fullChartParams:M.fullChartParams,valueScale:M.valueScale,textReverseTransformWithRotate:M.textReverseTransformWithRotate,minAndMax:M.minAndMax}),gk({selection:M.axisSelection,textClassName:g,fullParams:M.fullParams,axisLabelAlign:M.axisLabelAlign,gridAxesSize:M.gridAxesSize,fullDataFormatter:M.fullDataFormatter,fullChartParams:M.fullChartParams,textReverseTransform:M.textReverseTransform})}),()=>{f.next(void 0)}},Px="ValueAxis",yk=se(Px,zu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(Px,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),Dx="ValueStackAxis",bk=se(Dx,lp)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(Dx,{selection:t,computedData$:n.computedStackedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),Tx="ScalingArea",vk=it(Tx,"rect"),xk=se(Tx,cp)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=e.insert("rect","g").classed(vk,!0).attr("opacity",0);let s={k:1,x:0,y:0};r.layout$.pipe(I(o)).subscribe(l=>{a.attr("width",l.width).attr("height",l.height).attr("x",l.left).attr("y",l.top)});const u=r.computedData$.pipe(F(l=>l[0]?l[0].length-1:0),tt());return B({initGroupAxis:r.fullDataFormatter$.pipe(F(l=>l.grid.groupAxis),y_()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:u,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(I(o),W(async l=>l)).subscribe(l=>{const f=l.groupMaxIndex,h=l.initGroupAxis.scaleDomain[0]-l.initGroupAxis.scalePadding,p=l.initGroupAxis.scaleDomain[1]==="max"?f+l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[1]+l.initGroupAxis.scalePadding,g=eg({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=Th().on("zoom",function(v){const x=v.transform,b=E=>{const M=Math.round(E);return Math.min(f,Math.max(0,M))},S=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(b):x.rescaleY(g).domain().map(b);S[0]<=0&&S[1]>=f?x.k<s.k&&(x.k=s.k,x.x=s.x,x.y=s.y):S[1]-S[0]<=1&&x.k>s.k&&(x.k=s.k,x.x=s.x,x.y=s.y),s.k=x.k,s.x=x.x,s.y=x.y;const $={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:S}}};i.dataFormatter$.next($)});e.call(m)}),()=>{o.next(void 0),a.remove(),e.call(Th().on("zoom",null))}}),Ru="GroupAux",kh=it(Ru,"label-box");function _k({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function wk({groupLabel:t,axisX:e,fullParams:n,textSizePx:r}){const i=Ch(t,n.labelTextFormat),o=i.split(`
|
17
|
-
`),a=o.reduce((l,c)=>c.length>l.length?c:l,""),s=nx(a,r),u=r*o.length;return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:i,textArr:o,textWidth:s,textHeight:u}]:[]}function $k({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=it(e,"auxline"),a=t.selectAll(`line.${o}`).data(n),s=a.enter().append("line").classed(o,!0).style("stroke",l=>Ct(r.lineColorType,i)).style("stroke-width",1).style("stroke-dasharray",r.lineDashArray??"none").style("pointer-events","none"),u=a.merge(s);return a.exit().remove(),s.attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),a.transition().duration(50).attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),u}function Sk(t){t.selectAll("line").data([]).exit().remove()}function Ak({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){const s=t.selectAll(`g.${kh}`).data(e),u=s.enter().append("g").classed(kh,!0).style("cursor","pointer"),l=u.merge(s);return u.attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),s.transition().duration(50).attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),s.exit().remove(),l.each((c,f,h)=>{const p=c.textWidth+12,d=c.textHeight+6;let g=-p/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=n.labelRotate?-p+d:-p/2,m=2):r.grid.groupAxis.position==="left"?(g=-p+2,m=-d/2):r.grid.groupAxis.position==="right"?(g=-2,m=-d/2):r.grid.groupAxis.position==="top"&&(g=n.labelRotate?-p+d:-p/2,m=-d+2);const y=j(h[f]).selectAll("rect").data([c]),v=y.enter().append("rect").attr("height",`${d}px`).attr("fill",$=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m-3).attr("rx",5).attr("ry",5).style("cursor","pointer");y.merge(v).attr("width",$=>`${p}px`).style("transform",o),y.exit().remove();const x=j(h[f]).selectAll("text").data([c]),b=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer"),S=x.merge(b).style("transform",o).attr("fill",$=>Ct(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m);x.exit().remove(),S.each(($,E,M)=>{$x(j(M[E]),{textArr:c.textArr,textSizePx:a,groupAxisPosition:r.grid.groupAxis.position})})}),l}function Mk(t){t.selectAll(`g.${kh}`).data([]).exit().remove()}const Pk=se(Ru,Nu)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt;let a=!1;const s=e.insert("rect","g").classed(it(Ru,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=sr({selection:t,pluginName:Ru,clipPathID:"test",seriesLabels$:i.isSeriesSeprate$.pipe(W($=>Gp(()=>$,i.seriesLabels$,i.seriesLabels$.pipe(F(E=>[E[0]]))))),gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe($=>{s.attr("width",$.rootWidth).attr("height",$.rootHeight)});const h=B({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async $=>$),F($=>{const E=$.computedData[0]?$.computedData[0].length-1:0,M=$.fullDataFormatter.grid.groupAxis.scaleDomain[0]-$.fullDataFormatter.grid.groupAxis.scalePadding,w=$.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?E+$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[1]+$.fullDataFormatter.grid.groupAxis.scalePadding;return[M,w]}),St(1)),p=B({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async $=>$),F($=>Po().domain($.groupScaleDomain).range([0,$.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),F($=>$.highlightTarget),tt()),g=Eh(e,"mousemove").pipe(I(o)),m=B({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async $=>$),F($=>{const E=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,M=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,w=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${E} ${M} ${w}`}),tt()),y=B({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async $=>$),F($=>`${$.textReverseTransform} rotate(${$.fullParams.labelRotate}deg)`)),v=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((M,w)=>w.columnIndex>M?w.columnIndex:M,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((M,w)=>w.rowIndex>M?w.rowIndex:M,0)+1),tt()),b=vR({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(I(o));B({axesSelection:l,columnAmount:v,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPosition:b,computedData:i.computedData$,groupScale:p,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:d,textReverseTransformWithRotate:y,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).pipe(I(o),W(async $=>$)).subscribe($=>{const{groupIndex:E,groupLabel:M}=$.gridGroupPosition,w=$.groupScale(E)??0,P=_k({groupLabel:M,axisX:w,axisHeight:$.gridAxesSize.height,fullParams:$.fullParams});$k({selection:$.axesSelection,pluginName:n,lineData:P,fullParams:$.fullParams,fullChartParams:$.fullChartParams});const _=wk({groupLabel:M,axisX:w,fullParams:$.fullParams,textSizePx:$.textSizePx});Ak({selection:$.axesSelection,labelData:_,fullParams:$.fullParams,fullDataFormatter:$.fullDataFormatter,fullChartParams:$.fullChartParams,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}).on("mouseover",(T,A)=>{T.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(M)??[],groupIndex:E,groupLabel:M,event:T,data:$.computedData})}).on("mousemove",(T,A)=>{T.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(M)??[],groupIndex:E,groupLabel:M,event:T,data:$.computedData})}).on("mouseout",(T,A)=>{T.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(M)??[],groupIndex:E,groupLabel:M,event:T,data:$.computedData})}).on("click",(T,A)=>{T.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(M)??[],groupIndex:E,groupLabel:M,event:T,data:$.computedData})})});const S=Eh(s,"mouseout").pipe(I(o));return B({rootRectMouseout:S,axesSelection:l}).pipe(I(o),W(async $=>$)).subscribe($=>{setTimeout(()=>{a!=!0&&(Sk($.axesSelection),Mk($.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Lx={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,gridList:[{listRectWidth:14,listRectHeight:14,listRectRadius:0}],textColorType:"primary"},Ih={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]};Ih.tickFormat.toString=()=>"text => text";const ku={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]},Dk={...ku},Cx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Ex={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Rx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},kx={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Ix={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},Nx={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Nh={firstAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},secondAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},gridIndexes:[0,1]},Fx={...Nh},zx="MultiGridLegend",Tk=pe(zx,Lx)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.multiGridEachDetail$.pipe(I(i),F(l=>l.map((f,h)=>f.SeriesDataMap$.pipe(F(p=>Array.from(p.keys()))))),W(l=>B(l)),F(l=>l.flat())),a=B({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(I(i),W(async l=>l),F(l=>l.computedData.map((c,f)=>{const h=vl(l.fullParams.gridList[f]??{},{listRectWidth:l.fullParams.listRectWidth,listRectHeight:l.fullParams.listRectHeight,listRectRadius:l.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=B({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),F(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Eu(zx,{rootSelection:e,seriesLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),u()}}),Ce=t=>{const e=t.fullParams$.pipe(F(n=>n.gridIndexes),tt(),St(1));return B({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(F(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Fh="MultiBars",Gx=it(Fh,"grid"),Lk=pe(Fh,Cx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Gx}`).data(s).join("g").attr("class",Gx).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=Rh(Fh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),zh="MultiBarStack",Ox=it(zh,"grid"),Ck=pe(zh,Ex)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Ox}`).data(s).join("g").attr("class",Ox).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=px(zh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Gh="MultiBarsTriangle",Yx=it(Gh,"grid"),Ek=pe(Gh,Rx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Yx}`).data(s).join("g").attr("class",Yx).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=yx(Gh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,fullDataFormatter$:u.dataFormatter$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Oh="MultiLines",Ux=it(Oh,"grid"),Rk=pe(Oh,kx)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt,a=[],s=i.multiGridContainerPosition$.pipe(I(o),F(l=>l.flat()));return Ce(i).pipe(I(o)).subscribe(l=>{a.forEach(c=>c()),t.selectAll(`g.${Ux}`).data(l).join("g").attr("class",Ux).each((c,f,h)=>{const p=j(h[f]);a[f]=ix(Oh,{selection:p,computedData$:c.computedData$,computedLayoutData$:c.computedLayoutData$,visibleComputedData$:c.visibleComputedData$,visibleComputedLayoutData$:c.visibleComputedLayoutData$,seriesLabels$:c.seriesLabels$,SeriesDataMap$:c.SeriesDataMap$,GroupDataMap$:c.GroupDataMap$,fullDataFormatter$:c.dataFormatter$,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,gridAxesTransform$:c.gridAxesTransform$,gridGraphicTransform$:c.gridGraphicTransform$,gridAxesSize$:c.gridAxesSize$,gridHighlight$:c.gridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(l=>l())}}),Yh="MultiLineAreas",Bx=it(Yh,"grid"),kk=pe(Yh,Ix)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.multiGridContainerPosition$.pipe(I(i),F(u=>u.flat()));return Ce(r).pipe(I(i)).subscribe(u=>{o.forEach(l=>l()),t.selectAll(`g.${Bx}`).data(u).join("g").attr("class",Bx).each((l,c,f)=>{const h=j(f[c]);o[c]=ax(Yh,{selection:h,computedData$:l.computedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedData$:l.visibleComputedData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullDataFormatter$:l.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(u=>u())}}),Uh="MultiDots",Wx=it(Uh,"grid"),Ik=pe(Uh,Nx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Wx}`).data(s).join("g").attr("class",Wx).each((u,l,c)=>{const f=j(c[l]);o[l]=vx(Uh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Bh="MultiGroupAxis",Hx=it(Bh,"grid"),Nk=pe(Bh,Ih)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Hx}`).data(s).join("g").attr("class",Hx).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=Ax(Bh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Wh="MultiValueAxis",Xx=it(Wh,"grid"),Fk=pe(Wh,ku)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${Xx}`).data(s).join("g").attr("class",Xx).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=si(Wh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Hh="MultiValueStackAxis",qx=it(Hh,"grid"),zk=pe(Hh,ku)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Ce(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${qx}`).data(s).join("g").attr("class",qx).each((u,l,c)=>{const f=j(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=si(Hh,{selection:f,computedData$:u.computedStackedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}});function Gk(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function jx(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Gk(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=u*c+u*r,p=l*f+l*r,d=[h,p],g=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:g}})}const Vx=({fullDataFormatter$:t,layout$:e})=>{const n=new nt;function r({xAxis:i,yAxis:o,width:a,height:s}){if(!i||!o)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,c=0,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,l=s):o.position==="right"?(f=180,h=180,u=a,l=s):(f=180,l=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,u=a):(f=180,l=s)):i.position==="left"?o.position==="bottom"?(c=-90,l=s):o.position==="top"?(c=-90,h=180):(f=180,l=s):i.position==="right"?o.position==="bottom"?(c=-90,f=180,l=s,u=a):o.position==="top"?(c=-90,f=180,h=180,u=a):(f=180,l=s):(f=180,l=s),{translate:[u,l],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new dt(i=>(B({fullDataFormatter:t,layout:e}).pipe(I(n),W(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Zx=({gridAxesTransform$:t})=>t.pipe(F(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}})),Kx=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(W(async i=>i),F(i=>{if(i.fullDataFormatter.grid.separateSeries)return jx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=jx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Xh="OverlappingValueAxes",Qx=it(Xh,"grid"),Ok=pe(Xh,Nh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[1])),u=B({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),F(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},container:{...c.fullDataFormatter.container}}}));return Xo(r).pipe(I(i),F(c=>({...c,fullParams$:c.fullParams$.pipe(F(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Ce(c)),F(c=>c.map((f,h)=>{if(h===0)return f;const p=Vx({fullDataFormatter$:u,layout$:r.layout$}),d=Zx({gridAxesTransform$:p}),g=Kx({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,dataFormatter$:u,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Qx}`).data(c).join("g").attr("class",Qx).each((f,h,p)=>{if(h>1)return;const d=j(p[h]);o[h]=si(Xh,{selection:d,computedData$:f.computedData$,fullParams$:r.fullParams$.pipe(F(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),qh="OverlappingValueStackAxes",Jx=it(qh,"grid"),Yk=pe(qh,Fx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),F(c=>c.gridIndexes[1])),u=B({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),F(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},container:{...c.fullDataFormatter.container}}}));return Xo(r).pipe(I(i),F(c=>({...c,fullParams$:c.fullParams$.pipe(F(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Ce(c)),F(c=>c.map((f,h)=>{if(h===0)return f;const p=Vx({fullDataFormatter$:u,layout$:r.layout$}),d=Zx({gridAxesTransform$:p}),g=Kx({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,dataFormatter$:u,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Jx}`).data(c).join("g").attr("class",Jx).each((f,h,p)=>{if(h>1)return;const d=j(p[h]);o[h]=si(qh,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,fullParams$:r.fullParams$.pipe(F(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),Uk={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},jh={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:t=>{if(t.highlightTarget==="datum"&&t.datum)return[`${t.datum.label}: ${t.datum.value}`];if(t.highlightTarget==="series"){const e=t.seriesLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="category"){const e=t.categoryLabel,n=t.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}return[]},svgRenderFn:null};jh.textRenderFn.toString=()=>`(eventData) => {
|
19
|
+
`})}function WE({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{V(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function HE({selection:t,ids:e,fullChartParams:n}){t.interrupt("highlight");const r=()=>{t.transition("highlight").duration(200).style("opacity",1)};if(!e.length){r();return}t.each((i,o,a)=>{e.includes(i.id)?V(a[o]).style("opacity",1):V(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const jv=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:u,GroupDataMap$:l,fullParams$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,isSeriesSeprate$:y,event$:b})=>{const v=new nt,x=Dn(t,"clipPath-box"),S=ot(t,"pathG"),$=ot(t,"path"),{seriesSelection$:R,axesSelection$:T,defsSelection$:w,graphicGSelection$:P}=pr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(v),B(C=>-C.translate[1]/C.scale[1]));const _=o.pipe(B(C=>C.map(F=>F[0]?F[0].axisY-F[0].axisYFromZero:0)),tt()),N=U({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(v),W(async C=>C),B(C=>C.params.barWidth?C.params.barWidth:C.isSeriesSeprate?Xv({axisWidth:C.gridAxesSize.width,groupAmount:C.computedData[0]?C.computedData[0].length:0,barAmountOfGroup:1,barPadding:C.params.barPadding,barGroupPadding:C.params.barGroupPadding}):Xv({axisWidth:C.gridAxesSize.width,groupAmount:C.computedData[0]?C.computedData[0].length:0,barAmountOfGroup:C.visibleComputedData.length,barPadding:C.params.barPadding,barGroupPadding:C.params.barGroupPadding}))),D=i.pipe(I(v),B(C=>{const F=new Set;return C.forEach(X=>{X.forEach(Q=>{F.add(Q.groupLabel)})}),Array.from(F)})),A=new dt(C=>{U({seriesLabels:s,barWidth:N,params:c}).pipe(I(v),W(async F=>F)).subscribe(F=>{const X=OE(F.barWidth,F.seriesLabels,F.params);C.next(X)})}),L=f.pipe(I(v),B(C=>C.transitionDuration),tt()),M=new dt(C=>{U({groupLabels:D,transitionDuration:L}).pipe(W(async F=>F)).subscribe(F=>{const X=GE(F.groupLabels.length,F.transitionDuration);C.next(X)})}).pipe(I(v),tt()),G=new dt(C=>{U({groupLabels:D,transitionDuration:L}).pipe(W(async F=>F)).subscribe(F=>{const X=zE(F.groupLabels.length,F.transitionDuration);C.next(X)})}).pipe(I(v),tt());U({defsSelection:w,gridAxesSize:d}).pipe(I(v),W(async C=>C)).subscribe(C=>{const F=[{id:x,width:C.gridAxesSize.width,height:C.gridAxesSize.height}];WE({defsSelection:C.defsSelection,clipPathData:F})});const O=f.pipe(I(v),B(C=>C.highlightTarget),tt()),E=s.pipe(I(v),B(C=>C.map((F,X)=>Dn(t,`lineargradient-${F}`)))),k=U({graphicGSelection:P,defsSelection:w,computedData:n,visibleComputedLayoutData:o,linearGradientIds:E,zeroYArr:_,groupLabels:D,barScale:A,params:c,chartParams:f,barWidth:N,delayGroup:M,transitionItem:G,isSeriesSeprate:y}).pipe(I(v),W(async C=>C),B(C=>(UE({defsSelection:C.defsSelection,computedData:C.computedData,linearGradientIds:C.linearGradientIds,params:C.params}),YE({graphicGSelection:C.graphicGSelection,pathGClassName:S,pathClassName:$,visibleComputedLayoutData:C.visibleComputedLayoutData,linearGradientIds:C.linearGradientIds,zeroYArr:C.zeroYArr,groupLabels:C.groupLabels,barScale:C.barScale,params:C.params,chartParams:C.chartParams,barWidth:C.barWidth,delayGroup:C.delayGroup,transitionItem:C.transitionItem,isSeriesSeprate:C.isSeriesSeprate}))));return U({barSelection:k,computedData:n,highlightTarget:O,SeriesDataMap:u,GroupDataMap:l}).subscribe(C=>{C.barSelection.on("mouseover",(F,X)=>{F.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:C.highlightTarget,datum:X,gridIndex:X.gridIndex,series:C.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:C.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:F,data:C.computedData})}).on("mousemove",(F,X)=>{F.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:C.highlightTarget,datum:X,gridIndex:X.gridIndex,series:C.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:C.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:F,data:C.computedData})}).on("mouseout",(F,X)=>{F.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:C.highlightTarget,datum:X,gridIndex:X.gridIndex,series:C.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:C.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:F,data:C.computedData})}).on("click",(F,X)=>{F.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:C.highlightTarget,datum:X,gridIndex:X.gridIndex,series:C.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:C.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:F,data:C.computedData})})}),U({barSelection:k,highlight:g.pipe(B(C=>C.map(F=>F.id))),fullChartParams:f}).pipe(I(v),W(async C=>C)).subscribe(C=>{HE({selection:C.barSelection,ids:C.highlight,fullChartParams:C.fullChartParams})}),()=>{v.next(void 0)}},Vv="BarsTriangle",XE=ue({name:Vv,defaultParams:gp,layerIndex:5,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=jv(Vv,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,fullDataFormatter$:r.fullDataFormatter$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}});function jE({graphicGSelection:t,circleGClassName:e,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let u=0;return t.each((c,f,h)=>{V(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(u=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,g)=>{V(g[d]).selectAll("circle").data([p]).join(m=>m.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>d*u).attr("opacity",1),m=>m.transition().duration(50).attr("opacity",1),m=>m.remove()).attr("r",i.radius).attr("fill",(m,y)=>Mn({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,y)=>Mn({datum:m,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function VE({selection:t,ids:e,onlyShowHighlighted:n,fullChartParams:r}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}t.each((i,o,a)=>{e.includes(i.id)?V(a[o]).style("opacity",1).transition("highlight").duration(200):V(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function qE({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{V(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const qv=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:u,fullParams$:l,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,event$:y})=>{const b=new nt,v=Dn(t,"clipPath-box"),x=ot(t,"circleG"),S=ot(t,"circle"),{seriesSelection$:$,axesSelection$:R,defsSelection$:T,graphicGSelection$:w}=pr({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),P=U({computedData:n,gridGraphicReverseScale:p}).pipe(I(b),W(async A=>A),B(A=>A.computedData.map((L,M)=>A.gridGraphicReverseScale[M])));U({defsSelection:T,gridAxesSize:d}).pipe(I(b),W(async A=>A)).subscribe(A=>{const L=[{id:v,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];qE({defsSelection:A.defsSelection,clipPathData:L})});const _=c.pipe(I(b),B(A=>A.highlightTarget),tt()),N=U({graphicGSelection:w,visibleComputedLayoutData:o,graphicReverseScale:P,fullChartParams:c,fullParams:l}).pipe(I(b),W(async A=>A),B(A=>jE({graphicGSelection:A.graphicGSelection,circleGClassName:x,circleClassName:S,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));U({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:_}).pipe(I(b),W(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(L,M)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})}).on("mousemove",(L,M)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L})}).on("mouseout",(L,M)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})}).on("click",(L,M)=>{L.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:M,gridIndex:M.gridIndex,series:A.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,groups:A.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:L,data:A.computedData})})});const D=l.pipe(I(b),B(A=>A.onlyShowHighlighted),tt());return U({graphicSelection:N,highlight:g.pipe(B(A=>A.map(L=>L.id))),onlyShowHighlighted:D,fullChartParams:c}).pipe(I(b),W(async A=>A)).subscribe(A=>{VE({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{b.next(void 0)}},Zv="Dots",ZE=ue({name:Zv,defaultParams:pp,layerIndex:Ev,validator:(t,{validateColumns:e})=>e(t,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=qv(Zv,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,event$:n.event$});return()=>{i.next(void 0),o()}}),KE={listRectWidth:14,listRectHeight:14,listRectRadius:0};function Kv(t,e){const n=t<e.colors[e.colorScheme].series.length?t:t%e.colors[e.colorScheme].series.length;return e.colors[e.colorScheme].series[n]}const Fu=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=ot(t,"root-position"),u=ot(t,"legend-card"),l=ot(t,"legend-list"),c=ot(t,"legend-item"),f=new nt,h=U({seriesLabels:n,fullChartParams:o}).pipe(I(f),W(async w=>w),B(w=>{const P=new Map;let _=0;return w.seriesLabels.forEach((N,D)=>{if(!P.has(N)){const A=Kv(_,w.fullChartParams);P.set(N,A),_++}}),P})),p=n.pipe(I(f),B(w=>{const P=new Set;let _=[];return w.forEach(N=>{P.has(N)?_.push(!1):_.push(!0),P.add(N)}),_})),d=r.pipe(I(f),B(w=>w.position==="bottom"||w.position==="top"?"row":"column")),g=U({fullParams:r,layout:i}).pipe(I(f),W(async w=>w),B(w=>{const P=w.fullParams.padding*2+w.fullParams.gap*2;return w.fullParams.position==="bottom"||w.fullParams.position==="top"?w.layout.rootWidth-P:w.layout.rootHeight-P})),y=U({layout:i,fullParams:r}).pipe(I(f),W(async w=>w),B(w=>{let P=0,_=0;return w.fullParams.position==="bottom"?(_=w.layout.rootHeight,w.fullParams.justify==="start"?P=0:w.fullParams.justify==="center"?P=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(P=w.layout.rootWidth)):w.fullParams.position==="right"?(P=w.layout.rootWidth,w.fullParams.justify==="start"?_=0:w.fullParams.justify==="center"?_=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(_=w.layout.rootHeight)):w.fullParams.position==="top"?(_=0,w.fullParams.justify==="start"?P=0:w.fullParams.justify==="center"?P=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(P=w.layout.rootWidth)):w.fullParams.position==="left"&&(P=0,w.fullParams.justify==="start"?_=0:w.fullParams.justify==="center"?_=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(_=w.layout.rootHeight)),{x:P,y:_}})).pipe(I(f),B(w=>e.selectAll(`g.${s}`).data([w]).join(P=>P.append("g").classed(s,!0).attr("transform",_=>`translate(${_.x}, ${_.y})`),P=>P.transition().attr("transform",_=>`translate(${_.x}, ${_.y})`),P=>P.remove()))),b=r.pipe(I(f),B(w=>w.seriesList[0]?w.seriesList[0]:KE)),v=U({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:b,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),W(async w=>w),B(w=>w.seriesLabels.reduce((P,_,N)=>{if(!w.visibleList[N])return P;const D=Cv(_,w.textSizePx),A=w.textSizePx*1.5+D,L=w.SeriesLabelColorMap.get(_),M=P[0]&&P[0][0]?P[P.length-1][P[P.length-1].length-1]:null,{translateX:G,translateY:O,lineIndex:E,itemIndex:k}=((F,X,Q)=>{let z=0,Z=0,Y=0,q=0;if(F.lineDirection==="column"){let j=Q?Q.translateY+F.textSizePx+F.fullParams.gap:0;if(j+F.textSizePx>F.lineMaxSize){Y=Q.lineIndex+1,q=0,Z=0;const rt=X[X.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);z=Q.translateX+rt+F.fullParams.gap}else Y=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,Z=j,z=Q?Q.translateX:0}else{let j=Q?Q.translateX+Q.itemWidth+F.fullParams.gap:0;j+A>F.lineMaxSize?(Y=Q.lineIndex+1,q=0,z=0):(Y=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,z=j),Z=(F.textSizePx+F.fullParams.gap)*Y}return{translateX:z,translateY:Z,lineIndex:Y,itemIndex:q}})(w,P,M);P[E]||(P[E]=[]);const C=w.fullParams.seriesList[k]?w.fullParams.seriesList[k]:w.defaultListStyle;return P[E].push({id:_,seriesLabel:_,seriesIndex:N,lineIndex:E,itemIndex:k,text:_,itemWidth:A,translateX:G,translateY:O,color:L,listRectWidth:C.listRectWidth,listRectHeight:C.listRectHeight,listRectRadius:C.listRectRadius}),P},[])),St(1)),x=U({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:v,textSizePx:a}).pipe(I(f),W(async w=>w),B(w=>{const{width:P,height:_}=((N,D)=>{let A=0,L=0;if(!D.length||!D[0].length)return{width:A,height:L};const M=D[0][D[0].length-1];return N.lineDirection==="column"?(A=D.reduce((G,O)=>{const E=O.reduce((k,C)=>C.itemWidth>k?C.itemWidth:k,0);return G+E},0),A+=N.fullParams.gap*(D.length-1),L=M.translateY+N.textSizePx):(A=M.translateX+M.itemWidth,L=N.textSizePx*D.length+N.fullParams.gap*(D.length-1)),{width:A,height:L}})(w,w.lengendItems);return{direction:w.lineDirection,width:P,height:_,translateX:w.fullParams.gap,translateY:w.fullParams.gap}}),St(1)),S=U({fullParams:r,lengendList:x}).pipe(I(f),W(async w=>w),B(w=>{const P=w.lengendList.width+w.fullParams.gap*2,_=w.lengendList.height+w.fullParams.gap*2;let N=0,D=0;return w.fullParams.position==="left"?w.fullParams.justify==="start"?(N=w.fullParams.padding,D=w.fullParams.padding):w.fullParams.justify==="center"?(N=w.fullParams.padding,D=-_/2):w.fullParams.justify==="end"&&(N=w.fullParams.padding,D=-_-w.fullParams.padding):w.fullParams.position==="right"?w.fullParams.justify==="start"?(N=-P-w.fullParams.padding,D=w.fullParams.padding):w.fullParams.justify==="center"?(N=-P-w.fullParams.padding,D=-_/2):w.fullParams.justify==="end"&&(N=-P-w.fullParams.padding,D=-_-w.fullParams.padding):w.fullParams.position==="top"?w.fullParams.justify==="start"?(N=w.fullParams.padding,D=w.fullParams.padding):w.fullParams.justify==="center"?(N=-P/2,D=w.fullParams.padding):w.fullParams.justify==="end"&&(N=-P-w.fullParams.padding,D=w.fullParams.padding):w.fullParams.justify==="start"?(N=w.fullParams.padding,D=-_-w.fullParams.padding):w.fullParams.justify==="center"?(N=-P/2,D=-_-w.fullParams.padding):w.fullParams.justify==="end"&&(N=-P-w.fullParams.padding,D=-_-w.fullParams.padding),{width:P,height:_,translateX:N,translateY:D}})),$=U({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:S}).pipe(I(f),W(async w=>w),B(w=>w.rootPositionSelection.selectAll("g").data([w.legendCard]).join(P=>P.append("g").classed(u,!0).attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.transition().attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.remove()).each((P,_,N)=>{V(N[_]).selectAll("rect").data([P]).join("rect").attr("width",D=>D.width).attr("height",D=>D.height).attr("fill",kt(w.fullParams.backgroundFill,w.fullChartParams)).attr("stroke",kt(w.fullParams.backgroundStroke,w.fullChartParams))}))),R=U({lengendCardSelection:$,fullParams:r,lengendList:x}).pipe(I(f),W(async w=>w),B(w=>w.lengendCardSelection.selectAll("g").data([w.lengendList]).join(P=>P.append("g").classed(l,!0).attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.transition().attr("transform",_=>`translate(${_.translateX}, ${_.translateY})`),P=>P.remove())));return U({lengendListSelection:R,fullParams:r,fullChartParams:o,lengendItems:v,textSizePx:a}).pipe(I(f),W(async w=>w),B(w=>{const P=w.lengendItems[0]?w.lengendItems.flat():[];return w.lengendListSelection.selectAll(`g.${c}`).data(P).join(_=>_.append("g").classed(c,!0).attr("cursor","default"),_=>_,_=>_.remove()).attr("transform",(_,N)=>`translate(${_.translateX}, ${_.translateY})`).each((_,N,D)=>{const A=w.textSizePx/2,L=-_.listRectWidth/2,M=-_.listRectHeight/2;V(D[N]).selectAll("rect").data([_]).join("rect").attr("x",A).attr("y",A).attr("width",G=>G.listRectWidth).attr("height",G=>G.listRectHeight).attr("transform",G=>`translate(${L}, ${M})`).attr("fill",G=>G.color).attr("rx",G=>G.listRectRadius),V(D[N]).selectAll("text").data([_]).join(G=>G.append("text").attr("dominant-baseline","hanging"),G=>G,G=>G.remove()).attr("x",w.textSizePx*1.5).attr("font-size",w.fullChartParams.styles.textSize).attr("fill",G=>w.fullParams.textColorType==="series"?Kv(G.seriesIndex,w.fullChartParams):kt(w.fullParams.textColorType,w.fullChartParams)).text(G=>G.text)})})).subscribe(),()=>{e.select(`g.${s}`).remove(),f.next(void 0)}},Qv="GridLegend",QE=ue({name:Qv,defaultParams:bp,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(Qv,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}});function JE(t,{text:e,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(t==null||e==null){console.error("selection or text is not defined");return}n==null&&(n=t.node().getBBox().width/2);function a(p){let d;return i?d=p.split(""):d=p.split(/\s+/g),d[d.length-1]||d.pop(),d[0]||d.shift(),d}function s(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function u(p){var g;const d=document.createElement("canvas").getContext("2d");return((g=d==null?void 0:d.measureText(p))==null?void 0:g.width)??0}function l(p){const d=u(p.trim());return Math.sqrt(d*r)}function c(p,d){let g={width:0,text:""},m=1/0;const y=[];let b=" ";i&&(b="");for(let v=0,x=p.length;v<x;++v){const S=(g.text?g.text+b:"")+p[v],$=u(S);(m+$)/2<d?(g.width=m=$,g.text=S):(m=u(p[v]),g={width:m,text:p[v]},y.push(g))}return y}function f(p){let d=0;for(let g=0,m=p.length;g<m;++g){const y=(Math.abs(g-m/2+.5)+.5)*r,b=p[g].width/2;d=Math.max(d,Math.sqrt(b**2+y**2))}return d}function h(p,d){o>0&&(d=s(d,o));const g=a(d),m=l(d),y=c(g,m),b=f(y);let v=p.select("text");v.size()||(v=p.append("text")),v.attr("transform",`translate(0,0) scale(${n/b})`);const x=v.selectAll("tspan").data(y),S=x.enter().append("tspan").attr("x",0).merge(x).attr("y",($,R)=>(R-y.length/2+.8)*r).text($=>$.text);return x.exit().remove(),x.merge(S)}return h(t,e)}function Jv(t,{textArr:e,textSizePx:n,groupAxisPosition:r}){t.text(null);const i=Number(t.attr("x"));let o=Number(t.attr("y"));r==="top"&&(o-=(e.length-1)*n),t.selectAll("tspan").data(e).join("tspan").attr("x",i).attr("y",(a,s)=>o+s*n).text(a=>a)}function t2(t,{textArr:e,textSizePx:n,quadrant:r}){t.selectAll("tspan").data(e).join("tspan").attr("x",0).attr("y",(i,o)=>r==1||r==2?-(e.length-1-o)*n:o*n).text(i=>i)}const tI=6;function eI(t,e){return t.map((n,r)=>{const i=Bh(n,e),o=i.split(`
|
20
|
+
`);return{text:i,textArr:o}})}function nI({selection:t,groupingLabelClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,textReverseTransform:s}){const u=n.tickPadding+n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="top"?(f=-l,o.grid.valueAxis.position==="left"?c=u:o.grid.valueAxis.position==="right"&&(c=-u)):o.grid.groupAxis.position==="left"?(c=-u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)):o.grid.groupAxis.position==="right"&&(c=u,o.grid.valueAxis.position==="bottom"?f=-l:o.grid.valueAxis.position==="top"&&(f=l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",kt(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.groupAxis.label)}).attr("transform",h=>`translate(${i.width}, 0)`)}function rI({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:u,groupLabelData:l,textReverseTransformWithRotate:c,textSizePx:f}){const h=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),p=Math.floor(u[1])-Math.ceil(u[0])+1;let d=0,g=0;o.grid.groupAxis.position==="left"?(d=0,g=-n.tickPadding):o.grid.groupAxis.position==="right"?(d=0,g=n.tickPadding):o.grid.groupAxis.position==="bottom"?(d=n.tickPadding,g=0):o.grid.groupAxis.position==="top"&&(d=-n.tickPadding,g=-0);const m=a0(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?i.height:-tI).tickSizeOuter(0).tickFormat(v=>{var x;return((x=l[v])==null?void 0:x.text)??""}).tickPadding(d),y=h.transition().duration(100).call(m).on("end",(v,x)=>{h.selectAll(".tick text").each((S,$,R)=>{var w;const T=((w=l[S])==null?void 0:w.textArr)??[];Jv(V(R[$]),{textArr:T,textSizePx:f,groupAxisPosition:o.grid.groupAxis.position})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?kt(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?kt(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),h.selectAll("text").attr("font-size",a.styles.textSize).attr("fill",kt(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",g).style("transform",c).attr("dy",0),h}const e2=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c,textSizePx$:f})=>{const h=new nt,p=ot(t,"container"),d=ot(t,"xAxisG"),g=ot(t,"xAxis"),m=ot(t,"groupingLabel"),y=U({computedData:n.pipe(tt((_,N)=>_.length===N.length)),isSeriesSeprate:c}).pipe(I(h),W(async _=>_),B(_=>_.isSeriesSeprate?_.computedData:[_.computedData[0]]),B((_,N)=>e.selectAll(`g.${p}`).data(_,D=>D[0]?D[0].seriesIndex:N).join("g").classed(p,!0))),b=y.pipe(I(h),B((_,N)=>_.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));U({containerSelection:y,gridContainerPosition:l}).pipe(I(h),W(async _=>_)).subscribe(_=>{_.containerSelection.attr("transform",(N,D)=>{const A=_.gridContainerPosition[D]??_.gridContainerPosition[0],L=A.translate,M=A.scale;return`translate(${L[0]}, ${L[1]}) scale(${M[0]}, ${M[1]})`})}),U({axisSelection:b,gridAxesTransform:a}).pipe(I(h),W(async _=>_)).subscribe(_=>{_.axisSelection.style("transform",_.gridAxesTransform.value)});const v=U({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(h),W(async _=>_),B(_=>{const N=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,D=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,A=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${N} ${D} ${A}`}),tt()),x=U({textReverseTransform:v,fullParams:r}).pipe(I(h),W(async _=>_),B(_=>`${_.textReverseTransform} rotate(${_.fullParams.tickTextRotate}deg)`)),S=U({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(h),W(async _=>_),B(_=>{const N=_.computedData[0]?_.computedData[0].length-1:0,D=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,A=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?N+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding;return[D,A]}),St(1)),$=U({groupScaleDomain:S,gridAxesSize:u}).pipe(I(h),W(async _=>_),B(_=>Ro().domain(_.groupScaleDomain).range([0,_.gridAxesSize.width]))),R=n.pipe(B(_=>(_[0]??[]).map(N=>N.groupLabel))),T=U({fullDataFormatter:i,fullParams:r}).pipe(I(h),W(async _=>_),B(_=>{let N="middle",D="hanging";return _.fullDataFormatter.grid.groupAxis.position==="bottom"?(N=_.fullParams.tickTextRotate?"end":"middle",D="hanging"):_.fullDataFormatter.grid.groupAxis.position==="top"?(N=_.fullParams.tickTextRotate?"start":"middle",D="auto"):_.fullDataFormatter.grid.groupAxis.position==="left"?(N="end",D="middle"):_.fullDataFormatter.grid.groupAxis.position==="right"&&(N="start",D="middle"),{textAnchor:N,dominantBaseline:D}})),w=i.pipe(I(h),B(_=>{let N="start",D="hanging";return _.grid.groupAxis.position==="bottom"?D="hanging":_.grid.groupAxis.position==="top"?D="auto":_.grid.groupAxis.position==="left"?N="end":_.grid.groupAxis.position==="right"&&(N="start"),_.grid.valueAxis.position==="left"?N="start":_.grid.valueAxis.position==="right"?N="end":_.grid.valueAxis.position==="bottom"?D="auto":_.grid.valueAxis.position==="top"&&(D="hanging"),{textAnchor:N,dominantBaseline:D}})),P=U({groupLabels:R,fullParams:r}).pipe(I(h),W(async _=>_),B(_=>eI(_.groupLabels,_.fullParams.tickFormat)));return U({axisSelection:b,fullParams:r,tickTextAlign:T,axisLabelAlign:w,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:S,groupLabelData:P,textReverseTransform:v,textReverseTransformWithRotate:x,textSizePx:f}).pipe(I(h),W(async _=>_)).subscribe(_=>{rI({selection:_.axisSelection,xAxisClassName:g,fullParams:_.fullParams,tickTextAlign:_.tickTextAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,groupScale:_.groupScale,groupScaleDomain:_.groupScaleDomain,groupLabelData:_.groupLabelData,textReverseTransformWithRotate:_.textReverseTransformWithRotate,textSizePx:_.textSizePx}),nI({selection:_.axisSelection,groupingLabelClassName:m,fullParams:_.fullParams,axisLabelAlign:_.axisLabelAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,textReverseTransform:_.textReverseTransform})}),()=>{h.next(void 0)}},n2="GroupAxis",iI=ue({name:n2,defaultParams:Uu,layerIndex:Cn,validator:(t,{validateColumns:e})=>e(t,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:r=>r===null||r==="all"||typeof r=="number"},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=e2(n2,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),o()}}),oI=6;function aI({selection:t,textClassName:e,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,textReverseTransform:s}){const u=n.tickPadding-n.labelOffset[0],l=n.tickPadding+n.labelOffset[1];let c=0,f=0;o.grid.groupAxis.position==="bottom"?(f=-l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="top"?(f=l,o.grid.valueAxis.position==="left"?c=-u:o.grid.valueAxis.position==="right"&&(c=u)):o.grid.groupAxis.position==="left"?(c=u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)):o.grid.groupAxis.position==="right"&&(c=-u,o.grid.valueAxis.position==="bottom"?f=l:o.grid.valueAxis.position==="top"&&(f=-l)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",kt(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(g=>o.grid.valueAxis.label)}).attr("transform",h=>`translate(0, ${i.height})`)}function sI({selection:t,yAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:u,minAndMax:l}){const c=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),f=l[1]-l[0];let h=0,p=0;o.grid.valueAxis.position==="left"?(h=n.tickPadding,p=0):o.grid.valueAxis.position==="right"?(h=-n.tickPadding,p=0):o.grid.valueAxis.position==="bottom"?(h=0,p=n.tickPadding):o.grid.valueAxis.position==="top"&&(h=0,p=-n.tickPadding);const d=s0(s).scale(s).ticks(f>n.ticks?n.ticks:l[0]===0&&l[1]===0?1:Math.ceil(f)).tickFormat(y=>Bh(y,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:oI).tickPadding(h),g=c.transition().duration(100).call(d);g.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?kt(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?kt(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",kt(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",p);return m.style("transform",u),(o.grid.valueAxis.position==="bottom"||o.grid.valueAxis.position==="top")&&m.attr("dy",0),c}const bi=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:u,gridContainerPosition$:l,isSeriesSeprate$:c})=>{const f=new nt,h=ot(t,"container"),p=ot(t,"yAxisG"),d=ot(t,"yAxis"),g=ot(t,"text"),m=U({computedData:n.pipe(tt((T,w)=>T.length===w.length)),isSeriesSeprate:c}).pipe(I(f),W(async T=>T),B(T=>T.isSeriesSeprate?T.computedData:[T.computedData[0]]),B((T,w)=>e.selectAll(`g.${h}`).data(T,P=>P[0]?P[0].seriesIndex:w).join("g").classed(h,!0))),y=m.pipe(I(f),B((T,w)=>T.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));U({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async T=>T)).subscribe(T=>{T.containerSelection.attr("transform",(w,P)=>{const _=T.gridContainerPosition[P]??T.gridContainerPosition[0],N=_.translate,D=_.scale;return`translate(${N[0]}, ${N[1]}) scale(${D[0]}, ${D[1]})`})}),U({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async T=>T)).subscribe(T=>{T.axisSelection.style("transform",T.gridAxesTransform.value)});const b=U({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async T=>T),B(T=>{const w=`rotateX(${T.gridAxesReverseTransform.rotateX}deg) rotateY(${T.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${T.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/T.gridContainerPosition[0].scale[0]}, ${1/T.gridContainerPosition[0].scale[1]})`;return`${w} ${P} ${_}`}),tt()),v=U({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async T=>T),B(T=>`${T.textReverseTransform} rotate(${T.fullParams.tickTextRotate}deg)`)),x=new dt(T=>{U({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async w=>w)).subscribe(w=>{const P=w.computedData[0]?w.computedData[0].length-1:0,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,N=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?P+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding,D=w.computedData.map((L,M)=>L.filter((G,O)=>O>=_&&O<=N)),A=aE(D.flat());A[0]===A[1]&&(A[0]=A[1]-1),T.next(A)})}),S=new dt(T=>{U({fullDataFormatter:i,gridAxesSize:u,minAndMax:x}).pipe(I(f),W(async w=>w)).subscribe(w=>{const P=Tg({maxValue:w.minAndMax[1],minValue:w.minAndMax[0],axisWidth:w.gridAxesSize.height,scaleDomain:w.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:w.fullDataFormatter.grid.valueAxis.scaleRange});T.next(P)})}),$=U({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async T=>T),B(T=>{let w="start",P="hanging";return T.fullDataFormatter.grid.valueAxis.position==="left"?(w="end",P="middle"):T.fullDataFormatter.grid.valueAxis.position==="right"?(w="start",P="middle"):T.fullDataFormatter.grid.valueAxis.position==="bottom"?(w=T.fullParams.tickTextRotate?"end":"middle",P="hanging"):T.fullDataFormatter.grid.valueAxis.position==="top"&&(w=T.fullParams.tickTextRotate?"start":"middle",P="auto"),{textAnchor:w,dominantBaseline:P}})),R=i.pipe(I(f),B(T=>{let w="start",P="hanging";return T.grid.groupAxis.position==="bottom"?P="auto":T.grid.groupAxis.position==="top"?P="hanging":T.grid.groupAxis.position==="left"?w="start":T.grid.groupAxis.position==="right"&&(w="end"),T.grid.valueAxis.position==="left"?w="end":T.grid.valueAxis.position==="right"?w="start":T.grid.valueAxis.position==="bottom"?P="hanging":T.grid.valueAxis.position==="top"&&(P="auto"),{textAnchor:w,dominantBaseline:P}}));return U({axisSelection:y,fullParams:r,tickTextAlign:$,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:S,textReverseTransform:b,textReverseTransformWithRotate:v,minAndMax:x}).pipe(I(f),W(async T=>T)).subscribe(T=>{sI({selection:T.axisSelection,yAxisClassName:d,fullParams:T.fullParams,tickTextAlign:T.tickTextAlign,gridAxesSize:T.gridAxesSize,fullDataFormatter:T.fullDataFormatter,fullChartParams:T.fullChartParams,valueScale:T.valueScale,textReverseTransformWithRotate:T.textReverseTransformWithRotate,minAndMax:T.minAndMax}),aI({selection:T.axisSelection,textClassName:g,fullParams:T.fullParams,axisLabelAlign:T.axisLabelAlign,gridAxesSize:T.gridAxesSize,fullDataFormatter:T.fullDataFormatter,fullChartParams:T.fullChartParams,textReverseTransform:T.textReverseTransform})}),()=>{f.next(void 0)}},r2="ValueAxis",uI=ue({name:r2,defaultParams:Wu,layerIndex:Cn,validator:(t,{validateColumns:e})=>e(t,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=bi(r2,{selection:t,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),i2="ValueStackAxis",lI=ue({name:i2,defaultParams:mp,layerIndex:Cn,validator:(t,{validateColumns:e})=>e(t,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=bi(i2,{selection:t,computedData$:n.computedStackedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),cI=ue({name:"ScalingArea",defaultParams:yp,layerIndex:pE,validator:(t,{validateColumns:e})=>({status:"success",columnName:"",expectToBe:""})})(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt;let a={k:1,x:0,y:0};const s=r.computedData$.pipe(B(c=>c[0]?c[0].length-1:0),tt()),u=r.fullDataFormatter$.pipe(B(c=>c.grid.groupAxis),Y_()),l=U({initGroupAxis:u,fullDataFormatter:r.fullDataFormatter$,groupMax:s,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(I(o),W(async c=>c),B(c=>{const f=c.initGroupAxis.scaleDomain[0]-c.initGroupAxis.scalePadding,h=c.initGroupAxis.scaleDomain[1]==="max"?c.groupMax+c.initGroupAxis.scalePadding:c.initGroupAxis.scaleDomain[1]+c.initGroupAxis.scalePadding;return Tg({maxValue:c.groupMax,minValue:0,axisWidth:c.axisSize.width,scaleDomain:[f,h],scaleRange:[0,1]})}));return U({groupScale:l,fullDataFormatter:r.fullDataFormatter$,groupMax:s}).pipe(I(o),W(async c=>c)).subscribe(c=>{const h=c.groupScale.copy(),p=Ih().on("zoom",function(g){const m=g.transform,y=x=>{const S=Math.round(x);return Math.min(c.groupMax,Math.max(0,S))},b=c.fullDataFormatter.grid.groupAxis.position==="bottom"||c.fullDataFormatter.grid.groupAxis.position==="top"?m.rescaleX(h).domain().map(y):m.rescaleY(h).domain().map(y);b[0]<=0&&b[1]>=c.groupMax?m.k<a.k&&(m.k=a.k,m.x=a.x,m.y=a.y):b[1]-b[0]<=1&&m.k>a.k&&(m.k=a.k,m.x=a.x,m.y=a.y),a.k=m.k,a.x=m.x,a.y=m.y;const v={...c.fullDataFormatter,grid:{...c.fullDataFormatter.grid,groupAxis:{...c.fullDataFormatter.grid.groupAxis,scaleDomain:b}}};i.dataFormatter$.next(v)});e.call(p)}),()=>{o.next(void 0),e.call(Ih().on("zoom",null))}}),Ou="GroupAux",zh=ot(Ou,"label-box"),fI={name:Ou,defaultParams:Yu,layerIndex:dE,validator:(t,{validateColumns:e})=>e(t,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]},labelRotate:{toBeTypes:["number"]}})};function hI({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function pI({groupLabel:t,axisX:e,fullParams:n,textSizePx:r}){const i=Bh(t,n.labelTextFormat),o=i.split(`
|
21
|
+
`),a=o.reduce((l,c)=>c.length>l.length?c:l,""),s=Cv(a,r),u=r*o.length;return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:i,textArr:o,textWidth:s,textHeight:u}]:[]}function dI({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=ot(e,"auxline"),a=t.selectAll(`line.${o}`).data(n),s=a.enter().append("line").classed(o,!0).style("stroke",l=>kt(r.lineColorType,i)).style("stroke-width",1).style("stroke-dasharray",r.lineDashArray??"none").style("pointer-events","none"),u=a.merge(s);return a.exit().remove(),s.attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),a.transition().duration(50).attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),u}function gI(t){t.selectAll("line").data([]).exit().remove()}function mI({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){const s=t.selectAll(`g.${zh}`).data(e),u=s.enter().append("g").classed(zh,!0).style("cursor","pointer"),l=u.merge(s);return u.attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),s.transition().duration(50).attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),s.exit().remove(),l.each((c,f,h)=>{const p=c.textWidth+12,d=c.textHeight+6;let g=-p/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=n.labelRotate?-p+d:-p/2,m=2):r.grid.groupAxis.position==="left"?(g=-p+2,m=-d/2):r.grid.groupAxis.position==="right"?(g=-2,m=-d/2):r.grid.groupAxis.position==="top"&&(g=n.labelRotate?-p+d:-p/2,m=-d+2),V(h[f]).selectAll("rect").data([c]).join(y=>y.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),y=>y,y=>y.remove()).attr("width",y=>`${p}px`).attr("height",`${d}px`).attr("fill",y=>kt(n.labelColorType,i)).attr("x",g).attr("y",m-3).style("transform",o),V(h[f]).selectAll("text").data([c]).join(y=>y.append("text").style("dominant-baseline","hanging").style("cursor","pointer"),y=>y,y=>y.remove()).style("transform",o).attr("fill",y=>kt(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m).each((y,b,v)=>{Jv(V(v[b]),{textArr:c.textArr,textSizePx:a,groupAxisPosition:r.grid.groupAxis.position})})}),l}function yI(t){t.selectAll(`g.${zh}`).data([]).exit().remove()}const bI=ue(fI)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt;let a=!1;const s=e.insert("rect","g").classed(ot(Ou,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=pr({selection:t,pluginName:Ou,clipPathID:"test",seriesLabels$:i.isSeriesSeprate$.pipe(W($=>Xp(()=>$,i.seriesLabels$,i.seriesLabels$.pipe(B(R=>[R[0]]))))),gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe($=>{s.attr("width",$.rootWidth).attr("height",$.rootHeight)});const h=U({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async $=>$),B($=>{const R=$.computedData[0]?$.computedData[0].length-1:0,T=$.fullDataFormatter.grid.groupAxis.scaleDomain[0]-$.fullDataFormatter.grid.groupAxis.scalePadding,w=$.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?R+$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[1]+$.fullDataFormatter.grid.groupAxis.scalePadding;return[T,w]}),St(1)),p=U({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async $=>$),B($=>Ro().domain($.groupScaleDomain).range([0,$.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),B($=>$.highlightTarget),tt()),g=Fh(e,"mousemove").pipe(I(o)),m=U({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async $=>$),B($=>{const R=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,T=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,w=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${R} ${T} ${w}`}),tt()),y=U({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async $=>$),B($=>`${$.textReverseTransform} rotate(${$.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),B($=>$.reduce((T,w)=>w.columnIndex>T?w.columnIndex:T,0)+1),tt()),v=i.gridContainerPosition$.pipe(I(o),B($=>$.reduce((T,w)=>w.rowIndex>T?w.rowIndex:T,0)+1),tt()),x=sE({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(I(o));U({axesSelection:l,columnAmount:b,rowAmount:v,layout:i.layout$,rootMousemove:g,gridGroupPosition:x,computedData:i.computedData$,groupScale:p,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:d,textReverseTransformWithRotate:y,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).pipe(I(o),W(async $=>$)).subscribe($=>{const{groupIndex:R,groupLabel:T}=$.gridGroupPosition,w=$.groupScale(R)??0,P=hI({groupLabel:T,axisX:w,axisHeight:$.gridAxesSize.height,fullParams:$.fullParams});dI({selection:$.axesSelection,pluginName:n,lineData:P,fullParams:$.fullParams,fullChartParams:$.fullChartParams});const _=pI({groupLabel:T,axisX:w,fullParams:$.fullParams,textSizePx:$.textSizePx});mI({selection:$.axesSelection,labelData:_,fullParams:$.fullParams,fullDataFormatter:$.fullDataFormatter,fullChartParams:$.fullChartParams,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}).on("mouseover",(D,A)=>{D.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(T)??[],groupIndex:R,groupLabel:T,event:D,data:$.computedData})}).on("mousemove",(D,A)=>{D.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(T)??[],groupIndex:R,groupLabel:T,event:D,data:$.computedData})}).on("mouseout",(D,A)=>{D.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(T)??[],groupIndex:R,groupLabel:T,event:D,data:$.computedData})}).on("click",(D,A)=>{D.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(T)??[],groupIndex:R,groupLabel:T,event:D,data:$.computedData})})});const S=Fh(s,"mouseout").pipe(I(o));return U({rootRectMouseout:S,axesSelection:l}).pipe(I(o),W(async $=>$)).subscribe($=>{setTimeout(()=>{a!=!0&&(gI($.axesSelection),yI($.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),o2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,gridList:[{listRectWidth:14,listRectHeight:14,listRectRadius:0}],textColorType:"primary"},Yh={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]};Yh.tickFormat.toString=()=>"text => text";const Gu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]},xI={...Gu},a2={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},s2={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},u2={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},l2={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},c2={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},f2={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Uh={firstAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},secondAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},gridIndexes:[0,1]},h2={...Uh},p2="MultiGridLegend",vI=de({name:p2,defaultParams:o2,layerIndex:Bu,validator:(t,{validateColumns:e})=>{const n=e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},gridList:{toBeTypes:["object[]"]},textColorType:{toBeOption:"ColorType"}});if(t.gridList){const i=t.gridList.map((o,a)=>e(o,{listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]}})).find(o=>o.status==="error");if(i)return i}return n}})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.multiGridEachDetail$.pipe(I(i),B(l=>l.map((f,h)=>f.SeriesDataMap$.pipe(B(p=>Array.from(p.keys()))))),W(l=>U(l)),B(l=>l.flat())),a=U({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(I(i),W(async l=>l),B(l=>l.computedData.map((c,f)=>{const h=al(l.fullParams.gridList[f]??{},{listRectWidth:l.fullParams.listRectWidth,listRectHeight:l.fullParams.listRectHeight,listRectRadius:l.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=U({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),B(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Fu(p2,{rootSelection:e,seriesLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),u()}}),Re=t=>{const e=t.fullParams$.pipe(B(n=>n.gridIndexes),tt(),St(1));return U({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(B(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Wh="MultiBars",d2=ot(Wh,"grid"),_I=de({name:Wh,defaultParams:a2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${d2}`).data(s).join("g").attr("class",d2).each((u,l,c)=>{const f=V(c[l]),h=u.dataFormatter$.pipe(I(i),B(p=>p.grid.separateSeries),tt(),St(1));o[l]=Gh(Wh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Hh="MultiBarStack",g2=ot(Hh,"grid"),wI=de({name:Hh,defaultParams:s2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${g2}`).data(s).join("g").attr("class",g2).each((u,l,c)=>{const f=V(c[l]),h=u.dataFormatter$.pipe(I(i),B(p=>p.grid.separateSeries),tt(),St(1));o[l]=Uv(Hh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Xh="MultiBarsTriangle",m2=ot(Xh,"grid"),$I=de({name:Xh,defaultParams:u2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${m2}`).data(s).join("g").attr("class",m2).each((u,l,c)=>{const f=V(c[l]),h=u.dataFormatter$.pipe(I(i),B(p=>p.grid.separateSeries),tt(),St(1));o[l]=jv(Xh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,fullDataFormatter$:u.dataFormatter$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),jh="MultiLines",y2=ot(jh,"grid"),SI=de({name:jh,defaultParams:l2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new nt,a=[],s=i.multiGridContainerPosition$.pipe(I(o),B(l=>l.flat()));return Re(i).pipe(I(o)).subscribe(l=>{a.forEach(c=>c()),t.selectAll(`g.${y2}`).data(l).join("g").attr("class",y2).each((c,f,h)=>{const p=V(h[f]);a[f]=kv(jh,{selection:p,computedData$:c.computedData$,computedLayoutData$:c.computedLayoutData$,visibleComputedData$:c.visibleComputedData$,visibleComputedLayoutData$:c.visibleComputedLayoutData$,seriesLabels$:c.seriesLabels$,SeriesDataMap$:c.SeriesDataMap$,GroupDataMap$:c.GroupDataMap$,fullDataFormatter$:c.dataFormatter$,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,gridAxesTransform$:c.gridAxesTransform$,gridGraphicTransform$:c.gridGraphicTransform$,gridAxesSize$:c.gridAxesSize$,gridHighlight$:c.gridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(l=>l())}}),Vh="MultiLineAreas",b2=ot(Vh,"grid"),AI=de({name:Vh,defaultParams:c2,layerIndex:Rv,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.multiGridContainerPosition$.pipe(I(i),B(u=>u.flat()));return Re(r).pipe(I(i)).subscribe(u=>{o.forEach(l=>l()),t.selectAll(`g.${b2}`).data(u).join("g").attr("class",b2).each((l,c,f)=>{const h=V(f[c]);o[c]=Nv(Vh,{selection:h,computedData$:l.computedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedData$:l.visibleComputedData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullDataFormatter$:l.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(u=>u())}}),qh="MultiDots",x2=ot(qh,"grid"),TI=de({name:qh,defaultParams:f2,layerIndex:Ev,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${x2}`).data(s).join("g").attr("class",x2).each((u,l,c)=>{const f=V(c[l]);o[l]=qv(qh,{selection:f,computedData$:u.computedData$,visibleComputedData$:u.visibleComputedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridGraphicReverseScale$:u.gridGraphicReverseScale$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Zh="MultiGroupAxis",v2=ot(Zh,"grid"),PI=de({name:Zh,defaultParams:Yh,layerIndex:Cn,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:r=>r===null||r==="all"||typeof r=="number"},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${v2}`).data(s).join("g").attr("class",v2).each((u,l,c)=>{const f=V(c[l]),h=u.dataFormatter$.pipe(I(i),B(p=>p.grid.separateSeries),tt(),St(1));o[l]=e2(Zh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Kh="MultiValueAxis",_2=ot(Kh,"grid"),MI=de({name:Kh,defaultParams:Gu,layerIndex:Cn,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${_2}`).data(s).join("g").attr("class",_2).each((u,l,c)=>{const f=V(c[l]),h=u.dataFormatter$.pipe(I(i),B(p=>p.grid.separateSeries),tt(),St(1));o[l]=bi(Kh,{selection:f,computedData$:u.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Qh="MultiValueStackAxis",w2=ot(Qh,"grid"),DI=de({name:Qh,defaultParams:Gu,layerIndex:Cn,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[];return Re(r).pipe(I(i)).subscribe(s=>{o.forEach(u=>u()),t.selectAll(`g.${w2}`).data(s).join("g").attr("class",w2).each((u,l,c)=>{const f=V(c[l]),h=u.dataFormatter$.pipe(I(i),B(p=>p.grid.separateSeries),tt(),St(1));o[l]=bi(Qh,{selection:f,computedData$:u.computedStackedData$,fullParams$:r.fullParams$,fullDataFormatter$:u.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridAxesReverseTransform$:u.gridAxesReverseTransform$,gridAxesSize$:u.gridAxesSize$,gridContainerPosition$:u.gridContainerPosition$,isSeriesSeprate$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Jh="OverlappingValueAxes",$2=ot(Jh,"grid"),CI=de({name:Jh,defaultParams:Uh,layerIndex:Cn,validator:(t,{validateColumns:e})=>{const n=e(t,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(t.firstAxis){const r=e(t.firstAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(t.secondAxis){const r=e(t.secondAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),B(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),B(c=>c.gridIndexes[1])),u=U({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),B(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},container:{...c.fullDataFormatter.container}}}));return Qo(r).pipe(I(i),B(c=>({...c,fullParams$:c.fullParams$.pipe(B(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Re(c)),B(c=>c.map((f,h)=>{if(h===0)return f;const p=Mg({fullDataFormatter$:u,layout$:r.layout$}),d=Dg({gridAxesTransform$:p}),g=Cg({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,dataFormatter$:u,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${$2}`).data(c).join("g").attr("class",$2).each((f,h,p)=>{if(h>1)return;const d=V(p[h]);o[h]=bi(Jh,{selection:d,computedData$:f.computedData$,fullParams$:r.fullParams$.pipe(B(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),tp="OverlappingValueStackAxes",S2=ot(tp,"grid"),LI=de({name:tp,defaultParams:h2,layerIndex:Cn,validator:(t,{validateColumns:e})=>{const n=e(t,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(t.firstAxis){const r=e(t.firstAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(t.secondAxis){const r=e(t.secondAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=[],a=r.fullParams$.pipe(I(i),B(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(I(i),B(c=>c.gridIndexes[1])),u=U({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(I(i),W(async c=>c),B(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},container:{...c.fullDataFormatter.container}}}));return Qo(r).pipe(I(i),B(c=>({...c,fullParams$:c.fullParams$.pipe(B(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),W(c=>Re(c)),B(c=>c.map((f,h)=>{if(h===0)return f;const p=Mg({fullDataFormatter$:u,layout$:r.layout$}),d=Dg({gridAxesTransform$:p}),g=Cg({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,dataFormatter$:u,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${S2}`).data(c).join("g").attr("class",S2).each((f,h,p)=>{if(h>1)return;const d=V(p[h]);o[h]=bi(tp,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,fullParams$:r.fullParams$.pipe(B(g=>h===0?g.firstAxis:g.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),kI={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},ep={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:t=>{if(t.highlightTarget==="datum"&&t.datum)return[`${t.datum.label}: ${t.datum.value}`];if(t.highlightTarget==="series"){const e=t.seriesLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="category"){const e=t.categoryLabel,n=t.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}return[]},svgRenderFn:null};ep.textRenderFn.toString=()=>`(eventData) => {
|
18
22
|
if (eventData.highlightTarget === 'datum' && eventData.datum) {
|
19
23
|
return [\`\${eventData.datum.label}: \${eventData.datum.value}\`]
|
20
24
|
} else if (eventData.highlightTarget === 'series') {
|
@@ -52,10 +56,10 @@
|
|
52
56
|
return [label, value]
|
53
57
|
}
|
54
58
|
return []
|
55
|
-
}`;const
|
59
|
+
}`;const np="Tooltip",A2=ot(np,"g"),RI=ot(np,"box");function EI(t,e){const n=e.textSizePx*1.5,i=(t==null?[]:Array.isArray(t)?t:typeof t=="string"?t.split(`
|
56
60
|
`):[t]).filter(o=>o!="").map((o,a)=>`<tspan x="0" y="${a*n}">${o}</tspan>`).join("");return i?`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="0" style="dominant-baseline:text-before-edge">
|
57
61
|
${i}
|
58
|
-
</text>`:""}function
|
62
|
+
</text>`:""}function II({rootSelection:t,pluginName:e,rootWidth:n,rootHeight:r,svgString:i,tooltipStyle:o,event:a}){t.interrupt("fadeout");const s=5,u=i?[i]:[],l=i?[o]:[],f=t.selectAll(`g.${A2}`).data(u).join(x=>x.append("g").classed(A2,!0).attr("pointer-events","none"),x=>x,x=>x.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${RI}`).data(l).join(x=>x.append("g").classed(ot(e,"box"),!0)),h=f.selectAll("rect").data(l).join(x=>x.append("rect").attr("rx",s).attr("ry",s)).attr("fill",x=>x.backgroundColor).attr("stroke",x=>x.strokeColor).attr("opacity",x=>x.backgroundOpacity),p=f.selectAll("g").data(u).join(x=>x.append("g").classed(ot(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));u.length&&iE(p,u[0]);const d=p!=null&&p.node()?Dv(p):{width:0,height:0};h.attr("width",d.width+o.padding*2).attr("height",d.height+o.padding*2);const g=f!=null&&f.node()?Dv(f):{width:0,height:0},m=n-g.width,y=r-g.height,b=a.offsetX+o.offset[0]>m?m-a.offsetX:o.offset[0],v=a.offsetY+o.offset[1]>y?y-a.offsetY:o.offset[1];f.attr("transform",x=>`translate(${b}, ${v})`),f.attr("transform",x=>`translate(${b}, ${v})`)}const NI=HT({name:np,defaultParams:ep,layerIndex:gE,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},textRenderFn:{toBeTypes:["Function"]},svgRenderFn:{toBeTypes:["Function"]}})})(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new nt,s=o.event$.pipe(I(a),$i(g=>g.eventName==="mouseover"||g.eventName==="mousemove")),u=o.event$.pipe(I(a),$i(g=>g.eventName==="mouseout")),l=GT(i.fullChartParams$),c=U({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$,textSizePx:l}).pipe(I(a),W(async g=>g),B(g=>({backgroundColor:kt(g.fullParams.backgroundColorType,g.fullChartParams),backgroundOpacity:g.fullParams.backgroundOpacity,strokeColor:kt(g.fullParams.strokeColorType,g.fullChartParams),offset:g.fullParams.offset,padding:g.fullParams.padding,textSize:g.fullChartParams.styles.textSize,textSizePx:g.textSizePx,textColor:kt(g.fullParams.textColorType,g.fullChartParams)}))),f=U({fullParams:i.fullParams$,tooltipStyle:c}).pipe(I(a),W(async g=>g),B(g=>g.fullParams.svgRenderFn?g.fullParams.svgRenderFn:m=>{const y=g.fullParams.textRenderFn(m);return EI(y,g.tooltipStyle)})),h=U({event:s,contentRenderFn:f}).pipe(I(a),W(async g=>g),B(g=>g.contentRenderFn(g.event))),p=u.pipe(I(a),B(g=>"")),d=il(s,u).pipe(I(a),B(g=>g.event));return U({svgString:il(h,p),event:d,layout:i.layout$,tooltipStyle:c}).pipe(I(a),W(async g=>g)).subscribe(g=>{II({rootSelection:e,pluginName:n,rootWidth:g.layout.rootWidth,rootHeight:g.layout.rootHeight,svgString:g.svgString,tooltipStyle:g.tooltipStyle,event:g.event})}),function(){a.next(void 0)}}),T2={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},arcScaleType:"area"},P2={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},rp={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+i.reduce((o,a)=>o+(a.value??0),0),0)*n))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]};rp.eventFn.toString=()=>`(eventData: EventSeries, eventName: EventName, t: number) => {
|
59
63
|
if (eventName === 'mouseover' || eventName === 'mousemove') {
|
60
64
|
return [String(eventData.datum!.value)]
|
61
65
|
}
|
@@ -70,6 +74,6 @@
|
|
70
74
|
)
|
71
75
|
)
|
72
76
|
]
|
73
|
-
}`;const Kh={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:t=>String(t.label)};Kh.labelFn.toString=()=>"d => String(d.label)";const r2={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},Qh={outerRadius:.85,labelCentroid:2.1,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};Qh.labelFn.toString=()=>"d => String(d.label)";const i2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};let An;function qk(t,e){return Cm().velocityDecay(e.force.velocityDecay).force("collision",Dm().radius(n=>n.r+e.force.collisionSpacing)).force("charge",Em().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function jk({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),u=s.reduce((h,p)=>h+p.value,0),l=Qr().domain([0,u]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/Pg(s,p=>Math.PI*Math.pow(l(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const m=i.get(p.seriesLabel);p.x=Math.random()*m.width,p.y=Math.random()*m.height}const g=l(p.value??0)*c*f;return p.r=g,p._originR=g,p})}function Vk({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,u)=>{const l=j(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(uk,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function Zk(){return Hg().on("start",(t,e)=>{t.active||An.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||An.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function Kk({fullParams:t,SeriesContainerPositionMap:e}){An.force("x",Rm().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",km().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),An.alpha(1).restart()}function Qk({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=j(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(Zi).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const Jk=En("Bubbles",e2)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt;let o=new Map;const a=n.fullDataFormatter$.pipe(F(f=>f.sumSeries),tt()),s=n.fullParams$.pipe(I(i),F(f=>f.arcScaleType),tt()),u=B({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),W(async f=>f),F(f=>jk({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),St(1));u.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const l=n.fullChartParams$.pipe(I(i),F(f=>f.highlightTarget),tt()),c=B({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),W(async f=>f),F(f=>{An&&An.stop();const h=Vk({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return An=qk(h,f.fullParams),An.nodes(f.bubblesData),Kk({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return B({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:l}).pipe(I(i),W(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(Zk())}),B({bubblesSelection:c,bubblesData:u,highlight:n.seriesHighlight$.pipe(F(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(I(i),W(async f=>f)).subscribe(f=>{Qk({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function o2({data:t,startAngle:e,endAngle:n}){return dv().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function tI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=it(e,"series");return B({seriesLabels:r,separateSeries:n}).pipe(W(async o=>o),F((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,u=>u).join(u=>u.append("g").classed(i,!0),u=>u,u=>u.remove())}),St(1))}const Go=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=tI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return B({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a),tt((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),B({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}},Jh="Pie";function eI({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return tp(a,i.startAngle,i.endAngle,1)}:o=>tp(n,i.startAngle,i.endAngle,o)}function tp(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function a2({selection:t,data:e,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return t.selectAll("path").data(e,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,u)=>s.data.color).attr("stroke",(s,u)=>$n({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,u)=>n(s))}function nI({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const u=j(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(Zi).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function rI(t,e){const n=new nt,r=it(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(I(n),F(h=>h.width<h.height?h.width:h.height),tt()),s=new dt(h=>{B({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=o2({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new dt(h=>{B({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Cu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),l=new dt(h=>{B({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Cu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(I(n),F(h=>h.highlightTarget),tt()),f=new dt(h=>{B({pieData:s,arc:u,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(I(n),W(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,v=>v.id),g=d.enter(),m=d.exit(),y=eI({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(v,x)=>b=>{o=y(b),a2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(v,x)=>{o=tp(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const b=a2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(b),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(St(1));return B({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(I(n),W(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),B({pathSelection:f,highlight:e.seriesHighlight$.pipe(F(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:u,arcHighlight:l}).pipe(I(n),W(async h=>h)).subscribe(h=>{nI({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const iI=En(Jh,n2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Go({selection:t,pluginName:Jh,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=j(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),F(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(I(i),F(d=>d[l]??d[0]));a[l]=rI(Jh,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Iu="PieEventTexts",s2=it(Iu,"text");function ep(t,e){const n=t.selectAll(`text.${s2}`).data(e),r=n.enter().append("text").classed(s2,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=j(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function np({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,u)=>({text:s,attr:i[u],style:o[u]}))}function oI(t,e){const n=new nt;let r;const i=e.fullChartParams$.pipe(I(n),F(o=>o.highlightTarget),tt());return B({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(I(n),W(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>u=>{const l=np({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:u,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});ep(e.containerSelection,l)}).on("end",(a,s)=>{const u=np({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});ep(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=np({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});ep(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const aI=En(Iu,Zh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,{seriesCenterSelection$:o}=Go({selection:t,pluginName:Iu,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=j(c[l]),h=n.computedLayoutData$.pipe(I(i),F(d=>d[l]??d[0])),p=n.seriesContainerPosition$.pipe(I(i),F(d=>d[l]??d[0]));a[l]=oI(Iu,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),ui="PieLabels",sI=it(ui,"label-g"),uI=it(ui,"line-g"),lI=it(ui,"text"),u2=2;function cI({pieData:t,arc:e,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return t.map((a,s)=>{const[u,l]=e.centroid(a),[c,f]=n.centroid(a),h=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:h.split(`
|
74
|
-
`),lineStartX:u*i,lineStartY:l*i,lineStartMouseoverX:c*i,lineStartMouseoverY:f*i,x:u*r,y:l*r,mouseoverX:c*r,mouseoverY:f*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:u>=0&&l<=0?1:u<0&&l<=0?2:u<0&&l>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function fI({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(lI,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("x",0).attr("y",0).attr("fill",(a,s)=>$n({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{Sx(j(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function hI(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function pI({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>$n({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function dI({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=j(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>u.collisionShiftX||u.collisionShiftY?`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`:`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=j(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function gI(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(uI,!0);const i=e.containerSelection.append("g");i.classed(sI,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),F(c=>c.width<c.height?c.width:c.height),tt()),l=e.fullParams$.pipe(I(n),F(c=>c.labelCentroid>=u2?u2:c.labelCentroid));return B({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:l}).pipe(I(n),W(async c=>c)).subscribe(c=>{const f=Cu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),h=Cu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=o2({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=cI({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=fI({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{hI(d,s,c.textSizePx);const g=pI({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(g)},1e3),o.next(d)}),B({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(F(c=>c.map(f=>f.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async c=>c)).subscribe(c=>{dI({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const mI=En(ui,Kh)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Go({selection:t,pluginName:ui,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=j(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),F(p=>p[u]??p[0])),h=e.seriesContainerPosition$.pipe(I(r),F(p=>p[u]??p[0]));o[u]=gI(ui,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),rp="Rose",yI=Math.PI*2;function bI({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*e,s=i==="area"?.5:1,u=Qr().domain([0,r]).range([0,a]).exponent(s);return l=>{const c=u(l.prevValue),f=u(l.value),h=je(c,f);return p=>{const d=h(p);return bu().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(t)(l)}}}function vI({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const u=j(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(Zi).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.angleIncreaseWhileHighlight,endAngle:l.endAngle+n.angleIncreaseWhileHighlight})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function xI(t,e){const n=new nt,r=it(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),F(p=>p.width<p.height?p.width:p.height),tt()),a=B({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p),F(p=>{const d=yI/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:p.fullParams.padAngle,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=e.fullChartParams$.pipe(I(n),F(p=>p.highlightTarget),tt()),u=e.visibleComputedLayoutData$.pipe(F(p=>Math.max(...p.flat().map(d=>d.value))),tt()),l=B({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),W(async p=>p),F(p=>bI({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=e.fullChartParams$.pipe(I(n),F(p=>p.transitionDuration),tt()),f=new T2(!1),h=new dt(p=>{B({pieData:a,tweenArc:l,transitionDuration:c,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),W(async d=>d)).subscribe(d=>{const g=d.pieData.map((y,v)=>(y.prevValue=i[v]&&i[v].id===y.id?i[v].value:0,y));f.next(!0);const m=e.containerSelection.selectAll("path").data(g,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,v)=>y.data.color).attr("stroke",(y,v)=>$n({datum:y.data,colorType:d.fullParams.strokeColorType,fullChartParams:d.fullChartParams})).attr("stroke-width",d.fullParams.strokeWidth);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),f.next(!1)}),i=Object.assign([],g)})}).pipe(St(1));return B({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(I(n),W(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})})}),B({pathSelection:h,highlight:e.seriesHighlight$.pipe(F(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:l,isTransitionMoving:f}).pipe(I(n),W(async p=>p),hi(p=>!p.isTransitionMoving)).subscribe(p=>{vI({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const _I=En(rp,r2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Go({selection:t,pluginName:rp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=j(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),F(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(I(i),F(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=xI(rp,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),li="RoseLabels",wI=it(li,"label-g"),$I=it(li,"line-g"),SI=it(li,"text"),l2=2;function AI({pieData:t,labelCentroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const u=i/2*o,l=n==="area"?.5:1,c=Qr().domain([0,r]).range([0,u]).exponent(l);return t.map((f,h)=>{const p=c(f.value),d=bu().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[g,m]=d.centroid(f),[y,v]=[g,m],x=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:x.split(`
|
75
|
-
`),lineStartX:g*a,lineStartY:m*a,lineStartMouseoverX:y*a,lineStartMouseoverY:v*a,x:g*e,y:m*e,mouseoverX:y*e,mouseoverY:v*e,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:g>=0&&m<=0?1:g<0&&m<=0?2:g<0&&m>0?3:4}}).filter(f=>f.pieDatum.data.visible)}function MI({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(SI,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("fill",(a,s)=>$n({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{Sx(j(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function PI(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function DI({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>$n({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function TI({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=j(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=j(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function LI(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed($I,!0);const i=e.containerSelection.append("g");i.classed(wI,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),F(f=>f.width<f.height?f.width:f.height),tt()),l=e.visibleComputedLayoutData$.pipe(F(f=>Math.max(...f.flat().map(h=>h.value))),tt()),c=e.fullParams$.pipe(I(n),F(f=>f.labelCentroid>=l2?l2:f.labelCentroid));return B({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:l,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:c}).pipe(I(n),W(async f=>f)).subscribe(f=>{const h=Math.PI*2/f.containerVisibleComputedLayoutData.length,p=f.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:h*m,endAngle:h*(m+1),padAngle:0}));s=AI({pieData:p,labelCentroid:f.fullParams.labelCentroid,arcScaleType:f.fullParams.arcScaleType,maxValue:f.maxValue,axisWidth:f.shorterSideWith,outerRadius:f.fullParams.outerRadius,lineStartCentroid:f.lineStartCentroid,fullParams:f.fullParams}),r.selectAll("polyline").remove();const d=MI({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{PI(d,s,f.textSizePx);const g=DI({lineGSelection:r,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams});a.next(g)},1e3),o.next(d)}),B({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(F(f=>f.map(h=>h.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async f=>f)).subscribe(f=>{TI({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const CI=En(li,Qh)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Go({selection:t,pluginName:li,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=j(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),F(p=>JSON.parse(JSON.stringify(p[u]??p[0])))),h=e.seriesContainerPosition$.pipe(I(r),F(p=>JSON.parse(JSON.stringify(p[u]??p[0]))));o[u]=LI(li,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),c2="SeriesLegend",EI=En(c2,i2)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),F(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),F(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Eu(c2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ip={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};ip.sort.toString=()=>"(a, b) => b.value - a.value";const f2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},h2="TreeLegend",RI=rg(h2,f2)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.CategoryDataMap$.pipe(I(i),F(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),F(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Eu(h2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ur="TreeMap",p2=it(ur,"tree"),d2=it(ur,"tile");function kI({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${p2}`).data(e,u=>u.data.id).join("g").attr("class",p2);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const f=j(c[l]);f.selectAll(`rect.${d2}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",d2).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([u]).join("g").each((h,p,d)=>{j(d[p]).selectAll("text").data([h]).join("text").text(m=>m.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(m){const y=j(this),v=m.data.label.split(/\s+/).reverse();let x,b=[];const S=y.attr("x");let $=y.attr("y"),E=0,M=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$);for(;x=v.pop();)b.push(x),M.text(b.join(" ")),M.node().getComputedTextLength()>m.x1-m.x0-o&&(b.pop(),M.text(b.join(" ")),b=[x],E+=a,M=y.append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$).attr("dy",E+"px").text(x))})})}),s}function II({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?j(o[i]).style("opacity",1):j(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const NI=rg(ur,ip)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=B({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u),F(u=>{const l=Sy().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Xf.ratio(u.fullParams.squarifyRatio)),c=Zs(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=B({selection:Xo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),W(async u=>u),F(u=>kI({selection:t,treeData:u.treeData,fullParams:u.fullParams,fullChartParams:u.fullChartParams,textSizePx:u.textSizePx}))),s=r.fullChartParams$.pipe(I(i),F(u=>u.highlightTarget),tt());return B({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(I(i),W(async u=>u)).subscribe(u=>{u.cellSelection.on("mouseover",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:ur,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mousemove",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:ur,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mouseout",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:ur,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("click",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:ur,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})})}),B({cellSelection:a,highlight:r.treeHighlight$.pipe(F(u=>u.map(l=>l.id))),fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u)).subscribe(u=>{II({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});K.BarStack=qR,K.Bars=GR,K.BarsPN=OR,K.BarsTriangle=ek,K.Bubbles=Jk,K.CONTAINER_PLUGIN_PARAMS=Uk,K.DEFAULT_BARS_DIVERGING_PARAMS=g2,K.DEFAULT_BARS_PARAMS=Yo,K.DEFAULT_BARS_TRIANGLE_PARAMS=up,K.DEFAULT_BAR_STACK_PARAMS=sp,K.DEFAULT_BUBBLES_PARAMS=e2,K.DEFAULT_DOTS_PARAMS=ap,K.DEFAULT_GRID_LEGEND_PARAMS=fp,K.DEFAULT_GROUP_AREA_PARAMS=Nu,K.DEFAULT_GROUP_AXIS_PARAMS=Fu,K.DEFAULT_LINES_PARAMS=lr,K.DEFAULT_LINE_AREAS_PARAMS=op,K.DEFAULT_MULTI_BARS_PARAMS=Cx,K.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=Rx,K.DEFAULT_MULTI_BAR_STACK_PARAMS=Ex,K.DEFAULT_MULTI_DOTS_PARAMS=Nx,K.DEFAULT_MULTI_GRID_LEGEND_PARAMS=Lx,K.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Ih,K.DEFAULT_MULTI_LINES_PARAMS=kx,K.DEFAULT_MULTI_LINE_AREAS_PARAMS=Ix,K.DEFAULT_MULTI_VALUE_AXIS_PARAMS=ku,K.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=Dk,K.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Nh,K.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=Fx,K.DEFAULT_PIE_EVENT_TEXTS_PARAMS=Zh,K.DEFAULT_PIE_LABELS_PARAMS=Kh,K.DEFAULT_PIE_PARAMS=n2,K.DEFAULT_ROSE_LABELS_PARAMS=Qh,K.DEFAULT_ROSE_PARAMS=r2,K.DEFAULT_SCALING_AREA_PARAMS=cp,K.DEFAULT_SERIES_LEGEND_PARAMS=i2,K.DEFAULT_TREE_LEGEND_PARAMS=f2,K.DEFAULT_TREE_MAP_PARAMS=ip,K.DEFAULT_VALUE_AXIS_PARAMS=zu,K.DEFAULT_VALUE_STACK_AXIS_PARAMS=lp,K.Dots=ok,K.GridLegend=sk,K.GroupAux=Pk,K.GroupAxis=pk,K.LineAreas=ER,K.Lines=AR,K.MultiBarStack=Ck,K.MultiBars=Lk,K.MultiBarsTriangle=Ek,K.MultiDots=Ik,K.MultiGridLegend=Tk,K.MultiGroupAxis=Nk,K.MultiLineAreas=kk,K.MultiLines=Rk,K.MultiValueAxis=Fk,K.MultiValueStackAxis=zk,K.OverlappingValueAxes=Ok,K.OverlappingValueStackAxes=Yk,K.Pie=iI,K.PieEventTexts=aI,K.PieLabels=mI,K.Rose=_I,K.RoseLabels=CI,K.ScalingArea=xk,K.SeriesLegend=EI,K.TOOLTIP_PARAMS=jh,K.Tooltip=Xk,K.TreeLegend=RI,K.TreeMap=NI,K.ValueAxis=yk,K.ValueStackAxis=bk,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
77
|
+
}`;const ip={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:t=>String(t.label)};ip.labelFn.toString=()=>"d => String(d.label)";const M2={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},op={outerRadius:.85,labelCentroid:2.1,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};op.labelFn.toString=()=>"d => String(d.label)";const D2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},BI={name:"Bubbles",defaultParams:T2,layerIndex:ke,validator:(t,{validateColumns:e})=>{const n=e(t,{force:{toBeTypes:["object"]},bubbleText:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}});if(t.force){const r=e(t.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(r.status==="error")return r}if(t.bubbleText){const r=e(t.bubbleText,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},lineLengthMin:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};let Ln;function FI(t,e){return o1().velocityDecay(e.force.velocityDecay).force("collision",n1().radius(n=>n.r+e.force.collisionSpacing)).force("charge",a1().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function OI({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),u=s.reduce((h,p)=>h+p.value,0),l=li().domain([0,u]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/e0(s,p=>Math.PI*Math.pow(l(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const m=i.get(p.seriesLabel);p.x=Math.random()*m.width,p.y=Math.random()*m.height}const g=l(p.value??0)*c*f;return p.r=g,p._originR=g,p})}function GI({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,u)=>{const l=V(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(JE,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function zI(){return x0().on("start",(t,e)=>{t.active||Ln.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Ln.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function YI({fullParams:t,SeriesContainerPositionMap:e}){Ln.force("x",s1().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",u1().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Ln.alpha(1).restart()}function UI({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=V(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(no).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const WI=Fn(BI)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt;let o=new Map;const a=n.fullDataFormatter$.pipe(B(f=>f.sumSeries),tt()),s=n.fullParams$.pipe(I(i),B(f=>f.arcScaleType),tt()),u=U({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),W(async f=>f),B(f=>OI({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),St(1));u.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const l=n.fullChartParams$.pipe(I(i),B(f=>f.highlightTarget),tt()),c=U({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),W(async f=>f),B(f=>{Ln&&Ln.stop();const h=GI({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Ln=FI(h,f.fullParams),Ln.nodes(f.bubblesData),YI({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return U({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:l}).pipe(I(i),W(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(zI())}),U({bubblesSelection:c,bubblesData:u,highlight:n.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(I(i),W(async f=>f)).subscribe(f=>{UI({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function C2({data:t,startAngle:e,endAngle:n}){return Yx().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function HI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=ot(e,"series");return U({seriesLabels:r,separateSeries:n}).pipe(W(async o=>o),B((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,u=>u).join(u=>u.append("g").classed(i,!0),u=>u,u=>u.remove())}),St(1))}const Ho=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=HI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return U({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a),tt((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),U({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}},ap="Pie",XI={name:ap,defaultParams:P2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},innerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeTypes:["string"]},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]}})};function jI({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return sp(a,i.startAngle,i.endAngle,1)}:o=>sp(n,i.startAngle,i.endAngle,o)}function sp(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function L2({selection:t,data:e,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return t.selectAll("path").data(e,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,u)=>s.data.color).attr("stroke",(s,u)=>Mn({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,u)=>n(s))}function VI({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const u=V(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(no).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function qI(t,e){const n=new nt,r=ot(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(I(n),B(h=>h.width<h.height?h.width:h.height),tt()),s=new dt(h=>{U({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=C2({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new dt(h=>{U({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Nu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),l=new dt(h=>{U({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Nu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(I(n),B(h=>h.highlightTarget),tt()),f=new dt(h=>{U({pieData:s,arc:u,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(I(n),W(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,b=>b.id),g=d.enter(),m=d.exit(),y=jI({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,v)=>x=>{o=y(x),L2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,v)=>{o=sp(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const x=L2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(x),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(St(1));return U({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(I(n),W(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),U({pathSelection:f,highlight:e.seriesHighlight$.pipe(B(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:u,arcHighlight:l}).pipe(I(n),W(async h=>h)).subscribe(h=>{VI({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const ZI=Fn(XI)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:ap,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),B(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(I(i),B(d=>d[l]??d[0]));a[l]=qI(ap,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),zu="PieEventTexts",k2=ot(zu,"text"),KI={name:zu,defaultParams:rp,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{eventFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function up(t,e){const n=t.selectAll(`text.${k2}`).data(e),r=n.enter().append("text").classed(k2,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=V(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function lp({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,u)=>({text:s,attr:i[u],style:o[u]}))}function QI(t,e){const n=new nt;let r;const i=e.fullChartParams$.pipe(I(n),B(o=>o.highlightTarget),tt());return U({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(I(n),W(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>u=>{const l=lp({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:u,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,l)}).on("end",(a,s)=>{const u=lp({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=lp({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const JI=Fn(KI)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:zu,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=n.computedLayoutData$.pipe(I(i),B(d=>d[l]??d[0])),p=n.seriesContainerPosition$.pipe(I(i),B(d=>d[l]??d[0]));a[l]=QI(zu,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),xi="PieLabels",tN=ot(xi,"label-g"),eN=ot(xi,"line-g"),nN=ot(xi,"text"),R2=2,rN={name:xi,defaultParams:ip,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}})};function iN({pieData:t,arc:e,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return t.map((a,s)=>{const[u,l]=e.centroid(a),[c,f]=n.centroid(a),h=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:h.split(`
|
78
|
+
`),lineStartX:u*i,lineStartY:l*i,lineStartMouseoverX:c*i,lineStartMouseoverY:f*i,x:u*r,y:l*r,mouseoverX:c*r,mouseoverY:f*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:u>=0&&l<=0?1:u<0&&l<=0?2:u<0&&l>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function oN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(nN,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("x",0).attr("y",0).attr("fill",(a,s)=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{t2(V(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function aN(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function sN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function uN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>u.collisionShiftX||u.collisionShiftY?`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`:`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function lN(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(eN,!0);const i=e.containerSelection.append("g");i.classed(tN,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),B(c=>c.width<c.height?c.width:c.height),tt()),l=e.fullParams$.pipe(I(n),B(c=>c.labelCentroid>=R2?R2:c.labelCentroid));return U({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:l}).pipe(I(n),W(async c=>c)).subscribe(c=>{const f=Nu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),h=Nu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=C2({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=iN({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=oN({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{aN(d,s,c.textSizePx);const g=sN({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(g)},1e3),o.next(d)}),U({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(c=>c.map(f=>f.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async c=>c)).subscribe(c=>{uN({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const cN=Fn(rN)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Ho({selection:t,pluginName:xi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=V(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),B(p=>p[u]??p[0])),h=e.seriesContainerPosition$.pipe(I(r),B(p=>p[u]??p[0]));o[u]=lN(xi,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),cp="Rose",fN=Math.PI*2,hN={name:cp,defaultParams:M2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"},angleIncreaseWhileHighlight:{toBeTypes:["number"]}})};function pN({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*e,s=i==="area"?.5:1,u=li().domain([0,r]).range([0,a]).exponent(s);return l=>{const c=u(l.prevValue),f=u(l.value),h=Ze(c,f);return p=>{const d=h(p);return $u().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(t)(l)}}}function dN({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const u=V(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(no).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.angleIncreaseWhileHighlight,endAngle:l.endAngle+n.angleIncreaseWhileHighlight})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function gN(t,e){const n=new nt,r=ot(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),B(p=>p.width<p.height?p.width:p.height),tt()),a=U({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p),B(p=>{const d=fN/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:p.fullParams.padAngle,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=e.fullChartParams$.pipe(I(n),B(p=>p.highlightTarget),tt()),u=e.visibleComputedLayoutData$.pipe(B(p=>Math.max(...p.flat().map(d=>d.value))),tt()),l=U({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),W(async p=>p),B(p=>pN({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=e.fullChartParams$.pipe(I(n),B(p=>p.transitionDuration),tt()),f=new t_(!1),h=new dt(p=>{U({pieData:a,tweenArc:l,transitionDuration:c,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),W(async d=>d)).subscribe(d=>{const g=d.pieData.map((y,b)=>(y.prevValue=i[b]&&i[b].id===y.id?i[b].value:0,y));f.next(!0);const m=e.containerSelection.selectAll("path").data(g,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,b)=>y.data.color).attr("stroke",(y,b)=>Mn({datum:y.data,colorType:d.fullParams.strokeColorType,fullChartParams:d.fullChartParams})).attr("stroke-width",d.fullParams.strokeWidth);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),f.next(!1)}),i=Object.assign([],g)})}).pipe(St(1));return U({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(I(n),W(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})})}),U({pathSelection:h,highlight:e.seriesHighlight$.pipe(B(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:l,isTransitionMoving:f}).pipe(I(n),W(async p=>p),$i(p=>!p.isTransitionMoving)).subscribe(p=>{dN({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const mN=Fn(hN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:cp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),B(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(I(i),B(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=gN(cp,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),vi="RoseLabels",yN=ot(vi,"label-g"),bN=ot(vi,"line-g"),xN=ot(vi,"text"),E2=2,vN={name:vi,defaultParams:op,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}})};function _N({pieData:t,labelCentroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const u=i/2*o,l=n==="area"?.5:1,c=li().domain([0,r]).range([0,u]).exponent(l);return t.map((f,h)=>{const p=c(f.value),d=$u().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[g,m]=d.centroid(f),[y,b]=[g,m],v=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:v.split(`
|
79
|
+
`),lineStartX:g*a,lineStartY:m*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:g*e,y:m*e,mouseoverX:y*e,mouseoverY:b*e,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:g>=0&&m<=0?1:g<0&&m<=0?2:g<0&&m>0?3:4}}).filter(f=>f.pieDatum.data.visible)}function wN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(xN,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("fill",(a,s)=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{t2(V(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function $N(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function SN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function AN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function TN(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(bN,!0);const i=e.containerSelection.append("g");i.classed(yN,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),B(f=>f.width<f.height?f.width:f.height),tt()),l=e.visibleComputedLayoutData$.pipe(B(f=>Math.max(...f.flat().map(h=>h.value))),tt()),c=e.fullParams$.pipe(I(n),B(f=>f.labelCentroid>=E2?E2:f.labelCentroid));return U({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:l,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:c}).pipe(I(n),W(async f=>f)).subscribe(f=>{const h=Math.PI*2/f.containerVisibleComputedLayoutData.length,p=f.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:h*m,endAngle:h*(m+1),padAngle:0}));s=_N({pieData:p,labelCentroid:f.fullParams.labelCentroid,arcScaleType:f.fullParams.arcScaleType,maxValue:f.maxValue,axisWidth:f.shorterSideWith,outerRadius:f.fullParams.outerRadius,lineStartCentroid:f.lineStartCentroid,fullParams:f.fullParams}),r.selectAll("polyline").remove();const d=wN({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{$N(d,s,f.textSizePx);const g=SN({lineGSelection:r,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams});a.next(g)},1e3),o.next(d)}),U({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async f=>f)).subscribe(f=>{AN({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const PN=Fn(vN)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Ho({selection:t,pluginName:vi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=V(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),B(p=>JSON.parse(JSON.stringify(p[u]??p[0])))),h=e.seriesContainerPosition$.pipe(I(r),B(p=>JSON.parse(JSON.stringify(p[u]??p[0]))));o[u]=TN(vi,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),I2="SeriesLegend",MN=Fn({name:I2,defaultParams:D2,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(I2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),fp={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};fp.sort.toString=()=>"(a, b) => b.value - a.value";const N2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},B2="TreeLegend",DN=Lg({name:B2,defaultParams:N2,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.CategoryDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(B2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),dr="TreeMap",F2=ot(dr,"tree"),O2=ot(dr,"tile"),CN={name:dr,defaultParams:fp,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function LN({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${F2}`).data(e,u=>u.data.id).join("g").attr("class",F2);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const f=V(c[l]);f.selectAll(`rect.${O2}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",O2).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([u]).join("g").each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).join("text").text(m=>m.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(m){const y=V(this),b=m.data.label.split(/\s+/).reverse();let v,x=[];const S=y.attr("x");let $=y.attr("y"),R=0,T=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",kt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$);for(;v=b.pop();)x.push(v),T.text(x.join(" ")),T.node().getComputedTextLength()>m.x1-m.x0-o&&(x.pop(),T.text(x.join(" ")),x=[v],R+=a,T=y.append("tspan").attr("cursor","pointer").attr("fill",kt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$).attr("dy",R+"px").text(v))})})}),s}function kN({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const RN=Lg(CN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=U({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u),B(u=>{const l=Qy().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Qf.ratio(u.fullParams.squarifyRatio)),c=eu(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=U({selection:Qo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),W(async u=>u),B(u=>LN({selection:t,treeData:u.treeData,fullParams:u.fullParams,fullChartParams:u.fullChartParams,textSizePx:u.textSizePx}))),s=r.fullChartParams$.pipe(I(i),B(u=>u.highlightTarget),tt());return U({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(I(i),W(async u=>u)).subscribe(u=>{u.cellSelection.on("mouseover",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mousemove",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mouseout",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("click",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})})}),U({cellSelection:a,highlight:r.treeHighlight$.pipe(B(u=>u.map(l=>l.id))),fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u)).subscribe(u=>{kN({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});K.BarStack=FE,K.Bars=CE,K.BarsPN=LE,K.BarsTriangle=XE,K.Bubbles=WI,K.CONTAINER_PLUGIN_PARAMS=kI,K.DEFAULT_BARS_DIVERGING_PARAMS=G2,K.DEFAULT_BARS_PARAMS=jo,K.DEFAULT_BARS_TRIANGLE_PARAMS=gp,K.DEFAULT_BAR_STACK_PARAMS=dp,K.DEFAULT_BUBBLES_PARAMS=T2,K.DEFAULT_DOTS_PARAMS=pp,K.DEFAULT_GRID_LEGEND_PARAMS=bp,K.DEFAULT_GROUP_AREA_PARAMS=Yu,K.DEFAULT_GROUP_AXIS_PARAMS=Uu,K.DEFAULT_LINES_PARAMS=gr,K.DEFAULT_LINE_AREAS_PARAMS=hp,K.DEFAULT_MULTI_BARS_PARAMS=a2,K.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=u2,K.DEFAULT_MULTI_BAR_STACK_PARAMS=s2,K.DEFAULT_MULTI_DOTS_PARAMS=f2,K.DEFAULT_MULTI_GRID_LEGEND_PARAMS=o2,K.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Yh,K.DEFAULT_MULTI_LINES_PARAMS=l2,K.DEFAULT_MULTI_LINE_AREAS_PARAMS=c2,K.DEFAULT_MULTI_VALUE_AXIS_PARAMS=Gu,K.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=xI,K.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Uh,K.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=h2,K.DEFAULT_PIE_EVENT_TEXTS_PARAMS=rp,K.DEFAULT_PIE_LABELS_PARAMS=ip,K.DEFAULT_PIE_PARAMS=P2,K.DEFAULT_ROSE_LABELS_PARAMS=op,K.DEFAULT_ROSE_PARAMS=M2,K.DEFAULT_SCALING_AREA_PARAMS=yp,K.DEFAULT_SERIES_LEGEND_PARAMS=D2,K.DEFAULT_TREE_LEGEND_PARAMS=N2,K.DEFAULT_TREE_MAP_PARAMS=fp,K.DEFAULT_VALUE_AXIS_PARAMS=Wu,K.DEFAULT_VALUE_STACK_AXIS_PARAMS=mp,K.Dots=ZE,K.GridLegend=QE,K.GroupAux=bI,K.GroupAxis=iI,K.LineAreas=$E,K.Lines=mE,K.MultiBarStack=wI,K.MultiBars=_I,K.MultiBarsTriangle=$I,K.MultiDots=TI,K.MultiGridLegend=vI,K.MultiGroupAxis=PI,K.MultiLineAreas=AI,K.MultiLines=SI,K.MultiValueAxis=MI,K.MultiValueStackAxis=DI,K.OverlappingValueAxes=CI,K.OverlappingValueStackAxes=LI,K.Pie=ZI,K.PieEventTexts=JI,K.PieLabels=cN,K.Rose=mN,K.RoseLabels=PN,K.ScalingArea=cI,K.SeriesLegend=MN,K.TOOLTIP_PARAMS=ep,K.Tooltip=NI,K.TreeLegend=DN,K.TreeMap=RN,K.ValueAxis=uI,K.ValueStackAxis=lI,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|