@orbcharts/plugins-basic 3.0.0-alpha.63 → 3.0.0-alpha.65
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/orbcharts-plugins-basic.es.js +5699 -5476
- package/dist/orbcharts-plugins-basic.umd.js +16 -10
- package/dist/src/base/BaseGroupAxis.d.ts +1 -0
- package/dist/src/noneData/index.d.ts +0 -1
- package/dist/src/noneData/types.d.ts +1 -1
- package/dist/src/series/types.d.ts +6 -1
- package/package.json +2 -2
- package/src/base/BaseGroupAxis.ts +35 -20
- package/src/base/BaseLegend.ts +1 -0
- package/src/grid/plugins/GroupAxis.ts +1 -0
- package/src/multiGrid/plugins/MultiGroupAxis.ts +1 -0
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +3 -0
- package/src/multiGrid/plugins/OverlappingValueStackAxes.ts +1 -0
- package/src/noneData/index.ts +1 -1
- package/src/noneData/plugins/Tooltip.ts +26 -9
- package/src/noneData/types.ts +1 -1
- package/src/series/defaults.ts +15 -10
- package/src/series/plugins/Pie.ts +12 -4
- package/src/series/plugins/PieLabels.ts +357 -63
- package/src/series/plugins/Rose.ts +17 -8
- package/src/series/plugins/RoseLabels.ts +290 -87
- package/src/series/types.ts +9 -5
@@ -1,18 +1,19 @@
|
|
1
|
-
(function(K,
|
1
|
+
(function(K,lr){typeof exports=="object"&&typeof module<"u"?lr(exports):typeof define=="function"&&define.amd?define(["exports"],lr):(K=typeof globalThis<"u"?globalThis:K||self,lr(K["orbcharts-plugins-basic"]={}))})(this,function(K){"use strict";const lr={lineCurve:"curveLinear",lineWidth:2},ip={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},op={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1},Nu={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:t=>t,labelPadding:20,labelRotate:0};Nu.labelTextFormat.toString=()=>"text => text";const Yo={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},h2={...Yo},ap={barWidth:0,barGroupPadding:10,barRadius:!1},sp={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},Fu={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"};Fu.tickFormat.toString=()=>"text => text";const Gu={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"},up={...Gu},lp={},cp={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};var zu=function(t,e){return zu=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])},zu(t,e)};function Pn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function p2(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 fp(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 cr(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 fr(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 ci(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 hr(t){return this instanceof hr?(this.v=t,this):new hr(t)}function d2(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 hr?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 g2(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 cr=="function"?cr(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 Ou(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 Yu=Ou(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 Bu(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var zo=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=lr(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 Uu?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=lr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{dp(d)}catch(g){o=o??[],g instanceof Uu?o=si(si([],cr(o)),cr(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 Uu(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)dp(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)&&Bu(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Bu(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),hp=zo.EMPTY;function pp(t){return t instanceof zo||t&&"closed"in t&&yt(t.remove)&&yt(t.add)&&yt(t.unsubscribe)}function dp(t){yt(t)?t():t.unsubscribe()}var gp={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},mp={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,si([t,e],cr(n)))},clearTimeout:function(t){var e=mp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function yp(t){mp.setTimeout(function(){throw t})}function Yu(){}function Oo(t){t()}var Wu=function(t){Mn(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,pp(n)&&n.add(r)):r.destination=x2,r}return e.create=function(n,r,i){return new ui(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}(zo),y2=Function.prototype.bind;function Hu(t,e){return y2.call(t,e)}var b2=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){Uo(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Uo(r)}else Uo(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Uo(n)}},t}(),ui=function(t){Mn(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&&gp.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 b2(a),o}return e}(Wu);function Uo(t){yp(t)}function v2(t){throw t}var x2={closed:!0,next:Yu,error:v2,complete:Yu},Vu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function hr(t){return t}function _2(t){return t.length===0?hr: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=$2(e)?e:new ui(e,n,r);return Oo(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=bp(n),new n(function(i,o){var a=new ui({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[Vu]=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=bp(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 bp(t){var e;return(e=t??gp.Promise)!==null&&e!==void 0?e:Promise}function w2(t){return t&&yt(t.next)&&yt(t.error)&&yt(t.complete)}function $2(t){return t&&t instanceof Wu||w2(t)&&pp(t)}function S2(t){return yt(t==null?void 0:t.lift)}function fe(t){return function(e){if(S2(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 A2(t,e,n,r,i)}var A2=function(t){Mn(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),M2=Ou(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),nt=function(t){Mn(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 vp(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new M2},e.prototype.next=function(n){var r=this;Oo(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=lr(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;Oo(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;Oo(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?hp:(this.currentObservers=null,s.push(n),new zo(function(){r.currentObservers=null,Bu(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 vp(n,r)},e}(dt),vp=function(t){Mn(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:hp},e}(nt),D2=function(t){Mn(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),xp={now:function(){return(xp.delegate||Date).now()},delegate:void 0},P2=function(t){Mn(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=xp);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),_p=new dt(function(t){return t.complete()});function T2(t){return t&&yt(t.schedule)}function ju(t){return t[t.length-1]}function L2(t){return yt(ju(t))?t.pop():void 0}function qu(t){return T2(ju(t))?t.pop():void 0}function C2(t,e){return typeof ju(t)=="number"?t.pop():e}var Xu=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function wp(t){return yt(t==null?void 0:t.then)}function $p(t){return yt(t[Vu])}function Sp(t){return Symbol.asyncIterator&&yt(t==null?void 0:t[Symbol.asyncIterator])}function Ap(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 E2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Mp=E2();function Dp(t){return yt(t==null?void 0:t[Mp])}function Pp(t){return g2(this,arguments,function(){var n,r,i,o;return fp(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,fr(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,fr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,fr(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 Tp(t){return yt(t==null?void 0:t.getReader)}function he(t){if(t instanceof dt)return t;if(t!=null){if($p(t))return R2(t);if(Xu(t))return k2(t);if(wp(t))return I2(t);if(Sp(t))return Lp(t);if(Dp(t))return N2(t);if(Tp(t))return F2(t)}throw Ap(t)}function R2(t){return new dt(function(e){var n=t[Vu]();if(yt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function k2(t){return new dt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function I2(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,yp)})}function N2(t){return new dt(function(e){var n,r;try{for(var i=lr(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 Lp(t){return new dt(function(e){G2(t,e).catch(function(n){return e.error(n)})})}function F2(t){return Lp(Pp(t))}function G2(t,e){var n,r,i,o;return d2(this,void 0,void 0,function(){var a,s;return fp(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=m2(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 Cp(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 Ep(t,e){return e===void 0&&(e=0),fe(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function z2(t,e){return he(t).pipe(Ep(e),Cp(e))}function O2(t,e){return he(t).pipe(Ep(e),Cp(e))}function U2(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 B2(t,e){return new dt(function(n){var r;return ln(n,e,function(){r=t[Mp](),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 Rp(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 Y2(t,e){return Rp(Pp(t),e)}function W2(t,e){if(t!=null){if($p(t))return z2(t,e);if(Xu(t))return U2(t,e);if(wp(t))return O2(t,e);if(Sp(t))return Rp(t,e);if(Dp(t))return B2(t,e);if(Tp(t))return Y2(t,e)}throw Ap(t)}function Bo(t,e){return e?W2(t,e):he(t)}function Yo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=qu(t);return Bo(t,n)}var kp=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 H2=Array.isArray;function V2(t,e){return H2(e)?t.apply(void 0,si([],cr(e))):t(e)}function Ip(t){return F(function(e){return V2(t,e)})}var j2=Array.isArray,q2=Object.getPrototypeOf,X2=Object.prototype,Z2=Object.keys;function K2(t){if(t.length===1){var e=t[0];if(j2(e))return{args:e,keys:null};if(Q2(e)){var n=Z2(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function Q2(t){return t&&typeof t=="object"&&q2(t)===X2}function J2(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function Y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=qu(t),r=L2(t),i=K2(t),o=i.args,a=i.keys;if(o.length===0)return Bo([],n);var s=new dt(t_(o,n,a?function(u){return J2(a,u)}:hr));return r?s.pipe(Ip(r)):s}function t_(t,e,n){return n===void 0&&(n=hr),function(r){Np(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){Np(e,function(){var f=Bo(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 Np(t,e,n){t?ln(n,t,e):e()}function e_(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 b=u.shift();a||d(b)};u.length&&l<r;)y();h()}catch(b){e.error(b)}}))};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 e_(r,i,t,n)}))}function n_(t){return t===void 0&&(t=1/0),Zu(hr,t)}function r_(t){return new dt(function(e){he(t()).subscribe(e)})}var i_=["addListener","removeListener"],o_=["addEventListener","removeEventListener"],a_=["on","off"];function Ku(t,e,n,r){if(yt(n)&&(r=n,n=void 0),r)return Ku(t,e,n).pipe(Ip(r));var i=cr(l_(t)?o_.map(function(s){return function(u){return t[s](e,u,n)}}):s_(t)?i_.map(Fp(t,e)):u_(t)?a_.map(Fp(t,e)):[],2),o=i[0],a=i[1];if(!o&&Xu(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 Fp(t,e){return function(n){return function(r){return t[n](e,r)}}}function s_(t){return yt(t.addListener)&&yt(t.removeListener)}function u_(t){return yt(t.on)&&yt(t.off)}function l_(t){return yt(t.addEventListener)&&yt(t.removeEventListener)}function c_(t,e,n){return r_(function(){return t()?e:n})}function Qu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=qu(t),r=C2(t,1/0),i=t;return i.length?i.length===1?he(i[0]):n_(r)(Bo(i,n)):_p}function li(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 f_(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 h_(t){return t<=0?function(){return _p}: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=hr),t=t??p_,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 p_(t,e){return t===e}function d_(t){return t===void 0&&(t=g_),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 g_(){return new kp}function m_(t,e){var n=arguments.length>=2;return function(r){return r.pipe(hr,h_(1),n?f_(e):d_(function(){return new kp}))}}function y_(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 x=c;y(),x==null||x.unsubscribe()};return fe(function(x,v){p++,!g&&!d&&m();var $=h=h??n();v.add(function(){p--,p===0&&!g&&!d&&(f=Ju(b,u))}),$.subscribe(v),!c&&p>0&&(c=new ui({next:function(w){return $.next(w)},error:function(w){g=!0,m(),f=Ju(y,i,w),$.error(w)},complete:function(){d=!0,m(),f=Ju(y,a),$.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 ui({next:function(){i.unsubscribe(),t()}});return he(e.apply(void 0,si([],cr(n)))).subscribe(i)}}function St(t,e,n){var r,i=!1;return r=t,y_({connector:function(){return new P2(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()},Yu)),!n.closed&&e.subscribe(n)})}const pr={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""};function Wo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function b_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gp(t){let e,n,r;t.length!==2?(e=Wo,n=(s,u)=>Wo(t(s),u),r=(s,u)=>t(s)-u):(e=t===Wo||t===b_?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 x_(t){return t===null?NaN:+t}const __=Gp(Wo),zp=__.right;Gp(x_).center;const w_=Math.sqrt(50),$_=Math.sqrt(10),S_=Math.sqrt(2);function Ho(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>=w_?10:o>=$_?5:o>=S_?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?Ho(t,e,n*2):[s,u,l]}function A_(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?Ho(e,t,n):Ho(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,Ho(t,e,n)[2]}function M_(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 Op(){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 P_(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=Op.prototype={constructor:Vo,on:function(t,e){var n=this._,r=P_(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=T_(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]=Up(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Up(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 T_(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Up(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 Bp={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 jo(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Bp.hasOwnProperty(e)?{space:Bp[e],local:t}:t}function L_(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 C_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yp(t){var e=jo(t);return(e.local?C_:L_)(e)}function E_(){}function nl(t){return t==null?E_:function(){return this.querySelector(t)}}function R_(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 k_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function I_(){return[]}function Wp(t){return t==null?I_:function(){return this.querySelectorAll(t)}}function N_(t){return function(){return k_(t.apply(this,arguments))}}function F_(t){typeof t=="function"?t=N_(t):t=Wp(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 Hp(t){return function(){return this.matches(t)}}function Vp(t){return function(e){return e.matches(t)}}var G_=Array.prototype.find;function z_(t){return function(){return G_.call(this.children,t)}}function O_(){return this.firstElementChild}function U_(t){return this.select(t==null?O_:z_(typeof t=="function"?t:Vp(t)))}var B_=Array.prototype.filter;function Y_(){return Array.from(this.children)}function W_(t){return function(){return B_.call(this.children,t)}}function H_(t){return this.selectAll(t==null?Y_:W_(typeof t=="function"?t:Vp(t)))}function V_(t){typeof t!="function"&&(t=Hp(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 jp(t){return new Array(t.length)}function j_(){return new _e(this._enter||this._groups.map(jp),this._parents)}function qo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}qo.prototype={constructor:qo,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 q_(t){return function(){return t}}function X_(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 qo(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function Z_(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 qo(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function K_(t){return t.__data__}function Q_(t,e){if(!arguments.length)return Array.from(this,K_);var n=e?Z_:X_,r=this._parents,i=this._groups;typeof t!="function"&&(t=q_(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=J_(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,x=0,v,$;b<d;++b)if(v=g[b]){for(b>=x&&(x=b+1);!($=m[x])&&++x<d;);v._next=$||null}}return a=new _e(a,r),a._enter=s,a._exit=u,a}function J_(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function tw(){return new _e(this._exit||this._groups.map(jp),this._parents)}function ew(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 nw(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 rw(){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 iw(t){t||(t=ow);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 ow(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function aw(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function sw(){return Array.from(this)}function uw(){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 lw(){let t=0;for(const e of this)++t;return t}function cw(){return!this.node()}function fw(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 hw(t){return function(){this.removeAttribute(t)}}function pw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function dw(t,e){return function(){this.setAttribute(t,e)}}function gw(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function mw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function yw(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 bw(t,e){var n=jo(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?pw:hw:typeof e=="function"?n.local?yw:mw:n.local?gw:dw)(n,e))}function qp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function vw(t){return function(){this.style.removeProperty(t)}}function xw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function _w(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ww(t,e,n){return arguments.length>1?this.each((e==null?vw:typeof e=="function"?_w:xw)(t,e,n??"")):dr(this.node(),t)}function dr(t,e){return t.style.getPropertyValue(e)||qp(t).getComputedStyle(t,null).getPropertyValue(e)}function $w(t){return function(){delete this[t]}}function Sw(t,e){return function(){this[t]=e}}function Aw(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Mw(t,e){return arguments.length>1?this.each((e==null?$w:typeof e=="function"?Aw:Sw)(t,e)):this.node()[t]}function Xp(t){return t.trim().split(/^|\s+/)}function rl(t){return t.classList||new Zp(t)}function Zp(t){this._node=t,this._names=Xp(t.getAttribute("class")||"")}Zp.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 Kp(t,e){for(var n=rl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Qp(t,e){for(var n=rl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Dw(t){return function(){Kp(this,t)}}function Pw(t){return function(){Qp(this,t)}}function Tw(t,e){return function(){(e.apply(this,arguments)?Kp:Qp)(this,t)}}function Lw(t,e){var n=Xp(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"?Tw:e?Dw:Pw)(n,e))}function Cw(){this.textContent=""}function Ew(t){return function(){this.textContent=t}}function Rw(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function kw(t){return arguments.length?this.each(t==null?Cw:(typeof t=="function"?Rw:Ew)(t)):this.node().textContent}function Iw(){this.innerHTML=""}function Nw(t){return function(){this.innerHTML=t}}function Fw(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Gw(t){return arguments.length?this.each(t==null?Iw:(typeof t=="function"?Fw:Nw)(t)):this.node().innerHTML}function zw(){this.nextSibling&&this.parentNode.appendChild(this)}function Ow(){return this.each(zw)}function Uw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Bw(){return this.each(Uw)}function Yw(t){var e=typeof t=="function"?t:Yp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ww(){return null}function Hw(t,e){var n=typeof t=="function"?t:Yp(t),r=e==null?Ww:typeof e=="function"?e:nl(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Vw(){var t=this.parentNode;t&&t.removeChild(this)}function jw(){return this.each(Vw)}function qw(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Xw(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Zw(t){return this.select(t?Xw:qw)}function Kw(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Qw(t){return function(e){t.call(this,e,this.__data__)}}function Jw(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 t$(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 e$(t,e,n){return function(){var r=this.__on,i,o=Qw(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 n$(t,e,n){var r=Jw(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?e$:t$,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function Jp(t,e,n){var r=qp(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 r$(t,e){return function(){return Jp(this,t,e)}}function i$(t,e){return function(){return Jp(this,t,e.apply(this,arguments))}}function o$(t,e){return this.each((typeof e=="function"?i$:r$)(t,e))}function*a$(){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 s$=[null];function _e(t,e){this._groups=t,this._parents=e}function ci(){return new _e([[document.documentElement]],s$)}function u$(){return this}_e.prototype=ci.prototype={constructor:_e,select:R_,selectAll:F_,selectChild:U_,selectChildren:H_,filter:V_,data:Q_,enter:j_,exit:tw,join:ew,merge:nw,selection:u$,order:rw,sort:iw,call:aw,nodes:sw,node:uw,size:lw,empty:cw,each:fw,attr:bw,style:ww,property:Mw,classed:Lw,text:kw,html:Gw,raise:Ow,lower:Bw,append:Yw,insert:Hw,remove:jw,clone:Zw,datum:Kw,on:n$,dispatch:o$,[Symbol.iterator]:a$};function il(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function td(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function fi(){}var hi=.7,Xo=1/hi,gr="\\s*([+-]?\\d+)\\s*",pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l$=/^#([0-9a-f]{3,8})$/,c$=new RegExp(`^rgb\\(${gr},${gr},${gr}\\)$`),f$=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),h$=new RegExp(`^rgba\\(${gr},${gr},${gr},${pi}\\)$`),p$=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${pi}\\)$`),d$=new RegExp(`^hsl\\(${pi},${Ee},${Ee}\\)$`),g$=new RegExp(`^hsla\\(${pi},${Ee},${Ee},${pi}\\)$`),ed={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(fi,Dn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nd,formatHex:nd,formatHex8:m$,formatHsl:y$,formatRgb:rd,toString:rd});function nd(){return this.rgb().formatHex()}function m$(){return this.rgb().formatHex8()}function y$(){return ud(this).formatHsl()}function rd(){return this.rgb().formatRgb()}function Dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=l$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?id(e):n===3?new ne(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Zo(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Zo(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=c$.exec(t))?new ne(e[1],e[2],e[3],1):(e=f$.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=h$.exec(t))?Zo(e[1],e[2],e[3],e[4]):(e=p$.exec(t))?Zo(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=d$.exec(t))?sd(e[1],e[2]/100,e[3]/100,1):(e=g$.exec(t))?sd(e[1],e[2]/100,e[3]/100,e[4]):ed.hasOwnProperty(t)?id(ed[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function id(t){return new ne(t>>16&255,t>>8&255,t&255,1)}function Zo(t,e,n,r){return r<=0&&(t=e=n=NaN),new ne(t,e,n,r)}function b$(t){return t instanceof fi||(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?b$(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,td(fi,{brighter(t){return t=t==null?Xo:Math.pow(Xo,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?hi:Math.pow(hi,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ne(Pn(this.r),Pn(this.g),Pn(this.b),Ko(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:od,formatHex:od,formatHex8:v$,formatRgb:ad,toString:ad}));function od(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}`}function v$(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}${Tn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ad(){const t=Ko(this.opacity);return`${t===1?"rgb(":"rgba("}${Pn(this.r)}, ${Pn(this.g)}, ${Pn(this.b)}${t===1?")":`, ${t})`}`}function Ko(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Tn(t){return t=Pn(t),(t<16?"0":"")+t.toString(16)}function sd(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 ud(t){if(t instanceof we)return new we(t.h,t.s,t.l,t.opacity);if(t instanceof fi||(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 x$(t,e,n,r){return arguments.length===1?ud(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,x$,td(fi,{brighter(t){return t=t==null?Xo:Math.pow(Xo,t),new we(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?hi:Math.pow(hi,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(ld(this.h),Qo(this.s),Qo(this.l),Ko(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=Ko(this.opacity);return`${t===1?"hsl(":"hsla("}${ld(this.h)}, ${Qo(this.s)*100}%, ${Qo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ld(t){return t=(t||0)%360,t<0?t+360:t}function Qo(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 _$(t,e){return function(n){return t+n*e}}function w$(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 $$(t){return(t=+t)==1?cd:function(e,n){return n-e?w$(e,n,t):sl(isNaN(e)?n:e)}}function cd(t,e){var n=e-t;return n?_$(t,n):sl(isNaN(t)?e:t)}const Jo=function t(e){var n=$$(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=cd(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 S$(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 A$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function M$(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 P$(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 T$(t){return function(){return t}}function L$(t){return function(e){return t(e)+""}}function fd(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]?L$(u[0].x):T$(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,Jo):fd:e instanceof Dn?Jo:e instanceof Date?D$:A$(e)?S$:Array.isArray(e)?M$:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?P$:$e)(t,e)}function C$(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var hd=180/Math.PI,pd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dd(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)*hd,skewX:Math.atan(u)*hd,scaleX:a,scaleY:s}}var ta;function E$(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?pd:dd(e.a,e.b,e.c,e.d,e.e,e.f)}function R$(t){return t==null||(ta||(ta=document.createElementNS("http://www.w3.org/2000/svg","g")),ta.setAttribute("transform",t),!(t=ta.transform.baseVal.consolidate()))?pd:(t=t.matrix,dd(t.a,t.b,t.c,t.d,t.e,t.f))}function gd(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 k$=gd(E$,"px, ","px)","deg)"),I$=gd(R$,", ",")",")"),mr=0,di=0,gi=0,md=1e3,ea,mi,na=0,Ln=0,ra=0,yi=typeof performance=="object"&&performance.now?performance:Date,yd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function fl(){return Ln||(yd(N$),Ln=yi.now()+ra)}function N$(){Ln=0}function ia(){this._call=this._time=this._next=null}ia.prototype=bd.prototype={constructor:ia,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&&mi!==this&&(mi?mi._next=this:ea=this,mi=this),this._call=t,this._time=n,hl()},stop:function(){this._call&&(this._call=null,this._time=1/0,hl())}};function bd(t,e,n){var r=new ia;return r.restart(t,e,n),r}function F$(){fl(),++mr;for(var t=ea,e;t;)(e=Ln-t._time)>=0&&t._call.call(void 0,e),t=t._next;--mr}function vd(){Ln=(na=yi.now())+ra,mr=di=0;try{F$()}finally{mr=0,z$(),Ln=0}}function G$(){var t=yi.now(),e=t-na;e>md&&(ra-=e,na=t)}function z$(){for(var t,e=ea,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:ea=n);mi=t,hl(r)}function hl(t){if(!mr){di&&(di=clearTimeout(di));var e=t-Ln;e>24?(t<1/0&&(di=setTimeout(vd,t-yi.now()-ra)),gi&&(gi=clearInterval(gi))):(gi||(na=yi.now(),gi=setInterval(G$,md)),mr=1,yd(vd))}}function xd(t,e,n){var r=new ia;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var O$=Op("start","end","cancel","interrupt"),U$=[],_d=0,wd=1,pl=2,oa=3,$d=4,dl=5,aa=6;function sa(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:O$,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>oa)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=bd(o,0,n.time);function o(l){n.state=wd,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!==wd)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===oa)return xd(a);p.state===$d?(p.state=aa,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=aa,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(xd(function(){n.state===oa&&(n.state=$d,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=oa,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=aa,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Y$(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=aa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function W$(t){return this.each(function(){Y$(this,t)})}function H$(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 V$(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?H$:V$)(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 Sd(t,e){var n;return(typeof e=="number"?$e:e instanceof Dn?Jo:(n=Dn(e))?(e=n,Jo):fd)(t,e)}function q$(t){return function(){this.removeAttribute(t)}}function X$(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Z$(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 K$(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 Q$(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 J$(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 tS(t,e){var n=jo(t),r=n==="transform"?I$:Sd;return this.attrTween(t,typeof e=="function"?(n.local?J$:Q$)(n,r,ml(this,"attr."+t,e)):e==null?(n.local?X$:q$)(n):(n.local?K$:Z$)(n,r,e))}function eS(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function nS(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function rS(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 iS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&eS(t,o)),n}return i._value=e,i}function oS(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=jo(t);return this.tween(n,(r.local?rS:iS)(r,e))}function aS(t,e){return function(){gl(this,t).delay=+e.apply(this,arguments)}}function sS(t,e){return e=+e,function(){gl(this,t).delay=e}}function uS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?aS:sS)(e,t)):Se(this.node(),e).delay}function lS(t,e){return function(){Re(this,t).duration=+e.apply(this,arguments)}}function cS(t,e){return e=+e,function(){Re(this,t).duration=e}}function fS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?lS:cS)(e,t)):Se(this.node(),e).duration}function hS(t,e){if(typeof e!="function")throw new Error;return function(){Re(this,t).ease=e}}function pS(t){var e=this._id;return arguments.length?this.each(hS(e,t)):Se(this.node(),e).ease}function dS(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Re(this,t).ease=n}}function gS(t){if(typeof t!="function")throw new Error;return this.each(dS(this._id,t))}function mS(t){typeof t!="function"&&(t=Hp(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 yS(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 bS(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=bS(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 xS(t,e){var n=this._id;return arguments.length<2?Se(this.node(),n).on.on(t):this.each(vS(n,t,e))}function _S(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function wS(){return this.on("end.remove",_S(this._id))}function $S(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,sa(l[h],e,n,h,l,Se(c,n)));return new Ve(o,this._parents,e,n)}function SS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Wp(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])&&sa(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ve(o,a,e,n)}var AS=ci.prototype.constructor;function MS(){return new AS(this._groups,this._parents)}function DS(t,e){var n,r,i;return function(){var o=dr(this,t),a=(this.style.removeProperty(t),dr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Ad(t){return function(){this.style.removeProperty(t)}}function PS(t,e,n){var r,i=n+"",o;return function(){var a=dr(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function TS(t,e,n){var r,i,o;return function(){var a=dr(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),dr(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function LS(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=Ad(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function CS(t,e,n){var r=(t+="")=="transform"?k$:Sd;return e==null?this.styleTween(t,DS(t,r)).on("end.style."+t,Ad(t)):typeof e=="function"?this.styleTween(t,TS(t,r,ml(this,"style."+t,e))).each(LS(this._id,t)):this.styleTween(t,PS(t,r,e),n).on("end.style."+t,null)}function ES(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function RS(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&ES(t,a,n)),r}return o._value=e,o}function kS(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,RS(t,e,n??""))}function IS(t){return function(){this.textContent=t}}function NS(t){return function(){var e=t(this);this.textContent=e??""}}function FS(t){return this.tween("text",typeof t=="function"?NS(ml(this,"text",t)):IS(t==null?"":t+""))}function GS(t){return function(e){this.textContent=t.call(this,e)}}function zS(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 OS(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,zS(t))}function US(){for(var t=this._name,e=this._id,n=Md(),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);sa(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 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 YS=0;function Ve(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Md(){return++YS}var je=ci.prototype;Ve.prototype={constructor:Ve,select:$S,selectAll:SS,selectChild:je.selectChild,selectChildren:je.selectChildren,filter:mS,merge:yS,selection:MS,transition:US,call:je.call,nodes:je.nodes,node:je.node,size:je.size,empty:je.empty,each:je.each,on:xS,attr:tS,attrTween:oS,style:CS,styleTween:kS,text:FS,textTween:OS,remove:wS,tween:j$,delay:uS,duration:fS,ease:pS,easeVarying:gS,end:BS,[Symbol.iterator]:je[Symbol.iterator]};function WS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var HS={time:null,delay:0,duration:250,ease:WS};function VS(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 Ve?(e=t._id,t=t._name):(e=Md(),(n=HS).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])&&sa(u,t,e,l,a,n||VS(u,e));return new Ve(r,this._parents,t,e)}ci.prototype.interrupt=W$,ci.prototype.transition=jS;function qS(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ua(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 yr(t){return t=ua(Math.abs(t)),t?t[1]:NaN}function XS(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 ZS(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var KS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function la(t){if(!(e=KS.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]})}la.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 QS(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 Dd;function JS(t,e){var n=ua(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Dd=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")+ua(t,Math.max(0,e+o-1))[0]}function Pd(t,e){var n=ua(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 Td={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:qS,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)=>Pd(t*100,e),r:Pd,s:JS,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ld(t){return t}var Cd=Array.prototype.map,Ed=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tA(t){var e=t.grouping===void 0||t.thousands===void 0?Ld:XS(Cd.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?Ld:ZS(Cd.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=la(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,x=f.precision,v=f.trim,$=f.type;$==="n"?(b=!0,$="g"):Td[$]||(x===void 0&&(x=12),v=!0,$="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=g==="$"?n:g==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",R=g==="$"?r:/[%p]/.test($)?a:"",D=Td[$],_=/[defgprs%]/.test($);x=x===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function M(S){var G=w,C=R,A,L,P;if($==="c")C=D(S)+C,S="";else{S=+S;var O=S<0||1/S<0;if(S=isNaN(S)?u:D(Math.abs(S),x),v&&(S=QS(S)),O&&+S==0&&d!=="+"&&(O=!1),G=(O?d==="("?d:s:d==="-"||d==="("?"":d)+G,C=($==="s"?Ed[8+Dd/3]:"")+C+(O&&d==="("?")":""),_){for(A=-1,L=S.length;++A<L;)if(P=S.charCodeAt(A),48>P||P>57){C=(P===46?i+S.slice(A+1):S.slice(A))+C,S=S.slice(0,A);break}}}b&&!m&&(S=e(S,1/0));var z=G.length+S.length+C.length,k=z<y?new Array(y-z+1).join(h):"";switch(b&&m&&(S=e(k+S,k.length?y-C.length:1/0),k=""),p){case"<":S=G+S+C+k;break;case"=":S=G+k+S+C;break;case"^":S=k.slice(0,z=k.length>>1)+G+S+C+k.slice(z);break;default:S=k+G+S+C;break}return o(S)}return M.toString=function(){return f+""},M}function c(f,h){var p=l((f=la(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(yr(h)/3)))*3,g=Math.pow(10,-d),m=Ed[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var ca,Rd,kd;eA({thousands:",",grouping:[3],currency:["$",""]});function eA(t){return ca=tA(t),Rd=ca.format,kd=ca.formatPrefix,ca}function nA(t){return Math.max(0,-yr(Math.abs(t)))}function rA(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yr(e)/3)))*3-yr(Math.abs(t)))}function iA(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,yr(e)-yr(t))+1}function Id(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function oA(t){return function(){return t}}function aA(t){return+t}var Nd=[0,1];function br(t){return t}function bl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:oA(isNaN(e)?NaN:.5)}function sA(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function uA(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 lA(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=zp(t,s,1,r)-1;return o[u](i[u](s))}}function cA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function fA(){var t=Nd,e=Nd,n=cl,r,i,o,a=br,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==br&&(a=sA(t[0],t[h-1])),s=h>2?lA:uA,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,aA),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=C$,c()},f.clamp=function(h){return arguments.length?(a=h?!0:br,c()):a!==br},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 hA(){return fA()(br,br)}function pA(t,e,n,r){var i=M_(t,e,n),o;switch(r=la(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=rA(i,a))&&(r.precision=o),kd(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=iA(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=nA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Rd(r)}function Fd(t){var e=t.domain;return t.ticks=function(n){var r=e();return A_(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return pA(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 Gd(){var t=hA();return t.copy=function(){return cA(t,Gd())},Id.apply(t,arguments),Fd(t)}function zd(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[zp(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 zd().domain([t,e]).range(i).unknown(o)},Id.apply(Fd(a),arguments)}function bi(t,e,n){this.k=t,this.x=e,this.y=n}bi.prototype={constructor:bi,scale:function(t){return t===1?this:new bi(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new bi(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+")"}},bi.prototype;function fa(t){return Object.prototype.toString.call(t)==="[object Object]"}function vl(t,e){if(fa(t)===!1||fa(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;fa(r[a])&&fa(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 dA(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 Od(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 vr(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 vi(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 xi(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 xr(t){return this instanceof xr?(this.v=t,this):new xr(t)}function gA(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 xr?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 mA(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 vr=="function"?vr(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 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{dp(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)dp(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}(),hp=Uo.EMPTY;function pp(t){return t instanceof Uo||t&&"closed"in t&&yt(t.remove)&&yt(t.add)&&yt(t.unsubscribe)}function dp(t){yt(t)?t():t.unsubscribe()}var gp={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},mp={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=mp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function yp(t){mp.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,pp(n)&&n.add(r)):r.destination=v2,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),m2=Function.prototype.bind;function Hu(t,e){return m2.call(t,e)}var y2=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&&gp.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 y2(a),o}return e}(Wu);function Wo(t){yp(t)}function b2(t){throw t}var v2={closed:!0,next:Bu,error:b2,complete:Bu},Xu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function pr(t){return t}function x2(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=w2(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=bp(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 x2(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=bp(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 bp(t){var e;return(e=t??gp.Promise)!==null&&e!==void 0?e:Promise}function _2(t){return t&&yt(t.next)&&yt(t.error)&&yt(t.complete)}function w2(t){return t&&t instanceof Wu||_2(t)&&pp(t)}function $2(t){return yt(t==null?void 0:t.lift)}function fe(t){return function(e){if($2(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 S2(t,e,n,r,i)}var S2=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),A2=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 vp(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new A2},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?hp:(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 vp(n,r)},e}(dt),vp=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:hp},e}(nt),M2=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),xp={now:function(){return(xp.delegate||Date).now()},delegate:void 0},P2=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=xp);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),_p=new dt(function(t){return t.complete()});function D2(t){return t&&yt(t.schedule)}function qu(t){return t[t.length-1]}function T2(t){return yt(qu(t))?t.pop():void 0}function ju(t){return D2(qu(t))?t.pop():void 0}function L2(t,e){return typeof qu(t)=="number"?t.pop():e}var Vu=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function wp(t){return yt(t==null?void 0:t.then)}function $p(t){return yt(t[Xu])}function Sp(t){return Symbol.asyncIterator&&yt(t==null?void 0:t[Symbol.asyncIterator])}function Ap(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 C2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Mp=C2();function Pp(t){return yt(t==null?void 0:t[Mp])}function Dp(t){return d2(this,arguments,function(){var n,r,i,o;return fp(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 Tp(t){return yt(t==null?void 0:t.getReader)}function he(t){if(t instanceof dt)return t;if(t!=null){if($p(t))return E2(t);if(Vu(t))return R2(t);if(wp(t))return k2(t);if(Sp(t))return Lp(t);if(Pp(t))return I2(t);if(Tp(t))return N2(t)}throw Ap(t)}function E2(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 R2(t){return new dt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function k2(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,yp)})}function I2(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 Lp(t){return new dt(function(e){F2(t,e).catch(function(n){return e.error(n)})})}function N2(t){return Lp(Dp(t))}function F2(t,e){var n,r,i,o;return p2(this,void 0,void 0,function(){var a,s;return fp(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=g2(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 Cp(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 Ep(t,e){return e===void 0&&(e=0),fe(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function G2(t,e){return he(t).pipe(Ep(e),Cp(e))}function z2(t,e){return he(t).pipe(Ep(e),Cp(e))}function O2(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 Y2(t,e){return new dt(function(n){var r;return ln(n,e,function(){r=t[Mp](),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 Rp(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 U2(t,e){return Rp(Dp(t),e)}function B2(t,e){if(t!=null){if($p(t))return G2(t,e);if(Vu(t))return O2(t,e);if(wp(t))return z2(t,e);if(Sp(t))return Rp(t,e);if(Pp(t))return Y2(t,e);if(Tp(t))return U2(t,e)}throw Ap(t)}function Ho(t,e){return e?B2(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 kp=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 W2=Array.isArray;function H2(t,e){return W2(e)?t.apply(void 0,ci([],fr(e))):t(e)}function Ip(t){return F(function(e){return H2(t,e)})}var X2=Array.isArray,q2=Object.getPrototypeOf,j2=Object.prototype,V2=Object.keys;function Z2(t){if(t.length===1){var e=t[0];if(X2(e))return{args:e,keys:null};if(K2(e)){var n=V2(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function K2(t){return t&&typeof t=="object"&&q2(t)===j2}function Q2(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=T2(t),i=Z2(t),o=i.args,a=i.keys;if(o.length===0)return Ho([],n);var s=new dt(J2(o,n,a?function(u){return Q2(a,u)}:pr));return r?s.pipe(Ip(r)):s}function J2(t,e,n){return n===void 0&&(n=pr),function(r){Np(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){Np(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 Np(t,e,n){t?ln(n,t,e):e()}function t_(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 b=u.shift();a||d(b)};u.length&&l<r;)y();h()}catch(b){e.error(b)}}))};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 t_(r,i,t,n)}))}function e_(t){return t===void 0&&(t=1/0),Zu(pr,t)}function n_(t){return new dt(function(e){he(t()).subscribe(e)})}var r_=["addListener","removeListener"],i_=["addEventListener","removeEventListener"],o_=["on","off"];function Ku(t,e,n,r){if(yt(n)&&(r=n,n=void 0),r)return Ku(t,e,n).pipe(Ip(r));var i=fr(u_(t)?i_.map(function(s){return function(u){return t[s](e,u,n)}}):a_(t)?r_.map(Fp(t,e)):s_(t)?o_.map(Fp(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 Fp(t,e){return function(n){return function(r){return t[n](e,r)}}}function a_(t){return yt(t.addListener)&&yt(t.removeListener)}function s_(t){return yt(t.on)&&yt(t.off)}function u_(t){return yt(t.addEventListener)&&yt(t.removeEventListener)}function l_(t,e,n){return n_(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=L2(t,1/0),i=t;return i.length?i.length===1?he(i[0]):e_(r)(Ho(i,n)):_p}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 c_(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 f_(t){return t<=0?function(){return _p}: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??h_,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 h_(t,e){return t===e}function p_(t){return t===void 0&&(t=d_),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 d_(){return new kp}function g_(t,e){var n=arguments.length>=2;return function(r){return r.pipe(pr,f_(1),n?c_(e):p_(function(){return new kp}))}}function m_(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 x=c;y(),x==null||x.unsubscribe()};return fe(function(x,v){p++,!g&&!d&&m();var S=h=h??n();v.add(function(){p--,p===0&&!g&&!d&&(f=Ju(b,u))}),S.subscribe(v),!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,m_({connector:function(){return new P2(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:[0,"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 y_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gp(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===y_?t:b_,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 b_(){return 0}function v_(t){return t===null?NaN:+t}const x_=Gp(qo),zp=x_.right;Gp(v_).center;const __=Math.sqrt(50),w_=Math.sqrt(10),$_=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>=w_?5:o>=$_?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 S_(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 A_(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 M_={value:()=>{}};function Op(){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 P_(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=Op.prototype={constructor:Vo,on:function(t,e){var n=this._,r=P_(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=D_(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]=Yp(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Yp(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 D_(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Yp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=M_,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 Up={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)),Up.hasOwnProperty(e)?{space:Up[e],local:t}:t}function T_(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 L_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Bp(t){var e=Zo(t);return(e.local?L_:T_)(e)}function C_(){}function nl(t){return t==null?C_:function(){return this.querySelector(t)}}function E_(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 R_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function k_(){return[]}function Wp(t){return t==null?k_:function(){return this.querySelectorAll(t)}}function I_(t){return function(){return R_(t.apply(this,arguments))}}function N_(t){typeof t=="function"?t=I_(t):t=Wp(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 Hp(t){return function(){return this.matches(t)}}function Xp(t){return function(e){return e.matches(t)}}var F_=Array.prototype.find;function G_(t){return function(){return F_.call(this.children,t)}}function z_(){return this.firstElementChild}function O_(t){return this.select(t==null?z_:G_(typeof t=="function"?t:Xp(t)))}var Y_=Array.prototype.filter;function U_(){return Array.from(this.children)}function B_(t){return function(){return Y_.call(this.children,t)}}function W_(t){return this.selectAll(t==null?U_:B_(typeof t=="function"?t:Xp(t)))}function H_(t){typeof t!="function"&&(t=Hp(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 qp(t){return new Array(t.length)}function X_(){return new _e(this._enter||this._groups.map(qp),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 q_(t){return function(){return t}}function j_(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 V_(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 Z_(t){return t.__data__}function K_(t,e){if(!arguments.length)return Array.from(this,Z_);var n=e?V_:j_,r=this._parents,i=this._groups;typeof t!="function"&&(t=q_(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=Q_(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,x=0,v,S;b<d;++b)if(v=g[b]){for(b>=x&&(x=b+1);!(S=m[x])&&++x<d;);v._next=S||null}}return a=new _e(a,r),a._enter=s,a._exit=u,a}function Q_(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function J_(){return new _e(this._exit||this._groups.map(qp),this._parents)}function tw(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 ew(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 nw(){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=iw);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 iw(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ow(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function aw(){return Array.from(this)}function sw(){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 uw(){let t=0;for(const e of this)++t;return t}function lw(){return!this.node()}function cw(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 fw(t){return function(){this.removeAttribute(t)}}function hw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pw(t,e){return function(){this.setAttribute(t,e)}}function dw(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function gw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function mw(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 yw(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?hw:fw:typeof e=="function"?n.local?mw:gw:n.local?dw:pw)(n,e))}function jp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function bw(t){return function(){this.style.removeProperty(t)}}function vw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xw(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?bw:typeof e=="function"?xw:vw)(t,e,n??"")):gr(this.node(),t)}function gr(t,e){return t.style.getPropertyValue(e)||jp(t).getComputedStyle(t,null).getPropertyValue(e)}function ww(t){return function(){delete this[t]}}function $w(t,e){return function(){this[t]=e}}function Sw(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Aw(t,e){return arguments.length>1?this.each((e==null?ww:typeof e=="function"?Sw:$w)(t,e)):this.node()[t]}function Vp(t){return t.trim().split(/^|\s+/)}function rl(t){return t.classList||new Zp(t)}function Zp(t){this._node=t,this._names=Vp(t.getAttribute("class")||"")}Zp.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 Kp(t,e){for(var n=rl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Qp(t,e){for(var n=rl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Mw(t){return function(){Kp(this,t)}}function Pw(t){return function(){Qp(this,t)}}function Dw(t,e){return function(){(e.apply(this,arguments)?Kp:Qp)(this,t)}}function Tw(t,e){var n=Vp(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"?Dw:e?Mw:Pw)(n,e))}function Lw(){this.textContent=""}function Cw(t){return function(){this.textContent=t}}function Ew(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Rw(t){return arguments.length?this.each(t==null?Lw:(typeof t=="function"?Ew:Cw)(t)):this.node().textContent}function kw(){this.innerHTML=""}function Iw(t){return function(){this.innerHTML=t}}function Nw(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Fw(t){return arguments.length?this.each(t==null?kw:(typeof t=="function"?Nw:Iw)(t)):this.node().innerHTML}function Gw(){this.nextSibling&&this.parentNode.appendChild(this)}function zw(){return this.each(Gw)}function Ow(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yw(){return this.each(Ow)}function Uw(t){var e=typeof t=="function"?t:Bp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Bw(){return null}function Ww(t,e){var n=typeof t=="function"?t:Bp(t),r=e==null?Bw:typeof e=="function"?e:nl(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Hw(){var t=this.parentNode;t&&t.removeChild(this)}function Xw(){return this.each(Hw)}function qw(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function jw(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Vw(t){return this.select(t?jw:qw)}function Zw(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Kw(t){return function(e){t.call(this,e,this.__data__)}}function Qw(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 Jw(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 t$(t,e,n){return function(){var r=this.__on,i,o=Kw(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 e$(t,e,n){var r=Qw(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?t$:Jw,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function Jp(t,e,n){var r=jp(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 n$(t,e){return function(){return Jp(this,t,e)}}function r$(t,e){return function(){return Jp(this,t,e.apply(this,arguments))}}function i$(t,e){return this.each((typeof e=="function"?r$:n$)(t,e))}function*o$(){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 a$=[null];function _e(t,e){this._groups=t,this._parents=e}function pi(){return new _e([[document.documentElement]],a$)}function s$(){return this}_e.prototype=pi.prototype={constructor:_e,select:E_,selectAll:N_,selectChild:O_,selectChildren:W_,filter:H_,data:K_,enter:X_,exit:J_,join:tw,merge:ew,selection:s$,order:nw,sort:rw,call:ow,nodes:aw,node:sw,size:uw,empty:lw,each:cw,attr:yw,style:_w,property:Aw,classed:Tw,text:Rw,html:Fw,raise:zw,lower:Yw,append:Uw,insert:Ww,remove:Xw,clone:Vw,datum:Zw,on:e$,dispatch:i$,[Symbol.iterator]:o$};function il(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function td(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*",u$=/^#([0-9a-f]{3,8})$/,l$=new RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),c$=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),f$=new RegExp(`^rgba\\(${mr},${mr},${mr},${mi}\\)$`),h$=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${mi}\\)$`),p$=new RegExp(`^hsl\\(${mi},${Ee},${Ee}\\)$`),d$=new RegExp(`^hsla\\(${mi},${Ee},${Ee},${mi}\\)$`),ed={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:nd,formatHex:nd,formatHex8:g$,formatHsl:m$,formatRgb:rd,toString:rd});function nd(){return this.rgb().formatHex()}function g$(){return this.rgb().formatHex8()}function m$(){return ud(this).formatHsl()}function rd(){return this.rgb().formatRgb()}function Dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=u$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?id(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=l$.exec(t))?new ne(e[1],e[2],e[3],1):(e=c$.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=f$.exec(t))?Jo(e[1],e[2],e[3],e[4]):(e=h$.exec(t))?Jo(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=p$.exec(t))?sd(e[1],e[2]/100,e[3]/100,1):(e=d$.exec(t))?sd(e[1],e[2]/100,e[3]/100,e[4]):ed.hasOwnProperty(t)?id(ed[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function id(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 y$(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?y$(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,td(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:od,formatHex:od,formatHex8:b$,formatRgb:ad,toString:ad}));function od(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}`}function b$(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}${Ln((isNaN(this.opacity)?1:this.opacity)*255)}`}function ad(){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 sd(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 ud(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 v$(t,e,n,r){return arguments.length===1?ud(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,v$,td(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(ld(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("}${ld(this.h)}, ${ea(this.s)*100}%, ${ea(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ld(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 x$(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 w$(t){return(t=+t)==1?cd:function(e,n){return n-e?_$(e,n,t):sl(isNaN(e)?n:e)}}function cd(t,e){var n=e-t;return n?x$(t,n):sl(isNaN(t)?e:t)}const na=function t(e){var n=w$(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=cd(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 $$(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 S$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function A$(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 M$(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 P$(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 D$(t){return function(){return t}}function T$(t){return function(e){return t(e)+""}}function fd(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]?T$(u[0].x):D$(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):fd:e instanceof Dn?na:e instanceof Date?M$:S$(e)?$$:Array.isArray(e)?A$:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?P$:$e)(t,e)}function L$(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var hd=180/Math.PI,pd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dd(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)*hd,skewX:Math.atan(u)*hd,scaleX:a,scaleY:s}}var ra;function C$(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?pd:dd(e.a,e.b,e.c,e.d,e.e,e.f)}function E$(t){return t==null||(ra||(ra=document.createElementNS("http://www.w3.org/2000/svg","g")),ra.setAttribute("transform",t),!(t=ra.transform.baseVal.consolidate()))?pd:(t=t.matrix,dd(t.a,t.b,t.c,t.d,t.e,t.f))}function gd(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 R$=gd(C$,"px, ","px)","deg)"),k$=gd(E$,", ",")",")"),yr=0,yi=0,bi=0,md=1e3,ia,vi,oa=0,Cn=0,aa=0,xi=typeof performance=="object"&&performance.now?performance:Date,yd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function fl(){return Cn||(yd(I$),Cn=xi.now()+aa)}function I$(){Cn=0}function sa(){this._call=this._time=this._next=null}sa.prototype=bd.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 bd(t,e,n){var r=new sa;return r.restart(t,e,n),r}function N$(){fl(),++yr;for(var t=ia,e;t;)(e=Cn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yr}function vd(){Cn=(oa=xi.now())+aa,yr=yi=0;try{N$()}finally{yr=0,G$(),Cn=0}}function F$(){var t=xi.now(),e=t-oa;e>md&&(aa-=e,oa=t)}function G$(){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(vd,t-xi.now()-aa)),bi&&(bi=clearInterval(bi))):(bi||(oa=xi.now(),bi=setInterval(F$,md)),yr=1,yd(vd))}}function xd(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 z$=Op("start","end","cancel","interrupt"),O$=[],_d=0,wd=1,pl=2,ua=3,$d=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;Y$(t,n,{name:e,index:r,group:i,on:z$,tween:O$,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 Y$(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=bd(o,0,n.time);function o(l){n.state=wd,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!==wd)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===ua)return xd(a);p.state===$d?(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(xd(function(){n.state===ua&&(n.state=$d,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 U$(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 B$(t){return this.each(function(){U$(this,t)})}function W$(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 H$(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 X$(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?W$:H$)(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 Sd(t,e){var n;return(typeof e=="number"?$e:e instanceof Dn?na:(n=Dn(e))?(e=n,na):fd)(t,e)}function q$(t){return function(){this.removeAttribute(t)}}function j$(t){return function(){this.removeAttributeNS(t.space,t.local)}}function V$(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 Z$(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 K$(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 Q$(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 J$(t,e){var n=Zo(t),r=n==="transform"?k$:Sd;return this.attrTween(t,typeof e=="function"?(n.local?Q$:K$)(n,r,ml(this,"attr."+t,e)):e==null?(n.local?j$:q$)(n):(n.local?Z$:V$)(n,r,e))}function tS(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function eS(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function nS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&eS(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)&&tS(t,o)),n}return i._value=e,i}function iS(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?nS:rS)(r,e))}function oS(t,e){return function(){gl(this,t).delay=+e.apply(this,arguments)}}function aS(t,e){return e=+e,function(){gl(this,t).delay=e}}function sS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?oS:aS)(e,t)):Se(this.node(),e).delay}function uS(t,e){return function(){Re(this,t).duration=+e.apply(this,arguments)}}function lS(t,e){return e=+e,function(){Re(this,t).duration=e}}function cS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?uS:lS)(e,t)):Se(this.node(),e).duration}function fS(t,e){if(typeof e!="function")throw new Error;return function(){Re(this,t).ease=e}}function hS(t){var e=this._id;return arguments.length?this.each(fS(e,t)):Se(this.node(),e).ease}function pS(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Re(this,t).ease=n}}function dS(t){if(typeof t!="function")throw new Error;return this.each(pS(this._id,t))}function gS(t){typeof t!="function"&&(t=Hp(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 mS(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 yS(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 bS(t,e,n){var r,i,o=yS(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 vS(t,e){var n=this._id;return arguments.length<2?Se(this.node(),n).on.on(t):this.each(bS(n,t,e))}function xS(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",xS(this._id))}function wS(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 $S(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Wp(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 SS=pi.prototype.constructor;function AS(){return new SS(this._groups,this._parents)}function MS(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 Ad(t){return function(){this.style.removeProperty(t)}}function PS(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 DS(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 TS(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=Ad(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function LS(t,e,n){var r=(t+="")=="transform"?R$:Sd;return e==null?this.styleTween(t,MS(t,r)).on("end.style."+t,Ad(t)):typeof e=="function"?this.styleTween(t,DS(t,r,ml(this,"style."+t,e))).each(TS(this._id,t)):this.styleTween(t,PS(t,r,e),n).on("end.style."+t,null)}function CS(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ES(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&CS(t,a,n)),r}return o._value=e,o}function RS(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,ES(t,e,n??""))}function kS(t){return function(){this.textContent=t}}function IS(t){return function(){var e=t(this);this.textContent=e??""}}function NS(t){return this.tween("text",typeof t=="function"?IS(ml(this,"text",t)):kS(t==null?"":t+""))}function FS(t){return function(e){this.textContent=t.call(this,e)}}function GS(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&FS(i)),e}return r._value=t,r}function zS(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,GS(t))}function OS(){for(var t=this._name,e=this._id,n=Md(),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 YS(){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 US=0;function Xe(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Md(){return++US}var qe=pi.prototype;Xe.prototype={constructor:Xe,select:wS,selectAll:$S,selectChild:qe.selectChild,selectChildren:qe.selectChildren,filter:gS,merge:mS,selection:AS,transition:OS,call:qe.call,nodes:qe.nodes,node:qe.node,size:qe.size,empty:qe.empty,each:qe.each,on:vS,attr:J$,attrTween:iS,style:LS,styleTween:RS,text:NS,textTween:zS,remove:_S,tween:X$,delay:sS,duration:cS,ease:hS,easeVarying:dS,end:YS,[Symbol.iterator]:qe[Symbol.iterator]};function BS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var WS={time:null,delay:0,duration:250,ease:BS};function HS(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 XS(t){var e,n;t instanceof Xe?(e=t._id,t=t._name):(e=Md(),(n=WS).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||HS(u,e));return new Xe(r,this._parents,t,e)}pi.prototype.interrupt=B$,pi.prototype.transition=XS;function qS(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 jS(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 VS(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var ZS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ha(t){if(!(e=ZS.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 KS(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 Pd;function QS(t,e){var n=fa(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Pd=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 Dd(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 Td={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:qS,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)=>Dd(t*100,e),r:Dd,s:QS,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ld(t){return t}var Cd=Array.prototype.map,Ed=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JS(t){var e=t.grouping===void 0||t.thousands===void 0?Ld:jS(Cd.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?Ld:VS(Cd.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,b=f.comma,x=f.precision,v=f.trim,S=f.type;S==="n"?(b=!0,S="g"):Td[S]||(x===void 0&&(x=12),v=!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:"",P=Td[S],_=/[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 w(A){var N=$,C=R,M,L,D;if(S==="c")C=P(A)+C,A="";else{A=+A;var O=A<0||1/A<0;if(A=isNaN(A)?u:P(Math.abs(A),x),v&&(A=KS(A)),O&&+A==0&&d!=="+"&&(O=!1),N=(O?d==="("?d:s:d==="-"||d==="("?"":d)+N,C=(S==="s"?Ed[8+Pd/3]:"")+C+(O&&d==="("?")":""),_){for(M=-1,L=A.length;++M<L;)if(D=A.charCodeAt(M),48>D||D>57){C=(D===46?i+A.slice(M+1):A.slice(M))+C,A=A.slice(0,M);break}}}b&&!m&&(A=e(A,1/0));var z=N.length+A.length+C.length,k=z<y?new Array(y-z+1).join(h):"";switch(b&&m&&(A=e(k+A,k.length?y-C.length:1/0),k=""),p){case"<":A=N+A+C+k;break;case"=":A=N+k+A+C;break;case"^":A=k.slice(0,z=k.length>>1)+N+A+C+k.slice(z);break;default:A=k+N+A+C;break}return o(A)}return w.toString=function(){return f+""},w}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=Ed[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var pa,Rd,kd;tA({thousands:",",grouping:[3],currency:["$",""]});function tA(t){return pa=JS(t),Rd=pa.format,kd=pa.formatPrefix,pa}function eA(t){return Math.max(0,-br(Math.abs(t)))}function nA(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(br(e)/3)))*3-br(Math.abs(t)))}function rA(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,br(e)-br(t))+1}function Id(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function iA(t){return function(){return t}}function oA(t){return+t}var Nd=[0,1];function vr(t){return t}function bl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:iA(isNaN(e)?NaN:.5)}function aA(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function sA(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 uA(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=zp(t,s,1,r)-1;return o[u](i[u](s))}}function lA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function cA(){var t=Nd,e=Nd,n=cl,r,i,o,a=vr,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==vr&&(a=aA(t[0],t[h-1])),s=h>2?uA:sA,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,oA),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=L$,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 fA(){return cA()(vr,vr)}function hA(t,e,n,r){var i=A_(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=nA(i,a))&&(r.precision=o),kd(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=eA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Rd(r)}function Fd(t){var e=t.domain;return t.ticks=function(n){var r=e();return S_(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return hA(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 Gd(){var t=fA();return t.copy=function(){return lA(t,Gd())},Id.apply(t,arguments),Fd(t)}function zd(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[zp(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 zd().domain([t,e]).range(i).unknown(o)},Id.apply(Fd(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 pA(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 Od(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 dA(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 gA(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:
|
4
4
|
`+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
|
5
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function ha(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var _i=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=vr(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=vr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{Yd(d)}catch(g){o=o??[],g instanceof wl?o=xi(xi([],vi(o)),vi(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)Yd(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)&&ha(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ha(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Ud=_i.EMPTY;function Bd(t){return t instanceof _i||t&&"closed"in t&&Ft(t.remove)&&Ft(t.add)&&Ft(t.unsubscribe)}function Yd(t){Ft(t)?t():t.unsubscribe()}var Wd={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yA={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,xi([t,e],vi(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function Hd(t){yA.setTimeout(function(){throw t})}function $l(){}function pa(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,Bd(n)&&n.add(r)):r.destination=_A,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}(_i),bA=Function.prototype.bind;function Al(t,e){return bA.call(t,e)}var vA=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){da(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){da(r)}else da(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){da(n)}},t}(),wi=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&&Wd.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 vA(a),o}return e}(Sl);function da(t){Hd(t)}function xA(t){throw t}var _A={closed:!0,next:$l,error:xA,complete:$l},Ml=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Vd(t){return t}function wA(t){return t.length===0?Vd: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=SA(e)?e:new wi(e,n,r);return pa(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=jd(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[Ml]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return wA(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=jd(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 jd(t){var e;return(e=t??Wd.Promise)!==null&&e!==void 0?e:Promise}function $A(t){return t&&Ft(t.next)&&Ft(t.error)&&Ft(t.complete)}function SA(t){return t&&t instanceof Sl||$A(t)&&Bd(t)}function AA(t){return Ft(t==null?void 0:t.lift)}function $i(t){return function(e){if(AA(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 Si(t,e,n,r,i){return new MA(t,e,n,r,i)}var MA=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"}}),Ai=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 qd(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;pa(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=vr(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;pa(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;pa(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?Ud:(this.currentObservers=null,s.push(n),new _i(function(){r.currentObservers=null,ha(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 qd(n,r)},e}(cn),qd=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:Ud},e}(Ai),Xd=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}(Ai),Dl={now:function(){return(Dl.delegate||Date).now()},delegate:void 0},PA=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=Dl);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}(Ai),TA=function(t){ke(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(_i),Zd={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,xi([t,e],vi(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},LA=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),Zd.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&&Zd.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,ha(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(TA),Kd=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=Dl.now,t}(),CA=function(t){ke(e,t);function e(n,r){r===void 0&&(r=Kd.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}(Kd);new CA(LA);var EA=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function RA(t){return Ft(t==null?void 0:t.then)}function kA(t){return Ft(t[Ml])}function IA(t){return Symbol.asyncIterator&&Ft(t==null?void 0:t[Symbol.asyncIterator])}function NA(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 FA(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var GA=FA();function zA(t){return Ft(t==null?void 0:t[GA])}function OA(t){return gA(this,arguments,function(){var e,n,r,i;return Od(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,xr(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,xr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,xr(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 ga(t){if(t instanceof cn)return t;if(t!=null){if(kA(t))return BA(t);if(EA(t))return YA(t);if(RA(t))return WA(t);if(IA(t))return Qd(t);if(zA(t))return HA(t);if(UA(t))return VA(t)}throw NA(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 YA(t){return new cn(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function WA(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,Hd)})}function HA(t){return new cn(function(e){var n,r;try{for(var i=vr(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 Qd(t){return new cn(function(e){jA(t,e).catch(function(n){return e.error(n)})})}function VA(t){return Qd(OA(t))}function jA(t,e){var n,r,i,o;return dA(this,void 0,void 0,function(){var a,s;return Od(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=mA(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 Pl(t,e){return $i(function(n,r){var i=0;n.subscribe(Si(r,function(o){r.next(t.call(e,o,i++))}))})}function qA(t,e){return e===void 0&&(e=Vd),t=t??XA,$i(function(n,r){var i,o=!0;n.subscribe(Si(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function XA(t,e){return t===e}function ZA(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new Ai}: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 x=c;y(),x==null||x.unsubscribe()};return $i(function(x,v){p++,!g&&!d&&m();var $=h=h??n();v.add(function(){p--,p===0&&!g&&!d&&(f=Tl(b,u))}),$.subscribe(v),!c&&p>0&&(c=new wi({next:function(w){return $.next(w)},error:function(w){g=!0,m(),f=Tl(y,i,w),$.error(w)},complete:function(){d=!0,m(),f=Tl(y,a),$.complete()}}),ga(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 wi({next:function(){i.unsubscribe(),t()}});return ga(e.apply(void 0,xi([],vi(n)))).subscribe(i)}}function KA(t,e,n){var r,i=!1;return r=t,ZA({connector:function(){return new PA(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function QA(t,e){return $i(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(Si(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;ga(t(u,c)).subscribe(i=Si(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function JA(t){return $i(function(e,n){ga(t).subscribe(Si(n,function(){return n.complete()},$l)),!n.closed&&e.subscribe(n)})}const t3=t=>t.pipe(Pl(e=>e.styles.textSize),qA(),Pl(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})),Jd=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=pr.scaleDomain,scaleRange:i=pr.scaleRange})=>{const o=r[0]??pr.scaleDomain[0],a=r[1]??pr.scaleDomain[1],s=i[0]??pr.scaleRange[0],u=i[1]??pr.scaleRange[1],l=o==="auto"?e:o,c=a==="auto"?t:a,f=t-(t-l)/(1-s),h=c/u;return Gd().domain([f,h]).range([0,n])},tg=({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 zd().domain([s,e-s]).range(i)};function e3({name:t,defaultParams:e,initFn:n}){const r=new Ai,i=new WeakMap;let o=()=>{},a;const s=new Xd(e),u=new Xd({}),l=s.pipe(QA(c=>u.pipe(JA(r),Pl(f=>vl(f,c)))),KA(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 Mi=()=>function(t,e){return function(n){return class{constructor(){const r=e3({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}}}},Cn=Mi(),se=Mi(),pe=Mi(),eg=Mi(),ng=Mi();function _t(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rg(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ma(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===rg?t:n3,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 n3(){return 0}function ya(t){return t===null?NaN:+t}function*r3(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 ig=ma(_t),og=ig.right,i3=ig.left,o3=ma(ya).center,En=og;function a3(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 ag=sg(Ll),s3=sg(u3);function sg(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?(_r(s,l,i,o,a),_r(s,i,l,o,a),_r(s,l,i,o,a),wr(u,i,l,o,a),wr(u,l,i,o,a),wr(u,i,l,o,a)):s?(_r(s,i,l,o,a),_r(s,l,i,o,a),_r(s,i,l,o,a)):u&&(wr(u,i,l,o,a),wr(u,l,i,o,a),wr(u,i,l,o,a)),e}}function _r(t,e,n,r,i){for(let o=0,a=r*i;o<a;)t(e,n,o,o+=r,1)}function wr(t,e,n,r,i){for(let o=0,a=r*i;o<r;++o)t(e,n,o,o+a,r)}function u3(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 l3(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 l3(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 ba(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 c3(t){return t.length|0}function f3(t){return!(t>0)}function h3(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function p3(t){return e=>t(...e)}function d3(...t){const e=typeof t[t.length-1]=="function"&&p3(t.pop());t=t.map(h3);const n=t.map(c3),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(f3))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 g3(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 ug(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 lg(t,e){const n=ug(t,e);return n&&Math.sqrt(n)}function Di(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 m3(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 y3(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 Pi extends Map{constructor(e,n=hg){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(cg(this,e),n)}delete(e){return super.delete(fg(this,e))}}class Rn extends Set{constructor(e,n=hg){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(cg(this,e))}delete(e){return super.delete(fg(this,e))}}function Cl({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function cg({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function fg({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function hg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function $r(t){return t}function pg(t,...e){return Sr(t,$r,$r,e)}function dg(t,...e){return Sr(t,Array.from,$r,e)}function gg(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 b3(t,...e){return gg(dg(t,...e),e)}function v3(t,e,...n){return gg(yg(t,e,...n),n)}function mg(t,e,...n){return Sr(t,$r,e,n)}function yg(t,e,...n){return Sr(t,Array.from,e,n)}function x3(t,...e){return Sr(t,$r,bg,e)}function _3(t,...e){return Sr(t,Array.from,bg,e)}function bg(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Sr(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new Pi,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 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=Ar(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>Ar(n[i],n[o]))),vg(t,r)}return t.sort(Rl(n))}function Rl(t=_t){if(t===_t)return Ar;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 Ar(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function w3(t,e,n){return(e.length!==2?El(mg(t,e,n),([r,i],[o,a])=>_t(i,a)||_t(r,o)):El(pg(t,n),([r,i],[o,a])=>e(i,a)||_t(r,o))).map(([r])=>r)}var $3=Array.prototype,S3=$3.slice;function kl(t){return()=>t}const A3=Math.sqrt(50),M3=Math.sqrt(10),D3=Math.sqrt(2);function va(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>=A3?10:o>=M3?5:o>=D3?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?va(t,e,n*2):[s,u,l]}function kn(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?va(e,t,n):va(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 In(t,e,n){return e=+e,t=+t,n=+n,va(t,e,n)[2]}function xa(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?In(e,t,n):In(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Il(t,e,n){let r;for(;;){const i=In(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(ba(t))/Math.LN2)+1)}function xg(){var t=$r,e=Di,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,v=+p;if(e===Di&&([f,h]=Il(f,h,v)),p=kn(f,h,v),p[0]<=f&&(u=In(f,h,v)),p[p.length-1]>=h)if(x>=h&&e===Di){const $=In(f,h,v);isFinite($)&&($>0?h=(Math.floor(h/$)+1)*$:$<0&&(h=(Math.ceil(h*-$)+1)/-$))}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 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[En(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)?S3.call(i):i),r):n},r}function Ti(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 _a(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 Gl(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 wa(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?Ar: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));wa(t,e,p,d,i)}const o=t[e];let a=n,s=r;for(Li(t,n,e),i(t[r],o)>0&&Li(t,n,r);a<s;){for(Li(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Li(t,n,s):(++s,Li(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Li(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function _g(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 Ci(t,e,n){if(t=Float64Array.from(r3(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return _a(t);if(e>=1)return Ti(t);var r,i=(r-1)*e,o=Math.floor(i),a=Ti(wa(t,o).subarray(0,o+1)),s=_a(t.subarray(o+1));return a+(s-a)*(i-o)}}function wg(t,e,n=ya){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 $g(t,e,n=ya){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,u)=>ya(n(t[u],u,t))),e<=0)return Gl(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 wa(i,a,0,o,(s,u)=>Ar(r[s],r[u])),a=_g(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function P3(t,e,n){const r=ba(t),i=Ci(t,.75)-Ci(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function T3(t,e,n){const r=ba(t),i=lg(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function L3(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 C3(t,e){return Ci(t,.5,e)}function E3(t,e){return $g(t,.5,e)}function*R3(t){for(const e of t)yield*e}function zl(t){return Array.from(R3(t))}function k3(t,e){const n=new Pi;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 I3(t,e=N3){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function N3(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 F3(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)=>Ar(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 G3(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 Sg(t,e=_t){if(e.length===1)return Gl(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 z3(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 O3(t,e){const n=Sg(t,e);return n<0?void 0:n}const U3=Ag(Math.random);function Ag(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 Mg(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=_a(t,B3),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 B3(t){return t.length}function Y3(){return Dg(arguments)}function W3(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 H3(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 V3(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 j3(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 q3(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 X3(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function Z3(t,...e){t=new Rn(t);for(const n of e)for(const r of n)t.delete(r);return t}function K3(t,e){const n=e[Symbol.iterator](),r=new Rn;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 Q3(t,...e){t=new Rn(t),e=e.map(J3);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function J3(t){return t instanceof Rn?t:new Rn(t)}function Pg(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=Tg(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=Tg(a);if(r.add(u),Object.is(o,u))break}}return!0}function Tg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function t5(t,e){return Pg(e,t)}function e5(...t){const e=new Rn;for(const n of t)for(const r of n)e.add(r);return e}function n5(t){return t}var $a=1,Sa=2,Ol=3,Ei=4,Lg=1e-6;function r5(t){return"translate("+t+",0)"}function i5(t){return"translate(0,"+t+")"}function o5(t){return e=>+t(e)}function a5(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function s5(){return!this.__axis}function Aa(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===$a||t===Ei?-1:1,c=t===Ei||t===Sa?"x":"y",f=t===$a||t===Ol?r5:i5;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=i??(e.tickFormat?e.tickFormat.apply(e,n):n5),m=Math.max(o,0)+s,y=e.range(),b=+y[0]+u,x=+y[y.length-1]+u,v=(e.bandwidth?a5:o5)(e.copy(),u),$=p.selection?p.selection():p,w=$.selectAll(".domain").data([null]),R=$.selectAll(".tick").data(d,e).order(),D=R.exit(),_=R.enter().append("g").attr("class","tick"),M=R.select("line"),S=R.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(_),M=M.merge(_.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),S=S.merge(_.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",t===$a?"0em":t===Ol?"0.71em":"0.32em")),p!==$&&(w=w.transition(p),R=R.transition(p),M=M.transition(p),S=S.transition(p),D=D.transition(p).attr("opacity",Lg).attr("transform",function(G){return isFinite(G=v(G))?f(G+u):this.getAttribute("transform")}),_.attr("opacity",Lg).attr("transform",function(G){var C=this.parentNode.__axis;return f((C&&isFinite(C=C(G))?C:v(G))+u)})),D.remove(),w.attr("d",t===Ei||t===Sa?a?"M"+l*a+","+b+"H"+u+"V"+x+"H"+l*a:"M"+u+","+b+"V"+x:a?"M"+b+","+l*a+"V"+u+"H"+x+"V"+l*a:"M"+b+","+u+"H"+x),R.attr("opacity",1).attr("transform",function(G){return f(v(G)+u)}),M.attr(c+"2",l*o),S.attr(c,l*m).text(g),$.filter(s5).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Sa?"start":t===Ei?"end":"middle"),$.each(function(){this.__axis=v})}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 u5(t){return Aa($a,t)}function l5(t){return Aa(Sa,t)}function Cg(t){return Aa(Ol,t)}function Eg(t){return Aa(Ei,t)}var c5={value:()=>{}};function Nn(){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 Ma(n)}function Ma(t){this._=t}function f5(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}})}Ma.prototype=Nn.prototype={constructor:Ma,on:function(t,e){var n=this._,r=f5(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=h5(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]=Rg(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Rg(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 Ma(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 h5(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Rg(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=c5,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 Bl={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 Ri(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Bl.hasOwnProperty(e)?{space:Bl[e],local:t}:t}function p5(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 d5(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Da(t){var e=Ri(t);return(e.local?d5:p5)(e)}function g5(){}function Pa(t){return t==null?g5:function(){return this.querySelector(t)}}function m5(t){typeof t!="function"&&(t=Pa(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 kg(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function y5(){return[]}function Yl(t){return t==null?y5:function(){return this.querySelectorAll(t)}}function b5(t){return function(){return kg(t.apply(this,arguments))}}function v5(t){typeof t=="function"?t=b5(t):t=Yl(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 Ig(t){return function(e){return e.matches(t)}}var x5=Array.prototype.find;function _5(t){return function(){return x5.call(this.children,t)}}function w5(){return this.firstElementChild}function $5(t){return this.select(t==null?w5:_5(typeof t=="function"?t:Ig(t)))}var S5=Array.prototype.filter;function A5(){return Array.from(this.children)}function M5(t){return function(){return S5.call(this.children,t)}}function D5(t){return this.selectAll(t==null?A5:M5(typeof t=="function"?t:Ig(t)))}function P5(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 Ng(t){return new Array(t.length)}function T5(){return new Wt(this._enter||this._groups.map(Ng),this._parents)}function Ta(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ta.prototype={constructor:Ta,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 L5(t){return function(){return t}}function C5(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 Ta(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function E5(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 Ta(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function R5(t){return t.__data__}function k5(t,e){if(!arguments.length)return Array.from(this,R5);var n=e?E5:C5,r=this._parents,i=this._groups;typeof t!="function"&&(t=L5(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=I5(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,x=0,v,$;b<d;++b)if(v=g[b]){for(b>=x&&(x=b+1);!($=m[x])&&++x<d;);v._next=$||null}}return a=new Wt(a,r),a._enter=s,a._exit=u,a}function I5(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function N5(){return new Wt(this._exit||this._groups.map(Ng),this._parents)}function F5(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 G5(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 z5(){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 O5(t){t||(t=U5);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 U5(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function B5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Y5(){return Array.from(this)}function W5(){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 H5(){let t=0;for(const e of this)++t;return t}function V5(){return!this.node()}function j5(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 q5(t){return function(){this.removeAttribute(t)}}function X5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Z5(t,e){return function(){this.setAttribute(t,e)}}function K5(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Q5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function J5(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 t6(t,e){var n=Ri(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?X5:q5:typeof e=="function"?n.local?J5:Q5:n.local?K5:Z5)(n,e))}function Hl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function e6(t){return function(){this.style.removeProperty(t)}}function n6(t,e,n){return function(){this.style.setProperty(t,e,n)}}function r6(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function i6(t,e,n){return arguments.length>1?this.each((e==null?e6:typeof e=="function"?r6:n6)(t,e,n??"")):Fn(this.node(),t)}function Fn(t,e){return t.style.getPropertyValue(e)||Hl(t).getComputedStyle(t,null).getPropertyValue(e)}function o6(t){return function(){delete this[t]}}function a6(t,e){return function(){this[t]=e}}function s6(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function u6(t,e){return arguments.length>1?this.each((e==null?o6:typeof e=="function"?s6:a6)(t,e)):this.node()[t]}function Fg(t){return t.trim().split(/^|\s+/)}function Vl(t){return t.classList||new Gg(t)}function Gg(t){this._node=t,this._names=Fg(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 zg(t,e){for(var n=Vl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Og(t,e){for(var n=Vl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function l6(t){return function(){zg(this,t)}}function c6(t){return function(){Og(this,t)}}function f6(t,e){return function(){(e.apply(this,arguments)?zg:Og)(this,t)}}function h6(t,e){var n=Fg(t+"");if(arguments.length<2){for(var r=Vl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?f6:e?l6:c6)(n,e))}function p6(){this.textContent=""}function d6(t){return function(){this.textContent=t}}function g6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function m6(t){return arguments.length?this.each(t==null?p6:(typeof t=="function"?g6:d6)(t)):this.node().textContent}function y6(){this.innerHTML=""}function b6(t){return function(){this.innerHTML=t}}function v6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function x6(t){return arguments.length?this.each(t==null?y6:(typeof t=="function"?v6:b6)(t)):this.node().innerHTML}function _6(){this.nextSibling&&this.parentNode.appendChild(this)}function w6(){return this.each(_6)}function $6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S6(){return this.each($6)}function A6(t){var e=typeof t=="function"?t:Da(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function M6(){return null}function D6(t,e){var n=typeof t=="function"?t:Da(t),r=e==null?M6:typeof e=="function"?e:Pa(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function P6(){var t=this.parentNode;t&&t.removeChild(this)}function T6(){return this.each(P6)}function L6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function C6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function E6(t){return this.select(t?C6:L6)}function R6(t){return arguments.length?this.property("__data__",t):this.node().__data__}function k6(t){return function(e){t.call(this,e,this.__data__)}}function I6(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 N6(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 F6(t,e,n){return function(){var r=this.__on,i,o=k6(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 G6(t,e,n){var r=I6(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?F6:N6,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 z6(t,e){return function(){return Ug(this,t,e)}}function O6(t,e){return function(){return Ug(this,t,e.apply(this,arguments))}}function U6(t,e){return this.each((typeof e=="function"?O6:z6)(t,e))}function*B6(){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 Gn(){return new Wt([[document.documentElement]],jl)}function Y6(){return this}Wt.prototype=Gn.prototype={constructor:Wt,select:m5,selectAll:v5,selectChild:$5,selectChildren:D5,filter:P5,data:k5,enter:T5,exit:N5,join:F5,merge:G5,selection:Y6,order:z5,sort:O5,call:B5,nodes:Y5,node:W5,size:H5,empty:V5,each:j5,attr:t6,style:i6,property:u6,classed:h6,text:m6,html:x6,raise:w6,lower:S6,append:A6,insert:D6,remove:T6,clone:E6,datum:R6,on:G6,dispatch:U6,[Symbol.iterator]:B6};function Z(t){return typeof t=="string"?new Wt([[document.querySelector(t)]],[document.documentElement]):new Wt([[t]],jl)}function W6(t){return Z(Da(t).call(document.documentElement))}var H6=0;function Bg(){return new ql}function ql(){this._="@"+(++H6).toString(36)}ql.prototype=Bg.prototype={constructor:ql,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 Yg(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ue(t,e){if(t=Yg(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 V6(t,e){return t.target&&(t=Yg(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>ue(n,e))}function j6(t){return typeof t=="string"?new Wt([document.querySelectorAll(t)],[document.documentElement]):new Wt([kg(t)],jl)}const q6={passive:!1},ki={capture:!0,passive:!1};function Xl(t){t.stopImmediatePropagation()}function Mr(t){t.preventDefault(),t.stopImmediatePropagation()}function La(t){var e=t.document.documentElement,n=Z(t).on("dragstart.drag",Mr,ki);"onselectstart"in e?n.on("selectstart.drag",Mr,ki):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ca(t,e){var n=t.document.documentElement,r=Z(t).on("dragstart.drag",null);e&&(r.on("click.drag",Mr,ki),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 Ea=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 X6(t){return!t.ctrlKey&&!t.button}function Z6(){return this.parentNode}function K6(t,e){return e??{x:t.x,y:t.y}}function Q6(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wg(){var t=X6,e=Z6,n=K6,r=Q6,i={},o=Nn("start","drag","end"),a=0,s,u,l,c,f=0;function h(v){v.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,q6).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(v,$){if(!(c||!t.call(this,v,$))){var w=x(this,e.call(this,v,$),v,$,"mouse");w&&(Z(v.view).on("mousemove.drag",d,ki).on("mouseup.drag",g,ki),La(v.view),Xl(v),l=!1,s=v.clientX,u=v.clientY,w("start",v))}}function d(v){if(Mr(v),!l){var $=v.clientX-s,w=v.clientY-u;l=$*$+w*w>f}i.mouse("drag",v)}function g(v){Z(v.view).on("mousemove.drag mouseup.drag",null),Ca(v.view,l),Mr(v),i.mouse("end",v)}function m(v,$){if(t.call(this,v,$)){var w=v.changedTouches,R=e.call(this,v,$),D=w.length,_,M;for(_=0;_<D;++_)(M=x(this,R,v,$,w[_].identifier,w[_]))&&(Xl(v),M("start",v,w[_]))}}function y(v){var $=v.changedTouches,w=$.length,R,D;for(R=0;R<w;++R)(D=i[$[R].identifier])&&(Mr(v),D("drag",v,$[R]))}function b(v){var $=v.changedTouches,w=$.length,R,D;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),R=0;R<w;++R)(D=i[$[R].identifier])&&(Xl(v),D("end",v,$[R]))}function x(v,$,w,R,D,_){var M=o.copy(),S=ue(_||w,$),G,C,A;if((A=n.call(v,new Zl("beforestart",{sourceEvent:w,target:h,identifier:D,active:a,x:S[0],y:S[1],dx:0,dy:0,dispatch:M}),R))!=null)return G=A.x-S[0]||0,C=A.y-S[1]||0,function L(P,O,z){var k=S,E;switch(P){case"start":i[D]=L,E=a++;break;case"end":delete i[D],--a;case"drag":S=ue(z||O,$),E=a;break}M.call(P,v,new Zl(P,{sourceEvent:O,subject:A,target:h,identifier:D,active:E,x:S[0]+G,y:S[1]+C,dx:S[0]-k[0],dy:S[1]-k[1],dispatch:M}),R)}}return h.filter=function(v){return arguments.length?(t=typeof v=="function"?v:Ea(!!v),h):t},h.container=function(v){return arguments.length?(e=typeof v=="function"?v:Ea(v),h):e},h.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Ea(v),h):n},h.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Ea(!!v),h):r},h.on=function(){var v=o.on.apply(o,arguments);return v===o?h:v},h.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,h):Math.sqrt(f)},h}function Dr(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ii(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function hn(){}var zn=.7,Pr=1/zn,Tr="\\s*([+-]?\\d+)\\s*",Ni="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ie="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J6=/^#([0-9a-f]{3,8})$/,t8=new RegExp(`^rgb\\(${Tr},${Tr},${Tr}\\)$`),e8=new RegExp(`^rgb\\(${Ie},${Ie},${Ie}\\)$`),n8=new RegExp(`^rgba\\(${Tr},${Tr},${Tr},${Ni}\\)$`),r8=new RegExp(`^rgba\\(${Ie},${Ie},${Ie},${Ni}\\)$`),i8=new RegExp(`^hsl\\(${Ni},${Ie},${Ie}\\)$`),o8=new RegExp(`^hsla\\(${Ni},${Ie},${Ie},${Ni}\\)$`),Hg={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:Vg,formatHex:Vg,formatHex8:a8,formatHsl:s8,formatRgb:jg,toString:jg});function Vg(){return this.rgb().formatHex()}function a8(){return this.rgb().formatHex8()}function s8(){return Qg(this).formatHsl()}function jg(){return this.rgb().formatRgb()}function pn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=J6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?qg(e):n===3?new Et(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Ra(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Ra(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=t8.exec(t))?new Et(e[1],e[2],e[3],1):(e=e8.exec(t))?new Et(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=n8.exec(t))?Ra(e[1],e[2],e[3],e[4]):(e=r8.exec(t))?Ra(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=i8.exec(t))?Kg(e[1],e[2]/100,e[3]/100,1):(e=o8.exec(t))?Kg(e[1],e[2]/100,e[3]/100,e[4]):Hg.hasOwnProperty(t)?qg(Hg[t]):t==="transparent"?new Et(NaN,NaN,NaN,0):null}function qg(t){return new Et(t>>16&255,t>>8&255,t&255,1)}function Ra(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 Lr(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,Lr,Ii(hn,{brighter(t){return t=t==null?Pr:Math.pow(Pr,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?zn:Math.pow(zn,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Et(On(this.r),On(this.g),On(this.b),ka(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:Xg,formatHex:Xg,formatHex8:u8,formatRgb:Zg,toString:Zg}));function Xg(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}`}function u8(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}${Un((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zg(){const t=ka(this.opacity);return`${t===1?"rgb(":"rgba("}${On(this.r)}, ${On(this.g)}, ${On(this.b)}${t===1?")":`, ${t})`}`}function ka(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function On(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Un(t){return t=On(t),(t<16?"0":"")+t.toString(16)}function Kg(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 Qg(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 Ia(t,e,n,r){return arguments.length===1?Qg(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,Ia,Ii(hn,{brighter(t){return t=t==null?Pr:Math.pow(Pr,t),new Ae(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?zn:Math.pow(zn,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(Jg(this.h),Na(this.s),Na(this.l),ka(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=ka(this.opacity);return`${t===1?"hsl(":"hsla("}${Jg(this.h)}, ${Na(this.s)*100}%, ${Na(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Jg(t){return t=(t||0)%360,t<0?t+360:t}function Na(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 t0=Math.PI/180,e0=180/Math.PI,Fa=18,n0=.96422,r0=1,i0=.82521,o0=4/29,Cr=6/29,a0=3*Cr*Cr,l8=Cr*Cr*Cr;function s0(t){if(t instanceof Me)return new Me(t.l,t.a,t.b,t.opacity);if(t instanceof Ne)return l0(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)/r0),o,a;return e===n&&n===r?o=a=i:(o=Jl((.4360747*e+.3850649*n+.1430804*r)/n0),a=Jl((.0139322*e+.0971045*n+.7141733*r)/i0)),new Me(116*i-16,500*(o-i),200*(i-a),t.opacity)}function c8(t,e){return new Me(t,0,0,e??1)}function Ga(t,e,n,r){return arguments.length===1?s0(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,Ga,Ii(hn,{brighter(t){return new Me(this.l+Fa*(t??1),this.a,this.b,this.opacity)},darker(t){return new Me(this.l-Fa*(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=n0*tc(e),t=r0*tc(t),n=i0*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>l8?Math.pow(t,1/3):t/a0+o0}function tc(t){return t>Cr?t*t*t:a0*(t-o0)}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 u0(t){if(t instanceof Ne)return new Ne(t.h,t.c,t.l,t.opacity);if(t instanceof Me||(t=s0(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)*e0;return new Ne(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function f8(t,e,n,r){return arguments.length===1?u0(t):new Ne(n,e,t,r??1)}function za(t,e,n,r){return arguments.length===1?u0(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 l0(t){if(isNaN(t.h))return new Me(t.l,0,0,t.opacity);var e=t.h*t0;return new Me(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Dr(Ne,za,Ii(hn,{brighter(t){return new Ne(this.h,this.c,this.l+Fa*(t??1),this.opacity)},darker(t){return new Ne(this.h,this.c,this.l-Fa*(t??1),this.opacity)},rgb(){return l0(this).rgb()}}));var c0=-.14861,rc=1.78277,ic=-.29227,Oa=-.90649,Fi=1.97294,f0=Fi*Oa,h0=Fi*rc,p0=rc*ic-Oa*c0;function h8(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=(p0*r+f0*e-h0*n)/(p0+f0-h0),o=r-i,a=(Fi*(n-i)-ic*o)/Oa,s=Math.sqrt(a*a+o*o)/(Fi*i*(1-i)),u=s?Math.atan2(a,o)*e0-120:NaN;return new Bn(u<0?u+360:u,s,i,t.opacity)}function De(t,e,n,r){return arguments.length===1?h8(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,De,Ii(hn,{brighter(t){return t=t==null?Pr:Math.pow(Pr,t),new Bn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?zn:Math.pow(zn,t),new Bn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*t0,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*(c0*r+rc*i)),255*(e+n*(ic*r+Oa*i)),255*(e+n*(Fi*r)),this.opacity)}}));function d0(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 g0(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 d0((n-r/e)*e,a,i,o,s)}}function m0(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 d0((n-r/e)*e,i,o,a,s)}}const Ua=t=>()=>t;function y0(t,e){return function(n){return t+n*e}}function p8(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 Ba(t,e){var n=e-t;return n?y0(t,n>180||n<-180?n-360*Math.round(n/360):n):Ua(isNaN(t)?e:t)}function d8(t){return(t=+t)==1?Rt:function(e,n){return n-e?p8(e,n,t):Ua(isNaN(e)?n:e)}}function Rt(t,e){var n=e-t;return n?y0(t,n):Ua(isNaN(t)?e:t)}const Gi=function t(e){var n=d8(e);function r(i,o){var a=n((i=Lr(i)).r,(o=Lr(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 b0(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=Lr(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=b0(g0),g8=b0(m0);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 x0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function m8(t,e){return(x0(e)?oc:_0)(t,e)}function _0(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]=qe(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 w0(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 $0(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]=qe(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 y8(t){return function(){return t}}function b8(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]?b8(u[0].x):y8(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 qe(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ua(e):(n==="number"?de:n==="string"?(r=pn(e))?(e=r,Gi):uc:e instanceof pn?Gi:e instanceof Date?w0:x0(e)?oc:Array.isArray(e)?_0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?$0:de)(t,e)}function v8(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function x8(t,e){var n=Ba(+t,+e);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Ya(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var S0=180/Math.PI,lc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function A0(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)*S0,skewX:Math.atan(u)*S0,scaleX:a,scaleY:s}}var Wa;function _8(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?lc:A0(e.a,e.b,e.c,e.d,e.e,e.f)}function w8(t){return t==null||(Wa||(Wa=document.createElementNS("http://www.w3.org/2000/svg","g")),Wa.setAttribute("transform",t),!(t=Wa.transform.baseVal.consolidate()))?lc:(t=t.matrix,A0(t.a,t.b,t.c,t.d,t.e,t.f))}function M0(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=M0(_8,"px, ","px)","deg)"),P0=M0(w8,", ",")",")"),$8=1e-12;function T0(t){return((t=Math.exp(t))+1/t)/2}function S8(t){return((t=Math.exp(t))-1/t)/2}function A8(t){return((t=Math.exp(2*t))-1)/(t+1)}const L0=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<$8)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),x=(h*h-l*l+r*g)/(2*l*n*b),v=(h*h-l*l-r*g)/(2*h*n*b),$=Math.log(Math.sqrt(x*x+1)-x),w=Math.log(Math.sqrt(v*v+1)-v);y=(w-$)/e,m=function(R){var D=R*y,_=T0($),M=l/(n*b)*(_*A8(e*D+$)-S8($));return[s+M*p,u+M*d,l*_/T0(e*D+$)]}}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 C0(t){return function(e,n){var r=t((e=Ia(e)).h,(n=Ia(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 M8=C0(Ba);var D8=C0(Rt);function P8(t,e){var n=Rt((t=Ga(t)).l,(e=Ga(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 E0(t){return function(e,n){var r=t((e=za(e)).h,(n=za(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 T8=E0(Ba);var L8=E0(Rt);function R0(t){return function e(n){n=+n;function r(i,o){var a=t((i=De(i)).h,(o=De(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 C8=R0(Ba);var Ha=R0(Rt);function k0(t,e){e===void 0&&(e=t,t=qe);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 E8(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Er=0,zi=0,Oi=0,I0=1e3,Va,Ui,ja=0,Yn=0,qa=0,Bi=typeof performance=="object"&&performance.now?performance:Date,N0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Yi(){return Yn||(N0(R8),Yn=Bi.now()+qa)}function R8(){Yn=0}function Wi(){this._call=this._time=this._next=null}Wi.prototype=Xa.prototype={constructor:Wi,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Yi():+n)+(e==null?0:+e),!this._next&&Ui!==this&&(Ui?Ui._next=this:Va=this,Ui=this),this._call=t,this._time=n,cc()},stop:function(){this._call&&(this._call=null,this._time=1/0,cc())}};function Xa(t,e,n){var r=new Wi;return r.restart(t,e,n),r}function F0(){Yi(),++Er;for(var t=Va,e;t;)(e=Yn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Er}function G0(){Yn=(ja=Bi.now())+qa,Er=zi=0;try{F0()}finally{Er=0,I8(),Yn=0}}function k8(){var t=Bi.now(),e=t-ja;e>I0&&(qa-=e,ja=t)}function I8(){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);Ui=t,cc(r)}function cc(t){if(!Er){zi&&(zi=clearTimeout(zi));var e=t-Yn;e>24?(t<1/0&&(zi=setTimeout(G0,t-Bi.now()-qa)),Oi&&(Oi=clearInterval(Oi))):(Oi||(ja=Bi.now(),Oi=setInterval(k8,I0)),Er=1,N0(G0))}}function fc(t,e,n){var r=new Wi;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function N8(t,e,n){var r=new Wi,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?Yi():+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 F8=Nn("start","end","cancel","interrupt"),G8=[],z0=0,hc=1,pc=2,Za=3,O0=4,dc=5,Ka=6;function Qa(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;z8(t,n,{name:e,index:r,group:i,on:F8,tween:G8,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:z0})}function gc(t,e){var n=Pe(t,e);if(n.state>z0)throw new Error("too late; already scheduled");return n}function Fe(t,e){var n=Pe(t,e);if(n.state>Za)throw new Error("too late; already running");return n}function Pe(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function z8(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Xa(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===Za)return fc(a);p.state===O0?(p.state=Ka,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=Ka,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(fc(function(){n.state===Za&&(n.state=O0,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=Za,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=Ka,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Wn(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=Ka,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function O8(t){return this.each(function(){Wn(this,t)})}function U8(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 B8(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 Y8(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Pe(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?U8:B8)(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 Pe(i,r).value[e]}}function U0(t,e){var n;return(typeof e=="number"?de:e instanceof pn?Gi:(n=pn(e))?(e=n,Gi):uc)(t,e)}function W8(t){return function(){this.removeAttribute(t)}}function H8(t){return function(){this.removeAttributeNS(t.space,t.local)}}function V8(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 j8(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 q8(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 X8(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 Z8(t,e){var n=Ri(t),r=n==="transform"?P0:U0;return this.attrTween(t,typeof e=="function"?(n.local?X8:q8)(n,r,mc(this,"attr."+t,e)):e==null?(n.local?H8:W8)(n):(n.local?j8:V8)(n,r,e))}function K8(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Q8(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function J8(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Q8(t,o)),n}return i._value=e,i}function tM(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&K8(t,o)),n}return i._value=e,i}function eM(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=Ri(t);return this.tween(n,(r.local?J8:tM)(r,e))}function nM(t,e){return function(){gc(this,t).delay=+e.apply(this,arguments)}}function rM(t,e){return e=+e,function(){gc(this,t).delay=e}}function iM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?nM:rM)(e,t)):Pe(this.node(),e).delay}function oM(t,e){return function(){Fe(this,t).duration=+e.apply(this,arguments)}}function aM(t,e){return e=+e,function(){Fe(this,t).duration=e}}function sM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?oM:aM)(e,t)):Pe(this.node(),e).duration}function uM(t,e){if(typeof e!="function")throw new Error;return function(){Fe(this,t).ease=e}}function lM(t){var e=this._id;return arguments.length?this.each(uM(e,t)):Pe(this.node(),e).ease}function cM(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Fe(this,t).ease=n}}function fM(t){if(typeof t!="function")throw new Error;return this.each(cM(this._id,t))}function hM(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 Ge(r,this._parents,this._name,this._id)}function pM(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 dM(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 gM(t,e,n){var r,i,o=dM(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 mM(t,e){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(t):this.each(gM(n,t,e))}function yM(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function bM(){return this.on("end.remove",yM(this._id))}function vM(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Pa(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,Qa(l[h],e,n,h,l,Pe(c,n)));return new Ge(o,this._parents,e,n)}function xM(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Yl(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=Pe(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&Qa(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ge(o,a,e,n)}var _M=Gn.prototype.constructor;function wM(){return new _M(this._groups,this._parents)}function $M(t,e){var n,r,i;return function(){var o=Fn(this,t),a=(this.style.removeProperty(t),Fn(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 SM(t,e,n){var r,i=n+"",o;return function(){var a=Fn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function AM(t,e,n){var r,i,o;return function(){var a=Fn(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),Fn(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function MM(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 DM(t,e,n){var r=(t+="")=="transform"?D0:U0;return e==null?this.styleTween(t,$M(t,r)).on("end.style."+t,B0(t)):typeof e=="function"?this.styleTween(t,AM(t,r,mc(this,"style."+t,e))).each(MM(this._id,t)):this.styleTween(t,SM(t,r,e),n).on("end.style."+t,null)}function PM(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function TM(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&PM(t,a,n)),r}return o._value=e,o}function LM(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,TM(t,e,n??""))}function CM(t){return function(){this.textContent=t}}function EM(t){return function(){var e=t(this);this.textContent=e??""}}function RM(t){return this.tween("text",typeof t=="function"?EM(mc(this,"text",t)):CM(t==null?"":t+""))}function kM(t){return function(e){this.textContent=t.call(this,e)}}function IM(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&kM(i)),e}return r._value=t,r}function NM(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,IM(t))}function FM(){for(var t=this._name,e=this._id,n=W0(),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=Pe(u,e);Qa(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 GM(){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 zM=0;function Ge(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Y0(t){return Gn().transition(t)}function W0(){return++zM}var Xe=Gn.prototype;Ge.prototype=Y0.prototype={constructor:Ge,select:vM,selectAll:xM,selectChild:Xe.selectChild,selectChildren:Xe.selectChildren,filter:hM,merge:pM,selection:wM,transition:FM,call:Xe.call,nodes:Xe.nodes,node:Xe.node,size:Xe.size,empty:Xe.empty,each:Xe.each,on:mM,attr:Z8,attrTween:eM,style:DM,styleTween:LM,text:RM,textTween:NM,remove:bM,tween:Y8,delay:iM,duration:sM,ease:lM,easeVarying:fM,end:GM,[Symbol.iterator]:Xe[Symbol.iterator]};const OM=t=>+t;function UM(t){return t*t}function BM(t){return t*(2-t)}function H0(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function YM(t){return t*t*t}function WM(t){return--t*t*t+1}function Hi(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yc=3,HM=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}(yc),VM=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}(yc),V0=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,q0=j0/2;function jM(t){return+t==1?1:1-Math.cos(t*q0)}function qM(t){return Math.sin(t*q0)}function X0(t){return(1-Math.cos(j0*t))/2}function dn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function XM(t){return dn(1-+t)}function ZM(t){return 1-dn(t)}function Z0(t){return((t*=2)<=1?dn(1-t):2-dn(t-1))/2}function KM(t){return 1-Math.sqrt(1-t*t)}function QM(t){return Math.sqrt(1- --t*t)}function K0(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var bc=4/11,JM=6/11,t4=8/11,e4=3/4,n4=9/11,r4=10/11,i4=15/16,o4=21/22,a4=63/64,Ja=1/bc/bc;function s4(t){return 1-Vi(1-t)}function Vi(t){return(t=+t)<bc?Ja*t*t:t<t4?Ja*(t-=JM)*t+e4:t<r4?Ja*(t-=n4)*t+i4:Ja*(t-=o4)*t+a4}function u4(t){return((t*=2)<=1?1-Vi(1-t):Vi(t-1)+1)/2}var vc=1.70158,l4=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(vc),c4=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(vc),Q0=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),Rr=2*Math.PI,xc=1,_c=.3,f4=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Rr);function i(o){return e*dn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return t(o,n*Rr)},i.period=function(o){return t(e,o)},i}(xc,_c),ji=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Rr);function i(o){return 1-e*dn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return t(o,n*Rr)},i.period=function(o){return t(e,o)},i}(xc,_c),h4=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Rr);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*Rr)},i.period=function(o){return t(e,o)},i}(xc,_c),p4={time:null,delay:0,duration:250,ease:Hi};function d4(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 g4(t){var e,n;t instanceof Ge?(e=t._id,t=t._name):(e=W0(),(n=p4).time=Yi(),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])&&Qa(u,t,e,l,a,n||d4(u,e));return new Ge(r,this._parents,t,e)}Gn.prototype.interrupt=O8,Gn.prototype.transition=g4;var m4=[null];function y4(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 Ge([[t]],m4,e,+i)}return null}const wc=t=>()=>t;function b4(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 v4(t){t.stopImmediatePropagation()}function $c(t){t.preventDefault(),t.stopImmediatePropagation()}var J0={name:"drag"},Sc={name:"space"},kr={name:"handle"},Ir={name:"center"};const{abs:tm,max:Gt,min:zt}=Math;function em(t){return[+t[0],+t[1]]}function Ac(t){return[em(t[0]),em(t[1])]}var ts={name:"x",handles:["w","e"].map(qi),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]]}},es={name:"y",handles:["n","s"].map(qi),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]]}},x4={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(qi),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"},nm={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},rm={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},w4={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function qi(t){return{type:t}}function $4(t){return!t.ctrlKey&&!t.button}function S4(){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 A4(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mc(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function M4(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function D4(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function P4(){return Dc(ts)}function T4(){return Dc(es)}function L4(){return Dc(x4)}function Dc(t){var e=S4,n=$4,r=A4,i=!0,o=Nn("start","brush","end"),a=6,s;function u(m){var y=m.property("__brush",g).selectAll(".overlay").data([qi("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;Z(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([qi("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 b=m.selectAll(".handle").data(t.handles,function(x){return x.type});b.exit().remove(),b.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,b){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,v=x.__brush,$=c(x,arguments),w=v.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,v.extent),D=qe(w,R);function _(M){v.selection=M===1&&R===null?null:D(M),l.call(x),$.brush()}return w!==null&&R!==null?_:_(1)}):m.each(function(){var x=this,v=arguments,$=x.__brush,w=t.input(typeof y=="function"?y.apply(x,v):y,$.extent),R=c(x,v).beforestart();Wn(x),$.selection=w===null?null:w,l.call(x),R.start(b).brush(b).end(b)})},u.clear=function(m,y){u.move(m,null,y)};function l(){var m=Z(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(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 x=m.__brush.emitter;return x&&(!b||!x.clean)?x: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 x=Z(this.that).datum();o.call(m,this.that,new b4(m,{sourceEvent:y,target:u,selection:t.output(this.state.selection),mode:b,dispatch:o}),x)}};function h(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,b=m.target.__data__.type,x=(i&&m.metaKey?b="overlay":b)==="selection"?J0:i&&m.altKey?Ir:kr,v=t===es?null:_4[b],$=t===ts?null:w4[b],w=Mc(y),R=w.extent,D=w.selection,_=R[0][0],M,S,G=R[0][1],C,A,L=R[1][0],P,O,z=R[1][1],k,E,T=0,N=0,j,Q=v&&$&&i&&m.shiftKey,U,X,B=Array.from(m.touches||[m],st=>{const Dt=st.identifier;return st=ue(st,y),st.point0=st.slice(),st.identifier=Dt,st});Wn(y);var q=c(y,arguments,!0).beforestart();if(b==="overlay"){D&&(j=!0);const st=[B[0],B[1]||B[0]];w.selection=D=[[M=t===es?_:zt(st[0][0],st[1][0]),C=t===ts?G:zt(st[0][1],st[1][1])],[P=t===es?L:Gt(st[0][0],st[1][0]),k=t===ts?z:Gt(st[0][1],st[1][1])]],B.length>1&&mt(m)}else M=D[0][0],C=D[0][1],P=D[1][0],k=D[1][1];S=M,A=C,O=P,E=k;var V=Z(y).attr("pointer-events","none"),rt=V.selectAll(".overlay").attr("cursor",Ze[b]);if(m.touches)q.moved=H,q.ended=ht;else{var ut=Z(m.view).on("mousemove.brush",H,!0).on("mouseup.brush",ht,!0);i&&ut.on("keydown.brush",Yt,!0).on("keyup.brush",ee,!0),La(m.view)}l.call(y),q.start(m,x.name);function H(st){for(const Dt of st.changedTouches||[st])for(const Fo of B)Fo.identifier===Dt.identifier&&(Fo.cur=ue(Dt,y));if(Q&&!U&&!X&&B.length===1){const Dt=B[0];tm(Dt.cur[0]-Dt[0])>tm(Dt.cur[1]-Dt[1])?X=!0:U=!0}for(const Dt of B)Dt.cur&&(Dt[0]=Dt.cur[0],Dt[1]=Dt.cur[1]);j=!0,$c(st),mt(st)}function mt(st){const Dt=B[0],Fo=Dt.point0;var An;switch(T=Dt[0]-Fo[0],N=Dt[1]-Fo[1],x){case Sc:case J0:{v&&(T=Gt(_-M,zt(L-P,T)),S=M+T,O=P+T),$&&(N=Gt(G-C,zt(z-k,N)),A=C+N,E=k+N);break}case kr:{B[1]?(v&&(S=Gt(_,zt(L,B[0][0])),O=Gt(_,zt(L,B[1][0])),v=1),$&&(A=Gt(G,zt(z,B[0][1])),E=Gt(G,zt(z,B[1][1])),$=1)):(v<0?(T=Gt(_-M,zt(L-M,T)),S=M+T,O=P):v>0&&(T=Gt(_-P,zt(L-P,T)),S=M,O=P+T),$<0?(N=Gt(G-C,zt(z-C,N)),A=C+N,E=k):$>0&&(N=Gt(G-k,zt(z-k,N)),A=C,E=k+N));break}case Ir:{v&&(S=Gt(_,zt(L,M-T*v)),O=Gt(_,zt(L,P+T*v))),$&&(A=Gt(G,zt(z,C-N*$)),E=Gt(G,zt(z,k+N*$)));break}}O<S&&(v*=-1,An=M,M=P,P=An,An=S,S=O,O=An,b in nm&&rt.attr("cursor",Ze[b=nm[b]])),E<A&&($*=-1,An=C,C=k,k=An,An=A,A=E,E=An,b in rm&&rt.attr("cursor",Ze[b=rm[b]])),w.selection&&(D=w.selection),U&&(S=D[0][0],O=D[1][0]),X&&(A=D[0][1],E=D[1][1]),(D[0][0]!==S||D[0][1]!==A||D[1][0]!==O||D[1][1]!==E)&&(w.selection=[[S,A],[O,E]],l.call(y),q.brush(st,x.name))}function ht(st){if(v4(st),st.touches){if(st.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else Ca(st.view,j),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);V.attr("pointer-events","all"),rt.attr("cursor",Ze.overlay),w.selection&&(D=w.selection),M4(D)&&(w.selection=null,l.call(y)),q.end(st,x.name)}function Yt(st){switch(st.keyCode){case 16:{Q=v&&$;break}case 18:{x===kr&&(v&&(P=O-T*v,M=S+T*v),$&&(k=E-N*$,C=A+N*$),x=Ir,mt(st));break}case 32:{(x===kr||x===Ir)&&(v<0?P=O-T:v>0&&(M=S-T),$<0?k=E-N:$>0&&(C=A-N),x=Sc,rt.attr("cursor",Ze.selection),mt(st));break}default:return}$c(st)}function ee(st){switch(st.keyCode){case 16:{Q&&(U=X=Q=!1,mt(st));break}case 18:{x===Ir&&(v<0?P=O:v>0&&(M=S),$<0?k=E:$>0&&(C=A),x=kr,mt(st));break}case 32:{x===Sc&&(st.altKey?(v&&(P=O-T*v,M=S+T*v),$&&(k=E-N*$,C=A+N*$),x=Ir):(v<0?P=O:v>0&&(M=S),$<0?k=E:$>0&&(C=A),x=kr),rt.attr("cursor",Ze[b]),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 im=Math.abs,Nr=Math.cos,Fr=Math.sin,om=Math.PI,ns=om/2,am=om*2,sm=Math.max,Pc=1e-12;function Tc(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function C4(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function E4(){return Lc(!1,!1)}function R4(){return Lc(!1,!0)}function k4(){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=sm(0,am-n*u)/p,d=p?n:am/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=Tc(~u+1,u).filter(x=>x<0?s[~x*u+m]:s[m*u+x]);i&&b.sort((x,v)=>i(x<0?-s[~x*u+m]:s[m*u+x],v<0?-s[~v*u+m]:s[m*u+v]));for(const x of b)if(x<0){const v=f[~x*u+m]||(f[~x*u+m]={source:null,target:null});v.target={index:m,startAngle:g,endAngle:g+=s[~x*u+m]*p,value:s[~x*u+m]}}else{const v=f[m*u+x]||(f[m*u+x]={source:null,target:null});v.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 b=Tc(0,u).filter(x=>s[m*u+x]||s[x*u+m]);i&&b.sort((x,v)=>i(s[m*u+x],s[m*u+v]));for(const x of b){let v;if(m<x?(v=f[m*u+x]||(f[m*u+x]={source:null,target:null}),v.source={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]}):(v=f[x*u+m]||(f[x*u+m]={source:null,target:null}),v.target={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]},m===x&&(v.source=v.target)),v.source&&v.target&&v.source.value<v.target.value){const $=v.source;v.source=v.target,v.target=$}}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=sm(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=C4(s))._=s,a):o&&o._},a}const Cc=Math.PI,Ec=2*Cc,Hn=1e-6,I4=Ec-Hn;function um(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function N4(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return um;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 Xi=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?um:N4(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>Hn)if(!(Math.abs(f*u-l*c)>Hn)||!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),x=o*Math.tan((Cc-Math.acos((g+h-m)/(2*y*b)))/2),v=x/b,$=x/y;Math.abs(v-1)>Hn&&this._append`L${e+v*c},${n+v*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=e+$*u},${this._y1=n+$*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)>Hn||Math.abs(this._y1-c)>Hn)&&this._append`L${l},${c}`,r&&(h<0&&(h=h%Ec+Ec),h>I4?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>Hn&&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 Xi}Rc.prototype=Xi.prototype;function F4(t=3){return new Xi(+t)}var G4=Array.prototype.slice;function Vn(t){return function(){return t}}function z4(t){return t.source}function O4(t){return t.target}function lm(t){return t.radius}function U4(t){return t.startAngle}function B4(t){return t.endAngle}function Y4(){return 0}function W4(){return 10}function cm(t){var e=z4,n=O4,r=lm,i=lm,o=U4,a=B4,s=Y4,u=null;function l(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=G4.call(arguments),g=+r.apply(this,(d[0]=f,d)),m=o.apply(this,d)-ns,y=a.apply(this,d)-ns,b=+i.apply(this,(d[0]=h,d)),x=o.apply(this,d)-ns,v=a.apply(this,d)-ns;if(u||(u=c=Rc()),p>Pc&&(im(y-m)>p*2+Pc?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,im(v-x)>p*2+Pc?v>x?(x+=p,v-=p):(x-=p,v+=p):x=v=(x+v)/2),u.moveTo(g*Nr(m),g*Fr(m)),u.arc(0,0,g,m,y),m!==x||y!==v)if(t){var $=+t.apply(this,arguments),w=b-$,R=(x+v)/2;u.quadraticCurveTo(0,0,w*Nr(x),w*Fr(x)),u.lineTo(b*Nr(R),b*Fr(R)),u.lineTo(w*Nr(v),w*Fr(v))}else u.quadraticCurveTo(0,0,b*Nr(x),b*Fr(x)),u.arc(0,0,b,x,v);if(u.quadraticCurveTo(0,0,g*Nr(m),g*Fr(m)),u.closePath(),c)return u=null,c+""||null}return t&&(l.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Vn(+c),l):t}),l.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:Vn(+c),l):r},l.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Vn(+c),l):r},l.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:Vn(+c),l):i},l.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Vn(+c),l):o},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Vn(+c),l):a},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Vn(+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 H4(){return cm()}function V4(){return cm(W4)}var j4=Array.prototype,fm=j4.slice;function q4(t,e){return t-e}function X4(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 Z4(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=K4(t,e[n]))return i;return 0}function K4(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(Q4(u,f,e))return 0;c>r!=p>r&&n<(h-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function Q4(t,e,n){var r;return J4(t,e,n)&&tD(t[r=+(t[0]===e[0])],n[r],e[r])}function J4(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function tD(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function eD(){}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(q4);else{const f=Di(l,nD);for(c=kn(...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),X4(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=h.length,y;g<m;++g)if(Z4((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,x;for(d=g=-1,y=jn(l[0],c),Ke[y<<1].forEach(v);++d<t-1;)m=y,y=jn(l[d+1],c),Ke[m|y<<1].forEach(v);for(Ke[y<<0].forEach(v);++g<e-1;){for(d=-1,y=jn(l[g*t+t],c),b=jn(l[g*t],c),Ke[y<<1|b<<2].forEach(v);++d<t-1;)m=y,y=jn(l[g*t+t+d+1],c),x=b,b=jn(l[g*t+d+1],c),Ke[m|y<<1|b<<2|x<<3].forEach(v);Ke[y|b<<3].forEach(v)}for(d=-1,b=l[g*t]>=c,Ke[b<<2].forEach(v);++d<t-1;)x=b,b=jn(l[g*t+d+1],c),Ke[b<<2|x<<3].forEach(v);Ke[b<<3].forEach(v);function v($){var w=[$[0][0]+d,$[0][1]+g],R=[$[1][0]+d,$[1][1]+g],D=s(w),_=s(R),M,S;(M=p[D])?(S=h[_])?(delete p[M.end],delete h[S.start],M===S?(M.ring.push(R),f(M.ring)):h[M.start]=p[S.end]={start:M.start,end:S.end,ring:M.ring.concat(S.ring)}):(delete p[M.end],M.ring.push(R),p[M.end=_]=M):(M=h[_])?(S=p[D])?(delete h[M.start],delete p[S.end],M===S?(M.ring.push(R),f(M.ring)):h[S.start]=p[M.end]={start:S.start,end:M.end,ring:S.ring.concat(M.ring)}):(delete h[M.start],M.ring.unshift(w),h[M.start=D]=M):h[D]=p[_]={start:D,end:_,ring:[w,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=Ic(c[m*t+g]);p>0&&p<t&&g===p&&(h[0]=hm(p,Ic(c[m*t+g-1]),y,f)),d>0&&d<e&&m===d&&(h[1]=hm(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(fm.call(l)):gn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:eD,i):r===u},i}function nD(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 hm(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 rD(t){return t[0]}function iD(t){return t[1]}function oD(){return 1}function aD(){var t=rD,e=iD,n=oD,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(b){var x=new Float32Array(u*l),v=Math.pow(2,-a),$=-1;for(const C of b){var w=(t(C,++$,b)+s)*v,R=(e(C,$,b)+s)*v,D=+n(C,$,b);if(D&&w>=0&&w<u&&R>=0&&R<l){var _=Math.floor(w),M=Math.floor(R),S=w-_-.5,G=R-M-.5;x[_+M*u]+=(1-S)*(1-G)*D,x[_+1+M*u]+=S*(1-G)*D,x[_+1+(M+1)*u]+=S*G*D,x[_+(M+1)*u]+=(1-S)*G*D}}return ag({data:x,width:u,height:l},o*v),x}function h(b){var x=f(b),v=c(x),$=Math.pow(2,2*a);return Array.isArray(v)||(v=kn(Number.MIN_VALUE,Ti(x)/$,v)),kc().size([u,l]).thresholds(v.map(w=>w*$))(x).map((w,R)=>(w.value=+v[R],p(w)))}h.contours=function(b){var x=f(b),v=kc().size([u,l]),$=Math.pow(2,2*a),w=R=>{R=+R;var D=p(v.contour(x,R*$));return D.value=R,D};return Object.defineProperty(w,"max",{get:()=>Ti(x)/$}),w};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:gn(+b),h):t},h.y=function(b){return arguments.length?(e=typeof b=="function"?b:gn(+b),h):e},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:gn(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],v=+b[1];if(!(x>=0&&v>=0))throw new Error("invalid size");return r=x,i=v,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)?gn(fm.call(b)):gn(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 Qe=11102230246251565e-32,Ot=134217729,sD=(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 uD(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function Zi(t){return new Float64Array(t)}const lD=(3+16*Qe)*Qe,cD=(2+12*Qe)*Qe,fD=(9+64*Qe)*Qe*Qe,Gr=Zi(4),pm=Zi(8),dm=Zi(12),gm=Zi(16),Ht=Zi(4);function hD(t,e,n,r,i,o,a){let s,u,l,c,f,h,p,d,g,m,y,b,x,v,$,w,R,D;const _=t-i,M=n-i,S=e-o,G=r-o;v=_*G,h=Ot*_,p=h-(h-_),d=_-p,h=Ot*G,g=h-(h-G),m=G-g,$=d*m-(v-p*g-d*g-p*m),w=S*M,h=Ot*S,p=h-(h-S),d=S-p,h=Ot*M,g=h-(h-M),m=M-g,R=d*m-(w-p*g-d*g-p*m),y=$-R,f=$-y,Gr[0]=$-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,Gr[1]=x-(y+f)+(f-w),D=b+y,f=D-b,Gr[2]=b-(D-f)+(y-f),Gr[3]=D;let C=uD(4,Gr),A=cD*a;if(C>=A||-C>=A||(f=t-_,s=t-(_+f)+(f-i),f=n-M,l=n-(M+f)+(f-i),f=e-S,u=e-(S+f)+(f-o),f=r-G,c=r-(G+f)+(f-o),s===0&&u===0&&l===0&&c===0)||(A=fD*a+sD*Math.abs(C),C+=_*c+G*s-(S*l+M*u),C>=A||-C>=A))return C;v=s*G,h=Ot*s,p=h-(h-s),d=s-p,h=Ot*G,g=h-(h-G),m=G-g,$=d*m-(v-p*g-d*g-p*m),w=u*M,h=Ot*u,p=h-(h-u),d=u-p,h=Ot*M,g=h-(h-M),m=M-g,R=d*m-(w-p*g-d*g-p*m),y=$-R,f=$-y,Ht[0]=$-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,Ht[1]=x-(y+f)+(f-w),D=b+y,f=D-b,Ht[2]=b-(D-f)+(y-f),Ht[3]=D;const L=Nc(4,Gr,4,Ht,pm);v=_*c,h=Ot*_,p=h-(h-_),d=_-p,h=Ot*c,g=h-(h-c),m=c-g,$=d*m-(v-p*g-d*g-p*m),w=S*l,h=Ot*S,p=h-(h-S),d=S-p,h=Ot*l,g=h-(h-l),m=l-g,R=d*m-(w-p*g-d*g-p*m),y=$-R,f=$-y,Ht[0]=$-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,Ht[1]=x-(y+f)+(f-w),D=b+y,f=D-b,Ht[2]=b-(D-f)+(y-f),Ht[3]=D;const P=Nc(L,pm,4,Ht,dm);v=s*c,h=Ot*s,p=h-(h-s),d=s-p,h=Ot*c,g=h-(h-c),m=c-g,$=d*m-(v-p*g-d*g-p*m),w=u*l,h=Ot*u,p=h-(h-u),d=u-p,h=Ot*l,g=h-(h-l),m=l-g,R=d*m-(w-p*g-d*g-p*m),y=$-R,f=$-y,Ht[0]=$-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,Ht[1]=x-(y+f)+(f-w),D=b+y,f=D-b,Ht[2]=b-(D-f)+(y-f),Ht[3]=D;const O=Nc(P,dm,4,Ht,gm);return gm[O-1]}function rs(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)>=lD*l?u:-hD(t,e,n,r,i,o,l)}const mm=Math.pow(2,-52),is=new Uint32Array(512);class os{static from(e,n=yD,r=bD){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 os(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 _=0;_<a;_++){const M=e[2*_],S=e[2*_+1];M<s&&(s=M),S<u&&(u=S),M>l&&(l=M),S>c&&(c=S),this._ids[_]=_}const f=(s+l)/2,h=(u+c)/2;let p,d,g;for(let _=0,M=1/0;_<a;_++){const S=Fc(f,h,e[2*_],e[2*_+1]);S<M&&(p=_,M=S)}const m=e[2*p],y=e[2*p+1];for(let _=0,M=1/0;_<a;_++){if(_===p)continue;const S=Fc(m,y,e[2*_],e[2*_+1]);S<M&&S>0&&(d=_,M=S)}let b=e[2*d],x=e[2*d+1],v=1/0;for(let _=0;_<a;_++){if(_===p||_===d)continue;const M=gD(m,y,b,x,e[2*_],e[2*_+1]);M<v&&(g=_,v=M)}let $=e[2*g],w=e[2*g+1];if(v===1/0){for(let S=0;S<a;S++)this._dists[S]=e[2*S]-e[0]||e[2*S+1]-e[1];zr(this._ids,this._dists,0,a-1);const _=new Uint32Array(a);let M=0;for(let S=0,G=-1/0;S<a;S++){const C=this._ids[S],A=this._dists[C];A>G&&(_[M++]=C,G=A)}this.hull=_.subarray(0,M),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(rs(m,y,b,x,$,w)<0){const _=d,M=b,S=x;d=g,b=$,x=w,g=_,$=M,w=S}const R=mD(m,y,b,x,$,w);this._cx=R.x,this._cy=R.y;for(let _=0;_<a;_++)this._dists[_]=Fc(e[2*_],e[2*_+1],R.x,R.y);zr(this._ids,this._dists,0,a-1),this._hullStart=p;let D=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,x)]=d,o[this._hashKey($,w)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let _=0,M,S;_<this._ids.length;_++){const G=this._ids[_],C=e[2*G],A=e[2*G+1];if(_>0&&Math.abs(C-M)<=mm&&Math.abs(A-S)<=mm||(M=C,S=A,G===p||G===d||G===g))continue;let L=0;for(let E=0,T=this._hashKey(C,A);E<this._hashSize&&(L=o[(T+E)%this._hashSize],!(L!==-1&&L!==r[L]));E++);L=n[L];let P=L,O;for(;O=r[P],rs(C,A,e[2*P],e[2*P+1],e[2*O],e[2*O+1])>=0;)if(P=O,P===L){P=-1;break}if(P===-1)continue;let z=this._addTriangle(P,G,r[P],-1,-1,i[P]);i[G]=this._legalize(z+2),i[P]=z,D++;let k=r[P];for(;O=r[k],rs(C,A,e[2*k],e[2*k+1],e[2*O],e[2*O+1])<0;)z=this._addTriangle(k,G,O,i[G],-1,i[k]),i[G]=this._legalize(z+2),r[k]=k,D--,k=O;if(P===L)for(;O=n[P],rs(C,A,e[2*O],e[2*O+1],e[2*P],e[2*P+1])<0;)z=this._addTriangle(O,G,P,-1,i[P],i[O]),this._legalize(z+2),i[O]=z,r[P]=P,D--,P=O;this._hullStart=n[G]=P,r[P]=n[k]=G,r[G]=k,o[this._hashKey(C,A)]=G,o[this._hashKey(e[2*P],e[2*P+1])]=P}this.hull=new Uint32Array(D);for(let _=0,M=this._hullStart;_<D;_++)this.hull[_]=M,M=r[M];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(pD(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=is[--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(dD(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 b=l+(s+1)%3;o<is.length&&(is[o++]=b)}else{if(o===0)break;e=is[--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 pD(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 dD(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 gD(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 mD(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 zr(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;Ki(t,i,o),e[t[n]]>e[t[r]]&&Ki(t,n,r),e[t[o]]>e[t[r]]&&Ki(t,o,r),e[t[n]]>e[t[o]]&&Ki(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;Ki(t,o,a)}t[n+1]=t[a],t[a]=s,r-o+1>=a-n?(zr(t,e,o,r),zr(t,e,n,a-1)):(zr(t,e,n,a-1),zr(t,e,o,r))}}function Ki(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function yD(t){return t[0]}function bD(t){return t[1]}const ym=1e-6;class qn{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)>ym||Math.abs(this._y1-o)>ym)&&(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 Gc{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 bm{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,x;g<y;g+=3,m+=2){const v=r[g]*2,$=r[g+1]*2,w=r[g+2]*2,R=e[v],D=e[v+1],_=e[$],M=e[$+1],S=e[w],G=e[w+1],C=_-R,A=M-D,L=S-R,P=G-D,O=(C*P-A*L)*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 z=1e9*Math.sign((o-R)*P-(a-D)*L);b=(R+S)/2-z*P,x=(D+G)/2+z*L}else{const z=1/O,k=C*C+A*A,E=L*L+P*P;b=R+(P*k-A*E)*z,x=D+(C*E-L*k)*z}s[m]=b,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 qn: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 qn: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 qn: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 Gc;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 vD=2*Math.PI,Or=Math.pow;function xD(t){return t[0]}function _D(t){return t[1]}function wD(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 $D(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class zc{static from(e,n=xD,r=_D,i){return new zc("length"in e?SD(e,n,r,i):Float64Array.from(AD(e,n,r,i)))}constructor(e){this._delaunator=new os(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&&wD(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=$D(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new os(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 bm(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=Or(n-l[e*2],2)+Or(r-l[e*2+1],2);const h=i[e];let p=h;do{let d=u[p];const g=Or(n-l[d*2],2)+Or(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&&Or(n-l[p*2],2)+Or(r-l[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(e){const n=e==null?e=new qn: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 qn: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,vD)}return r&&r.value()}renderHull(e){const n=e==null?e=new qn: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 Gc;return this.renderHull(e),e.value()}renderTriangle(e,n){const r=n==null?n=new qn: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 Gc;return this.renderTriangle(e,n),n.value()}}function SD(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*AD(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={},Oc={},Uc=34,Qi=10,Bc=13;function xm(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function MD(t,e){var n=xm(t);return function(r,i){return e(n(r),i,t)}}function _m(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 DD(t){return t<0?"-"+re(-t,6):t>9999?"+"+re(t,6):re(t,4)}function PD(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":DD(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 as(t){var e=new RegExp('["'+t+`
|
6
|
-
\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?
|
7
|
-
`)}function s(f,h){return h==null&&(h=
|
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{Bd(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)Bd(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}(),Yd=Si.EMPTY;function Ud(t){return t instanceof Si||t&&"closed"in t&&Ft(t.remove)&&Ft(t.add)&&Ft(t.unsubscribe)}function Bd(t){Ft(t)?t():t.unsubscribe()}var Wd={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},mA={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 Hd(t){mA.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,Ud(n)&&n.add(r)):r.destination=xA,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),yA=Function.prototype.bind;function Al(t,e){return yA.call(t,e)}var bA=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&&Wd.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 bA(a),o}return e}(Sl);function ya(t){Hd(t)}function vA(t){throw t}var xA={closed:!0,next:$l,error:vA,complete:$l},Ml=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Xd(t){return t}function _A(t){return t.length===0?Xd: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=$A(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=qd(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=qd(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 qd(t){var e;return(e=t??Wd.Promise)!==null&&e!==void 0?e:Promise}function wA(t){return t&&Ft(t.next)&&Ft(t.error)&&Ft(t.complete)}function $A(t){return t&&t instanceof Sl||wA(t)&&Ud(t)}function SA(t){return Ft(t==null?void 0:t.lift)}function Mi(t){return function(e){if(SA(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 AA(t,e,n,r,i)}var AA=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),MA=_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 jd(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new MA},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?Yd:(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 jd(n,r)},e}(cn),jd=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:Yd},e}(Di),Vd=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},PA=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),DA=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),Zd={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},TA=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),Zd.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&&Zd.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}(DA),Kd=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}(),LA=function(t){ke(e,t);function e(n,r){r===void 0&&(r=Kd.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}(Kd);new LA(TA);var CA=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function EA(t){return Ft(t==null?void 0:t.then)}function RA(t){return Ft(t[Ml])}function kA(t){return Symbol.asyncIterator&&Ft(t==null?void 0:t[Symbol.asyncIterator])}function IA(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 NA(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var FA=NA();function GA(t){return Ft(t==null?void 0:t[FA])}function zA(t){return dA(this,arguments,function(){var e,n,r,i;return Od(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 OA(t){return Ft(t==null?void 0:t.getReader)}function ba(t){if(t instanceof cn)return t;if(t!=null){if(RA(t))return YA(t);if(CA(t))return UA(t);if(EA(t))return BA(t);if(kA(t))return Qd(t);if(GA(t))return WA(t);if(OA(t))return HA(t)}throw IA(t)}function YA(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 UA(t){return new cn(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function BA(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,Hd)})}function WA(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 Qd(t){return new cn(function(e){XA(t,e).catch(function(n){return e.error(n)})})}function HA(t){return Qd(zA(t))}function XA(t,e){var n,r,i,o;return pA(this,void 0,void 0,function(){var a,s;return Od(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=gA(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 qA(t,e){return e===void 0&&(e=Xd),t=t??jA,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 jA(t,e){return t===e}function VA(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},b=function(){var x=c;y(),x==null||x.unsubscribe()};return Mi(function(x,v){p++,!g&&!d&&m();var S=h=h??n();v.add(function(){p--,p===0&&!g&&!d&&(f=Tl(b,u))}),S.subscribe(v),!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 ZA(t,e,n){var r,i=!1;return r=t,VA({connector:function(){return new PA(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function KA(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 QA(t){return Mi(function(e,n){ba(t).subscribe(Pi(n,function(){return n.complete()},$l)),!n.closed&&e.subscribe(n)})}const JA=t=>t.pipe(Dl(e=>e.styles.textSize),qA(),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})),Jd=({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],l=o==="auto"?e:o,c=a==="auto"?t:a,f=t-(t-l)/(1-s),h=c/u;return Gd().domain([f,h]).range([0,n])},tg=({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 zd().domain([s,e-s]).range(i)};function t3({name:t,defaultParams:e,initFn:n}){const r=new Di,i=new WeakMap;let o=()=>{},a;const s=new Vd(e),u=new Vd({}),l=s.pipe(KA(c=>u.pipe(QA(r),Dl(f=>vl(f,c)))),ZA(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=t3({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(),e3=Ti(),eg=Ti();function _t(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ng(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===ng?t:n3,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 n3(){return 0}function xa(t){return t===null?NaN:+t}function*r3(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=va(_t),ig=rg.right,i3=rg.left,o3=va(xa).center,Rn=ig;function a3(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 og=ag(Ll),s3=ag(u3);function ag(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 u3(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 l3(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 l3(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 c3(t){return t.length|0}function f3(t){return!(t>0)}function h3(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function p3(t){return e=>t(...e)}function d3(...t){const e=typeof t[t.length-1]=="function"&&p3(t.pop());t=t.map(h3);const n=t.map(c3),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(f3))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 g3(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 sg(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 ug(t,e){const n=sg(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 m3(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 y3(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=fg){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(lg(this,e),n)}delete(e){return super.delete(cg(this,e))}}class kn extends Set{constructor(e,n=fg){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(lg(this,e))}delete(e){return super.delete(cg(this,e))}}function Cl({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function lg({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function cg({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function fg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Sr(t){return t}function hg(t,...e){return Ar(t,Sr,Sr,e)}function pg(t,...e){return Ar(t,Array.from,Sr,e)}function dg(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 b3(t,...e){return dg(pg(t,...e),e)}function v3(t,e,...n){return dg(mg(t,e,...n),n)}function gg(t,e,...n){return Ar(t,Sr,e,n)}function mg(t,e,...n){return Ar(t,Array.from,e,n)}function x3(t,...e){return Ar(t,Sr,yg,e)}function _3(t,...e){return Ar(t,Array.from,yg,e)}function yg(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 bg(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]))),bg(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 w3(t,e,n){return(e.length!==2?El(gg(t,e,n),([r,i],[o,a])=>_t(i,a)||_t(r,o)):El(hg(t,n),([r,i],[o,a])=>e(i,a)||_t(r,o))).map(([r])=>r)}var $3=Array.prototype,S3=$3.slice;function kl(t){return()=>t}const A3=Math.sqrt(50),M3=Math.sqrt(10),P3=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>=A3?10:o>=M3?5:o>=P3?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 vg(){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,v=+p;if(e===Li&&([f,h]=Il(f,h,v)),p=In(f,h,v),p[0]<=f&&(u=Nn(f,h,v)),p[p.length-1]>=h)if(x>=h&&e===Li){const S=Nn(f,h,v);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 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)?S3.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 Gl(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 xg(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(r3(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 wg(t,e,n=xa){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,u)=>xa(n(t[u],u,t))),e<=0)return Gl(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=xg(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function D3(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 T3(t,e,n){const r=_a(t),i=ug(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function L3(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 C3(t,e){return ki(t,.5,e)}function E3(t,e){return wg(t,.5,e)}function*R3(t){for(const e of t)yield*e}function zl(t){return Array.from(R3(t))}function k3(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 I3(t,e=N3){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function N3(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 F3(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 G3(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 $g(t,e=_t){if(e.length===1)return Gl(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 z3(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 O3(t,e){const n=$g(t,e);return n<0?void 0:n}const Y3=Sg(Math.random);function Sg(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 Ag(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 Mg(t){if(!(o=t.length))return[];for(var e=-1,n=Sa(t,U3),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 U3(t){return t.length}function B3(){return Mg(arguments)}function W3(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 H3(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 X3(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 q3(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 j3(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 V3(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function Z3(t,...e){t=new kn(t);for(const n of e)for(const r of n)t.delete(r);return t}function K3(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 Q3(t,...e){t=new kn(t),e=e.map(J3);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function J3(t){return t instanceof kn?t:new kn(t)}function Pg(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=Dg(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=Dg(a);if(r.add(u),Object.is(o,u))break}}return!0}function Dg(t){return t!==null&&typeof t=="object"?t.valueOf():t}function t5(t,e){return Pg(e,t)}function e5(...t){const e=new kn;for(const n of t)for(const r of n)e.add(r);return e}function n5(t){return t}var Ma=1,Pa=2,Ol=3,Ii=4,Tg=1e-6;function r5(t){return"translate("+t+",0)"}function i5(t){return"translate(0,"+t+")"}function o5(t){return e=>+t(e)}function a5(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function s5(){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?r5:i5;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),g=i??(e.tickFormat?e.tickFormat.apply(e,n):n5),m=Math.max(o,0)+s,y=e.range(),b=+y[0]+u,x=+y[y.length-1]+u,v=(e.bandwidth?a5:o5)(e.copy(),u),S=p.selection?p.selection():p,$=S.selectAll(".domain").data([null]),R=S.selectAll(".tick").data(d,e).order(),P=R.exit(),_=R.enter().append("g").attr("class","tick"),w=R.select("line"),A=R.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(_),w=w.merge(_.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),A=A.merge(_.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",t===Ma?"0em":t===Ol?"0.71em":"0.32em")),p!==S&&($=$.transition(p),R=R.transition(p),w=w.transition(p),A=A.transition(p),P=P.transition(p).attr("opacity",Tg).attr("transform",function(N){return isFinite(N=v(N))?f(N+u):this.getAttribute("transform")}),_.attr("opacity",Tg).attr("transform",function(N){var C=this.parentNode.__axis;return f((C&&isFinite(C=C(N))?C:v(N))+u)})),P.remove(),$.attr("d",t===Ii||t===Pa?a?"M"+l*a+","+b+"H"+u+"V"+x+"H"+l*a:"M"+u+","+b+"V"+x:a?"M"+b+","+l*a+"V"+u+"H"+x+"V"+l*a:"M"+b+","+u+"H"+x),R.attr("opacity",1).attr("transform",function(N){return f(v(N)+u)}),w.attr(c+"2",l*o),A.attr(c,l*m).text(g),S.filter(s5).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=v})}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 u5(t){return Da(Ma,t)}function l5(t){return Da(Pa,t)}function Lg(t){return Da(Ol,t)}function Cg(t){return Da(Ii,t)}var c5={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 f5(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=f5(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=h5(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]=Eg(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Eg(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 h5(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Eg(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=c5,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 p5(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 d5(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function La(t){var e=Ni(t);return(e.local?d5:p5)(e)}function g5(){}function Ca(t){return t==null?g5:function(){return this.querySelector(t)}}function m5(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 Rg(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function y5(){return[]}function Bl(t){return t==null?y5:function(){return this.querySelectorAll(t)}}function b5(t){return function(){return Rg(t.apply(this,arguments))}}function v5(t){typeof t=="function"?t=b5(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 kg(t){return function(e){return e.matches(t)}}var x5=Array.prototype.find;function _5(t){return function(){return x5.call(this.children,t)}}function w5(){return this.firstElementChild}function $5(t){return this.select(t==null?w5:_5(typeof t=="function"?t:kg(t)))}var S5=Array.prototype.filter;function A5(){return Array.from(this.children)}function M5(t){return function(){return S5.call(this.children,t)}}function P5(t){return this.selectAll(t==null?A5:M5(typeof t=="function"?t:kg(t)))}function D5(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 Ig(t){return new Array(t.length)}function T5(){return new Wt(this._enter||this._groups.map(Ig),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 L5(t){return function(){return t}}function C5(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 E5(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 R5(t){return t.__data__}function k5(t,e){if(!arguments.length)return Array.from(this,R5);var n=e?E5:C5,r=this._parents,i=this._groups;typeof t!="function"&&(t=L5(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=I5(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,x=0,v,S;b<d;++b)if(v=g[b]){for(b>=x&&(x=b+1);!(S=m[x])&&++x<d;);v._next=S||null}}return a=new Wt(a,r),a._enter=s,a._exit=u,a}function I5(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function N5(){return new Wt(this._exit||this._groups.map(Ig),this._parents)}function F5(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 G5(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 z5(){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 O5(t){t||(t=Y5);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 Y5(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function U5(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function B5(){return Array.from(this)}function W5(){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 H5(){let t=0;for(const e of this)++t;return t}function X5(){return!this.node()}function q5(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 j5(t){return function(){this.removeAttribute(t)}}function V5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Z5(t,e){return function(){this.setAttribute(t,e)}}function K5(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Q5(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function J5(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 t6(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?V5:j5:typeof e=="function"?n.local?J5:Q5:n.local?K5:Z5)(n,e))}function Hl(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function e6(t){return function(){this.style.removeProperty(t)}}function n6(t,e,n){return function(){this.style.setProperty(t,e,n)}}function r6(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function i6(t,e,n){return arguments.length>1?this.each((e==null?e6:typeof e=="function"?r6:n6)(t,e,n??"")):Gn(this.node(),t)}function Gn(t,e){return t.style.getPropertyValue(e)||Hl(t).getComputedStyle(t,null).getPropertyValue(e)}function o6(t){return function(){delete this[t]}}function a6(t,e){return function(){this[t]=e}}function s6(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function u6(t,e){return arguments.length>1?this.each((e==null?o6:typeof e=="function"?s6:a6)(t,e)):this.node()[t]}function Ng(t){return t.trim().split(/^|\s+/)}function Xl(t){return t.classList||new Fg(t)}function Fg(t){this._node=t,this._names=Ng(t.getAttribute("class")||"")}Fg.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 Gg(t,e){for(var n=Xl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function zg(t,e){for(var n=Xl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function l6(t){return function(){Gg(this,t)}}function c6(t){return function(){zg(this,t)}}function f6(t,e){return function(){(e.apply(this,arguments)?Gg:zg)(this,t)}}function h6(t,e){var n=Ng(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"?f6:e?l6:c6)(n,e))}function p6(){this.textContent=""}function d6(t){return function(){this.textContent=t}}function g6(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function m6(t){return arguments.length?this.each(t==null?p6:(typeof t=="function"?g6:d6)(t)):this.node().textContent}function y6(){this.innerHTML=""}function b6(t){return function(){this.innerHTML=t}}function v6(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function x6(t){return arguments.length?this.each(t==null?y6:(typeof t=="function"?v6:b6)(t)):this.node().innerHTML}function _6(){this.nextSibling&&this.parentNode.appendChild(this)}function w6(){return this.each(_6)}function $6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S6(){return this.each($6)}function A6(t){var e=typeof t=="function"?t:La(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function M6(){return null}function P6(t,e){var n=typeof t=="function"?t:La(t),r=e==null?M6:typeof e=="function"?e:Ca(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function D6(){var t=this.parentNode;t&&t.removeChild(this)}function T6(){return this.each(D6)}function L6(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function C6(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function E6(t){return this.select(t?C6:L6)}function R6(t){return arguments.length?this.property("__data__",t):this.node().__data__}function k6(t){return function(e){t.call(this,e,this.__data__)}}function I6(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 N6(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 F6(t,e,n){return function(){var r=this.__on,i,o=k6(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 G6(t,e,n){var r=I6(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?F6:N6,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function Og(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 z6(t,e){return function(){return Og(this,t,e)}}function O6(t,e){return function(){return Og(this,t,e.apply(this,arguments))}}function Y6(t,e){return this.each((typeof e=="function"?O6:z6)(t,e))}function*U6(){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 zn(){return new Wt([[document.documentElement]],ql)}function B6(){return this}Wt.prototype=zn.prototype={constructor:Wt,select:m5,selectAll:v5,selectChild:$5,selectChildren:P5,filter:D5,data:k5,enter:T5,exit:N5,join:F5,merge:G5,selection:B6,order:z5,sort:O5,call:U5,nodes:B5,node:W5,size:H5,empty:X5,each:q5,attr:t6,style:i6,property:u6,classed:h6,text:m6,html:x6,raise:w6,lower:S6,append:A6,insert:P6,remove:T6,clone:E6,datum:R6,on:G6,dispatch:Y6,[Symbol.iterator]:U6};function j(t){return typeof t=="string"?new Wt([[document.querySelector(t)]],[document.documentElement]):new Wt([[t]],ql)}function W6(t){return j(La(t).call(document.documentElement))}var H6=0;function Yg(){return new jl}function jl(){this._="@"+(++H6).toString(36)}jl.prototype=Yg.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 Ug(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ue(t,e){if(t=Ug(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 X6(t,e){return t.target&&(t=Ug(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>ue(n,e))}function q6(t){return typeof t=="string"?new Wt([document.querySelectorAll(t)],[document.documentElement]):new Wt([Rg(t)],ql)}const j6={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 V6(t){return!t.ctrlKey&&!t.button}function Z6(){return this.parentNode}function K6(t,e){return e??{x:t.x,y:t.y}}function Q6(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bg(){var t=V6,e=Z6,n=K6,r=Q6,i={},o=Fn("start","drag","end"),a=0,s,u,l,c,f=0;function h(v){v.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,j6).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(v,S){if(!(c||!t.call(this,v,S))){var $=x(this,e.call(this,v,S),v,S,"mouse");$&&(j(v.view).on("mousemove.drag",d,Fi).on("mouseup.drag",g,Fi),Ra(v.view),Vl(v),l=!1,s=v.clientX,u=v.clientY,$("start",v))}}function d(v){if(Pr(v),!l){var S=v.clientX-s,$=v.clientY-u;l=S*S+$*$>f}i.mouse("drag",v)}function g(v){j(v.view).on("mousemove.drag mouseup.drag",null),ka(v.view,l),Pr(v),i.mouse("end",v)}function m(v,S){if(t.call(this,v,S)){var $=v.changedTouches,R=e.call(this,v,S),P=$.length,_,w;for(_=0;_<P;++_)(w=x(this,R,v,S,$[_].identifier,$[_]))&&(Vl(v),w("start",v,$[_]))}}function y(v){var S=v.changedTouches,$=S.length,R,P;for(R=0;R<$;++R)(P=i[S[R].identifier])&&(Pr(v),P("drag",v,S[R]))}function b(v){var S=v.changedTouches,$=S.length,R,P;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),R=0;R<$;++R)(P=i[S[R].identifier])&&(Vl(v),P("end",v,S[R]))}function x(v,S,$,R,P,_){var w=o.copy(),A=ue(_||$,S),N,C,M;if((M=n.call(v,new Zl("beforestart",{sourceEvent:$,target:h,identifier:P,active:a,x:A[0],y:A[1],dx:0,dy:0,dispatch:w}),R))!=null)return N=M.x-A[0]||0,C=M.y-A[1]||0,function L(D,O,z){var k=A,E;switch(D){case"start":i[P]=L,E=a++;break;case"end":delete i[P],--a;case"drag":A=ue(z||O,S),E=a;break}w.call(D,v,new Zl(D,{sourceEvent:O,subject:M,target:h,identifier:P,active:E,x:A[0]+N,y:A[1]+C,dx:A[0]-k[0],dy:A[1]-k[1],dispatch:w}),R)}}return h.filter=function(v){return arguments.length?(t=typeof v=="function"?v:Ia(!!v),h):t},h.container=function(v){return arguments.length?(e=typeof v=="function"?v:Ia(v),h):e},h.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Ia(v),h):n},h.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Ia(!!v),h):r},h.on=function(){var v=o.on.apply(o,arguments);return v===o?h:v},h.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,h):Math.sqrt(f)},h}function Dr(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Gi(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*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ie="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J6=/^#([0-9a-f]{3,8})$/,t8=new RegExp(`^rgb\\(${Lr},${Lr},${Lr}\\)$`),e8=new RegExp(`^rgb\\(${Ie},${Ie},${Ie}\\)$`),n8=new RegExp(`^rgba\\(${Lr},${Lr},${Lr},${zi}\\)$`),r8=new RegExp(`^rgba\\(${Ie},${Ie},${Ie},${zi}\\)$`),i8=new RegExp(`^hsl\\(${zi},${Ie},${Ie}\\)$`),o8=new RegExp(`^hsla\\(${zi},${Ie},${Ie},${zi}\\)$`),Wg={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:Hg,formatHex:Hg,formatHex8:a8,formatHsl:s8,formatRgb:Xg,toString:Xg});function Hg(){return this.rgb().formatHex()}function a8(){return this.rgb().formatHex8()}function s8(){return Kg(this).formatHsl()}function Xg(){return this.rgb().formatRgb()}function pn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=J6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?qg(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=t8.exec(t))?new Et(e[1],e[2],e[3],1):(e=e8.exec(t))?new Et(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=n8.exec(t))?Na(e[1],e[2],e[3],e[4]):(e=r8.exec(t))?Na(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=i8.exec(t))?Zg(e[1],e[2]/100,e[3]/100,1):(e=o8.exec(t))?Zg(e[1],e[2]/100,e[3]/100,e[4]):Wg.hasOwnProperty(t)?qg(Wg[t]):t==="transparent"?new Et(NaN,NaN,NaN,0):null}function qg(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,Gi(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:jg,formatHex:jg,formatHex8:u8,formatRgb:Vg,toString:Vg}));function jg(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}`}function u8(){return`#${Un(this.r)}${Un(this.g)}${Un(this.b)}${Un((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vg(){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 Zg(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 Kg(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 Ga(t,e,n,r){return arguments.length===1?Kg(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,Ga,Gi(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(Qg(this.h),za(this.s),za(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("}${Qg(this.h)}, ${za(this.s)*100}%, ${za(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Qg(t){return t=(t||0)%360,t<0?t+360:t}function za(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 Jg=Math.PI/180,t0=180/Math.PI,Oa=18,e0=.96422,n0=1,r0=.82521,i0=4/29,Er=6/29,o0=3*Er*Er,l8=Er*Er*Er;function a0(t){if(t instanceof Me)return new Me(t.l,t.a,t.b,t.opacity);if(t instanceof Ne)return u0(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)/n0),o,a;return e===n&&n===r?o=a=i:(o=Jl((.4360747*e+.3850649*n+.1430804*r)/e0),a=Jl((.0139322*e+.0971045*n+.7141733*r)/r0)),new Me(116*i-16,500*(o-i),200*(i-a),t.opacity)}function c8(t,e){return new Me(t,0,0,e??1)}function Ya(t,e,n,r){return arguments.length===1?a0(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,Gi(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=e0*tc(e),t=n0*tc(t),n=r0*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>l8?Math.pow(t,1/3):t/o0+i0}function tc(t){return t>Er?t*t*t:o0*(t-i0)}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 s0(t){if(t instanceof Ne)return new Ne(t.h,t.c,t.l,t.opacity);if(t instanceof Me||(t=a0(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)*t0;return new Ne(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function f8(t,e,n,r){return arguments.length===1?s0(t):new Ne(n,e,t,r??1)}function Ua(t,e,n,r){return arguments.length===1?s0(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 u0(t){if(isNaN(t.h))return new Me(t.l,0,0,t.opacity);var e=t.h*Jg;return new Me(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Dr(Ne,Ua,Gi(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 u0(this).rgb()}}));var l0=-.14861,rc=1.78277,ic=-.29227,Ba=-.90649,Oi=1.97294,c0=Oi*Ba,f0=Oi*rc,h0=rc*ic-Ba*l0;function h8(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=(h0*r+c0*e-f0*n)/(h0+c0-f0),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)*t0-120:NaN;return new Bn(u<0?u+360:u,s,i,t.opacity)}function Pe(t,e,n,r){return arguments.length===1?h8(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,Gi(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)*Jg,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*(l0*r+rc*i)),255*(e+n*(ic*r+Ba*i)),255*(e+n*(Oi*r)),this.opacity)}}));function p0(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 d0(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 p0((n-r/e)*e,a,i,o,s)}}function g0(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 p0((n-r/e)*e,i,o,a,s)}}const Wa=t=>()=>t;function m0(t,e){return function(n){return t+n*e}}function p8(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?m0(t,n>180||n<-180?n-360*Math.round(n/360):n):Wa(isNaN(t)?e:t)}function d8(t){return(t=+t)==1?Rt:function(e,n){return n-e?p8(e,n,t):Wa(isNaN(e)?n:e)}}function Rt(t,e){var n=e-t;return n?m0(t,n):Wa(isNaN(t)?e:t)}const Yi=function t(e){var n=d8(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 y0(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 b0=y0(d0),g8=y0(g0);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 v0(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function m8(t,e){return(v0(e)?oc:x0)(t,e)}function x0(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 w0(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 y8(t){return function(){return t}}function b8(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]?b8(u[0].x):y8(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:v0(e)?oc:Array.isArray(e)?x0:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?w0:de)(t,e)}function v8(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function x8(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 $0=180/Math.PI,lc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function S0(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)*$0,skewX:Math.atan(u)*$0,scaleX:a,scaleY:s}}var qa;function _8(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?lc:S0(e.a,e.b,e.c,e.d,e.e,e.f)}function w8(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,S0(t.a,t.b,t.c,t.d,t.e,t.f))}function A0(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 M0=A0(_8,"px, ","px)","deg)"),P0=A0(w8,", ",")",")"),$8=1e-12;function D0(t){return((t=Math.exp(t))+1/t)/2}function S8(t){return((t=Math.exp(t))-1/t)/2}function A8(t){return((t=Math.exp(2*t))-1)/(t+1)}const T0=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<$8)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),x=(h*h-l*l+r*g)/(2*l*n*b),v=(h*h-l*l-r*g)/(2*h*n*b),S=Math.log(Math.sqrt(x*x+1)-x),$=Math.log(Math.sqrt(v*v+1)-v);y=($-S)/e,m=function(R){var P=R*y,_=D0(S),w=l/(n*b)*(_*A8(e*P+S)-S8(S));return[s+w*p,u+w*d,l*_/D0(e*P+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 L0(t){return function(e,n){var r=t((e=Ga(e)).h,(n=Ga(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 M8=L0(Ha);var P8=L0(Rt);function D8(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 C0(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 T8=C0(Ha);var L8=C0(Rt);function E0(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 C8=E0(Ha);var ja=E0(Rt);function R0(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 E8(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,k0=1e3,Va,Wi,Za=0,Wn=0,Ka=0,Hi=typeof performance=="object"&&performance.now?performance:Date,I0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xi(){return Wn||(I0(R8),Wn=Hi.now()+Ka)}function R8(){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 N0(){Xi(),++Rr;for(var t=Va,e;t;)(e=Wn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Rr}function F0(){Wn=(Za=Hi.now())+Ka,Rr=Ui=0;try{N0()}finally{Rr=0,I8(),Wn=0}}function k8(){var t=Hi.now(),e=t-Za;e>k0&&(Ka-=e,Za=t)}function I8(){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(F0,t-Hi.now()-Ka)),Bi&&(Bi=clearInterval(Bi))):(Bi||(Za=Hi.now(),Bi=setInterval(k8,k0)),Rr=1,I0(F0))}}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 N8(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 F8=Fn("start","end","cancel","interrupt"),G8=[],G0=0,hc=1,pc=2,Ja=3,z0=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;z8(t,n,{name:e,index:r,group:i,on:F8,tween:G8,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:G0})}function gc(t,e){var n=De(t,e);if(n.state>G0)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 z8(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===z0?(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=z0,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 O8(t){return this.each(function(){Hn(this,t)})}function Y8(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 U8(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 B8(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?Y8:U8)(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 O0(t,e){var n;return(typeof e=="number"?de:e instanceof pn?Yi:(n=pn(e))?(e=n,Yi):uc)(t,e)}function W8(t){return function(){this.removeAttribute(t)}}function H8(t){return function(){this.removeAttributeNS(t.space,t.local)}}function X8(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 q8(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 j8(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 V8(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 Z8(t,e){var n=Ni(t),r=n==="transform"?P0:O0;return this.attrTween(t,typeof e=="function"?(n.local?V8:j8)(n,r,mc(this,"attr."+t,e)):e==null?(n.local?H8:W8)(n):(n.local?q8:X8)(n,r,e))}function K8(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Q8(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function J8(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Q8(t,o)),n}return i._value=e,i}function tM(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&K8(t,o)),n}return i._value=e,i}function eM(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?J8:tM)(r,e))}function nM(t,e){return function(){gc(this,t).delay=+e.apply(this,arguments)}}function rM(t,e){return e=+e,function(){gc(this,t).delay=e}}function iM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?nM:rM)(e,t)):De(this.node(),e).delay}function oM(t,e){return function(){Fe(this,t).duration=+e.apply(this,arguments)}}function aM(t,e){return e=+e,function(){Fe(this,t).duration=e}}function sM(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?oM:aM)(e,t)):De(this.node(),e).duration}function uM(t,e){if(typeof e!="function")throw new Error;return function(){Fe(this,t).ease=e}}function lM(t){var e=this._id;return arguments.length?this.each(uM(e,t)):De(this.node(),e).ease}function cM(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Fe(this,t).ease=n}}function fM(t){if(typeof t!="function")throw new Error;return this.each(cM(this._id,t))}function hM(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 Ge(r,this._parents,this._name,this._id)}function pM(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 dM(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 gM(t,e,n){var r,i,o=dM(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 mM(t,e){var n=this._id;return arguments.length<2?De(this.node(),n).on.on(t):this.each(gM(n,t,e))}function yM(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function bM(){return this.on("end.remove",yM(this._id))}function vM(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 Ge(o,this._parents,e,n)}function xM(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 Ge(o,a,e,n)}var _M=zn.prototype.constructor;function wM(){return new _M(this._groups,this._parents)}function $M(t,e){var n,r,i;return function(){var o=Gn(this,t),a=(this.style.removeProperty(t),Gn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Y0(t){return function(){this.style.removeProperty(t)}}function SM(t,e,n){var r,i=n+"",o;return function(){var a=Gn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function AM(t,e,n){var r,i,o;return function(){var a=Gn(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),Gn(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function MM(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=Y0(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function PM(t,e,n){var r=(t+="")=="transform"?M0:O0;return e==null?this.styleTween(t,$M(t,r)).on("end.style."+t,Y0(t)):typeof e=="function"?this.styleTween(t,AM(t,r,mc(this,"style."+t,e))).each(MM(this._id,t)):this.styleTween(t,SM(t,r,e),n).on("end.style."+t,null)}function DM(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function TM(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&DM(t,a,n)),r}return o._value=e,o}function LM(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,TM(t,e,n??""))}function CM(t){return function(){this.textContent=t}}function EM(t){return function(){var e=t(this);this.textContent=e??""}}function RM(t){return this.tween("text",typeof t=="function"?EM(mc(this,"text",t)):CM(t==null?"":t+""))}function kM(t){return function(e){this.textContent=t.call(this,e)}}function IM(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&kM(i)),e}return r._value=t,r}function NM(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,IM(t))}function FM(){for(var t=this._name,e=this._id,n=B0(),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 Ge(r,this._parents,t,n)}function GM(){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 zM=0;function Ge(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function U0(t){return zn().transition(t)}function B0(){return++zM}var Ve=zn.prototype;Ge.prototype=U0.prototype={constructor:Ge,select:vM,selectAll:xM,selectChild:Ve.selectChild,selectChildren:Ve.selectChildren,filter:hM,merge:pM,selection:wM,transition:FM,call:Ve.call,nodes:Ve.nodes,node:Ve.node,size:Ve.size,empty:Ve.empty,each:Ve.each,on:mM,attr:Z8,attrTween:eM,style:PM,styleTween:LM,text:RM,textTween:NM,remove:bM,tween:B8,delay:iM,duration:sM,ease:lM,easeVarying:fM,end:GM,[Symbol.iterator]:Ve[Symbol.iterator]};const OM=t=>+t;function YM(t){return t*t}function UM(t){return t*(2-t)}function W0(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function BM(t){return t*t*t}function WM(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,HM=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}(yc),XM=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}(yc),H0=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),X0=Math.PI,q0=X0/2;function qM(t){return+t==1?1:1-Math.cos(t*q0)}function jM(t){return Math.sin(t*q0)}function j0(t){return(1-Math.cos(X0*t))/2}function dn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function VM(t){return dn(1-+t)}function ZM(t){return 1-dn(t)}function V0(t){return((t*=2)<=1?dn(1-t):2-dn(t-1))/2}function KM(t){return 1-Math.sqrt(1-t*t)}function QM(t){return Math.sqrt(1- --t*t)}function Z0(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var bc=4/11,JM=6/11,t4=8/11,e4=3/4,n4=9/11,r4=10/11,i4=15/16,o4=21/22,a4=63/64,ns=1/bc/bc;function s4(t){return 1-Vi(1-t)}function Vi(t){return(t=+t)<bc?ns*t*t:t<t4?ns*(t-=JM)*t+e4:t<r4?ns*(t-=n4)*t+i4:ns*(t-=o4)*t+a4}function u4(t){return((t*=2)<=1?1-Vi(1-t):Vi(t-1)+1)/2}var vc=1.70158,l4=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(vc),c4=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(vc),K0=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,f4=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),h4=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),p4={time:null,delay:0,duration:250,ease:ji};function d4(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 g4(t){var e,n;t instanceof Ge?(e=t._id,t=t._name):(e=B0(),(n=p4).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||d4(u,e));return new Ge(r,this._parents,t,e)}zn.prototype.interrupt=O8,zn.prototype.transition=g4;var m4=[null];function y4(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 Ge([[t]],m4,e,+i)}return null}const wc=t=>()=>t;function b4(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 v4(t){t.stopImmediatePropagation()}function $c(t){t.preventDefault(),t.stopImmediatePropagation()}var Q0={name:"drag"},Sc={name:"space"},Ir={name:"handle"},Nr={name:"center"};const{abs:J0,max:Gt,min:zt}=Math;function tm(t){return[+t[0],+t[1]]}function Ac(t){return[tm(t[0]),tm(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]]}},x4={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"},em={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},nm={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},w4={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 $4(t){return!t.ctrlKey&&!t.button}function S4(){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 A4(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mc(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function M4(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function P4(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function D4(){return Pc(rs)}function T4(){return Pc(is)}function L4(){return Pc(x4)}function Pc(t){var e=S4,n=$4,r=A4,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 b=m.selectAll(".handle").data(t.handles,function(x){return x.type});b.exit().remove(),b.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,b){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,v=x.__brush,S=c(x,arguments),$=v.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,v.extent),P=je($,R);function _(w){v.selection=w===1&&R===null?null:P(w),l.call(x),S.brush()}return $!==null&&R!==null?_:_(1)}):m.each(function(){var x=this,v=arguments,S=x.__brush,$=t.input(typeof y=="function"?y.apply(x,v):y,S.extent),R=c(x,v).beforestart();Hn(x),S.selection=$===null?null:$,l.call(x),R.start(b).brush(b).end(b)})},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(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 x=m.__brush.emitter;return x&&(!b||!x.clean)?x: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 x=j(this.that).datum();o.call(m,this.that,new b4(m,{sourceEvent:y,target:u,selection:t.output(this.state.selection),mode:b,dispatch:o}),x)}};function h(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,b=m.target.__data__.type,x=(i&&m.metaKey?b="overlay":b)==="selection"?Q0:i&&m.altKey?Nr:Ir,v=t===is?null:_4[b],S=t===rs?null:w4[b],$=Mc(y),R=$.extent,P=$.selection,_=R[0][0],w,A,N=R[0][1],C,M,L=R[1][0],D,O,z=R[1][1],k,E,T=0,G=0,q,Q=v&&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(b==="overlay"){P&&(q=!0);const st=[U[0],U[1]||U[0]];$.selection=P=[[w=t===is?_:zt(st[0][0],st[1][0]),C=t===rs?N:zt(st[0][1],st[1][1])],[D=t===is?L:Gt(st[0][0],st[1][0]),k=t===rs?z:Gt(st[0][1],st[1][1])]],U.length>1&&mt(m)}else w=P[0][0],C=P[0][1],D=P[1][0],k=P[1][1];A=w,M=C,O=D,E=k;var X=j(y).attr("pointer-events","none"),rt=X.selectAll(".overlay").attr("cursor",Ze[b]);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];J0(Pt.cur[0]-Pt[0])>J0(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]);q=!0,$c(st),mt(st)}function mt(st){const Pt=U[0],Oo=Pt.point0;var Mn;switch(T=Pt[0]-Oo[0],G=Pt[1]-Oo[1],x){case Sc:case Q0:{v&&(T=Gt(_-w,zt(L-D,T)),A=w+T,O=D+T),S&&(G=Gt(N-C,zt(z-k,G)),M=C+G,E=k+G);break}case Ir:{U[1]?(v&&(A=Gt(_,zt(L,U[0][0])),O=Gt(_,zt(L,U[1][0])),v=1),S&&(M=Gt(N,zt(z,U[0][1])),E=Gt(N,zt(z,U[1][1])),S=1)):(v<0?(T=Gt(_-w,zt(L-w,T)),A=w+T,O=D):v>0&&(T=Gt(_-D,zt(L-D,T)),A=w,O=D+T),S<0?(G=Gt(N-C,zt(z-C,G)),M=C+G,E=k):S>0&&(G=Gt(N-k,zt(z-k,G)),M=C,E=k+G));break}case Nr:{v&&(A=Gt(_,zt(L,w-T*v)),O=Gt(_,zt(L,D+T*v))),S&&(M=Gt(N,zt(z,C-G*S)),E=Gt(N,zt(z,k+G*S)));break}}O<A&&(v*=-1,Mn=w,w=D,D=Mn,Mn=A,A=O,O=Mn,b in em&&rt.attr("cursor",Ze[b=em[b]])),E<M&&(S*=-1,Mn=C,C=k,k=Mn,Mn=M,M=E,E=Mn,b in nm&&rt.attr("cursor",Ze[b=nm[b]])),$.selection&&(P=$.selection),Y&&(A=P[0][0],O=P[1][0]),Z&&(M=P[0][1],E=P[1][1]),(P[0][0]!==A||P[0][1]!==M||P[1][0]!==O||P[1][1]!==E)&&($.selection=[[A,M],[O,E]],l.call(y),V.brush(st,x.name))}function ht(st){if(v4(st),st.touches){if(st.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else ka(st.view,q),ut.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);X.attr("pointer-events","all"),rt.attr("cursor",Ze.overlay),$.selection&&(P=$.selection),M4(P)&&($.selection=null,l.call(y)),V.end(st,x.name)}function Bt(st){switch(st.keyCode){case 16:{Q=v&&S;break}case 18:{x===Ir&&(v&&(D=O-T*v,w=A+T*v),S&&(k=E-G*S,C=M+G*S),x=Nr,mt(st));break}case 32:{(x===Ir||x===Nr)&&(v<0?D=O-T:v>0&&(w=A-T),S<0?k=E-G:S>0&&(C=M-G),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&&(v<0?D=O:v>0&&(w=A),S<0?k=E:S>0&&(C=M),x=Ir,mt(st));break}case 32:{x===Sc&&(st.altKey?(v&&(D=O-T*v,w=A+T*v),S&&(k=E-G*S,C=M+G*S),x=Nr):(v<0?D=O:v>0&&(w=A),S<0?k=E:S>0&&(C=M),x=Ir),rt.attr("cursor",Ze[b]),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 rm=Math.abs,Fr=Math.cos,Gr=Math.sin,im=Math.PI,os=im/2,om=im*2,am=Math.max,Dc=1e-12;function Tc(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function C4(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function E4(){return Lc(!1,!1)}function R4(){return Lc(!1,!0)}function k4(){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=am(0,om-n*u)/p,d=p?n:om/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=Tc(~u+1,u).filter(x=>x<0?s[~x*u+m]:s[m*u+x]);i&&b.sort((x,v)=>i(x<0?-s[~x*u+m]:s[m*u+x],v<0?-s[~v*u+m]:s[m*u+v]));for(const x of b)if(x<0){const v=f[~x*u+m]||(f[~x*u+m]={source:null,target:null});v.target={index:m,startAngle:g,endAngle:g+=s[~x*u+m]*p,value:s[~x*u+m]}}else{const v=f[m*u+x]||(f[m*u+x]={source:null,target:null});v.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 b=Tc(0,u).filter(x=>s[m*u+x]||s[x*u+m]);i&&b.sort((x,v)=>i(s[m*u+x],s[m*u+v]));for(const x of b){let v;if(m<x?(v=f[m*u+x]||(f[m*u+x]={source:null,target:null}),v.source={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]}):(v=f[x*u+m]||(f[x*u+m]={source:null,target:null}),v.target={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]},m===x&&(v.source=v.target)),v.source&&v.target&&v.source.value<v.target.value){const S=v.source;v.source=v.target,v.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=am(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=C4(s))._=s,a):o&&o._},a}const Cc=Math.PI,Ec=2*Cc,Xn=1e-6,I4=Ec-Xn;function sm(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function N4(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return sm;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?sm:N4(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),b=Math.sqrt(h),x=o*Math.tan((Cc-Math.acos((g+h-m)/(2*y*b)))/2),v=x/b,S=x/y;Math.abs(v-1)>Xn&&this._append`L${e+v*c},${n+v*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>I4?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 F4(t=3){return new Qi(+t)}var G4=Array.prototype.slice;function qn(t){return function(){return t}}function z4(t){return t.source}function O4(t){return t.target}function um(t){return t.radius}function Y4(t){return t.startAngle}function U4(t){return t.endAngle}function B4(){return 0}function W4(){return 10}function lm(t){var e=z4,n=O4,r=um,i=um,o=Y4,a=U4,s=B4,u=null;function l(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=G4.call(arguments),g=+r.apply(this,(d[0]=f,d)),m=o.apply(this,d)-os,y=a.apply(this,d)-os,b=+i.apply(this,(d[0]=h,d)),x=o.apply(this,d)-os,v=a.apply(this,d)-os;if(u||(u=c=Rc()),p>Dc&&(rm(y-m)>p*2+Dc?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,rm(v-x)>p*2+Dc?v>x?(x+=p,v-=p):(x-=p,v+=p):x=v=(x+v)/2),u.moveTo(g*Fr(m),g*Gr(m)),u.arc(0,0,g,m,y),m!==x||y!==v)if(t){var S=+t.apply(this,arguments),$=b-S,R=(x+v)/2;u.quadraticCurveTo(0,0,$*Fr(x),$*Gr(x)),u.lineTo(b*Fr(R),b*Gr(R)),u.lineTo($*Fr(v),$*Gr(v))}else u.quadraticCurveTo(0,0,b*Fr(x),b*Gr(x)),u.arc(0,0,b,x,v);if(u.quadraticCurveTo(0,0,g*Fr(m),g*Gr(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 H4(){return lm()}function X4(){return lm(W4)}var q4=Array.prototype,cm=q4.slice;function j4(t,e){return t-e}function V4(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 Z4(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=K4(t,e[n]))return i;return 0}function K4(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(Q4(u,f,e))return 0;c>r!=p>r&&n<(h-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function Q4(t,e,n){var r;return J4(t,e,n)&&tP(t[r=+(t[0]===e[0])],n[r],e[r])}function J4(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function tP(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function eP(){}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(j4);else{const f=Li(l,nP);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),V4(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=h.length,y;g<m;++g)if(Z4((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,x;for(d=g=-1,y=jn(l[0],c),Ke[y<<1].forEach(v);++d<t-1;)m=y,y=jn(l[d+1],c),Ke[m|y<<1].forEach(v);for(Ke[y<<0].forEach(v);++g<e-1;){for(d=-1,y=jn(l[g*t+t],c),b=jn(l[g*t],c),Ke[y<<1|b<<2].forEach(v);++d<t-1;)m=y,y=jn(l[g*t+t+d+1],c),x=b,b=jn(l[g*t+d+1],c),Ke[m|y<<1|b<<2|x<<3].forEach(v);Ke[y|b<<3].forEach(v)}for(d=-1,b=l[g*t]>=c,Ke[b<<2].forEach(v);++d<t-1;)x=b,b=jn(l[g*t+d+1],c),Ke[b<<2|x<<3].forEach(v);Ke[b<<3].forEach(v);function v(S){var $=[S[0][0]+d,S[0][1]+g],R=[S[1][0]+d,S[1][1]+g],P=s($),_=s(R),w,A;(w=p[P])?(A=h[_])?(delete p[w.end],delete h[A.start],w===A?(w.ring.push(R),f(w.ring)):h[w.start]=p[A.end]={start:w.start,end:A.end,ring:w.ring.concat(A.ring)}):(delete p[w.end],w.ring.push(R),p[w.end=_]=w):(w=h[_])?(A=p[P])?(delete h[w.start],delete p[A.end],w===A?(w.ring.push(R),f(w.ring)):h[A.start]=p[w.end]={start:A.start,end:w.end,ring:A.ring.concat(w.ring)}):(delete h[w.start],w.ring.unshift($),h[w.start=P]=w):h[P]=p[_]={start:P,end:_,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=Ic(c[m*t+g]);p>0&&p<t&&g===p&&(h[0]=fm(p,Ic(c[m*t+g-1]),y,f)),d>0&&d<e&&m===d&&(h[1]=fm(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(cm.call(l)):gn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:eP,i):r===u},i}function nP(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 fm(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 rP(t){return t[0]}function iP(t){return t[1]}function oP(){return 1}function aP(){var t=rP,e=iP,n=oP,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(b){var x=new Float32Array(u*l),v=Math.pow(2,-a),S=-1;for(const C of b){var $=(t(C,++S,b)+s)*v,R=(e(C,S,b)+s)*v,P=+n(C,S,b);if(P&&$>=0&&$<u&&R>=0&&R<l){var _=Math.floor($),w=Math.floor(R),A=$-_-.5,N=R-w-.5;x[_+w*u]+=(1-A)*(1-N)*P,x[_+1+w*u]+=A*(1-N)*P,x[_+1+(w+1)*u]+=A*N*P,x[_+(w+1)*u]+=(1-A)*N*P}}return og({data:x,width:u,height:l},o*v),x}function h(b){var x=f(b),v=c(x),S=Math.pow(2,2*a);return Array.isArray(v)||(v=In(Number.MIN_VALUE,Ei(x)/S,v)),kc().size([u,l]).thresholds(v.map($=>$*S))(x).map(($,R)=>($.value=+v[R],p($)))}h.contours=function(b){var x=f(b),v=kc().size([u,l]),S=Math.pow(2,2*a),$=R=>{R=+R;var P=p(v.contour(x,R*S));return P.value=R,P};return Object.defineProperty($,"max",{get:()=>Ei(x)/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:gn(+b),h):t},h.y=function(b){return arguments.length?(e=typeof b=="function"?b:gn(+b),h):e},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:gn(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],v=+b[1];if(!(x>=0&&v>=0))throw new Error("invalid size");return r=x,i=v,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)?gn(cm.call(b)):gn(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 Qe=11102230246251565e-32,Ot=134217729,sP=(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 uP(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 lP=(3+16*Qe)*Qe,cP=(2+12*Qe)*Qe,fP=(9+64*Qe)*Qe*Qe,zr=Ji(4),hm=Ji(8),pm=Ji(12),dm=Ji(16),Ht=Ji(4);function hP(t,e,n,r,i,o,a){let s,u,l,c,f,h,p,d,g,m,y,b,x,v,S,$,R,P;const _=t-i,w=n-i,A=e-o,N=r-o;v=_*N,h=Ot*_,p=h-(h-_),d=_-p,h=Ot*N,g=h-(h-N),m=N-g,S=d*m-(v-p*g-d*g-p*m),$=A*w,h=Ot*A,p=h-(h-A),d=A-p,h=Ot*w,g=h-(h-w),m=w-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,zr[0]=S-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-$,f=x-y,zr[1]=x-(y+f)+(f-$),P=b+y,f=P-b,zr[2]=b-(P-f)+(y-f),zr[3]=P;let C=uP(4,zr),M=cP*a;if(C>=M||-C>=M||(f=t-_,s=t-(_+f)+(f-i),f=n-w,l=n-(w+f)+(f-i),f=e-A,u=e-(A+f)+(f-o),f=r-N,c=r-(N+f)+(f-o),s===0&&u===0&&l===0&&c===0)||(M=fP*a+sP*Math.abs(C),C+=_*c+N*s-(A*l+w*u),C>=M||-C>=M))return C;v=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-(v-p*g-d*g-p*m),$=u*w,h=Ot*u,p=h-(h-u),d=u-p,h=Ot*w,g=h-(h-w),m=w-g,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-$,f=x-y,Ht[1]=x-(y+f)+(f-$),P=b+y,f=P-b,Ht[2]=b-(P-f)+(y-f),Ht[3]=P;const L=Nc(4,zr,4,Ht,hm);v=_*c,h=Ot*_,p=h-(h-_),d=_-p,h=Ot*c,g=h-(h-c),m=c-g,S=d*m-(v-p*g-d*g-p*m),$=A*l,h=Ot*A,p=h-(h-A),d=A-p,h=Ot*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=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-$,f=x-y,Ht[1]=x-(y+f)+(f-$),P=b+y,f=P-b,Ht[2]=b-(P-f)+(y-f),Ht[3]=P;const D=Nc(L,hm,4,Ht,pm);v=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-(v-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,R=d*m-($-p*g-d*g-p*m),y=S-R,f=S-y,Ht[0]=S-(y+f)+(f-R),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-$,f=x-y,Ht[1]=x-(y+f)+(f-$),P=b+y,f=P-b,Ht[2]=b-(P-f)+(y-f),Ht[3]=P;const O=Nc(D,pm,4,Ht,dm);return dm[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)>=lP*l?u:-hP(t,e,n,r,i,o,l)}const gm=Math.pow(2,-52),ss=new Uint32Array(512);class us{static from(e,n=yP,r=bP){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 _=0;_<a;_++){const w=e[2*_],A=e[2*_+1];w<s&&(s=w),A<u&&(u=A),w>l&&(l=w),A>c&&(c=A),this._ids[_]=_}const f=(s+l)/2,h=(u+c)/2;let p,d,g;for(let _=0,w=1/0;_<a;_++){const A=Fc(f,h,e[2*_],e[2*_+1]);A<w&&(p=_,w=A)}const m=e[2*p],y=e[2*p+1];for(let _=0,w=1/0;_<a;_++){if(_===p)continue;const A=Fc(m,y,e[2*_],e[2*_+1]);A<w&&A>0&&(d=_,w=A)}let b=e[2*d],x=e[2*d+1],v=1/0;for(let _=0;_<a;_++){if(_===p||_===d)continue;const w=gP(m,y,b,x,e[2*_],e[2*_+1]);w<v&&(g=_,v=w)}let S=e[2*g],$=e[2*g+1];if(v===1/0){for(let A=0;A<a;A++)this._dists[A]=e[2*A]-e[0]||e[2*A+1]-e[1];Or(this._ids,this._dists,0,a-1);const _=new Uint32Array(a);let w=0;for(let A=0,N=-1/0;A<a;A++){const C=this._ids[A],M=this._dists[C];M>N&&(_[w++]=C,N=M)}this.hull=_.subarray(0,w),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(as(m,y,b,x,S,$)<0){const _=d,w=b,A=x;d=g,b=S,x=$,g=_,S=w,$=A}const R=mP(m,y,b,x,S,$);this._cx=R.x,this._cy=R.y;for(let _=0;_<a;_++)this._dists[_]=Fc(e[2*_],e[2*_+1],R.x,R.y);Or(this._ids,this._dists,0,a-1),this._hullStart=p;let P=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,x)]=d,o[this._hashKey(S,$)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let _=0,w,A;_<this._ids.length;_++){const N=this._ids[_],C=e[2*N],M=e[2*N+1];if(_>0&&Math.abs(C-w)<=gm&&Math.abs(M-A)<=gm||(w=C,A=M,N===p||N===d||N===g))continue;let L=0;for(let E=0,T=this._hashKey(C,M);E<this._hashSize&&(L=o[(T+E)%this._hashSize],!(L!==-1&&L!==r[L]));E++);L=n[L];let D=L,O;for(;O=r[D],as(C,M,e[2*D],e[2*D+1],e[2*O],e[2*O+1])>=0;)if(D=O,D===L){D=-1;break}if(D===-1)continue;let z=this._addTriangle(D,N,r[D],-1,-1,i[D]);i[N]=this._legalize(z+2),i[D]=z,P++;let k=r[D];for(;O=r[k],as(C,M,e[2*k],e[2*k+1],e[2*O],e[2*O+1])<0;)z=this._addTriangle(k,N,O,i[N],-1,i[k]),i[N]=this._legalize(z+2),r[k]=k,P--,k=O;if(D===L)for(;O=n[D],as(C,M,e[2*O],e[2*O+1],e[2*D],e[2*D+1])<0;)z=this._addTriangle(O,N,D,-1,i[D],i[O]),this._legalize(z+2),i[O]=z,r[D]=D,P--,D=O;this._hullStart=n[N]=D,r[D]=n[k]=N,r[N]=k,o[this._hashKey(C,M)]=N,o[this._hashKey(e[2*D],e[2*D+1])]=D}this.hull=new Uint32Array(P);for(let _=0,w=this._hullStart;_<P;_++)this.hull[_]=w,w=r[w];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(pP(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(dP(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 b=l+(s+1)%3;o<ss.length&&(ss[o++]=b)}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 pP(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 dP(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 gP(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 mP(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 yP(t){return t[0]}function bP(t){return t[1]}const mm=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)>mm||Math.abs(this._y1-o)>mm)&&(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 Gc{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 ym{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,x;g<y;g+=3,m+=2){const v=r[g]*2,S=r[g+1]*2,$=r[g+2]*2,R=e[v],P=e[v+1],_=e[S],w=e[S+1],A=e[$],N=e[$+1],C=_-R,M=w-P,L=A-R,D=N-P,O=(C*D-M*L)*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 z=1e9*Math.sign((o-R)*D-(a-P)*L);b=(R+A)/2-z*D,x=(P+N)/2+z*L}else{const z=1/O,k=C*C+M*M,E=L*L+D*D;b=R+(D*k-M*E)*z,x=P+(C*E-L*k)*z}s[m]=b,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],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 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 Gc;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 vP=2*Math.PI,Yr=Math.pow;function xP(t){return t[0]}function _P(t){return t[1]}function wP(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 $P(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class zc{static from(e,n=xP,r=_P,i){return new zc("length"in e?SP(e,n,r,i):Float64Array.from(AP(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&&wP(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=$P(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 ym(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,vP)}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 Gc;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 Gc;return this.renderTriangle(e,n),n.value()}}function SP(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*AP(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 bm={},Oc={},Yc=34,eo=10,Uc=13;function vm(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function MP(t,e){var n=vm(t);return function(r,i){return e(n(r),i,t)}}function xm(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 PP(t){return t<0?"-"+re(-t,6):t>9999?"+"+re(t,6):re(t,4)}function DP(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":PP(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
|
+
\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?MP(m,h):vm(m)});return g.columns=d||[],g}function i(f,h){var p=[],d=f.length,g=0,m=0,y,b=d<=0,x=!1;f.charCodeAt(d-1)===eo&&--d,f.charCodeAt(d-1)===Uc&&--d;function v(){if(b)return Oc;if(x)return x=!1,bm;var $,R=g,P;if(f.charCodeAt(R)===Yc){for(;g++<d&&f.charCodeAt(g)!==Yc||f.charCodeAt(++g)===Yc;);return($=g)>=d?b=!0:(P=f.charCodeAt(g++))===eo?x=!0:P===Uc&&(x=!0,f.charCodeAt(g)===eo&&++g),f.slice(R+1,$-1).replace(/""/g,'"')}for(;g<d;){if((P=f.charCodeAt($=g++))===eo)x=!0;else if(P===Uc)x=!0,f.charCodeAt(g)===eo&&++g;else if(P!==n)continue;return f.slice(R,$)}return b=!0,f.slice(R,d)}for(;(y=v())!==Oc;){for(var S=[];y!==bm&&y!==Oc;)S.push(y),y=v();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=xm(f)),[h.map(c).join(t)].concat(o(f,h)).join(`
|
7
|
+
`)}function s(f,h){return h==null&&(h=xm(f)),o(f,h).join(`
|
8
8
|
`)}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?PD(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:u,formatRow:l,formatValue:c}}var Xn=as(","),wm=Xn.parse,TD=Xn.parseRows,LD=Xn.format,CD=Xn.formatBody,ED=Xn.formatRows,RD=Xn.formatRow,kD=Xn.formatValue,Zn=as(" "),$m=Zn.parse,ID=Zn.parseRows,ND=Zn.format,FD=Zn.formatBody,GD=Zn.formatRows,zD=Zn.formatRow,OD=Zn.formatValue;function UD(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})?)?$/))BD&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;t[e]=n}return t}const BD=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function YD(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function WD(t,e){return fetch(t,e).then(YD)}function HD(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function VD(t,e){return fetch(t,e).then(HD)}function jD(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function ss(t,e){return fetch(t,e).then(jD)}function Sm(t){return function(e,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),ss(e,n).then(function(i){return t(i,r)})}}function qD(t,e,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=as(t);return ss(e,n).then(function(o){return i.parse(o,r)})}var XD=Sm(wm),ZD=Sm($m);function KD(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 QD(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(!(t.status===204||t.status===205))return t.json()}function JD(t,e){return fetch(t,e).then(QD)}function Yc(t){return(e,n)=>ss(e,n).then(r=>new DOMParser().parseFromString(r,t))}const tP=Yc("application/xml");var eP=Yc("text/html"),nP=Yc("image/svg+xml");function rP(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 iP(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Am(this.cover(e,n),e,n,t)}function Am(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 oP(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)Am(this,a[n],s[n],t[n]);return this}function aP(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 sP(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function uP(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 Vt(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function lP(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 Vt(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 Vt(p[3],m,y,u,l),new Vt(p[2],a,y,m,l),new Vt(p[1],m,s,u,y),new Vt(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),x=e-+this._y.call(null,p.data),v=b*b+x*x;if(v<n){var $=Math.sqrt(n=v);i=t-$,o=e-$,c=t+$,f=e+$,r=p.data}}return r}function cP(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 fP(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function hP(){return this._root}function pP(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function dP(t){var e=[],n,r=this._root,i,o,a,s,u;for(r&&e.push(new Vt(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 Vt(i,l,c,s,u)),(i=r[2])&&e.push(new Vt(i,o,c,l,u)),(i=r[1])&&e.push(new Vt(i,l,a,s,c)),(i=r[0])&&e.push(new Vt(i,o,a,l,c))}return this}function gP(t){var e=[],n=[],r;for(this._root&&e.push(new Vt(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 Vt(o,a,s,c,f)),(o=i[1])&&e.push(new Vt(o,c,s,u,f)),(o=i[2])&&e.push(new Vt(o,a,f,c,l)),(o=i[3])&&e.push(new Vt(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 mP(t){return t[0]}function yP(t){return arguments.length?(this._x=t,this):this._x}function bP(t){return t[1]}function vP(t){return arguments.length?(this._y=t,this):this._y}function us(t,e,n){var r=new Wc(e??mP,n??bP,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 Mm(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var jt=us.prototype=Wc.prototype;jt.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=Mm(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]=Mm(r));return t},jt.add=iP,jt.addAll=oP,jt.cover=aP,jt.data=sP,jt.extent=uP,jt.find=lP,jt.remove=cP,jt.removeAll=fP,jt.root=hP,jt.size=pP,jt.visit=dP,jt.visitAfter=gP,jt.x=yP,jt.y=vP;function Lt(t){return function(){return t}}function mn(t){return(t()-.5)*1e-6}function xP(t){return t.x+t.vx}function _P(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=us(e,xP,_P).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(x,v,$,w,R){var D=x.data,_=x.r,M=g+_;if(D){if(D.index>h.index){var S=p-D.x-D.vx,G=d-D.y-D.vy,C=S*S+G*G;C<M*M&&(S===0&&(S=mn(r),C+=S*S),G===0&&(G=mn(r),C+=G*G),C=(M-(C=Math.sqrt(C)))/C*i,h.vx+=(S*=C)*(M=(_*=_)/(m+_)),h.vy+=(G*=C)*M,D.vx-=S*(M=1-M),D.vy-=G*M)}return}return v>p+M||w<p-M||$>d+M||R<d-M}}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 wP(t){return t.index}function Pm(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function $P(t){var e=wP,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 x=0,v,$,w,R,D,_,M;x<b;++x)v=t[x],$=v.source,w=v.target,R=w.x+w.vx-$.x-$.vx||mn(l),D=w.y+w.vy-$.y-$.vy||mn(l),_=Math.sqrt(R*R+D*D),_=(_-o[x])/_*m*r[x],R*=_,D*=_,w.vx-=R*(M=u[x]),w.vy-=D*M,$.vx+=R*(M=1-M),$.vy+=D*M}function p(){if(a){var m,y=a.length,b=t.length,x=new Map(a.map(($,w)=>[e($,w,a),$])),v;for(m=0,s=new Array(y);m<b;++m)v=t[m],v.index=m,typeof v.source!="object"&&(v.source=Pm(x,v.source)),typeof v.target!="object"&&(v.target=Pm(x,v.target)),s[v.source.index]=(s[v.source.index]||0)+1,s[v.target.index]=(s[v.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)v=t[m],u[m]=s[v.source.index]/(s[v.source.index]+s[v.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 SP=1664525,AP=1013904223,Tm=4294967296;function MP(){let t=1;return()=>(t=(SP*t+AP)%Tm)/Tm}function DP(t){return t.x}function PP(t){return t.y}var TP=10,LP=Math.PI*(3-Math.sqrt(5));function Lm(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=Xa(f),l=Nn("tick","end"),c=MP();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 x=0;x<g;++x)for(n+=(o-n)*i,s.forEach(function(v){v(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=TP*Math.sqrt(.5+g),x=g*LP;y.x=b*Math.cos(x),y.y=b*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 b=0,x=t.length,v,$,w,R,D;for(y==null?y=1/0:y*=y,b=0;b<x;++b)R=t[b],v=g-R.x,$=m-R.y,w=v*v+$*$,w<y&&(D=R,y=w);return D},on:function(g,m){return arguments.length>1?(l.on(g,m),e):l.on(g)}}}function Cm(){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=us(t,DP,PP).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,x,v;if(p.length){for(b=x=v=0;v<4;++v)(g=p[v])&&(m=Math.abs(g.value))&&(d+=g.value,y+=m,b+=m*g.x,x+=m*g.y);p.x=b/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,b=p.y-e.y,x=m-d,v=y*y+b*b;if(x*x/u<v)return v<s&&(y===0&&(y=mn(n),v+=y*y),b===0&&(b=mn(n),v+=b*b),v<a&&(v=Math.sqrt(a*v)),e.vx+=y*p.value*r/v,e.vy+=b*p.value*r/v),!0;if(p.length||v>=s)return;(p.data!==e||p.next)&&(y===0&&(y=mn(n),v+=y*y),b===0&&(b=mn(n),v+=b*b),v<a&&(v=Math.sqrt(a*v)));do p.data!==e&&(x=o[p.data.index]*r/v,e.vx+=y*x,e.vy+=b*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 CP(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 Em(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 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.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 EP(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ls(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=ls(Math.abs(t)),t?t[1]:NaN}function RP(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 kP(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var IP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Br(t){if(!(e=IP.exec(t)))throw new Error("invalid format: "+t);var e;return new cs({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=cs.prototype;function cs(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+""}cs.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 NP(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 km;function FP(t,e){var n=ls(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(km=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")+ls(t,Math.max(0,e+o-1))[0]}function Im(t,e){var n=ls(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 Nm={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:EP,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)=>Im(t*100,e),r:Im,s:FP,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Fm(t){return t}var Gm=Array.prototype.map,zm=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Om(t){var e=t.grouping===void 0||t.thousands===void 0?Fm:RP(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?Fm:kP(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,b=f.comma,x=f.precision,v=f.trim,$=f.type;$==="n"?(b=!0,$="g"):Nm[$]||(x===void 0&&(x=12),v=!0,$="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var w=g==="$"?n:g==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",R=g==="$"?r:/[%p]/.test($)?a:"",D=Nm[$],_=/[defgprs%]/.test($);x=x===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function M(S){var G=w,C=R,A,L,P;if($==="c")C=D(S)+C,S="";else{S=+S;var O=S<0||1/S<0;if(S=isNaN(S)?u:D(Math.abs(S),x),v&&(S=NP(S)),O&&+S==0&&d!=="+"&&(O=!1),G=(O?d==="("?d:s:d==="-"||d==="("?"":d)+G,C=($==="s"?zm[8+km/3]:"")+C+(O&&d==="("?")":""),_){for(A=-1,L=S.length;++A<L;)if(P=S.charCodeAt(A),48>P||P>57){C=(P===46?i+S.slice(A+1):S.slice(A))+C,S=S.slice(0,A);break}}}b&&!m&&(S=e(S,1/0));var z=G.length+S.length+C.length,k=z<y?new Array(y-z+1).join(h):"";switch(b&&m&&(S=e(k+S,k.length?y-C.length:1/0),k=""),p){case"<":S=G+S+C+k;break;case"=":S=G+k+S+C;break;case"^":S=k.slice(0,z=k.length>>1)+G+S+C+k.slice(z);break;default:S=k+G+S+C;break}return o(S)}return M.toString=function(){return f+""},M}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=zm[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var fs,Ji,Hc;Um({thousands:",",grouping:[3],currency:["$",""]});function Um(t){return fs=Om(t),Ji=fs.format,Hc=fs.formatPrefix,fs}function Bm(t){return Math.max(0,-Ur(Math.abs(t)))}function Ym(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ur(e)/3)))*3-Ur(Math.abs(t)))}function Wm(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ur(e)-Ur(t))+1}var it=1e-6,to=1e-12,ft=Math.PI,At=ft/2,hs=ft/4,qt=ft*2,bt=180/ft,ot=ft/180,pt=Math.abs,Yr=Math.atan,Xt=Math.atan2,et=Math.cos,ps=Math.ceil,Hm=Math.exp,Vc=Math.hypot,ds=Math.log,jc=Math.pow,J=Math.sin,ge=Math.sign||function(t){return t>0?1:t<0?-1:0},kt=Math.sqrt,qc=Math.tan;function Vm(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 gs(t,e){t&&Xm.hasOwnProperty(t.type)&&Xm[t.type](t,e)}var qm={Feature:function(t,e){gs(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)gs(n[r].geometry,e)}},Xm={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){Xc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Xc(n[r],e,0)},Polygon:function(t,e){Zm(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Zm(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)gs(n[r],e)}};function Xc(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 Zm(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Xc(t[n],e,1);e.polygonEnd()}function Te(t,e){t&&qm.hasOwnProperty(t.type)?qm[t.type](t,e):gs(t,e)}var ms=new Tt,ys=new Tt,Km,Qm,Zc,Kc,Qc,ze={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){ms=new Tt,ze.lineStart=GP,ze.lineEnd=zP},polygonEnd:function(){var t=+ms;ys.add(t<0?qt+t:t),this.lineStart=this.lineEnd=this.point=wt},sphere:function(){ys.add(qt)}};function GP(){ze.point=OP}function zP(){Jm(Km,Qm)}function OP(t,e){ze.point=Jm,Km=t,Qm=e,t*=ot,e*=ot,Zc=t,Kc=et(e=e/2+hs),Qc=J(e)}function Jm(t,e){t*=ot,e*=ot,e=e/2+hs;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);ms.add(Xt(l,u)),Zc=t,Kc=o,Qc=a}function UP(t){return ys=new Tt,Te(t,ze),ys*2}function bs(t){return[Xt(t[1],t[0]),Zt(t[2])]}function Kn(t){var e=t[0],n=t[1],r=et(n);return[r*et(e),r*J(e),J(n)]}function vs(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Wr(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 xs(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function _s(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,Qn,t1,e1,Hr,eo,yn,Je,tn={point:tf,lineStart:r1,lineEnd:i1,polygonStart:function(){tn.point=o1,tn.lineStart=BP,tn.lineEnd=YP,eo=new Tt,ze.polygonStart()},polygonEnd:function(){ze.polygonEnd(),tn.point=tf,tn.lineStart=r1,tn.lineEnd=i1,ms<0?($t=-(Mt=180),ie=-(le=90)):eo>it?le=90:eo<-it&&(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 n1(t,e){var n=Kn([t*ot,e*ot]);if(Hr){var r=Wr(Hr,n),i=[r[1],-r[0],0],o=Wr(i,r);_s(o),o=bs(o);var a=t-Qn,s=a>0?1:-1,u=o[0]*bt*s,l,c=pt(a)>180;c^(s*Qn<u&&u<s*t)?(l=o[1]*bt,l>le&&(le=l)):(u=(u+360)%360-180,c^(s*Qn<u&&u<s*t)?(l=-o[1]*bt,l<ie&&(ie=l)):(e<ie&&(ie=e),e>le&&(le=e))),c?t<Qn?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>Qn?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),Hr=n,Qn=t}function r1(){tn.point=n1}function i1(){Je[0]=$t,Je[1]=Mt,tn.point=tf,Hr=null}function o1(t,e){if(Hr){var n=t-Qn;eo.add(pt(n)>180?n+(n>0?360:-360):n)}else t1=t,e1=e;ze.point(t,e),n1(t,e)}function BP(){ze.lineStart()}function YP(){o1(t1,e1),ze.lineEnd(),pt(eo)>it&&($t=-(Mt=180)),Je[0]=$t,Je[1]=Mt,Hr=null}function ce(t,e){return(e-=t)<0?e+360:e}function WP(t,e){return t[0]-e[0]}function a1(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function HP(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(WP),e=1,r=yn[0],o=[r];e<n;++e)i=yn[e],a1(r,i[0])||a1(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 no,ws,$s,Ss,As,Ms,Ds,Ps,ef,nf,rf,s1,u1,Kt,Qt,Jt,Le={sphere:wt,point:of,lineStart:l1,lineEnd:c1,polygonStart:function(){Le.lineStart=qP,Le.lineEnd=XP},polygonEnd:function(){Le.lineStart=l1,Le.lineEnd=c1}};function of(t,e){t*=ot,e*=ot;var n=et(e);ro(n*et(t),n*J(t),J(e))}function ro(t,e,n){++no,$s+=(t-$s)/no,Ss+=(e-Ss)/no,As+=(n-As)/no}function l1(){Le.point=VP}function VP(t,e){t*=ot,e*=ot;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),Le.point=jP,ro(Kt,Qt,Jt)}function jP(t,e){t*=ot,e*=ot;var n=et(e),r=n*et(t),i=n*J(t),o=J(e),a=Xt(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);ws+=a,Ms+=a*(Kt+(Kt=r)),Ds+=a*(Qt+(Qt=i)),Ps+=a*(Jt+(Jt=o)),ro(Kt,Qt,Jt)}function c1(){Le.point=of}function qP(){Le.point=ZP}function XP(){f1(s1,u1),Le.point=of}function ZP(t,e){s1=t,u1=e,t*=ot,e*=ot,Le.point=f1;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),ro(Kt,Qt,Jt)}function f1(t,e){t*=ot,e*=ot;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=Vc(a,s,u),c=Zt(l),f=l&&-c/l;ef.add(f*a),nf.add(f*s),rf.add(f*u),ws+=c,Ms+=c*(Kt+(Kt=r)),Ds+=c*(Qt+(Qt=i)),Ps+=c*(Jt+(Jt=o)),ro(Kt,Qt,Jt)}function KP(t){no=ws=$s=Ss=As=Ms=Ds=Ps=0,ef=new Tt,nf=new Tt,rf=new Tt,Te(t,Le);var e=+ef,n=+nf,r=+rf,i=Vc(e,n,r);return i<to&&(e=Ms,n=Ds,r=Ps,ws<it&&(e=$s,n=Ss,r=As),i=Vc(e,n,r),i<to)?[NaN,NaN]:[Xt(n,e)*bt,Zt(r/i)*bt]}function Vr(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/qt)*qt),[t,e]}sf.invert=sf;function uf(t,e,n){return(t%=qt)?e||n?af(p1(t),d1(e,n)):p1(t):e||n?d1(e,n):sf}function h1(t){return function(e,n){return e+=t,pt(e)>ft&&(e-=Math.round(e/qt)*qt),[e,n]}}function p1(t){var e=h1(t);return e.invert=h1(-t),e}function d1(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[Xt(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[Xt(f*i+h*o,c*n+p*r),Zt(p*n-c*r)]},a}function g1(t){t=uf(t[0]*ot,t[1]*ot,t.length>2?t[2]*ot:0);function e(n){return n=t(n[0]*ot,n[1]*ot),n[0]*=bt,n[1]*=bt,n}return e.invert=function(n){return n=t.invert(n[0]*ot,n[1]*ot),n[0]*=bt,n[1]*=bt,n},e}function m1(t,e,n,r,i,o){if(n){var a=et(e),s=J(e),u=r*n;i==null?(i=e+r*qt,o=e-u/2):(i=y1(a,i),o=y1(a,o),(r>0?i<o:i>o)&&(i+=r*qt));for(var l,c=i;r>0?c>o:c<o;c-=u)l=bs([a,-s*et(c),-s*J(c)]),t.point(l[0],l[1])}}function y1(t,e){e=Kn(e),e[0]-=t,_s(e);var n=Vm(-e[1]);return((-e[2]<0?-n:n)+qt-it)%qt}function QP(){var t=Vr([0,0]),e=Vr(90),n=Vr(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)*ot,c=n.apply(this,arguments)*ot;return r=[],i=uf(-u[0]*ot,-u[1]*ot,0).invert,m1(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:Vr([+u[0],+u[1]]),s):t},s.radius=function(u){return arguments.length?(e=typeof u=="function"?u:Vr(+u),s):e},s.precision=function(u){return arguments.length?(n=typeof u=="function"?u:Vr(+u),s):n},s}function b1(){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 Ts(t,e){return pt(t[0]-e[0])<it&&pt(t[1]-e[1])<it}function Ls(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(Ts(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 Ls(m,d,null,!0)),a.push(b.o=new Ls(m,null,b,!1)),o.push(b=new Ls(y,d,null,!1)),a.push(b.o=new Ls(y,null,b,!0))}}),!!o.length){for(a.sort(e),x1(o),x1(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 x1(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)%qt-ft)}function _1(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+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=lf(p),g=p[1]/2+hs,m=J(g),y=et(g),b=0;b<h;++b,d=v,m=w,y=R,p=x){var x=f[b],v=lf(x),$=x[1]/2+hs,w=J($),R=et($),D=v-d,_=D>=0?1:-1,M=_*D,S=M>ft,G=m*w;if(u.add(Xt(G*_*J(M),y*R+G*et(M))),a+=S?D+_*qt:D,S^d>=n^v>=n){var C=Wr(Kn(p),Kn(x));_s(C);var A=Wr(o,C);_s(A);var L=(S^D>=0?-1:1)*Zt(A[2]);(r>L||r===L&&(C[0]||C[1]))&&(s+=S^D>=0?1:-1)}}return(a<-it||a<it&&u<-to)^s&1}function w1(t,e,n,r){return function(i){var o=e(i),a=b1(),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=x,c=[],l=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,c=zl(c);var v=_1(l,r);c.length?(u||(i.polygonStart(),u=!0),v1(c,t7,v,n,i)):v&&(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(v,$){t(v,$)&&i.point(v,$)}function d(v,$){o.point(v,$)}function g(){h.point=d,o.lineStart()}function m(){h.point=p,o.lineEnd()}function y(v,$){f.push([v,$]),s.point(v,$)}function b(){s.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),s.lineEnd();var v=s.clean(),$=a.result(),w,R=$.length,D,_,M;if(f.pop(),l.push(f),f=null,!!R){if(v&1){if(_=$[0],(D=_.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),w=0;w<D;++w)i.point((M=_[w])[0],M[1]);i.lineEnd()}return}R>1&&v&2&&$.push($.pop().concat($.shift())),c.push($.filter(JP))}}return h}}function JP(t){return t.length>1}function t7(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 cf=w1(function(){return!0},e7,r7,[-ft,-At]);function e7(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=n7(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 n7(t,e,n,r){var i,o,a=J(t-n);return pt(a)>it?Yr((J(e)*(o=et(r))*J(n)-J(r)*(i=et(e))*J(t))/(i*o*a)):(e+r)/2}function r7(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 $1(t){var e=et(t),n=2*ot,r=e>0,i=pt(e)>it;function o(c,f,h,p){m1(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],x,v=a(m,y),$=r?v?0:l(m,y):v?l(m+(m<0?ft:-ft),y):0;if(!f&&(d=p=v)&&c.lineStart(),v!==p&&(x=u(f,b),(!x||Ts(f,x)||Ts(b,x))&&(b[2]=1)),v!==p)g=0,v?(c.lineStart(),x=u(b,f),c.point(x[0],x[1])):(x=u(f,b),c.point(x[0],x[1],2),c.lineEnd()),f=x;else if(i&&f&&r^v){var w;!($&h)&&(w=u(b,f,!0))&&(g=0,r?(c.lineStart(),c.point(w[0][0],w[0][1]),c.point(w[1][0],w[1][1]),c.lineEnd()):(c.point(w[1][0],w[1][1]),c.lineEnd(),c.lineStart(),c.point(w[0][0],w[0][1],3)))}v&&(!f||!Ts(f,b))&&c.point(b[0],b[1]),f=b,p=v,h=$},lineEnd:function(){p&&c.lineEnd(),f=null},clean:function(){return g|(d&&p)<<1}}}function u(c,f,h){var p=Kn(c),d=Kn(f),g=[1,0,0],m=Wr(p,d),y=vs(m,m),b=m[0],x=y-b*b;if(!x)return!h&&c;var v=e*y/x,$=-e*b/x,w=Wr(g,m),R=xs(g,v),D=xs(m,$);Jc(R,D);var _=w,M=vs(R,_),S=vs(_,_),G=M*M-S*(vs(R,R)-1);if(!(G<0)){var C=kt(G),A=xs(_,(-M-C)/S);if(Jc(A,R),A=bs(A),!h)return A;var L=c[0],P=f[0],O=c[1],z=f[1],k;P<L&&(k=L,L=P,P=k);var E=P-L,T=pt(E-ft)<it,N=T||E<it;if(!T&&z<O&&(k=O,O=z,z=k),N?T?O+z>0^A[1]<(pt(A[0]-L)<it?O:z):O<=A[1]&&A[1]<=z:E>ft^(L<=A[0]&&A[0]<=P)){var j=xs(_,(-M+C)/S);return Jc(j,R),[A,bs(j)]}}}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 w1(a,s,o,r?[0,-t]:[-ft,t-ft])}function i7(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 io=1e9,Cs=-io;function Es(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=b1(),h,p,d,g,m,y,b,x,v,$,w,R={point:D,lineStart:G,lineEnd:C,polygonStart:M,polygonEnd:S};function D(L,P){i(L,P)&&c.point(L,P)}function _(){for(var L=0,P=0,O=p.length;P<O;++P)for(var z=p[P],k=1,E=z.length,T=z[0],N,j,Q=T[0],U=T[1];k<E;++k)N=Q,j=U,T=z[k],Q=T[0],U=T[1],j<=r?U>r&&(Q-N)*(r-j)>(U-j)*(t-N)&&++L:U<=r&&(Q-N)*(r-j)<(U-j)*(t-N)&&--L;return L}function M(){c=f,h=[],p=[],w=!0}function S(){var L=_(),P=w&&L,O=(h=zl(h)).length;(P||O)&&(l.polygonStart(),P&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),O&&v1(h,s,L,o,l),l.polygonEnd()),c=l,h=p=d=null}function G(){R.point=A,p&&p.push(d=[]),$=!0,v=!1,b=x=NaN}function C(){h&&(A(g,m),y&&v&&f.rejoin(),h.push(f.result())),R.point=D,v&&c.lineEnd()}function A(L,P){var O=i(L,P);if(p&&d.push([L,P]),$)g=L,m=P,y=O,$=!1,O&&(c.lineStart(),c.point(L,P));else if(O&&v)c.point(L,P);else{var z=[b=Math.max(Cs,Math.min(io,b)),x=Math.max(Cs,Math.min(io,x))],k=[L=Math.max(Cs,Math.min(io,L)),P=Math.max(Cs,Math.min(io,P))];i7(z,k,t,e,n,r)?(v||(c.lineStart(),c.point(z[0],z[1])),c.point(k[0],k[1]),O||c.lineEnd(),w=!1):O&&(c.lineStart(),c.point(L,P),w=!1)}b=L,x=P,v=O}return R}}function o7(){var t=0,e=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=Es(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,Rs,ks,jr={sphere:wt,point:wt,lineStart:a7,lineEnd:wt,polygonStart:wt,polygonEnd:wt};function a7(){jr.point=u7,jr.lineEnd=s7}function s7(){jr.point=jr.lineEnd=wt}function u7(t,e){t*=ot,e*=ot,hf=t,Rs=J(e),ks=et(e),jr.point=l7}function l7(t,e){t*=ot,e*=ot;var n=J(e),r=et(e),i=pt(t-hf),o=et(i),a=J(i),s=r*a,u=ks*n-Rs*r*o,l=Rs*n+ks*r*o;ff.add(Xt(kt(s*s+u*u),l)),hf=t,Rs=n,ks=r}function S1(t){return ff=new Tt,Te(t,jr),+ff}var pf=[null,null],c7={type:"LineString",coordinates:pf};function Is(t,e){return pf[0]=t,pf[1]=e,S1(c7)}var A1={Feature:function(t,e){return Ns(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(Ns(n[r].geometry,e))return!0;return!1}},M1={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 P1(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(P1(n[r],e))return!0;return!1},Polygon:function(t,e){return T1(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(T1(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(Ns(n[r],e))return!0;return!1}};function Ns(t,e){return t&&M1.hasOwnProperty(t.type)?M1[t.type](t,e):!1}function D1(t,e){return Is(t,e)===0}function P1(t,e){for(var n,r,i,o=0,a=t.length;o<a;o++){if(r=Is(t[o],e),r===0||o>0&&(i=Is(t[o],t[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<to*i))return!0;n=r}return!1}function T1(t,e){return!!_1(t.map(f7),L1(e))}function f7(t){return t=t.map(L1),t.pop(),t}function L1(t){return[t[0]*ot,t[1]*ot]}function h7(t,e){return(t&&A1.hasOwnProperty(t.type)?A1[t.type]:Ns)(t,e)}function C1(t,e,n){var r=fn(t,e-it,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function E1(t,e,n){var r=fn(t,e-it,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function R1(){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 fn(ps(r/c)*c,n,c).map(d).concat(fn(ps(s/f)*f,a,f).map(g)).concat(fn(ps(e/u)*u,t,u).filter(function(x){return pt(x%c)>it}).map(h)).concat(fn(ps(o/l)*l,i,l).filter(function(x){return pt(x%f)>it}).map(p))}return y.lines=function(){return b().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=C1(o,i,90),p=E1(e,t,m),d=C1(s,a,90),g=E1(r,n,m),y):m},y.extentMajor([[-180,-90+it],[180,90-it]]).extentMinor([[-180,-80-it],[180,80+it]])}function p7(){return R1()()}function d7(t,e){var n=t[0]*ot,r=t[1]*ot,i=e[0]*ot,o=e[1]*ot,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 b=J(y*=d)/g,x=J(d-y)/g,v=x*c+b*h,$=x*f+b*p,w=x*s+b*l;return[Xt($,v)*bt,Xt(w,kt(v*v+$*$))*bt]}:function(){return[n*bt,r*bt]};return m.distance=d,m}const oo=t=>t;var df=new Tt,gf=new Tt,k1,I1,mf,yf,en={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){en.lineStart=g7,en.lineEnd=y7},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 g7(){en.point=m7}function m7(t,e){en.point=N1,k1=mf=t,I1=yf=e}function N1(t,e){gf.add(yf*t-mf*e),mf=t,yf=e}function y7(){N1(k1,I1)}var qr=1/0,Fs=qr,ao=-qr,Gs=ao,zs={point:b7,lineStart:wt,lineEnd:wt,polygonStart:wt,polygonEnd:wt,result:function(){var t=[[qr,Fs],[ao,Gs]];return ao=Gs=-(Fs=qr=1/0),t}};function b7(t,e){t<qr&&(qr=t),t>ao&&(ao=t),e<Fs&&(Fs=e),e>Gs&&(Gs=e)}var bf=0,vf=0,so=0,Os=0,Us=0,Xr=0,xf=0,_f=0,uo=0,F1,G1,Oe,Ue,me={point:Jn,lineStart:z1,lineEnd:O1,polygonStart:function(){me.lineStart=_7,me.lineEnd=w7},polygonEnd:function(){me.point=Jn,me.lineStart=z1,me.lineEnd=O1},result:function(){var t=uo?[xf/uo,_f/uo]:Xr?[Os/Xr,Us/Xr]:so?[bf/so,vf/so]:[NaN,NaN];return bf=vf=so=Os=Us=Xr=xf=_f=uo=0,t}};function Jn(t,e){bf+=t,vf+=e,++so}function z1(){me.point=v7}function v7(t,e){me.point=x7,Jn(Oe=t,Ue=e)}function x7(t,e){var n=t-Oe,r=e-Ue,i=kt(n*n+r*r);Os+=i*(Oe+t)/2,Us+=i*(Ue+e)/2,Xr+=i,Jn(Oe=t,Ue=e)}function O1(){me.point=Jn}function _7(){me.point=$7}function w7(){U1(F1,G1)}function $7(t,e){me.point=U1,Jn(F1=Oe=t,G1=Ue=e)}function U1(t,e){var n=t-Oe,r=e-Ue,i=kt(n*n+r*r);Os+=i*(Oe+t)/2,Us+=i*(Ue+e)/2,Xr+=i,i=Ue*t-Oe*e,xf+=i*(Oe+t),_f+=i*(Ue+e),uo+=i*3,Jn(Oe=t,Ue=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,qt);break}}},result:wt};var wf=new Tt,$f,Y1,W1,lo,co,fo={point:wt,lineStart:function(){fo.point=S7},lineEnd:function(){$f&&H1(Y1,W1),fo.point=wt},polygonStart:function(){$f=!0},polygonEnd:function(){$f=null},result:function(){var t=+wf;return wf=new Tt,t}};function S7(t,e){fo.point=H1,Y1=lo=t,W1=co=e}function H1(t,e){lo-=t,co-=e,wf.add(kt(lo*lo+co*co)),lo=t,co=e}let V1,Bs,j1,q1;class X1{constructor(e){this._append=e==null?Z1:A7(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!==Bs){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,Bs=this._append,q1=this._,this._=i}this._+=q1;break}}}result(){const e=this._;return this._="",e.length?e:null}}function Z1(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function A7(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return Z1;if(e!==V1){const n=10**e;V1=e,Bs=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 Bs}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)),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(fo)),fo.result()},a.bounds=function(s){return Te(s,i(zs)),zs.result()},a.centroid=function(s){return Te(s,i(me)),me.result()},a.projection=function(s){return arguments.length?(i=s==null?(t=null,oo):(t=s).stream,a):t},a.context=function(s){return arguments.length?(o=s==null?(e=null,new X1(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 X1(n)),a},a.projection(t).digits(n).context(e)}function D7(t){return{stream:ho(t)}}function ho(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(zs)),e(zs.result()),r!=null&&t.clipExtent(r),t}function Ys(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 Ys(t,[[0,0],e],n)}function Df(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 Pf(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 K1=16,P7=et(30*ot);function Q1(t,e){return+e?L7(t,e):T7(t)}function T7(t){return ho({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function L7(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,x=y*y+b*b;if(x>4*e&&g--){var v=a+h,$=s+p,w=u+d,R=kt(v*v+$*$+w*w),D=Zt(w/=R),_=pt(pt(w)-1)<it||pt(o-f)<it?(o+f)/2:Xt($,v),M=t(_,D),S=M[0],G=M[1],C=S-r,A=G-i,L=b*C-y*A;(L*L/x>e||pt((y*C+b*A)/x-.5)>.3||a*h+s*p+u*d<P7)&&(n(r,i,o,a,s,u,S,G,_,v/=R,$/=R,w,g,m),m.point(S,G),n(S,G,_,v,$,w,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:v,polygonStart:function(){r.polygonStart(),m.lineStart=$},polygonEnd:function(){r.polygonEnd(),m.lineStart=b}};function y(D,_){D=t(D,_),r.point(D[0],D[1])}function b(){f=NaN,m.point=x,r.lineStart()}function x(D,_){var M=Kn([D,_]),S=t(D,_);n(f,h,c,p,d,g,f=S[0],h=S[1],c=D,p=M[0],d=M[1],g=M[2],K1,r),r.point(f,h)}function v(){m.point=y,r.lineEnd()}function $(){b(),m.point=w,m.lineEnd=R}function w(D,_){x(i=D,_),o=f,a=h,s=p,u=d,l=g,m.point=x}function R(){n(f,h,c,p,d,g,o,a,i,s,u,l,K1,r),m.lineEnd=v,v()}return m}}var C7=ho({point:function(t,e){this.stream.point(t*ot,e*ot)}});function E7(t){return ho({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function R7(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 J1(t,e,n,r,i,o){if(!o)return R7(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 Be(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,b,x,v=oo,$=.5,w,R,D,_,M;function S(L){return D(L[0]*ot,L[1]*ot)}function G(L){return L=D.invert(L[0],L[1]),L&&[L[0]*bt,L[1]*bt]}S.stream=function(L){return _&&M===L?_:_=C7(E7(c)(g(w(v(M=L)))))},S.preclip=function(L){return arguments.length?(g=L,d=void 0,A()):g},S.postclip=function(L){return arguments.length?(v=L,m=y=b=x=null,A()):v},S.clipAngle=function(L){return arguments.length?(g=+L?$1(d=L*ot):(d=null,cf),A()):d*bt},S.clipExtent=function(L){return arguments.length?(v=L==null?(m=y=b=x=null,oo):Es(m=+L[0][0],y=+L[0][1],b=+L[1][0],x=+L[1][1]),A()):m==null?null:[[m,y],[b,x]]},S.scale=function(L){return arguments.length?(n=+L,C()):n},S.translate=function(L){return arguments.length?(r=+L[0],i=+L[1],C()):[r,i]},S.center=function(L){return arguments.length?(o=L[0]%360*ot,a=L[1]%360*ot,C()):[o*bt,a*bt]},S.rotate=function(L){return arguments.length?(s=L[0]%360*ot,u=L[1]%360*ot,l=L.length>2?L[2]%360*ot:0,C()):[s*bt,u*bt,l*bt]},S.angle=function(L){return arguments.length?(f=L%360*ot,C()):f*bt},S.reflectX=function(L){return arguments.length?(h=L?-1:1,C()):h<0},S.reflectY=function(L){return arguments.length?(p=L?-1:1,C()):p<0},S.precision=function(L){return arguments.length?(w=Q1(R,$=L*L),A()):kt($)},S.fitExtent=function(L,P){return Ys(S,L,P)},S.fitSize=function(L,P){return Mf(S,L,P)},S.fitWidth=function(L,P){return Df(S,L,P)},S.fitHeight=function(L,P){return Pf(S,L,P)};function C(){var L=J1(n,0,0,h,p,f).apply(null,e(o,a)),P=J1(n,r-L[0],i-L[1],h,p,f);return c=uf(s,u,l),R=af(e,P),D=af(c,R),w=Q1(R,$),A()}function A(){return _=M=null,S}return function(){return e=t.apply(this,arguments),S.invert=e.invert&&G,C()}}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]*ot,n=o[1]*ot):[e*bt,n*bt]},i}function k7(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 ty(t,e){var n=J(t),r=(n+J(e))/2;if(pt(r)<it)return k7(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=Xt(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 Ws(){return Lf(ty).scale(155.424).center([0,33.6442])}function ey(){return Ws().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function I7(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 N7(){var t,e,n=ey(),r,i=Ws().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=Ws().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=I7([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 Ys(c,h,p)},c.fitSize=function(h,p){return Mf(c,h,p)},c.fitWidth=function(h,p){return Df(c,h,p)},c.fitHeight=function(h,p){return Pf(c,h,p)};function f(){return t=e=null,c}return c.scale(1070)}function ny(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 po(t){return function(e,n){var r=kt(e*e+n*n),i=t(r),o=J(i),a=et(i);return[Xt(e*o,r*a),Zt(r&&n*o/r)]}}var Cf=ny(function(t){return kt(2/(1+t))});Cf.invert=po(function(t){return 2*Zt(t/2)});function F7(){return Be(Cf).scale(124.75).clipAngle(180-.001)}var Ef=ny(function(t){return(t=Vm(t))&&t/J(t)});Ef.invert=po(function(t){return t});function G7(){return Be(Ef).scale(79.4188).clipAngle(180-.001)}function go(t,e){return[t,ds(qc((At+e)/2))]}go.invert=function(t,e){return[t,2*Yr(Hm(e))-At]};function z7(){return ry(go).scale(961/qt)}function ry(t){var e=Be(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(g1(e.rotate()).invert([0,0]));return o(a==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:t===go?[[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 Hs(t){return qc((At+t)/2)}function iy(t,e){var n=et(t),r=t===e?J(t):ds(n/et(e))/ds(Hs(e)/Hs(t)),i=n*jc(Hs(t),r)/r;if(!r)return go;function o(a,s){i>0?s<-At+it&&(s=-At+it):s>At-it&&(s=At-it);var u=i/jc(Hs(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=Xt(a,pt(u))*ge(u);return u*r<0&&(c-=ft*ge(a)*ge(u)),[c/r,2*Yr(jc(i/l,1/r))-At]},o}function O7(){return Lf(iy).scale(109.5).parallels([30,30])}function mo(t,e){return[t,e]}mo.invert=mo;function U7(){return Be(mo).scale(152.63)}function oy(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 mo;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=Xt(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 B7(){return Lf(oy).scale(131.154).center([0,13.9389])}var yo=1.340264,bo=-.081106,vo=893e-6,xo=.003796,Vs=kt(3)/2,Y7=12;function Rf(t,e){var n=Zt(Vs*J(e)),r=n*n,i=r*r*r;return[t*et(n)/(Vs*(yo+3*bo*r+i*(7*vo+9*xo*r))),n*(yo+bo*r+i*(vo+xo*r))]}Rf.invert=function(t,e){for(var n=e,r=n*n,i=r*r*r,o=0,a,s,u;o<Y7&&(s=n*(yo+bo*r+i*(vo+xo*r))-e,u=yo+3*bo*r+i*(7*vo+9*xo*r),n-=a=s/u,r=n*n,i=r*r*r,!(pt(a)<to));++o);return[Vs*t*(yo+3*bo*r+i*(7*vo+9*xo*r))/et(n),Zt(J(n)/Vs)]};function W7(){return Be(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=po(Yr);function H7(){return Be(kf).scale(144.049).clipAngle(60)}function V7(){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=ho({point:function(v,$){var w=x([v,$]);this.stream.point(w[0],w[1])}}),g=oo,m,y;function b(){return h=t*r,p=t*i,m=y=null,x}function x(v){var $=v[0]*h,w=v[1]*p;if(o){var R=w*a-$*s;$=$*a+w*s,w=R}return[$+e,w+n]}return x.invert=function(v){var $=v[0]-e,w=v[1]-n;if(o){var R=w*a+$*s;$=$*a-w*s,w=R}return[$/h,w/p]},x.stream=function(v){return m&&y===v?m:m=d(g(y=v))},x.postclip=function(v){return arguments.length?(g=v,u=l=c=f=null,b()):g},x.clipExtent=function(v){return arguments.length?(g=v==null?(u=l=c=f=null,oo):Es(u=+v[0][0],l=+v[0][1],c=+v[1][0],f=+v[1][1]),b()):u==null?null:[[u,l],[c,f]]},x.scale=function(v){return arguments.length?(t=+v,b()):t},x.translate=function(v){return arguments.length?(e=+v[0],n=+v[1],b()):[e,n]},x.angle=function(v){return arguments.length?(o=v%360*ot,s=J(o),a=et(o),b()):o*bt},x.reflectX=function(v){return arguments.length?(r=v?-1:1,b()):r<0},x.reflectY=function(v){return arguments.length?(i=v?-1:1,b()):i<0},x.fitExtent=function(v,$){return Ys(x,v,$)},x.fitSize=function(v,$){return Mf(x,v,$)},x.fitWidth=function(v,$){return Df(x,v,$)},x.fitHeight=function(v,$){return Pf(x,v,$)},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)>it&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function j7(){return Be(If).scale(175.295)}function Nf(t,e){return[et(e)*J(t),J(e)]}Nf.invert=po(Zt);function q7(){return Be(Nf).scale(249.5).clipAngle(90+it)}function Ff(t,e){var n=et(e),r=1+et(t)*n;return[n*J(t)/r,J(e)/r]}Ff.invert=po(function(t){return 2*Yr(t)});function X7(){return Be(Ff).scale(250).clipAngle(142)}function Gf(t,e){return[ds(qc((At+e)/2)),-t]}Gf.invert=function(t,e){return[-e,2*Yr(Hm(t))-At]};function Z7(){var t=ry(Gf),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 K7(t,e){return t.parent===e.parent?1:2}function Q7(t){return t.reduce(J7,0)/t.length}function J7(t,e){return t+e.x}function tT(t){return 1+t.reduce(eT,0)}function eT(t,e){return Math.max(t,e.y)}function nT(t){for(var e;e=t.children;)t=e[0];return t}function rT(t){for(var e;e=t.children;)t=e[e.length-1];return t}function iT(){var t=K7,e=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(h){var p=h.children;p?(h.x=Q7(p),h.y=tT(p)):(h.x=a?s+=t(h,a):0,h.y=0,a=h)});var u=nT(o),l=rT(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 oT(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 aT(){return this.eachAfter(oT)}function sT(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function uT(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 lT(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 cT(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function fT(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 hT(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function pT(t){for(var e=this,n=dT(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 dT(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 gT(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function mT(){return Array.from(this)}function yT(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function bT(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*vT(){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 js(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=wT)):e===void 0&&(e=_T);for(var n=new tr(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 tr(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(ay)}function xT(){return js(this).eachBefore($T)}function _T(t){return t.children}function wT(t){return Array.isArray(t)?t[1]:null}function $T(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function ay(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function tr(t){this.data=t,this.depth=this.height=0,this.parent=null}tr.prototype=js.prototype={constructor:tr,count:aT,each:sT,eachAfter:lT,eachBefore:uT,find:cT,sum:fT,sort:hT,path:pT,ancestors:gT,descendants:mT,leaves:yT,links:bT,copy:xT,[Symbol.iterator]:vT};function qs(t){return t==null?null:sy(t)}function sy(t){if(typeof t!="function")throw new Error;return t}function er(){return 0}function Zr(t){return function(){return t}}const ST=1664525,AT=1013904223,uy=4294967296;function zf(){let t=1;return()=>(t=(ST*t+AT)%uy)/uy}function MT(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function DT(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 PT(t){return ly(t,zf())}function ly(t,e){for(var n=0,r=(t=DT(Array.from(t),e)).length,i=[],o,a;n<r;)o=t[n],a&&cy(a,o)?++n:(a=LT(i=TT(i,o)),n=0);return a}function TT(t,e){var n,r;if(Of(e,t))return[e];for(n=0;n<t.length;++n)if(Xs(e,t[n])&&Of(_o(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(Xs(_o(t[n],t[r]),e)&&Xs(_o(t[n],e),t[r])&&Xs(_o(t[r],e),t[n])&&Of(fy(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function Xs(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 cy(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(!cy(t,e[n]))return!1;return!0}function LT(t){switch(t.length){case 1:return CT(t[0]);case 2:return _o(t[0],t[1]);case 3:return fy(t[0],t[1],t[2])}}function CT(t){return{x:t.x,y:t.y,r:t.r}}function _o(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 fy(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,x=b-a*a-s*s+u*u,v=b-l*l-c*c+f*f,$=p*d-h*g,w=(d*v-g*x)/($*2)-r,R=(g*m-d*y)/$,D=(p*x-h*v)/($*2)-i,_=(h*y-p*m)/$,M=R*R+_*_-1,S=2*(o+w*R+D*_),G=w*w+D*D-o*o,C=-(Math.abs(M)>1e-6?(S+Math.sqrt(S*S-4*M*G))/(2*M):G/S);return{x:r+w+R*C,y:i+D+_*C,r:C}}function hy(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 py(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 dy(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 Zs(t){this._=t,this.next=null,this.previous=null}function gy(t,e){if(!(o=(t=MT(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;hy(r,n,i=t[2]),n=new Zs(n),r=new Zs(r),i=new Zs(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){hy(n._,r._,i=t[u]),i=new Zs(i),l=r.next,c=n.previous,f=r._.r,h=n._.r;do if(f<=h){if(py(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}f+=l._.r,l=l.next}else{if(py(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=dy(n);(i=i.next)!==r;)(s=dy(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=ly(n,e),u=0;u<o;++u)n=t[u],n.x-=i.x,n.y-=i.y;return i.r}function ET(t){return gy(t,zf()),t}function RT(t){return Math.sqrt(t.value)}function kT(){var t=null,e=1,n=1,r=er;function i(o){const a=zf();return o.x=e/2,o.y=n/2,t?o.eachBefore(my(t)).eachAfter(Uf(r,.5,a)).eachBefore(yy(1)):o.eachBefore(my(RT)).eachAfter(Uf(er,1,a)).eachAfter(Uf(r,o.r/Math.min(e,n),a)).eachBefore(yy(Math.min(e,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(t=qs(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:Zr(+o),i):r},i}function my(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Uf(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=gy(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=u+s}}}function yy(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 by(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 wo(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 IT(){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(by),a}function o(a,s){return function(u){u.children&&wo(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 NT={depth:-1},vy={},Bf={};function FT(t){return t.id}function GT(t){return t.parentId}function zT(){var t=FT,e=GT,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((v,$)=>OT(n(v,$,i))),b=y.map(xy),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(xy(v)),o.push(Bf));a=(v,$)=>y[$],s=(v,$)=>b[$]}for(c=0,u=o.length;c<u;++c)l=o[c],p=o[c]=new tr(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===Bf&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Bf);--y)p.data=null}if(f.parent=NT,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(ay),f.parent=null,u>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=qs(i),r):t},r.parentId=function(i){return arguments.length?(e=qs(i),r):e},r.path=function(i){return arguments.length?(n=qs(i),r):n},r}function OT(t){t=`${t}`;let e=t.length;return Yf(t,e-1)&&!Yf(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function xy(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Yf(t,e););return t.slice(0,e)}function Yf(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function UT(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 BT(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 YT(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 WT(t,e,n){return t.a.parent===e.parent?t.a:n}function Ks(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}Ks.prototype=Object.create(tr.prototype);function HT(t){for(var e=new Ks(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 Ks(o[a],a)),i.parent=n;return(e.parent=new Ks(null,0)).children=[e],e}function VT(){var t=UT,e=1,n=1,r=null;function i(l){var c=HT(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){YT(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,x=g.m,v;d=Hf(d),h=Wf(h),d&&h;)g=Wf(g),p=Hf(p),p.a=l,v=d.z+b-h.z-m+t(d._,h._),v>0&&(BT(WT(d,l,f),l,v),m+=v,y+=v),b+=d.m,m+=h.m,x+=g.m,y+=p.m;d&&!Hf(p)&&(p.t=d,p.m+=b-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 Qs(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 _y=(1+Math.sqrt(5))/2;function wy(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,x,v,$,w;c<h;){p=i-n,d=o-r;do m=s[f++].value;while(!m&&f<h);for(y=b=m,$=Math.max(d/p,p/d)/(g*t),w=m*m*$,v=Math.max(b/w,w/y);f<h;++f){if(m+=l=s[f].value,l<y&&(y=l),l>b&&(b=l),w=m*m*$,x=Math.max(b/w,w/y),x>v){m-=l;break}v=x}a.push(u={value:m,dice:p<d,children:s.slice(c,f)}),u.dice?wo(u,n,r,i,g?r+=d*m/g:o):Qs(u,n,r,g?n+=p*m/g:i,o),g-=m,c=f}return a}const Vf=function t(e){function n(r,i,o,a,s){wy(e,r,i,o,a,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(_y);function $y(){var t=Vf,e=!1,n=1,r=1,i=[0],o=er,a=er,s=er,u=er,l=er;function c(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(f),i=[0],e&&h.eachBefore(by),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=sy(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:Zr(+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:Zr(+h),c):a},c.paddingRight=function(h){return arguments.length?(s=typeof h=="function"?h:Zr(+h),c):s},c.paddingBottom=function(h){return arguments.length?(u=typeof h=="function"?h:Zr(+h),c):u},c.paddingLeft=function(h){return arguments.length?(l=typeof h=="function"?h:Zr(+h),c):l},c}function jT(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 x=l[f],v=p/2+x,$=f+1,w=h-1;$<w;){var R=$+w>>>1;l[R]<v?$=R+1:w=R}v-l[$-1]<l[$]-v&&f+1<$&&--$;var D=l[$]-x,_=p-D;if(m-d>y-g){var M=p?(d*_+m*D)/p:m;c(f,$,D,d,g,M,y),c($,h,_,M,g,m,y)}else{var S=p?(g*_+y*D)/p:y;c(f,$,D,d,g,m,S),c($,h,_,d,S,m,y)}}}function qT(t,e,n,r,i){(t.depth&1?Qs:wo)(t,e,n,r,i)}const XT=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?wo(l,i,o,a,g?o+=(s-o)*l.value/g:s):Qs(l,i,o,g?i+=(a-i)*l.value/g:a,s),g-=l.value}else r._squarify=u=wy(e,r,i,o,a,s),u.ratio=e}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(_y);function ZT(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 KT(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 QT(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function JT(t,e){return t[0]-e[0]||t[1]-e[1]}function Sy(t){const e=t.length,n=[0,1];let r=2,i;for(i=2;i<e;++i){for(;r>1&&QT(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function t9(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(JT),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=Sy(r),a=Sy(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 e9(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 n9(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,r9=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),i9=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),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}(Nt),o9=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}(Nt),Ay=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),a9=function t(e){var n=Ay.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),s9=function t(e){function n(r){return function(){return-Math.log1p(-e())/r}}return n.source=t,n}(Nt),u9=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),l9=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),My=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),qf=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}(Nt),Dy=function t(e){var n=qf.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),Py=function t(e){var n=My.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),c9=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),f9=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),h9=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),p9=function t(e){var n=qf.source(e),r=Py.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),d9=1664525,g9=1013904223,Ty=1/4294967296;function m9(t=Math.random()){let e=(0<=t&&t<1?t/Ty:Math.abs(t))|0;return()=>(e=d9*e+g9|0,Ty*(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 Xf=Symbol("implicit");function Zf(){var t=new Pi,e=[],n=[],r=Xf;function i(o){let a=t.get(o);if(a===void 0){if(r!==Xf)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 Pi;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 Ly(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ly(e())},t}function Qf(){return Ly(Kf.apply(null,arguments).paddingInner(1))}function y9(t){return function(){return t}}function Js(t){return+t}var Cy=[0,1];function te(t){return t}function Jf(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:y9(isNaN(e)?NaN:.5)}function b9(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function v9(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 x9(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=En(t,s,1,r)-1;return o[u](i[u](s))}}function $o(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function tu(){var t=Cy,e=Cy,n=qe,r,i,o,a=te,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==te&&(a=b9(t[0],t[h-1])),s=h>2?x9:v9,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,Js),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=Ya,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 tu()(te,te)}function Ey(t,e,n,r){var i=xa(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=Ym(i,a))&&(r.precision=o),Hc(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Wm(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 Ji(r)}function bn(t){var e=t.domain;return t.ticks=function(n){var r=e();return kn(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Ey(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=In(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 So(){var t=th();return t.copy=function(){return $o(t,So())},ye.apply(t,arguments),bn(t)}function Ry(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,Js),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Ry(t).unknown(e)},t=arguments.length?Array.from(t,Js):[0,1],bn(n)}function ky(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 Iy(t){return Math.log(t)}function Ny(t){return Math.exp(t)}function _9(t){return-Math.log(-t)}function w9(t){return-Math.exp(-t)}function $9(t){return isFinite(t)?+("1e"+t):t<0?0:t}function S9(t){return t===10?$9:t===Math.E?Math.exp:e=>Math.pow(t,e)}function A9(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 Fy(t){return(e,n)=>-t(-e,n)}function eh(t){const e=t(Iy,Ny),n=e.domain;let r=10,i,o;function a(){return i=A9(r),o=S9(r),n()[0]<0?(i=Fy(i),o=Fy(o),t(_9,w9)):t(Iy,Ny),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=kn(l,c,m))}else y=kn(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=Ji(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(ky(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function Gy(){const t=eh(tu()).domain([1,10]);return t.copy=()=>$o(t,Gy()).base(t.base()),ye.apply(t,arguments),t}function zy(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Oy(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nh(t){var e=1,n=t(zy(e),Oy(e));return n.constant=function(r){return arguments.length?t(zy(e=+r),Oy(e)):e},bn(n)}function Uy(){var t=nh(tu());return t.copy=function(){return $o(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 M9(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function D9(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(M9,D9):t(By(n),By(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},bn(e)}function Kr(){var t=rh(tu());return t.copy=function(){return $o(t,Kr()).exponent(t.exponent())},ye.apply(t,arguments),t}function P9(){return Kr.apply(null,arguments).exponent(.5)}function Yy(t){return Math.sign(t)*t*t}function T9(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Wy(){var t=th(),e=[0,1],n=!1,r;function i(o){var a=T9(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(Yy(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,Js)).map(Yy)),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 Wy(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ye.apply(i,arguments),bn(i)}function Hy(){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]=wg(t,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:e[En(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 Hy().domain(t).range(e).unknown(r)},ye.apply(o,arguments)}function Vy(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[En(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 Vy().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[En(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 Pt(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=>Pt(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 Qr=Pt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Qr.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Pt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Qr);const qy=Qr.range,rn=1e3,be=rn*60,on=be*60,an=on*24,ah=an*7,Xy=an*30,sh=an*365,sn=Pt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*rn)},(t,e)=>(e-t)/rn,t=>t.getUTCSeconds()),Zy=sn.range,eu=Pt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*rn)},(t,e)=>{t.setTime(+t+e*be)},(t,e)=>(e-t)/be,t=>t.getMinutes()),L9=eu.range,nu=Pt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*be)},(t,e)=>(e-t)/be,t=>t.getUTCMinutes()),C9=nu.range,ru=Pt(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()),E9=ru.range,iu=Pt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*on)},(t,e)=>(e-t)/on,t=>t.getUTCHours()),R9=iu.range,Jr=Pt(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),k9=Jr.range,Ao=Pt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/an,t=>t.getUTCDate()-1),I9=Ao.range,uh=Pt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/an,t=>Math.floor(t/an)),N9=uh.range;function nr(t){return Pt(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 ti=nr(0),Mo=nr(1),Ky=nr(2),Qy=nr(3),rr=nr(4),Jy=nr(5),tb=nr(6),eb=ti.range,F9=Mo.range,G9=Ky.range,z9=Qy.range,O9=rr.range,U9=Jy.range,B9=tb.range;function ir(t){return Pt(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 ei=ir(0),Do=ir(1),nb=ir(2),rb=ir(3),or=ir(4),ib=ir(5),ob=ir(6),ab=ei.range,Y9=Do.range,W9=nb.range,H9=rb.range,V9=or.range,j9=ib.range,q9=ob.range,ou=Pt(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()),X9=ou.range,au=Pt(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()),Z9=au.range,Ye=Pt(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());Ye.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Pt(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 K9=Ye.range,We=Pt(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:Pt(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 Q9=We.range;function sb(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,Xy],[e,3,3*Xy],[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=ma(([,,m])=>m).right(a,h);if(p===a.length)return t.every(xa(l/sh,c/sh,f));if(p===0)return Qr.every(Math.max(xa(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[ub,lb]=sb(We,au,ei,uh,iu,nu),[cb,fb]=sb(Ye,ou,ti,Jr,ru,eu);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 Po(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function hb(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=To(i),c=Lo(i),f=To(o),h=Lo(o),p=To(a),d=Lo(a),g=To(s),m=Lo(s),y=To(u),b=Lo(u),x={a:O,A:z,b:k,B:E,c:null,d:bb,e:bb,f:_L,g:CL,G:RL,H:bL,I:vL,j:xL,L:vb,m:wL,M:$L,p:T,q:N,Q:Ab,s:Mb,S:SL,u:AL,U:ML,V:DL,w:PL,W:TL,x:null,X:null,y:LL,Y:EL,Z:kL,"%":Sb},v={a:j,A:Q,b:U,B:X,c:null,d:_b,e:_b,f:GL,g:qL,G:ZL,H:IL,I:NL,j:FL,L:wb,m:zL,M:OL,p:B,q,Q:Ab,s:Mb,S:UL,u:BL,U:YL,V:WL,w:HL,W:VL,x:null,X:null,y:jL,Y:XL,Z:KL,"%":Sb},$={a:M,A:S,b:G,B:C,c:A,d:mb,e:mb,f:dL,g:gb,G:db,H:yb,I:yb,j:cL,L:pL,m:lL,M:fL,p:_,q:uL,Q:mL,s:yL,S:hL,u:rL,U:iL,V:oL,w:nL,W:aL,x:L,X:P,y:gb,Y:db,Z:sL,"%":gL};x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),v.x=w(n,v),v.X=w(r,v),v.c=w(e,v);function w(V,rt){return function(ut){var H=[],mt=-1,ht=0,Yt=V.length,ee,st,Dt;for(ut instanceof Date||(ut=new Date(+ut));++mt<Yt;)V.charCodeAt(mt)===37&&(H.push(V.slice(ht,mt)),(st=pb[ee=V.charAt(++mt)])!=null?ee=V.charAt(++mt):st=ee==="e"?" ":"0",(Dt=rt[ee])&&(ee=Dt(ut,st)),H.push(ee),ht=mt+1);return H.push(V.slice(ht,mt)),H.join("")}}function R(V,rt){return function(ut){var H=Po(1900,void 0,1),mt=D(H,V,ut+="",0),ht,Yt;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(Po(H.y,0,1)),Yt=ht.getUTCDay(),ht=Yt>4||Yt===0?Do.ceil(ht):Do(ht),ht=Ao.offset(ht,(H.V-1)*7),H.y=ht.getUTCFullYear(),H.m=ht.getUTCMonth(),H.d=ht.getUTCDate()+(H.w+6)%7):(ht=lh(Po(H.y,0,1)),Yt=ht.getDay(),ht=Yt>4||Yt===0?Mo.ceil(ht):Mo(ht),ht=Jr.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),Yt="Z"in H?ch(Po(H.y,0,1)).getUTCDay():lh(Po(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(Yt+5)%7:H.w+H.U*7-(Yt+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,ch(H)):lh(H)}}function D(V,rt,ut,H){for(var mt=0,ht=rt.length,Yt=ut.length,ee,st;mt<ht;){if(H>=Yt)return-1;if(ee=rt.charCodeAt(mt++),ee===37){if(ee=rt.charAt(mt++),st=$[ee in pb?rt.charAt(mt++):ee],!st||(H=st(V,ut,H))<0)return-1}else if(ee!=ut.charCodeAt(H++))return-1}return H}function _(V,rt,ut){var H=l.exec(rt.slice(ut));return H?(V.p=c.get(H[0].toLowerCase()),ut+H[0].length):-1}function M(V,rt,ut){var H=p.exec(rt.slice(ut));return H?(V.w=d.get(H[0].toLowerCase()),ut+H[0].length):-1}function S(V,rt,ut){var H=f.exec(rt.slice(ut));return H?(V.w=h.get(H[0].toLowerCase()),ut+H[0].length):-1}function G(V,rt,ut){var H=y.exec(rt.slice(ut));return H?(V.m=b.get(H[0].toLowerCase()),ut+H[0].length):-1}function C(V,rt,ut){var H=g.exec(rt.slice(ut));return H?(V.m=m.get(H[0].toLowerCase()),ut+H[0].length):-1}function A(V,rt,ut){return D(V,e,rt,ut)}function L(V,rt,ut){return D(V,n,rt,ut)}function P(V,rt,ut){return D(V,r,rt,ut)}function O(V){return a[V.getDay()]}function z(V){return o[V.getDay()]}function k(V){return u[V.getMonth()]}function E(V){return s[V.getMonth()]}function T(V){return i[+(V.getHours()>=12)]}function N(V){return 1+~~(V.getMonth()/3)}function j(V){return a[V.getUTCDay()]}function Q(V){return o[V.getUTCDay()]}function U(V){return u[V.getUTCMonth()]}function X(V){return s[V.getUTCMonth()]}function B(V){return i[+(V.getUTCHours()>=12)]}function q(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var rt=w(V+="",x);return rt.toString=function(){return V},rt},parse:function(V){var rt=R(V+="",!1);return rt.toString=function(){return V},rt},utcFormat:function(V){var rt=w(V+="",v);return rt.toString=function(){return V},rt},utcParse:function(V){var rt=R(V+="",!0);return rt.toString=function(){return V},rt}}}var pb={"-":"",_:" ",0:"0"},It=/^\s*\d+/,J9=/^%/,tL=/[\\^$*+?|[\]().{}]/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 eL(t){return t.replace(tL,"\\$&")}function To(t){return new RegExp("^(?:"+t.map(eL).join("|")+")","i")}function Lo(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function nL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function rL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function iL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function oL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function aL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function db(t,e,n){var r=It.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function gb(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 sL(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 uL(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 lL(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 mb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function cL(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 yb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.H=+r[0],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],n+r[0].length):-1}function hL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function pL(t,e,n){var r=It.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function dL(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 gL(t,e,n){var r=J9.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mL(t,e,n){var r=It.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function yL(t,e,n){var r=It.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function bb(t,e){return gt(t.getDate(),e,2)}function bL(t,e){return gt(t.getHours(),e,2)}function vL(t,e){return gt(t.getHours()%12||12,e,2)}function xL(t,e){return gt(1+Jr.count(Ye(t),t),e,3)}function vb(t,e){return gt(t.getMilliseconds(),e,3)}function _L(t,e){return vb(t,e)+"000"}function wL(t,e){return gt(t.getMonth()+1,e,2)}function $L(t,e){return gt(t.getMinutes(),e,2)}function SL(t,e){return gt(t.getSeconds(),e,2)}function AL(t){var e=t.getDay();return e===0?7:e}function ML(t,e){return gt(ti.count(Ye(t)-1,t),e,2)}function xb(t){var e=t.getDay();return e>=4||e===0?rr(t):rr.ceil(t)}function DL(t,e){return t=xb(t),gt(rr.count(Ye(t),t)+(Ye(t).getDay()===4),e,2)}function PL(t){return t.getDay()}function TL(t,e){return gt(Mo.count(Ye(t)-1,t),e,2)}function LL(t,e){return gt(t.getFullYear()%100,e,2)}function CL(t,e){return t=xb(t),gt(t.getFullYear()%100,e,2)}function EL(t,e){return gt(t.getFullYear()%1e4,e,4)}function RL(t,e){var n=t.getDay();return t=n>=4||n===0?rr(t):rr.ceil(t),gt(t.getFullYear()%1e4,e,4)}function kL(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gt(e/60|0,"0",2)+gt(e%60,"0",2)}function _b(t,e){return gt(t.getUTCDate(),e,2)}function IL(t,e){return gt(t.getUTCHours(),e,2)}function NL(t,e){return gt(t.getUTCHours()%12||12,e,2)}function FL(t,e){return gt(1+Ao.count(We(t),t),e,3)}function wb(t,e){return gt(t.getUTCMilliseconds(),e,3)}function GL(t,e){return wb(t,e)+"000"}function zL(t,e){return gt(t.getUTCMonth()+1,e,2)}function OL(t,e){return gt(t.getUTCMinutes(),e,2)}function UL(t,e){return gt(t.getUTCSeconds(),e,2)}function BL(t){var e=t.getUTCDay();return e===0?7:e}function YL(t,e){return gt(ei.count(We(t)-1,t),e,2)}function $b(t){var e=t.getUTCDay();return e>=4||e===0?or(t):or.ceil(t)}function WL(t,e){return t=$b(t),gt(or.count(We(t),t)+(We(t).getUTCDay()===4),e,2)}function HL(t){return t.getUTCDay()}function VL(t,e){return gt(Do.count(We(t)-1,t),e,2)}function jL(t,e){return gt(t.getUTCFullYear()%100,e,2)}function qL(t,e){return t=$b(t),gt(t.getUTCFullYear()%100,e,2)}function XL(t,e){return gt(t.getUTCFullYear()%1e4,e,4)}function ZL(t,e){var n=t.getUTCDay();return t=n>=4||n===0?or(t):or.ceil(t),gt(t.getUTCFullYear()%1e4,e,4)}function KL(){return"+0000"}function Sb(){return"%"}function Ab(t){return+t}function Mb(t){return Math.floor(+t/1e3)}var ni,fh,Db,su,hh;Pb({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 Pb(t){return ni=hb(t),fh=ni.format,Db=ni.parse,su=ni.utcFormat,hh=ni.utcParse,ni}var Tb="%Y-%m-%dT%H:%M:%S.%LZ";function QL(t){return t.toISOString()}var JL=Date.prototype.toISOString?QL:su(Tb);const tC=JL;function eC(t){var e=new Date(t);return isNaN(e)?null:e}var nC=+new Date("2000-01-01T00:00:00.000Z")?eC:hh(Tb);const rC=nC;function iC(t){return new Date(t)}function oC(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"),b=l("%b %d"),x=l("%B"),v=l("%Y");function $(w){return(u(w)<w?p:s(w)<w?d:a(w)<w?g:o(w)<w?m:r(w)<w?i(w)<w?y:b:n(w)<w?x:v)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?h(Array.from(w,oC)):h().map(iC)},c.ticks=function(w){var R=h();return t(R[0],R[R.length-1],w??10)},c.tickFormat=function(w,R){return R==null?$:l(R)},c.nice=function(w){var R=h();return(!w||typeof w.range!="function")&&(w=e(R[0],R[R.length-1],w??10)),w?h(ky(R,w)):c},c.copy=function(){return $o(c,ph(t,e,n,r,i,o,a,s,u,l))},c}function aC(){return ye.apply(ph(cb,fb,Ye,ou,ti,Jr,ru,eu,sn,fh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function sC(){return ye.apply(ph(ub,lb,We,au,ei,Ao,iu,nu,sn,su).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function uu(){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(qe),l.rangeRound=c(Ya),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 Lb(){var t=bn(uu()(te));return t.copy=function(){return vn(t,Lb())},nn.apply(t,arguments)}function Cb(){var t=eh(uu()).domain([1,10]);return t.copy=function(){return vn(t,Cb()).base(t.base())},nn.apply(t,arguments)}function Eb(){var t=nh(uu());return t.copy=function(){return vn(t,Eb()).constant(t.constant())},nn.apply(t,arguments)}function dh(){var t=rh(uu());return t.copy=function(){return vn(t,dh()).exponent(t.exponent())},nn.apply(t,arguments)}function uC(){return dh.apply(null,arguments).exponent(.5)}function Rb(){var t=[],e=te;function n(r){if(r!=null&&!isNaN(r=+r))return e((En(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)=>Ci(t,o/r))},n.copy=function(){return Rb(e).domain(t)},nn.apply(n,arguments)}function lu(){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,x;return arguments.length?([y,b,x]=m,l=k0(g,[y,b,x]),p):[l(0),l(.5),l(1)]}}return p.range=d(qe),p.rangeRound=d(Ya),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 kb(){var t=bn(lu()(te));return t.copy=function(){return vn(t,kb())},nn.apply(t,arguments)}function Ib(){var t=eh(lu()).domain([.1,1,10]);return t.copy=function(){return vn(t,Ib()).base(t.base())},nn.apply(t,arguments)}function Nb(){var t=nh(lu());return t.copy=function(){return vn(t,Nb()).constant(t.constant())},nn.apply(t,arguments)}function gh(){var t=rh(lu());return t.copy=function(){return vn(t,gh()).exponent(t.exponent())},nn.apply(t,arguments)}function lC(){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 cC=ct("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),fC=ct("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),hC=ct("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),pC=ct("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),dC=ct("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),gC=ct("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),mC=ct("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),yC=ct("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),bC=ct("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),vC=ct("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),xC=ct("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),vt=t=>v0(t[t.length-1]);var Fb=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(ct);const _C=vt(Fb);var Gb=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(ct);const wC=vt(Gb);var zb=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(ct);const $C=vt(zb);var Ob=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(ct);const SC=vt(Ob);var Ub=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(ct);const AC=vt(Ub);var Bb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(ct);const MC=vt(Bb);var Yb=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(ct);const DC=vt(Yb);var Wb=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(ct);const PC=vt(Wb);var Hb=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(ct);const TC=vt(Hb);var Vb=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(ct);const LC=vt(Vb);var jb=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(ct);const CC=vt(jb);var qb=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(ct);const EC=vt(qb);var Xb=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(ct);const RC=vt(Xb);var Zb=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(ct);const kC=vt(Zb);var Kb=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(ct);const IC=vt(Kb);var Qb=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(ct);const NC=vt(Qb);var Jb=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(ct);const FC=vt(Jb);var tv=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(ct);const GC=vt(tv);var ev=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(ct);const zC=vt(ev);var nv=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(ct);const OC=vt(nv);var rv=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(ct);const UC=vt(rv);var iv=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(ct);const BC=vt(iv);var ov=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(ct);const YC=vt(ov);var av=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(ct);const WC=vt(av);var sv=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(ct);const HC=vt(sv);var uv=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(ct);const VC=vt(uv);var lv=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(ct);const jC=vt(lv);function qC(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 XC=Ha(De(300,.5,0),De(-240,.5,1));var ZC=Ha(De(-100,.75,.35),De(80,1.5,.8)),KC=Ha(De(260,.75,.35),De(80,1.5,.8)),cu=De();function QC(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return cu.h=360*t-100,cu.s=1.5-1.5*e,cu.l=.8-.9*e,cu+""}var fu=Lr(),JC=Math.PI/3,tE=Math.PI*2/3;function eE(t){var e;return t=(.5-t)*Math.PI,fu.r=255*(e=Math.sin(t))*e,fu.g=255*(e=Math.sin(t+JC))*e,fu.b=255*(e=Math.sin(t+tE))*e,fu+""}function nE(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 hu(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const rE=hu(ct("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var iE=hu(ct("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),oE=hu(ct("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),aE=hu(ct("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function lt(t){return function(){return t}}const cv=Math.abs,Ut=Math.atan2,un=Math.cos,sE=Math.max,ri=Math.min,oe=Math.sin,xt=Math.sqrt,Bt=1e-12,xn=Math.PI,pu=xn/2,_n=2*xn;function uE(t){return t>1?0:t<-1?xn:Math.acos(t)}function fv(t){return t>=1?pu:t<=-1?-pu:Math.asin(t)}function Co(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 Xi(e)}function lE(t){return t.innerRadius}function cE(t){return t.outerRadius}function fE(t){return t.startAngle}function hE(t){return t.endAngle}function pE(t){return t&&t.padAngle}function dE(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<Bt))return h=(c*(e-o)-f*(t-i))/h,[t+h*u,e+h*l]}function du(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,b=d-h,x=g-p,v=b*b+x*x,$=i-o,w=h*g-d*p,R=(x<0?-1:1)*xt(sE(0,$*$*v-w*w)),D=(w*x-b*R)/v,_=(-w*b-x*R)/v,M=(w*x+b*R)/v,S=(-w*b+x*R)/v,G=D-m,C=_-y,A=M-m,L=S-y;return G*G+C*C>A*A+L*L&&(D=M,_=S),{cx:D,cy:_,x01:-c,y01:-f,x11:D*(i/$-1),y11:_*(i/$-1)}}function gu(){var t=lE,e=cE,n=lt(0),r=null,i=fE,o=hE,a=pE,s=null,u=Co(l);function l(){var c,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-pu,g=o.apply(this,arguments)-pu,m=cv(g-d),y=g>d;if(s||(s=c=u()),p<h&&(f=p,p=h,h=f),!(p>Bt))s.moveTo(0,0);else if(m>_n-Bt)s.moveTo(p*un(d),p*oe(d)),s.arc(0,0,p,d,g,!y),h>Bt&&(s.moveTo(h*un(g),h*oe(g)),s.arc(0,0,h,g,d,y));else{var b=d,x=g,v=d,$=g,w=m,R=m,D=a.apply(this,arguments)/2,_=D>Bt&&(r?+r.apply(this,arguments):xt(h*h+p*p)),M=ri(cv(p-h)/2,+n.apply(this,arguments)),S=M,G=M,C,A;if(_>Bt){var L=fv(_/h*oe(D)),P=fv(_/p*oe(D));(w-=L*2)>Bt?(L*=y?1:-1,v+=L,$-=L):(w=0,v=$=(d+g)/2),(R-=P*2)>Bt?(P*=y?1:-1,b+=P,x-=P):(R=0,b=x=(d+g)/2)}var O=p*un(b),z=p*oe(b),k=h*un($),E=h*oe($);if(M>Bt){var T=p*un(x),N=p*oe(x),j=h*un(v),Q=h*oe(v),U;if(m<xn)if(U=dE(O,z,j,Q,T,N,k,E)){var X=O-U[0],B=z-U[1],q=T-U[0],V=N-U[1],rt=1/oe(uE((X*q+B*V)/(xt(X*X+B*B)*xt(q*q+V*V)))/2),ut=xt(U[0]*U[0]+U[1]*U[1]);S=ri(M,(h-ut)/(rt-1)),G=ri(M,(p-ut)/(rt+1))}else S=G=0}R>Bt?G>Bt?(C=du(j,Q,O,z,p,G,y),A=du(T,N,k,E,p,G,y),s.moveTo(C.cx+C.x01,C.cy+C.y01),G<M?s.arc(C.cx,C.cy,G,Ut(C.y01,C.x01),Ut(A.y01,A.x01),!y):(s.arc(C.cx,C.cy,G,Ut(C.y01,C.x01),Ut(C.y11,C.x11),!y),s.arc(0,0,p,Ut(C.cy+C.y11,C.cx+C.x11),Ut(A.cy+A.y11,A.cx+A.x11),!y),s.arc(A.cx,A.cy,G,Ut(A.y11,A.x11),Ut(A.y01,A.x01),!y))):(s.moveTo(O,z),s.arc(0,0,p,b,x,!y)):s.moveTo(O,z),!(h>Bt)||!(w>Bt)?s.lineTo(k,E):S>Bt?(C=du(k,E,T,N,h,-S,y),A=du(O,z,j,Q,h,-S,y),s.lineTo(C.cx+C.x01,C.cy+C.y01),S<M?s.arc(C.cx,C.cy,S,Ut(C.y01,C.x01),Ut(A.y01,A.x01),!y):(s.arc(C.cx,C.cy,S,Ut(C.y01,C.x01),Ut(C.y11,C.x11),!y),s.arc(0,0,h,Ut(C.cy+C.y11,C.cx+C.x11),Ut(A.cy+A.y11,A.cx+A.x11),y),s.arc(A.cx,A.cy,S,Ut(A.y11,A.x11),Ut(A.y01,A.x01),!y))):s.arc(0,0,h,$,v,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 gE=Array.prototype.slice;function mu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function hv(t){this._context=t}hv.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 yu(t){return new hv(t)}function mh(t){return t[0]}function yh(t){return t[1]}function bu(t,e){var n=lt(!0),r=null,i=yu,o=null,a=Co(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=mu(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=yu,s=null,u=Co(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=mu(f)).length,m,y=!1,b,x=new Array(g),v=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(x[d],v[d]);s.lineEnd(),s.areaEnd()}y&&(x[h]=+t(m,h,f),v[h]=+e(m,h,f),s.point(r?+r(m,h,f):x[h],n?+n(m,h,f):v[h]))}if(b)return s=null,b+""||null}function c(){return bu().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 mE(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function yE(t){return t}function pv(){var t=yE,e=mE,n=null,r=lt(0),i=lt(_n),o=lt(0);function a(s){var u,l=(s=mu(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,b=Math.min(Math.abs(m)/l,o.apply(this,arguments)),x=b*(m<0?-1:1),v;for(u=0;u<l;++u)(v=d[p[u]=u]=+t(s[u],u,s))>0&&(h+=v);for(e!=null?p.sort(function($,w){return e(d[$],d[w])}):n!=null&&p.sort(function($,w){return n(s[$],s[w])}),u=0,f=h?(m-l*x)/h:0;u<l;++u,g=y)c=p[u],v=d[c],y=g+(v>0?v*f:0)+x,d[c]={data:s[c],index:u,value:v,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 dv=vh(yu);function gv(t){this._curve=t}gv.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 gv(t(n))}return e._curve=t,e}function Eo(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 mv(){return Eo(bu().curve(dv))}function yv(){var t=bh().curve(dv),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 Eo(n())},delete t.lineX0,t.lineEndAngle=function(){return Eo(r())},delete t.lineX1,t.lineInnerRadius=function(){return Eo(i())},delete t.lineY0,t.lineOuterRadius=function(){return Eo(o())},delete t.lineY1,t.curve=function(a){return arguments.length?e(vh(a)):e()._curve},t}function Ro(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}class bv{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 bE{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=Ro(this._x0,this._y0),i=Ro(this._x0,this._y0=(this._y0+n)/2),o=Ro(e,this._y0),a=Ro(e,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=e,this._y0=n}}function vv(t){return new bv(t,!0)}function xv(t){return new bv(t,!1)}function vE(t){return new bE(t)}function xE(t){return t.source}function _E(t){return t.target}function vu(t){let e=xE,n=_E,r=mh,i=yh,o=null,a=null,s=Co(u);function u(){let l;const c=gE.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 wE(){return vu(vv)}function $E(){return vu(xv)}function SE(){const t=vu(vE);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const AE=xt(3),_v={draw(t,e){const n=xt(e+ri(e/28,.75))*.59436,r=n/2,i=r*AE;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},xu={draw(t,e){const n=xt(e/xn);t.moveTo(n,0),t.arc(0,0,n,0,_n)}},wv={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()}},$v=xt(1/3),ME=$v*2,Sv={draw(t,e){const n=xt(e/ME),r=n*$v;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Av={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()}},Mv={draw(t,e){const n=xt(e-ri(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)}},Pv={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()}},DE=.8908130915292852,Tv=oe(xn/10)/oe(7*xn/10),PE=oe(_n/10)*Tv,TE=-un(_n/10)*Tv,Lv={draw(t,e){const n=xt(e*DE),r=PE*n,i=TE*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),Cv={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()}},LE=xt(3),Ev={draw(t,e){const n=xt(e)*.6824,r=n/2,i=n*LE/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),CE=(_h/2+1)*3,Rv={draw(t,e){const n=xt(e/CE),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-ri(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},kv=[xu,wv,Sv,Dv,Lv,Cv,Rv],EE=[xu,Mv,wh,Ev,_v,Pv,Av];function RE(t,e){let n=null,r=Co(i);t=typeof t=="function"?t:lt(t||xu),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 _u(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 wu(t){this._context=t}wu.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:_u(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:_u(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function kE(t){return new wu(t)}function Iv(t){this._context=t}Iv.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:_u(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function IE(t){return new Iv(t)}function Nv(t){this._context=t}Nv.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:_u(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function NE(t){return new Nv(t)}function Fv(t,e){this._basis=new wu(t),this._beta=e}Fv.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 FE=function t(e){function n(r){return e===1?new wu(r):new Fv(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function $u(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:$u(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:$u(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 GE=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:$u(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 zE=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:$u(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 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>Bt){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>Bt){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 UE=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 zv(t,e){this._context=t,this._alpha=e}zv.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 BE=function t(e){function n(r){return e?new zv(r,e):new Sh(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: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 YE=function t(e){function n(r){return e?new Ov(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 WE(t){return new Uv(t)}function Bv(t){return t<0?-1:1}function Yv(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 Wv(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Dh(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 Su(t){this._context=t}Su.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:Dh(this,this._t0,Wv(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,Dh(this,Wv(this,n=Yv(this,t,e)),n);break;default:Dh(this,this._t0,n=Yv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function Hv(t){this._context=new Vv(t)}(Hv.prototype=Object.create(Su.prototype)).point=function(t,e){Su.prototype.point.call(this,e,t)};function Vv(t){this._context=t}Vv.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 HE(t){return new Su(t)}function VE(t){return new Hv(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=qv(t),i=qv(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 qv(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 jE(t){return new jv(t)}function Au(t,e){this._context=t,this._t=e}Au.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 qE(t){return new Au(t,.5)}function XE(t){return new Au(t,0)}function ZE(t){return new Au(t,1)}function ii(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 oi(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function KE(t,e){return t[e]}function QE(t){const e=[];return e.key=t,e}function JE(){var t=lt([]),e=oi,n=ii,r=KE;function i(o){var a=Array.from(t.apply(this,arguments),QE),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=mu(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?oi:typeof o=="function"?o:lt(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(n=o??ii,i):n},i}function tR(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}ii(t,e)}}function eR(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 nR(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}ii(t,e)}}function rR(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,ii(t,e)}}function Xv(t){var e=t.map(iR);return oi(t).sort(function(n,r){return e[n]-e[r]})}function iR(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 Zv(t){var e=t.map(Kv);return oi(t).sort(function(n,r){return e[n]-e[r]})}function Kv(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function oR(t){return Zv(t).reverse()}function aR(t){var e=t.length,n,r,i=t.map(Kv),o=Xv(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 sR(t){return oi(t).reverse()}const Mu=t=>()=>t;function uR(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 Du=new He(1,0,0);Qv.prototype=He.prototype;function Qv(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Du;return t.__zoom}function Ph(t){t.stopImmediatePropagation()}function ko(t){t.preventDefault(),t.stopImmediatePropagation()}function lR(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function cR(){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 Jv(){return this.__zoom||Du}function fR(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function hR(){return navigator.maxTouchPoints||"ontouchstart"in this}function pR(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 tx(){var t=lR,e=cR,n=pR,r=fR,i=hR,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,u=L0,l=Nn("start","zoom","end"),c,f,h,p=500,d=150,g=0,m=10;function y(A){A.property("__zoom",Jv).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",M).filter(i).on("touchstart.zoom",S).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(A,L,P,O){var z=A.selection?A.selection():A;z.property("__zoom",Jv),A!==z?$(A,L,P,O):z.interrupt().each(function(){w(this,arguments).event(O).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},y.scaleBy=function(A,L,P,O){y.scaleTo(A,function(){var z=this.__zoom.k,k=typeof L=="function"?L.apply(this,arguments):L;return z*k},P,O)},y.scaleTo=function(A,L,P,O){y.transform(A,function(){var z=e.apply(this,arguments),k=this.__zoom,E=P==null?v(z):typeof P=="function"?P.apply(this,arguments):P,T=k.invert(E),N=typeof L=="function"?L.apply(this,arguments):L;return n(x(b(k,N),E,T),z,a)},P,O)},y.translateBy=function(A,L,P,O){y.transform(A,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof P=="function"?P.apply(this,arguments):P),e.apply(this,arguments),a)},null,O)},y.translateTo=function(A,L,P,O,z){y.transform(A,function(){var k=e.apply(this,arguments),E=this.__zoom,T=O==null?v(k):typeof O=="function"?O.apply(this,arguments):O;return n(Du.translate(T[0],T[1]).scale(E.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof P=="function"?-P.apply(this,arguments):-P),k,a)},O,z)};function b(A,L){return L=Math.max(o[0],Math.min(o[1],L)),L===A.k?A:new He(L,A.x,A.y)}function x(A,L,P){var O=L[0]-P[0]*A.k,z=L[1]-P[1]*A.k;return O===A.x&&z===A.y?A:new He(A.k,O,z)}function v(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function $(A,L,P,O){A.on("start.zoom",function(){w(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(O).end()}).tween("zoom",function(){var z=this,k=arguments,E=w(z,k).event(O),T=e.apply(z,k),N=P==null?v(T):typeof P=="function"?P.apply(z,k):P,j=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),Q=z.__zoom,U=typeof L=="function"?L.apply(z,k):L,X=u(Q.invert(N).concat(j/Q.k),U.invert(N).concat(j/U.k));return function(B){if(B===1)B=U;else{var q=X(B),V=j/q[2];B=new He(V,N[0]-q[0]*V,N[1]-q[1]*V)}E.zoom(null,B)}})}function w(A,L,P){return!P&&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=Z(this.that).datum();l.call(A,this.that,new uR(A,{sourceEvent:this.sourceEvent,target:y,type:A,transform:this.that.__zoom,dispatch:l}),L)}};function D(A,...L){if(!t.apply(this,arguments))return;var P=w(this,L).event(A),O=this.__zoom,z=Math.max(o[0],Math.min(o[1],O.k*Math.pow(2,r.apply(this,arguments)))),k=ue(A);if(P.wheel)(P.mouse[0][0]!==k[0]||P.mouse[0][1]!==k[1])&&(P.mouse[1]=O.invert(P.mouse[0]=k)),clearTimeout(P.wheel);else{if(O.k===z)return;P.mouse=[k,O.invert(k)],Wn(this),P.start()}ko(A),P.wheel=setTimeout(E,d),P.zoom("mouse",n(x(b(O,z),P.mouse[0],P.mouse[1]),P.extent,a));function E(){P.wheel=null,P.end()}}function _(A,...L){if(h||!t.apply(this,arguments))return;var P=A.currentTarget,O=w(this,L,!0).event(A),z=Z(A.view).on("mousemove.zoom",N,!0).on("mouseup.zoom",j,!0),k=ue(A,P),E=A.clientX,T=A.clientY;La(A.view),Ph(A),O.mouse=[k,this.__zoom.invert(k)],Wn(this),O.start();function N(Q){if(ko(Q),!O.moved){var U=Q.clientX-E,X=Q.clientY-T;O.moved=U*U+X*X>g}O.event(Q).zoom("mouse",n(x(O.that.__zoom,O.mouse[0]=ue(Q,P),O.mouse[1]),O.extent,a))}function j(Q){z.on("mousemove.zoom mouseup.zoom",null),Ca(Q.view,O.moved),ko(Q),O.event(Q).end()}}function M(A,...L){if(t.apply(this,arguments)){var P=this.__zoom,O=ue(A.changedTouches?A.changedTouches[0]:A,this),z=P.invert(O),k=P.k*(A.shiftKey?.5:2),E=n(x(b(P,k),O,z),e.apply(this,L),a);ko(A),s>0?Z(this).transition().duration(s).call($,E,O,A):Z(this).call(y.transform,E,O,A)}}function S(A,...L){if(t.apply(this,arguments)){var P=A.touches,O=P.length,z=w(this,L,A.changedTouches.length===O).event(A),k,E,T,N;for(Ph(A),E=0;E<O;++E)T=P[E],N=ue(T,this),N=[N,this.__zoom.invert(N),T.identifier],z.touch0?!z.touch1&&z.touch0[2]!==N[2]&&(z.touch1=N,z.taps=0):(z.touch0=N,k=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),k&&(z.taps<2&&(f=N[0],c=setTimeout(function(){c=null},p)),Wn(this),z.start())}}function G(A,...L){if(this.__zooming){var P=w(this,L).event(A),O=A.changedTouches,z=O.length,k,E,T,N;for(ko(A),k=0;k<z;++k)E=O[k],T=ue(E,this),P.touch0&&P.touch0[2]===E.identifier?P.touch0[0]=T:P.touch1&&P.touch1[2]===E.identifier&&(P.touch1[0]=T);if(E=P.that.__zoom,P.touch1){var j=P.touch0[0],Q=P.touch0[1],U=P.touch1[0],X=P.touch1[1],B=(B=U[0]-j[0])*B+(B=U[1]-j[1])*B,q=(q=X[0]-Q[0])*q+(q=X[1]-Q[1])*q;E=b(E,Math.sqrt(B/q)),T=[(j[0]+U[0])/2,(j[1]+U[1])/2],N=[(Q[0]+X[0])/2,(Q[1]+X[1])/2]}else if(P.touch0)T=P.touch0[0],N=P.touch0[1];else return;P.zoom("touch",n(x(E,T,N),P.extent,a))}}function C(A,...L){if(this.__zooming){var P=w(this,L).event(A),O=A.changedTouches,z=O.length,k,E;for(Ph(A),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),k=0;k<z;++k)E=O[k],P.touch0&&P.touch0[2]===E.identifier?delete P.touch0:P.touch1&&P.touch1[2]===E.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(E=ue(E,this),Math.hypot(f[0]-E[0],f[1]-E[1])<m)){var T=Z(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return y.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:Mu(+A),y):r},y.filter=function(A){return arguments.length?(t=typeof A=="function"?A:Mu(!!A),y):t},y.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Mu(!!A),y):i},y.extent=function(A){return arguments.length?(e=typeof A=="function"?A:Mu([[+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 Th=Object.freeze(Object.defineProperty({__proto__:null,Adder:Tt,Delaunay:zc,FormatSpecifier:cs,InternMap:Pi,InternSet:Rn,Node:tr,Path:Xi,Voronoi:bm,ZoomTransform:He,active:y4,arc:gu,area:bh,areaRadial:yv,ascending:_t,autoType:UD,axisBottom:Cg,axisLeft:Eg,axisRight:l5,axisTop:u5,bin:xg,bisect:En,bisectCenter:o3,bisectLeft:i3,bisectRight:og,bisector:ma,blob:WD,blur:a3,blur2:ag,blurImage:s3,brush:L4,brushSelection:D4,brushX:P4,brushY:T4,buffer:VD,chord:E4,chordDirected:k4,chordTranspose:R4,cluster:iT,color:pn,contourDensity:aD,contours:kc,count:ba,create:W6,creator:Da,cross:d3,csv:XD,csvFormat:LD,csvFormatBody:CD,csvFormatRow:RD,csvFormatRows:ED,csvFormatValue:kD,csvParse:wm,csvParseRows:TD,cubehelix:De,cumsum:g3,curveBasis:kE,curveBasisClosed:IE,curveBasisOpen:NE,curveBumpX:vv,curveBumpY:xv,curveBundle:FE,curveCardinal:GE,curveCardinalClosed:zE,curveCardinalOpen:OE,curveCatmullRom:UE,curveCatmullRomClosed:BE,curveCatmullRomOpen:YE,curveLinear:yu,curveLinearClosed:WE,curveMonotoneX:HE,curveMonotoneY:VE,curveNatural:jE,curveStep:qE,curveStepAfter:ZE,curveStepBefore:XE,descending:rg,deviation:lg,difference:Z3,disjoint:K3,dispatch:Nn,drag:Wg,dragDisable:La,dragEnable:Ca,dsv:qD,dsvFormat:as,easeBack:Q0,easeBackIn:l4,easeBackInOut:Q0,easeBackOut:c4,easeBounce:Vi,easeBounceIn:s4,easeBounceInOut:u4,easeBounceOut:Vi,easeCircle:K0,easeCircleIn:KM,easeCircleInOut:K0,easeCircleOut:QM,easeCubic:Hi,easeCubicIn:YM,easeCubicInOut:Hi,easeCubicOut:WM,easeElastic:ji,easeElasticIn:f4,easeElasticInOut:h4,easeElasticOut:ji,easeExp:Z0,easeExpIn:XM,easeExpInOut:Z0,easeExpOut:ZM,easeLinear:OM,easePoly:V0,easePolyIn:HM,easePolyInOut:V0,easePolyOut:VM,easeQuad:H0,easeQuadIn:UM,easeQuadInOut:H0,easeQuadOut:BM,easeSin:X0,easeSinIn:jM,easeSinInOut:X0,easeSinOut:qM,every:W3,extent:Di,fcumsum:y3,filter:V3,flatGroup:b3,flatRollup:v3,forceCenter:rP,forceCollide:Dm,forceLink:$P,forceManyBody:Cm,forceRadial:CP,forceSimulation:Lm,forceX:Em,forceY:Rm,get format(){return Ji},formatDefaultLocale:Um,formatLocale:Om,get formatPrefix(){return Hc},formatSpecifier:Br,fsum:m3,geoAlbers:ey,geoAlbersUsa:N7,geoArea:UP,geoAzimuthalEqualArea:F7,geoAzimuthalEqualAreaRaw:Cf,geoAzimuthalEquidistant:G7,geoAzimuthalEquidistantRaw:Ef,geoBounds:HP,geoCentroid:KP,geoCircle:QP,geoClipAntimeridian:cf,geoClipCircle:$1,geoClipExtent:o7,geoClipRectangle:Es,geoConicConformal:O7,geoConicConformalRaw:iy,geoConicEqualArea:Ws,geoConicEqualAreaRaw:ty,geoConicEquidistant:B7,geoConicEquidistantRaw:oy,geoContains:h7,geoDistance:Is,geoEqualEarth:W7,geoEqualEarthRaw:Rf,geoEquirectangular:U7,geoEquirectangularRaw:mo,geoGnomonic:H7,geoGnomonicRaw:kf,geoGraticule:R1,geoGraticule10:p7,geoIdentity:V7,geoInterpolate:d7,geoLength:S1,geoMercator:z7,geoMercatorRaw:go,geoNaturalEarth1:j7,geoNaturalEarth1Raw:If,geoOrthographic:q7,geoOrthographicRaw:Nf,geoPath:M7,geoProjection:Be,geoProjectionMutator:Tf,geoRotation:g1,geoStereographic:X7,geoStereographicRaw:Ff,geoStream:Te,geoTransform:D7,geoTransverseMercator:Z7,geoTransverseMercatorRaw:Gf,gray:c8,greatest:_g,greatestIndex:z3,group:pg,groupSort:w3,groups:dg,hcl:za,hierarchy:js,histogram:xg,hsl:Ia,html:eP,image:KD,index:x3,indexes:_3,interpolate:qe,interpolateArray:m8,interpolateBasis:g0,interpolateBasisClosed:m0,interpolateBlues:BC,interpolateBrBG:_C,interpolateBuGn:LC,interpolateBuPu:CC,interpolateCividis:qC,interpolateCool:KC,interpolateCubehelix:C8,interpolateCubehelixDefault:XC,interpolateCubehelixLong:Ha,interpolateDate:w0,interpolateDiscrete:v8,interpolateGnBu:EC,interpolateGreens:YC,interpolateGreys:WC,interpolateHcl:T8,interpolateHclLong:L8,interpolateHsl:M8,interpolateHslLong:D8,interpolateHue:x8,interpolateInferno:oE,interpolateLab:P8,interpolateMagma:iE,interpolateNumber:de,interpolateNumberArray:oc,interpolateObject:$0,interpolateOrRd:RC,interpolateOranges:jC,interpolatePRGn:wC,interpolatePiYG:$C,interpolatePlasma:aE,interpolatePuBu:IC,interpolatePuBuGn:kC,interpolatePuOr:SC,interpolatePuRd:NC,interpolatePurples:HC,interpolateRainbow:QC,interpolateRdBu:AC,interpolateRdGy:MC,interpolateRdPu:FC,interpolateRdYlBu:DC,interpolateRdYlGn:PC,interpolateReds:VC,interpolateRgb:Gi,interpolateRgbBasis:v0,interpolateRgbBasisClosed:g8,interpolateRound:Ya,interpolateSinebow:eE,interpolateSpectral:TC,interpolateString:uc,interpolateTransformCss:D0,interpolateTransformSvg:P0,interpolateTurbo:nE,interpolateViridis:rE,interpolateWarm:ZC,interpolateYlGn:zC,interpolateYlGnBu:GC,interpolateYlOrBr:OC,interpolateYlOrRd:UC,interpolateZoom:L0,interrupt:Wn,intersection:Q3,interval:N8,isoFormat:tC,isoParse:rC,json:JD,lab:Ga,lch:f8,least:G3,leastIndex:Sg,line:bu,lineRadial:mv,link:vu,linkHorizontal:wE,linkRadial:SE,linkVertical:$E,local:Bg,map:j3,matcher:Wl,max:Ti,maxIndex:Fl,mean:L3,median:C3,medianIndex:E3,merge:zl,min:_a,minIndex:Gl,mode:k3,namespace:Ri,namespaces:Bl,nice:Il,now:Yi,pack:kT,packEnclose:PT,packSiblings:ET,pairs:I3,partition:IT,path:Rc,pathRound:F4,permute:vg,pie:pv,piecewise:k0,pointRadial:Ro,pointer:ue,pointers:V6,polygonArea:ZT,polygonCentroid:KT,polygonContains:e9,polygonHull:t9,polygonLength:n9,precisionFixed:Bm,precisionPrefix:Ym,precisionRound:Wm,quadtree:us,quantile:Ci,quantileIndex:$g,quantileSorted:wg,quantize:E8,quickselect:wa,radialArea:yv,radialLine:mv,randomBates:a9,randomBernoulli:l9,randomBeta:Dy,randomBinomial:Py,randomCauchy:f9,randomExponential:s9,randomGamma:qf,randomGeometric:My,randomInt:i9,randomIrwinHall:Ay,randomLcg:m9,randomLogNormal:o9,randomLogistic:h9,randomNormal:jf,randomPareto:u9,randomPoisson:p9,randomUniform:r9,randomWeibull:c9,range:fn,rank:F3,reduce:q3,reverse:X3,rgb:Lr,ribbon:H4,ribbonArrow:V4,rollup:mg,rollups:yg,scaleBand:Kf,scaleDiverging:kb,scaleDivergingLog:Ib,scaleDivergingPow:gh,scaleDivergingSqrt:lC,scaleDivergingSymlog:Nb,scaleIdentity:Ry,scaleImplicit:Xf,scaleLinear:So,scaleLog:Gy,scaleOrdinal:Zf,scalePoint:Qf,scalePow:Kr,scaleQuantile:Hy,scaleQuantize:Vy,scaleRadial:Wy,scaleSequential:Lb,scaleSequentialLog:Cb,scaleSequentialPow:dh,scaleSequentialQuantile:Rb,scaleSequentialSqrt:uC,scaleSequentialSymlog:Eb,scaleSqrt:P9,scaleSymlog:Uy,scaleThreshold:jy,scaleTime:aC,scaleUtc:sC,scan:O3,schemeAccent:fC,schemeBlues:iv,schemeBrBG:Fb,schemeBuGn:Vb,schemeBuPu:jb,schemeCategory10:cC,schemeDark2:hC,schemeGnBu:qb,schemeGreens:ov,schemeGreys:av,schemeObservable10:pC,schemeOrRd:Xb,schemeOranges:lv,schemePRGn:Gb,schemePaired:dC,schemePastel1:gC,schemePastel2:mC,schemePiYG:zb,schemePuBu:Kb,schemePuBuGn:Zb,schemePuOr:Ob,schemePuRd:Qb,schemePurples:sv,schemeRdBu:Ub,schemeRdGy:Bb,schemeRdPu:Jb,schemeRdYlBu:Yb,schemeRdYlGn:Wb,schemeReds:uv,schemeSet1:yC,schemeSet2:bC,schemeSet3:vC,schemeSpectral:Hb,schemeTableau10:xC,schemeYlGn:ev,schemeYlGnBu:tv,schemeYlOrBr:nv,schemeYlOrRd:rv,select:Z,selectAll:j6,selection:Gn,selector:Pa,selectorAll:Yl,shuffle:U3,shuffler:Ag,some:H3,sort:El,stack:JE,stackOffsetDiverging:eR,stackOffsetExpand:tR,stackOffsetNone:ii,stackOffsetSilhouette:nR,stackOffsetWiggle:rR,stackOrderAppearance:Xv,stackOrderAscending:Zv,stackOrderDescending:oR,stackOrderInsideOut:aR,stackOrderNone:oi,stackOrderReverse:sR,stratify:zT,style:Fn,subset:t5,sum:Mg,superset:Pg,svg:nP,symbol:RE,symbolAsterisk:_v,symbolCircle:xu,symbolCross:wv,symbolDiamond:Sv,symbolDiamond2:Av,symbolPlus:Mv,symbolSquare:Dv,symbolSquare2:Pv,symbolStar:Lv,symbolTimes:wh,symbolTriangle:Cv,symbolTriangle2:Ev,symbolWye:Rv,symbolX:wh,symbols:kv,symbolsFill:kv,symbolsStroke:EE,text:ss,thresholdFreedmanDiaconis:P3,thresholdScott:T3,thresholdSturges:Nl,tickFormat:Ey,tickIncrement:In,tickStep:xa,ticks:kn,timeDay:Jr,timeDays:k9,get timeFormat(){return fh},timeFormatDefaultLocale:Pb,timeFormatLocale:hb,timeFriday:Jy,timeFridays:U9,timeHour:ru,timeHours:E9,timeInterval:Pt,timeMillisecond:Qr,timeMilliseconds:qy,timeMinute:eu,timeMinutes:L9,timeMonday:Mo,timeMondays:F9,timeMonth:ou,timeMonths:X9,get timeParse(){return Db},timeSaturday:tb,timeSaturdays:B9,timeSecond:sn,timeSeconds:Zy,timeSunday:ti,timeSundays:eb,timeThursday:rr,timeThursdays:O9,timeTickInterval:fb,timeTicks:cb,timeTuesday:Ky,timeTuesdays:G9,timeWednesday:Qy,timeWednesdays:z9,timeWeek:ti,timeWeeks:eb,timeYear:Ye,timeYears:K9,timeout:fc,timer:Xa,timerFlush:F0,transition:Y0,transpose:Dg,tree:VT,treemap:$y,treemapBinary:jT,treemapDice:wo,treemapResquarify:XT,treemapSlice:Qs,treemapSliceDice:qT,treemapSquarify:Vf,tsv:ZD,tsvFormat:ND,tsvFormatBody:FD,tsvFormatRow:zD,tsvFormatRows:GD,tsvFormatValue:OD,tsvParse:$m,tsvParseRows:ID,union:e5,unixDay:uh,unixDays:N9,utcDay:Ao,utcDays:I9,get utcFormat(){return su},utcFriday:ib,utcFridays:j9,utcHour:iu,utcHours:R9,utcMillisecond:Qr,utcMilliseconds:qy,utcMinute:nu,utcMinutes:C9,utcMonday:Do,utcMondays:Y9,utcMonth:au,utcMonths:Z9,get utcParse(){return hh},utcSaturday:ob,utcSaturdays:q9,utcSecond:sn,utcSeconds:Zy,utcSunday:ei,utcSundays:ab,utcThursday:or,utcThursdays:V9,utcTickInterval:lb,utcTicks:ub,utcTuesday:nb,utcTuesdays:W9,utcWednesday:rb,utcWednesdays:H9,utcWeek:ei,utcWeeks:ab,utcYear:We,utcYears:Q9,variance:ug,window:Hl,xml:tP,zip:Y3,zoom:tx,zoomIdentity:Du,zoomTransform:Qv},Symbol.toStringTag,{value:"Module"}));function ex(t){try{return t.node().getBBox()}catch(e){throw new Error(e)}}function dR(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 Io(t){return t.substring(0,4)!=="ease"?Hi:Th[t]??Hi}function Pu({axisWidth:t,innerRadius:e,outerRadius:n,padAngle:r,cornerRadius:i}){const o=So().domain([0,1]).range([0,t/2]),a=o(n);return gu().innerRadius(o(e)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const Lh=(t,e)=>e instanceof Function?e(t):Ji(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 gR(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 mR(t){const e=t.filter(n=>n.value!=null&&n.visible!=!1).map(n=>n.value);return gR(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 Tu({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 at(t,e,n){const r=n?`--${n}`:"";return`orbcharts-${t}__${e}${r}`}function $n(t,e){const r=Math.random().toString(36).substr(2,5);return at(t,e,r)}function Ch(t,e){let n=new dt(()=>{});return t.each(function(){const r=Ku(this,e);n=Qu(n,r)}),n}const ar=({selection:t,pluginName:e,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=at(e,"series"),u=at(e,"axes"),l=at(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,b,x)=>{Z(x[b]).selectAll(`g.${u}`).data([b]).join(v=>v.append("g").classed(u,!0).attr("clip-path",`url(#${n})`).each(($,w,R)=>{Z(R[w]).selectAll("defs").data([w]).join("defs"),Z(R[w]).selectAll("g").data([w]).join("g").classed(l,!0)}),v=>v,v=>v.remove())}),m=>m,m=>m.remove())),St(1));Y({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,x=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${x[0]}, ${x[1]})`})});const f=Y({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=Y({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=Y({fullDataFormatter:t,gridAxesSize:e,computedData:n}).pipe(W(async h=>h),F(h=>{const d=h.computedData[0]?h.computedData[0].length-1:0,g=h.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[0]-h.fullDataFormatter.grid.groupAxis.scalePadding,m=h.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?d+h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[1]+h.fullDataFormatter.grid.groupAxis.scalePadding;return[g,m]}),St(1)),u=Y({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=Y({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=>{Y({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=tg({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 x={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},v=m(x),$=g(v),w=Math.ceil(p.groupScaleDomain[0]),R=$+w;return{groupIndex:R,groupLabel:p.scaleRangeGroupLabels[R]??""}};return h.next(y),function(){a.next(void 0)}})})},yR=({rootSelection:t,fullDataFormatter$:e,gridAxesSize$:n,computedData$:r,fullChartParams$:i,gridContainerPosition$:o,layout$:a})=>{const s=Ch(t,"mousemove"),u=Y({fullDataFormatter:e,gridAxesSize:n,computedData:r}).pipe(W(async b=>b),F(b=>{const v=b.computedData[0]?b.computedData[0].length-1:0,$=b.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-b.fullDataFormatter.grid.groupAxis.scalePadding:b.fullDataFormatter.grid.groupAxis.scaleDomain[0]-b.fullDataFormatter.grid.groupAxis.scalePadding,w=b.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?v+b.fullDataFormatter.grid.groupAxis.scalePadding:b.fullDataFormatter.grid.groupAxis.scaleDomain[1]+b.fullDataFormatter.grid.groupAxis.scalePadding;return[$,w]}),St(1)),l=Y({fullDataFormatter:e,computedData:r}).pipe(W(async b=>b),F(b=>b.fullDataFormatter.grid.seriesDirection==="row"?(b.computedData[0]??[]).map(x=>x.groupLabel):b.computedData.map(x=>x[0].groupLabel))),c=Y({groupScaleDomain:u,groupLabels:l}).pipe(W(async b=>b),F(b=>b.groupLabels.filter((x,v)=>v>=b.groupScaleDomain[0]&&v<=b.groupScaleDomain[1]))),f=e.pipe(F(b=>b.grid.valueAxis.position==="right"||b.grid.valueAxis.position==="bottom")),h=Y({reverse:f,gridAxesSize:n,scaleRangeGroupLabels:c,fullDataFormatter:e}).pipe(W(async b=>b),F(b=>tg({axisLabels:b.scaleRangeGroupLabels,axisWidth:b.gridAxesSize.width,padding:b.fullDataFormatter.grid.groupAxis.scalePadding,reverse:b.reverse}))),p=o.pipe(F(b=>b.reduce((v,$)=>$.columnIndex>v?$.columnIndex:v,0)+1),tt()),d=o.pipe(F(b=>b.reduce((v,$)=>$.rowIndex>v?$.rowIndex:v,0)+1),tt()),g=Y({fullDataFormatter:e,fullChartParams:i,rootMousemove:s,columnAmount:p,rowAmount:d,layout:a}).pipe(W(async b=>b),F(b=>{const x={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"?x.offsetX-b.fullChartParams.padding.left:x.offsetY-b.fullChartParams.padding.top})),m=Y({xIndexScale:h,axisValue:g,groupScaleDomain:u}).pipe(W(async b=>b),F(b=>{const x=b.xIndexScale(b.axisValue),v=Math.ceil(b.groupScaleDomain[0]);return x+v})),y=Y({groupIndex:m,groupLabels:l}).pipe(W(async b=>b),F(b=>b.groupLabels[b.groupIndex]??""));return Y({groupIndex:m,groupLabel:y}).pipe(W(async b=>b),F(b=>({groupIndex:b.groupIndex,groupLabel:b.groupLabel})))};function bR(t="curveLinear"){return bu().x(e=>e.axisX).y(e=>e.axisY).curve(Th[t])}function vR(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 xR({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?Z(o[i]).style("opacity",1):Z(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function wR({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)=>{Z(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(Io(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$:b,event$:x})=>{const v=new nt,$=$n(t,"clipPath-box"),w=at(t,"path"),{seriesSelection$:R,axesSelection$:D,defsSelection$:_,graphicGSelection$:M}=ar({selection:e,pluginName:t,clipPathID:$,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),S=new dt(z=>{const k=l.pipe(I(v)).subscribe(E=>{if(!E)return;const T=bR(E.lineCurve);z.next(T)});return()=>{k.unsubscribe()}}),G=f.pipe(F(z=>z.transitionDuration),tt()),C=f.pipe(F(z=>z.transitionEase),tt());Y({defsSelection:_,seriesLabels:a,axisSize:d,transitionDuration:G,transitionEase:C}).pipe(I(v),W(async z=>z)).subscribe(z=>{const E=[{id:$,width:z.axisSize.width,height:z.axisSize.height}].concat(z.seriesLabels.map(T=>({id:`orbcharts__clipPath_${T}`,width:z.axisSize.width,height:z.axisSize.height})));wR({defsSelection:z.defsSelection,clipPathData:E,transitionDuration:z.transitionDuration,transitionEase:z.transitionEase})});const A=n.pipe(F(z=>{const k=new Map;return z.flat().forEach(E=>k.set(E.id,E)),k})),L=rx({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:y,layout$:b}),P=f.pipe(I(v),F(z=>z.highlightTarget),tt()),O=Y({graphicGSelection:M,visibleComputedLayoutData:o,linePath:S,params:l}).pipe(I(v),W(async z=>z),F(z=>{let k=[];return z.graphicGSelection.each((E,T,N)=>{const j=vR(z.visibleComputedLayoutData[T]??[]);k[T]=xR({selection:Z(N[T]),pathClassName:w,linePath:z.linePath,segmentData:j,params:z.params})}),k}));return Y({pathSelectionArr:O,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:P,gridGroupPositionFn:L}).pipe(I(v),W(async z=>z)).subscribe(z=>{z.pathSelectionArr.forEach(k=>{k.on("mouseover",(E,T)=>{E.stopPropagation();const N=T[0]?T[0].seriesLabel:"",{groupIndex:j,groupLabel:Q}=z.gridGroupPositionFn(E),B=z.GroupDataMap.get(Q).find(q=>q.seriesLabel===N)??T[0];x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:z.highlightTarget,datum:B,gridIndex:B.gridIndex,series:z.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:z.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:E,data:z.computedData})}).on("mousemove",(E,T)=>{E.stopPropagation();const N=T[0]?T[0].seriesLabel:"",{groupIndex:j,groupLabel:Q}=z.gridGroupPositionFn(E),B=z.GroupDataMap.get(Q).find(q=>q.seriesLabel===N)??T[0];x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:z.highlightTarget,datum:B,gridIndex:B.gridIndex,series:z.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:z.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:E,data:z.computedData})}).on("mouseout",(E,T)=>{E.stopPropagation();const N=T[0]?T[0].seriesLabel:"",{groupIndex:j,groupLabel:Q}=z.gridGroupPositionFn(E),B=z.GroupDataMap.get(Q).find(q=>q.seriesLabel===N)??T[0];x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:z.highlightTarget,datum:B,gridIndex:B.gridIndex,series:z.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:z.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:E,data:z.computedData})}).on("click",(E,T)=>{E.stopPropagation();const N=T[0]?T[0].seriesLabel:"",{groupIndex:j,groupLabel:Q}=z.gridGroupPositionFn(E),B=z.GroupDataMap.get(Q).find(q=>q.seriesLabel===N)??T[0];x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:z.highlightTarget,datum:B,gridIndex:B.gridIndex,series:z.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:z.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:E,data:z.computedData})})})}),f.pipe(I(v),li(z=>z.highlightTarget==="series"),W(z=>Y({graphicGSelection:M,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(v),W(async k=>k)))).subscribe(z=>{const k=z.gridHighlight[0]?z.gridHighlight[0].seriesLabel:null;_R({selection:z.graphicGSelection,seriesLabel:k,fullChartParams:z.fullChartParams})}),()=>{v.next(void 0)}},ox="Lines",$R=se(ox,ur)(({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 SR(t="curveLinear",e){return bh().x(n=>n.axisX).y0(n=>e).y1(n=>n.axisY).curve(Th[t])}function AR(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 MR({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 DR({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?Z(o[i]).style("opacity",1):Z(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function PR({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`
|
9
|
+
`)}function l(f){return f.map(c).join(t)}function c(f){return f==null?"":f instanceof Date?DP(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,TP=Zn.parseRows,LP=Zn.format,CP=Zn.formatBody,EP=Zn.formatRows,RP=Zn.formatRow,kP=Zn.formatValue,Kn=ls(" "),wm=Kn.parse,IP=Kn.parseRows,NP=Kn.format,FP=Kn.formatBody,GP=Kn.formatRows,zP=Kn.formatRow,OP=Kn.formatValue;function YP(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})?)?$/))UP&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;t[e]=n}return t}const UP=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function BP(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function WP(t,e){return fetch(t,e).then(BP)}function HP(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}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.text()}function cs(t,e){return fetch(t,e).then(qP)}function $m(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 jP(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 VP=$m(_m),ZP=$m(wm);function KP(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 QP(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(!(t.status===204||t.status===205))return t.json()}function JP(t,e){return fetch(t,e).then(QP)}function Bc(t){return(e,n)=>cs(e,n).then(r=>new DOMParser().parseFromString(r,t))}const tD=Bc("application/xml");var eD=Bc("text/html"),nD=Bc("image/svg+xml");function rD(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 iD(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Sm(this.cover(e,n),e,n,t)}function Sm(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 oD(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)Sm(this,a[n],s[n],t[n]);return this}function aD(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 sD(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function uD(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 lD(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),x=e-+this._y.call(null,p.data),v=b*b+x*x;if(v<n){var S=Math.sqrt(n=v);i=t-S,o=e-S,c=t+S,f=e+S,r=p.data}}return r}function cD(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 fD(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function hD(){return this._root}function pD(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function dD(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 gD(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 mD(t){return t[0]}function yD(t){return arguments.length?(this._x=t,this):this._x}function bD(t){return t[1]}function vD(t){return arguments.length?(this._y=t,this):this._y}function fs(t,e,n){var r=new Wc(e??mD,n??bD,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 Am(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=Am(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]=Am(r));return t},qt.add=iD,qt.addAll=oD,qt.cover=aD,qt.data=sD,qt.extent=uD,qt.find=lD,qt.remove=cD,qt.removeAll=fD,qt.root=hD,qt.size=pD,qt.visit=dD,qt.visitAfter=gD,qt.x=yD,qt.y=vD;function Lt(t){return function(){return t}}function mn(t){return(t()-.5)*1e-6}function xD(t){return t.x+t.vx}function _D(t){return t.y+t.vy}function Mm(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,xD,_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(b);function b(x,v,S,$,R){var P=x.data,_=x.r,w=g+_;if(P){if(P.index>h.index){var A=p-P.x-P.vx,N=d-P.y-P.vy,C=A*A+N*N;C<w*w&&(A===0&&(A=mn(r),C+=A*A),N===0&&(N=mn(r),C+=N*N),C=(w-(C=Math.sqrt(C)))/C*i,h.vx+=(A*=C)*(w=(_*=_)/(m+_)),h.vy+=(N*=C)*w,P.vx-=A*(w=1-w),P.vy-=N*w)}return}return v>p+w||$<p-w||S>d+w||R<d-w}}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 wD(t){return t.index}function Pm(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function $D(t){var e=wD,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 x=0,v,S,$,R,P,_,w;x<b;++x)v=t[x],S=v.source,$=v.target,R=$.x+$.vx-S.x-S.vx||mn(l),P=$.y+$.vy-S.y-S.vy||mn(l),_=Math.sqrt(R*R+P*P),_=(_-o[x])/_*m*r[x],R*=_,P*=_,$.vx-=R*(w=u[x]),$.vy-=P*w,S.vx+=R*(w=1-w),S.vy+=P*w}function p(){if(a){var m,y=a.length,b=t.length,x=new Map(a.map((S,$)=>[e(S,$,a),S])),v;for(m=0,s=new Array(y);m<b;++m)v=t[m],v.index=m,typeof v.source!="object"&&(v.source=Pm(x,v.source)),typeof v.target!="object"&&(v.target=Pm(x,v.target)),s[v.source.index]=(s[v.source.index]||0)+1,s[v.target.index]=(s[v.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)v=t[m],u[m]=s[v.source.index]/(s[v.source.index]+s[v.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 SD=1664525,AD=1013904223,Dm=4294967296;function MD(){let t=1;return()=>(t=(SD*t+AD)%Dm)/Dm}function PD(t){return t.x}function DD(t){return t.y}var TD=10,LD=Math.PI*(3-Math.sqrt(5));function Tm(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=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 x=0;x<g;++x)for(n+=(o-n)*i,s.forEach(function(v){v(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=TD*Math.sqrt(.5+g),x=g*LD;y.x=b*Math.cos(x),y.y=b*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 b=0,x=t.length,v,S,$,R,P;for(y==null?y=1/0:y*=y,b=0;b<x;++b)R=t[b],v=g-R.x,S=m-R.y,$=v*v+S*S,$<y&&(P=R,y=$);return P},on:function(g,m){return arguments.length>1?(l.on(g,m),e):l.on(g)}}}function Lm(){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,PD,DD).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,x,v;if(p.length){for(b=x=v=0;v<4;++v)(g=p[v])&&(m=Math.abs(g.value))&&(d+=g.value,y+=m,b+=m*g.x,x+=m*g.y);p.x=b/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,b=p.y-e.y,x=m-d,v=y*y+b*b;if(x*x/u<v)return v<s&&(y===0&&(y=mn(n),v+=y*y),b===0&&(b=mn(n),v+=b*b),v<a&&(v=Math.sqrt(a*v)),e.vx+=y*p.value*r/v,e.vy+=b*p.value*r/v),!0;if(p.length||v>=s)return;(p.data!==e||p.next)&&(y===0&&(y=mn(n),v+=y*y),b===0&&(b=mn(n),v+=b*b),v<a&&(v=Math.sqrt(a*v)));do p.data!==e&&(x=o[p.data.index]*r/v,e.vx+=y*x,e.vy+=b*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 CD(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 Cm(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 Em(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 ED(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 RD(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 kD(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var ID=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Br(t){if(!(e=ID.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 ND(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 Rm;function FD(t,e){var n=hs(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Rm=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 km(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 Im={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ED,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)=>km(t*100,e),r:km,s:FD,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Nm(t){return t}var Fm=Array.prototype.map,Gm=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zm(t){var e=t.grouping===void 0||t.thousands===void 0?Nm:RD(Fm.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?Nm:kD(Fm.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,b=f.comma,x=f.precision,v=f.trim,S=f.type;S==="n"?(b=!0,S="g"):Im[S]||(x===void 0&&(x=12),v=!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:"",P=Im[S],_=/[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 w(A){var N=$,C=R,M,L,D;if(S==="c")C=P(A)+C,A="";else{A=+A;var O=A<0||1/A<0;if(A=isNaN(A)?u:P(Math.abs(A),x),v&&(A=ND(A)),O&&+A==0&&d!=="+"&&(O=!1),N=(O?d==="("?d:s:d==="-"||d==="("?"":d)+N,C=(S==="s"?Gm[8+Rm/3]:"")+C+(O&&d==="("?")":""),_){for(M=-1,L=A.length;++M<L;)if(D=A.charCodeAt(M),48>D||D>57){C=(D===46?i+A.slice(M+1):A.slice(M))+C,A=A.slice(0,M);break}}}b&&!m&&(A=e(A,1/0));var z=N.length+A.length+C.length,k=z<y?new Array(y-z+1).join(h):"";switch(b&&m&&(A=e(k+A,k.length?y-C.length:1/0),k=""),p){case"<":A=N+A+C+k;break;case"=":A=N+k+A+C;break;case"^":A=k.slice(0,z=k.length>>1)+N+A+C+k.slice(z);break;default:A=k+N+A+C;break}return o(A)}return w.toString=function(){return f+""},w}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=Gm[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var ds,no,Hc;Om({thousands:",",grouping:[3],currency:["$",""]});function Om(t){return ds=zm(t),no=ds.format,Hc=ds.formatPrefix,ds}function Ym(t){return Math.max(0,-Ur(Math.abs(t)))}function Um(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ur(e)/3)))*3-Ur(Math.abs(t)))}function Bm(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,Wm=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 Hm(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 Xm(t){return(t=J(t/2))*t}function wt(){}function bs(t,e){t&&jm.hasOwnProperty(t.type)&&jm[t.type](t,e)}var qm={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)}},jm={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){Vm(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Vm(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 Vm(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&&qm.hasOwnProperty(t.type)?qm[t.type](t,e):bs(t,e)}var vs=new Tt,xs=new Tt,Zm,Km,Zc,Kc,Qc,ze={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){vs=new Tt,ze.lineStart=GD,ze.lineEnd=zD},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 GD(){ze.point=OD}function zD(){Qm(Zm,Km)}function OD(t,e){ze.point=Qm,Zm=t,Km=e,t*=at,e*=at,Zc=t,Kc=et(e=e/2+gs),Qc=J(e)}function Qm(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 YD(t){return xs=new Tt,Te(t,ze),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,Jm,t1,Xr,io,yn,Je,tn={point:tf,lineStart:n1,lineEnd:r1,polygonStart:function(){tn.point=i1,tn.lineStart=UD,tn.lineEnd=BD,io=new Tt,ze.polygonStart()},polygonEnd:function(){ze.polygonEnd(),tn.point=tf,tn.lineStart=n1,tn.lineEnd=r1,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 e1(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 n1(){tn.point=e1}function r1(){Je[0]=$t,Je[1]=Mt,tn.point=tf,Xr=null}function i1(t,e){if(Xr){var n=t-Jn;io.add(pt(n)>180?n+(n>0?360:-360):n)}else Jm=t,t1=e;ze.point(t,e),e1(t,e)}function UD(){ze.lineStart()}function BD(){i1(Jm,t1),ze.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 WD(t,e){return t[0]-e[0]}function o1(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function HD(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(WD),e=1,r=yn[0],o=[r];e<n;++e)i=yn[e],o1(r,i[0])||o1(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,a1,s1,Kt,Qt,Jt,Le={sphere:wt,point:of,lineStart:u1,lineEnd:l1,polygonStart:function(){Le.lineStart=jD,Le.lineEnd=VD},polygonEnd:function(){Le.lineStart=u1,Le.lineEnd=l1}};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 u1(){Le.point=XD}function XD(t,e){t*=at,e*=at;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),Le.point=qD,ao(Kt,Qt,Jt)}function qD(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 l1(){Le.point=of}function jD(){Le.point=ZD}function VD(){c1(a1,s1),Le.point=of}function ZD(t,e){a1=t,s1=e,t*=at,e*=at,Le.point=c1;var n=et(e);Kt=n*et(t),Qt=n*J(t),Jt=J(e),ao(Kt,Qt,Jt)}function c1(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 KD(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(h1(t),p1(e,n)):h1(t):e||n?p1(e,n):sf}function f1(t){return function(e,n){return e+=t,pt(e)>ft&&(e-=Math.round(e/jt)*jt),[e,n]}}function h1(t){var e=f1(t);return e.invert=f1(-t),e}function p1(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 d1(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 g1(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=m1(a,i),o=m1(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 m1(t,e){e=Qn(e),e[0]-=t,Ss(e);var n=Hm(-e[1]);return((-e[2]<0?-n:n)+jt-ot)%jt}function QD(){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,g1(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 y1(){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 b1(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(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(b=new Rs(m,d,null,!0)),a.push(b.o=new Rs(m,null,b,!1)),o.push(b=new Rs(y,d,null,!1)),a.push(b.o=new Rs(y,null,b,!0))}}),!!o.length){for(a.sort(e),v1(o),v1(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 v1(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 x1(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),b=0;b<h;++b,d=v,m=$,y=R,p=x){var x=f[b],v=lf(x),S=x[1]/2+gs,$=J(S),R=et(S),P=v-d,_=P>=0?1:-1,w=_*P,A=w>ft,N=m*$;if(u.add(Vt(N*_*J(w),y*R+N*et(w))),a+=A?P+_*jt:P,A^d>=n^v>=n){var C=Hr(Qn(p),Qn(x));Ss(C);var M=Hr(o,C);Ss(M);var L=(A^P>=0?-1:1)*Zt(M[2]);(r>L||r===L&&(C[0]||C[1]))&&(s+=A^P>=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=y1(),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=x,c=[],l=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=m,c=zl(c);var v=x1(l,r);c.length?(u||(i.polygonStart(),u=!0),b1(c,t7,v,n,i)):v&&(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(v,S){t(v,S)&&i.point(v,S)}function d(v,S){o.point(v,S)}function g(){h.point=d,o.lineStart()}function m(){h.point=p,o.lineEnd()}function y(v,S){f.push([v,S]),s.point(v,S)}function b(){s.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),s.lineEnd();var v=s.clean(),S=a.result(),$,R=S.length,P,_,w;if(f.pop(),l.push(f),f=null,!!R){if(v&1){if(_=S[0],(P=_.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),$=0;$<P;++$)i.point((w=_[$])[0],w[1]);i.lineEnd()}return}R>1&&v&2&&S.push(S.pop().concat(S.shift())),c.push(S.filter(JD))}}return h}}function JD(t){return t.length>1}function t7(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},e7,r7,[-ft,-At]);function e7(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=n7(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 n7(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 r7(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 w1(t){var e=et(t),n=2*at,r=e>0,i=pt(e)>ot;function o(c,f,h,p){g1(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],x,v=a(m,y),S=r?v?0:l(m,y):v?l(m+(m<0?ft:-ft),y):0;if(!f&&(d=p=v)&&c.lineStart(),v!==p&&(x=u(f,b),(!x||Es(f,x)||Es(b,x))&&(b[2]=1)),v!==p)g=0,v?(c.lineStart(),x=u(b,f),c.point(x[0],x[1])):(x=u(f,b),c.point(x[0],x[1],2),c.lineEnd()),f=x;else if(i&&f&&r^v){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)))}v&&(!f||!Es(f,b))&&c.point(b[0],b[1]),f=b,p=v,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),b=m[0],x=y-b*b;if(!x)return!h&&c;var v=e*y/x,S=-e*b/x,$=Hr(g,m),R=$s(g,v),P=$s(m,S);Jc(R,P);var _=$,w=ws(R,_),A=ws(_,_),N=w*w-A*(ws(R,R)-1);if(!(N<0)){var C=kt(N),M=$s(_,(-w-C)/A);if(Jc(M,R),M=_s(M),!h)return M;var L=c[0],D=f[0],O=c[1],z=f[1],k;D<L&&(k=L,L=D,D=k);var E=D-L,T=pt(E-ft)<ot,G=T||E<ot;if(!T&&z<O&&(k=O,O=z,z=k),G?T?O+z>0^M[1]<(pt(M[0]-L)<ot?O:z):O<=M[1]&&M[1]<=z:E>ft^(L<=M[0]&&M[0]<=D)){var q=$s(_,(-w+C)/A);return Jc(q,R),[M,_s(q)]}}}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 i7(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=y1(),h,p,d,g,m,y,b,x,v,S,$,R={point:P,lineStart:N,lineEnd:C,polygonStart:w,polygonEnd:A};function P(L,D){i(L,D)&&c.point(L,D)}function _(){for(var L=0,D=0,O=p.length;D<O;++D)for(var z=p[D],k=1,E=z.length,T=z[0],G,q,Q=T[0],Y=T[1];k<E;++k)G=Q,q=Y,T=z[k],Q=T[0],Y=T[1],q<=r?Y>r&&(Q-G)*(r-q)>(Y-q)*(t-G)&&++L:Y<=r&&(Q-G)*(r-q)<(Y-q)*(t-G)&&--L;return L}function w(){c=f,h=[],p=[],$=!0}function A(){var L=_(),D=$&&L,O=(h=zl(h)).length;(D||O)&&(l.polygonStart(),D&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),O&&b1(h,s,L,o,l),l.polygonEnd()),c=l,h=p=d=null}function N(){R.point=M,p&&p.push(d=[]),S=!0,v=!1,b=x=NaN}function C(){h&&(M(g,m),y&&v&&f.rejoin(),h.push(f.result())),R.point=P,v&&c.lineEnd()}function M(L,D){var O=i(L,D);if(p&&d.push([L,D]),S)g=L,m=D,y=O,S=!1,O&&(c.lineStart(),c.point(L,D));else if(O&&v)c.point(L,D);else{var z=[b=Math.max(ks,Math.min(so,b)),x=Math.max(ks,Math.min(so,x))],k=[L=Math.max(ks,Math.min(so,L)),D=Math.max(ks,Math.min(so,D))];i7(z,k,t,e,n,r)?(v||(c.lineStart(),c.point(z[0],z[1])),c.point(k[0],k[1]),O||c.lineEnd(),$=!1):O&&(c.lineStart(),c.point(L,D),$=!1)}b=L,x=D,v=O}return R}}function o7(){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:a7,lineEnd:wt,polygonStart:wt,polygonEnd:wt};function a7(){jr.point=u7,jr.lineEnd=s7}function s7(){jr.point=jr.lineEnd=wt}function u7(t,e){t*=at,e*=at,hf=t,Ns=J(e),Fs=et(e),jr.point=l7}function l7(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 $1(t){return ff=new Tt,Te(t,jr),+ff}var pf=[null,null],c7={type:"LineString",coordinates:pf};function Gs(t,e){return pf[0]=t,pf[1]=e,$1(c7)}var S1={Feature:function(t,e){return zs(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(zs(n[r].geometry,e))return!0;return!1}},A1={Sphere:function(){return!0},Point:function(t,e){return M1(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(M1(n[r],e))return!0;return!1},LineString:function(t,e){return P1(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(P1(n[r],e))return!0;return!1},Polygon:function(t,e){return D1(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(D1(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(zs(n[r],e))return!0;return!1}};function zs(t,e){return t&&A1.hasOwnProperty(t.type)?A1[t.type](t,e):!1}function M1(t,e){return Gs(t,e)===0}function P1(t,e){for(var n,r,i,o=0,a=t.length;o<a;o++){if(r=Gs(t[o],e),r===0||o>0&&(i=Gs(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 D1(t,e){return!!x1(t.map(f7),T1(e))}function f7(t){return t=t.map(T1),t.pop(),t}function T1(t){return[t[0]*at,t[1]*at]}function h7(t,e){return(t&&S1.hasOwnProperty(t.type)?S1[t.type]:zs)(t,e)}function L1(t,e,n){var r=fn(t,e-ot,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function C1(t,e,n){var r=fn(t,e-ot,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function E1(){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 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 b().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=L1(o,i,90),p=C1(e,t,m),d=L1(s,a,90),g=C1(r,n,m),y):m},y.extentMajor([[-180,-90+ot],[180,90-ot]]).extentMinor([[-180,-80-ot],[180,80+ot]])}function p7(){return E1()()}function d7(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(Xm(o-r)+a*u*Xm(i-n))),g=J(d),m=d?function(y){var b=J(y*=d)/g,x=J(d-y)/g,v=x*c+b*h,S=x*f+b*p,$=x*s+b*l;return[Vt(S,v)*bt,Vt($,kt(v*v+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,R1,k1,mf,yf,en={point:wt,lineStart:wt,lineEnd:wt,polygonStart:function(){en.lineStart=g7,en.lineEnd=y7},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 g7(){en.point=m7}function m7(t,e){en.point=I1,R1=mf=t,k1=yf=e}function I1(t,e){gf.add(yf*t-mf*e),mf=t,yf=e}function y7(){I1(R1,k1)}var Vr=1/0,Os=Vr,lo=-Vr,Ys=lo,Us={point:b7,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 b7(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,N1,F1,Oe,Ye,me={point:tr,lineStart:G1,lineEnd:z1,polygonStart:function(){me.lineStart=_7,me.lineEnd=w7},polygonEnd:function(){me.point=tr,me.lineStart=G1,me.lineEnd=z1},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 G1(){me.point=v7}function v7(t,e){me.point=x7,tr(Oe=t,Ye=e)}function x7(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 z1(){me.point=tr}function _7(){me.point=$7}function w7(){O1(N1,F1)}function $7(t,e){me.point=O1,tr(N1=Oe=t,F1=Ye=e)}function O1(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 Y1(t){this._context=t}Y1.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,U1,B1,ho,po,go={point:wt,lineStart:function(){go.point=S7},lineEnd:function(){$f&&W1(U1,B1),go.point=wt},polygonStart:function(){$f=!0},polygonEnd:function(){$f=null},result:function(){var t=+wf;return wf=new Tt,t}};function S7(t,e){go.point=W1,U1=ho=t,B1=po=e}function W1(t,e){ho-=t,po-=e,wf.add(kt(ho*ho+po*po)),ho=t,po=e}let H1,Hs,X1,q1;class j1{constructor(e){this._append=e==null?V1:A7(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!==X1||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`,X1=r,Hs=this._append,q1=this._,this._=i}this._+=q1;break}}}result(){const e=this._;return this._="",e.length?e:null}}function V1(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function A7(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return V1;if(e!==H1){const n=10**e;H1=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 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)),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 j1(n)):new Y1(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 j1(n)),a},a.projection(t).digits(n).context(e)}function P7(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 Z1=16,D7=et(30*at);function K1(t,e){return+e?L7(t,e):T7(t)}function T7(t){return mo({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function L7(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,x=y*y+b*b;if(x>4*e&&g--){var v=a+h,S=s+p,$=u+d,R=kt(v*v+S*S+$*$),P=Zt($/=R),_=pt(pt($)-1)<ot||pt(o-f)<ot?(o+f)/2:Vt(S,v),w=t(_,P),A=w[0],N=w[1],C=A-r,M=N-i,L=b*C-y*M;(L*L/x>e||pt((y*C+b*M)/x-.5)>.3||a*h+s*p+u*d<D7)&&(n(r,i,o,a,s,u,A,N,_,v/=R,S/=R,$,g,m),m.point(A,N),n(A,N,_,v,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:v,polygonStart:function(){r.polygonStart(),m.lineStart=S},polygonEnd:function(){r.polygonEnd(),m.lineStart=b}};function y(P,_){P=t(P,_),r.point(P[0],P[1])}function b(){f=NaN,m.point=x,r.lineStart()}function x(P,_){var w=Qn([P,_]),A=t(P,_);n(f,h,c,p,d,g,f=A[0],h=A[1],c=P,p=w[0],d=w[1],g=w[2],Z1,r),r.point(f,h)}function v(){m.point=y,r.lineEnd()}function S(){b(),m.point=$,m.lineEnd=R}function $(P,_){x(i=P,_),o=f,a=h,s=p,u=d,l=g,m.point=x}function R(){n(f,h,c,p,d,g,o,a,i,s,u,l,Z1,r),m.lineEnd=v,v()}return m}}var C7=mo({point:function(t,e){this.stream.point(t*at,e*at)}});function E7(t){return mo({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function R7(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 Q1(t,e,n,r,i,o){if(!o)return R7(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,b,x,v=uo,S=.5,$,R,P,_,w;function A(L){return P(L[0]*at,L[1]*at)}function N(L){return L=P.invert(L[0],L[1]),L&&[L[0]*bt,L[1]*bt]}A.stream=function(L){return _&&w===L?_:_=C7(E7(c)(g($(v(w=L)))))},A.preclip=function(L){return arguments.length?(g=L,d=void 0,M()):g},A.postclip=function(L){return arguments.length?(v=L,m=y=b=x=null,M()):v},A.clipAngle=function(L){return arguments.length?(g=+L?w1(d=L*at):(d=null,cf),M()):d*bt},A.clipExtent=function(L){return arguments.length?(v=L==null?(m=y=b=x=null,uo):Is(m=+L[0][0],y=+L[0][1],b=+L[1][0],x=+L[1][1]),M()):m==null?null:[[m,y],[b,x]]},A.scale=function(L){return arguments.length?(n=+L,C()):n},A.translate=function(L){return arguments.length?(r=+L[0],i=+L[1],C()):[r,i]},A.center=function(L){return arguments.length?(o=L[0]%360*at,a=L[1]%360*at,C()):[o*bt,a*bt]},A.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,C()):[s*bt,u*bt,l*bt]},A.angle=function(L){return arguments.length?(f=L%360*at,C()):f*bt},A.reflectX=function(L){return arguments.length?(h=L?-1:1,C()):h<0},A.reflectY=function(L){return arguments.length?(p=L?-1:1,C()):p<0},A.precision=function(L){return arguments.length?($=K1(R,S=L*L),M()):kt(S)},A.fitExtent=function(L,D){return Xs(A,L,D)},A.fitSize=function(L,D){return Mf(A,L,D)},A.fitWidth=function(L,D){return Pf(A,L,D)},A.fitHeight=function(L,D){return Df(A,L,D)};function C(){var L=Q1(n,0,0,h,p,f).apply(null,e(o,a)),D=Q1(n,r-L[0],i-L[1],h,p,f);return c=uf(s,u,l),R=af(e,D),P=af(c,R),$=K1(R,S),M()}function M(){return _=w=null,A}return function(){return e=t.apply(this,arguments),A.invert=e.invert&&N,C()}}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 k7(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 J1(t,e){var n=J(t),r=(n+J(e))/2;if(pt(r)<ot)return k7(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(J1).scale(155.424).center([0,33.6442])}function ty(){return qs().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function I7(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 N7(){var t,e,n=ty(),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=I7([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 ey(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=ey(function(t){return kt(2/(1+t))});Cf.invert=yo(function(t){return 2*Zt(t/2)});function F7(){return Ue(Cf).scale(124.75).clipAngle(180-.001)}var Ef=ey(function(t){return(t=Hm(t))&&t/J(t)});Ef.invert=yo(function(t){return t});function G7(){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(Wm(e))-At]};function z7(){return ny(bo).scale(961/jt)}function ny(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(d1(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 ry(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 O7(){return Lf(ry).scale(109.5).parallels([30,30])}function vo(t,e){return[t,e]}vo.invert=vo;function Y7(){return Ue(vo).scale(152.63)}function iy(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 U7(){return Lf(iy).scale(131.154).center([0,13.9389])}var xo=1.340264,_o=-.081106,wo=893e-6,$o=.003796,Vs=kt(3)/2,B7=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<B7&&(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 W7(){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 H7(){return Ue(kf).scale(144.049).clipAngle(60)}function X7(){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(v,S){var $=x([v,S]);this.stream.point($[0],$[1])}}),g=uo,m,y;function b(){return h=t*r,p=t*i,m=y=null,x}function x(v){var S=v[0]*h,$=v[1]*p;if(o){var R=$*a-S*s;S=S*a+$*s,$=R}return[S+e,$+n]}return x.invert=function(v){var S=v[0]-e,$=v[1]-n;if(o){var R=$*a+S*s;S=S*a-$*s,$=R}return[S/h,$/p]},x.stream=function(v){return m&&y===v?m:m=d(g(y=v))},x.postclip=function(v){return arguments.length?(g=v,u=l=c=f=null,b()):g},x.clipExtent=function(v){return arguments.length?(g=v==null?(u=l=c=f=null,uo):Is(u=+v[0][0],l=+v[0][1],c=+v[1][0],f=+v[1][1]),b()):u==null?null:[[u,l],[c,f]]},x.scale=function(v){return arguments.length?(t=+v,b()):t},x.translate=function(v){return arguments.length?(e=+v[0],n=+v[1],b()):[e,n]},x.angle=function(v){return arguments.length?(o=v%360*at,s=J(o),a=et(o),b()):o*bt},x.reflectX=function(v){return arguments.length?(r=v?-1:1,b()):r<0},x.reflectY=function(v){return arguments.length?(i=v?-1:1,b()):i<0},x.fitExtent=function(v,S){return Xs(x,v,S)},x.fitSize=function(v,S){return Mf(x,v,S)},x.fitWidth=function(v,S){return Pf(x,v,S)},x.fitHeight=function(v,S){return Df(x,v,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 q7(){return Ue(If).scale(175.295)}function Nf(t,e){return[et(e)*J(t),J(e)]}Nf.invert=yo(Zt);function j7(){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 V7(){return Ue(Ff).scale(250).clipAngle(142)}function Gf(t,e){return[ys(jc((At+e)/2)),-t]}Gf.invert=function(t,e){return[-e,2*Wr(Wm(t))-At]};function Z7(){var t=ny(Gf),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 K7(t,e){return t.parent===e.parent?1:2}function Q7(t){return t.reduce(J7,0)/t.length}function J7(t,e){return t+e.x}function tT(t){return 1+t.reduce(eT,0)}function eT(t,e){return Math.max(t,e.y)}function nT(t){for(var e;e=t.children;)t=e[0];return t}function rT(t){for(var e;e=t.children;)t=e[e.length-1];return t}function iT(){var t=K7,e=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(h){var p=h.children;p?(h.x=Q7(p),h.y=tT(p)):(h.x=a?s+=t(h,a):0,h.y=0,a=h)});var u=nT(o),l=rT(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 oT(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 aT(){return this.eachAfter(oT)}function sT(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function uT(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 lT(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 cT(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function fT(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 hT(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function pT(t){for(var e=this,n=dT(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 dT(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 gT(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function mT(){return Array.from(this)}function yT(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function bT(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*vT(){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=wT)):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(oy)}function xT(){return Zs(this).eachBefore($T)}function _T(t){return t.children}function wT(t){return Array.isArray(t)?t[1]:null}function $T(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function oy(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:aT,each:sT,eachAfter:lT,eachBefore:uT,find:cT,sum:fT,sort:hT,path:pT,ancestors:gT,descendants:mT,leaves:yT,links:bT,copy:xT,[Symbol.iterator]:vT};function Ks(t){return t==null?null:ay(t)}function ay(t){if(typeof t!="function")throw new Error;return t}function nr(){return 0}function Kr(t){return function(){return t}}const ST=1664525,AT=1013904223,sy=4294967296;function zf(){let t=1;return()=>(t=(ST*t+AT)%sy)/sy}function MT(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function PT(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 DT(t){return uy(t,zf())}function uy(t,e){for(var n=0,r=(t=PT(Array.from(t),e)).length,i=[],o,a;n<r;)o=t[n],a&&ly(a,o)?++n:(a=LT(i=TT(i,o)),n=0);return a}function TT(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(cy(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 ly(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(!ly(t,e[n]))return!1;return!0}function LT(t){switch(t.length){case 1:return CT(t[0]);case 2:return So(t[0],t[1]);case 3:return cy(t[0],t[1],t[2])}}function CT(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 cy(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,x=b-a*a-s*s+u*u,v=b-l*l-c*c+f*f,S=p*d-h*g,$=(d*v-g*x)/(S*2)-r,R=(g*m-d*y)/S,P=(p*x-h*v)/(S*2)-i,_=(h*y-p*m)/S,w=R*R+_*_-1,A=2*(o+$*R+P*_),N=$*$+P*P-o*o,C=-(Math.abs(w)>1e-6?(A+Math.sqrt(A*A-4*w*N))/(2*w):N/A);return{x:r+$+R*C,y:i+P+_*C,r:C}}function fy(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 hy(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 py(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 dy(t,e){if(!(o=(t=MT(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;fy(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){fy(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(hy(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}f+=l._.r,l=l.next}else{if(hy(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=py(n);(i=i.next)!==r;)(s=py(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=uy(n,e),u=0;u<o;++u)n=t[u],n.x-=i.x,n.y-=i.y;return i.r}function ET(t){return dy(t,zf()),t}function RT(t){return Math.sqrt(t.value)}function kT(){var t=null,e=1,n=1,r=nr;function i(o){const a=zf();return o.x=e/2,o.y=n/2,t?o.eachBefore(gy(t)).eachAfter(Yf(r,.5,a)).eachBefore(my(1)):o.eachBefore(gy(RT)).eachAfter(Yf(nr,1,a)).eachAfter(Yf(r,o.r/Math.min(e,n),a)).eachBefore(my(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 gy(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=dy(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=u+s}}}function my(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 yy(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 IT(){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(yy),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 NT={depth:-1},by={},Uf={};function FT(t){return t.id}function GT(t){return t.parentId}function zT(){var t=FT,e=GT,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((v,S)=>OT(n(v,S,i))),b=y.map(vy),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(vy(v)),o.push(Uf));a=(v,S)=>y[S],s=(v,S)=>b[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)?by: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===by)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=NT,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(oy),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 OT(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 vy(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 YT(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 UT(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 BT(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 WT(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 HT(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 XT(){var t=YT,e=1,n=1,r=null;function i(l){var c=HT(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){BT(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,x=g.m,v;d=Hf(d),h=Wf(h),d&&h;)g=Wf(g),p=Hf(p),p.a=l,v=d.z+b-h.z-m+t(d._,h._),v>0&&(UT(WT(d,l,f),l,v),m+=v,y+=v),b+=d.m,m+=h.m,x+=g.m,y+=p.m;d&&!Hf(p)&&(p.t=d,p.m+=b-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 xy=(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,b,x,v,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,v=Math.max(b/$,$/y);f<h;++f){if(m+=l=s[f].value,l<y&&(y=l),l>b&&(b=l),$=m*m*S,x=Math.max(b/$,$/y),x>v){m-=l;break}v=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}(xy);function wy(){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(yy),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=ay(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 qT(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 x=l[f],v=p/2+x,S=f+1,$=h-1;S<$;){var R=S+$>>>1;l[R]<v?S=R+1:$=R}v-l[S-1]<l[S]-v&&f+1<S&&--S;var P=l[S]-x,_=p-P;if(m-d>y-g){var w=p?(d*_+m*P)/p:m;c(f,S,P,d,g,w,y),c(S,h,_,w,g,m,y)}else{var A=p?(g*_+y*P)/p:y;c(f,S,P,d,g,m,A),c(S,h,_,d,A,m,y)}}}function jT(t,e,n,r,i){(t.depth&1?eu:Ao)(t,e,n,r,i)}const VT=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}(xy);function ZT(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 KT(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 QT(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function JT(t,e){return t[0]-e[0]||t[1]-e[1]}function $y(t){const e=t.length,n=[0,1];let r=2,i;for(i=2;i<e;++i){for(;r>1&&QT(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function t9(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(JT),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=$y(r),a=$y(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 e9(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 n9(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,r9=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),i9=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),o9=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),Sy=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),a9=function t(e){var n=Sy.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),s9=function t(e){function n(r){return function(){return-Math.log1p(-e())/r}}return n.source=t,n}(Nt),u9=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),l9=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),Ay=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),My=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),Py=function t(e){var n=Ay.source(e),r=My.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),c9=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),f9=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),h9=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),p9=function t(e){var n=jf.source(e),r=Py.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),d9=1664525,g9=1013904223,Dy=1/4294967296;function m9(t=Math.random()){let e=(0<=t&&t<1?t/Dy:Math.abs(t))|0;return()=>(e=d9*e+g9|0,Dy*(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 Ty(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ty(e())},t}function Qf(){return Ty(Kf.apply(null,arguments).paddingInner(1))}function y9(t){return function(){return t}}function nu(t){return+t}var Ly=[0,1];function te(t){return t}function Jf(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:y9(isNaN(e)?NaN:.5)}function b9(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function v9(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 x9(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=Ly,e=Ly,n=je,r,i,o,a=te,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==te&&(a=b9(t[0],t[h-1])),s=h>2?x9:v9,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 Cy(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=Um(i,a))&&(r.precision=o),Hc(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Bm(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Ym(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 Cy(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 Ey(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 Ey(t).unknown(e)},t=arguments.length?Array.from(t,nu):[0,1],bn(n)}function Ry(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 ky(t){return Math.log(t)}function Iy(t){return Math.exp(t)}function _9(t){return-Math.log(-t)}function w9(t){return-Math.exp(-t)}function $9(t){return isFinite(t)?+("1e"+t):t<0?0:t}function S9(t){return t===10?$9:t===Math.E?Math.exp:e=>Math.pow(t,e)}function A9(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 Ny(t){return(e,n)=>-t(-e,n)}function eh(t){const e=t(ky,Iy),n=e.domain;let r=10,i,o;function a(){return i=A9(r),o=S9(r),n()[0]<0?(i=Ny(i),o=Ny(o),t(_9,w9)):t(ky,Iy),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(Ry(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function Fy(){const t=eh(ru()).domain([1,10]);return t.copy=()=>Mo(t,Fy()).base(t.base()),ye.apply(t,arguments),t}function Gy(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function zy(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nh(t){var e=1,n=t(Gy(e),zy(e));return n.constant=function(r){return arguments.length?t(Gy(e=+r),zy(e)):e},bn(n)}function Oy(){var t=nh(ru());return t.copy=function(){return Mo(t,Oy()).constant(t.constant())},ye.apply(t,arguments)}function Yy(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 P9(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(M9,P9):t(Yy(n),Yy(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 D9(){return Qr.apply(null,arguments).exponent(.5)}function Uy(t){return Math.sign(t)*t*t}function T9(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function By(){var t=th(),e=[0,1],n=!1,r;function i(o){var a=T9(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(Uy(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(Uy)),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 By(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},ye.apply(i,arguments),bn(i)}function Wy(){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 Wy().domain(t).range(e).unknown(r)},ye.apply(o,arguments)}function Hy(){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 Hy().domain([t,e]).range(i).unknown(o)},ye.apply(bn(a),arguments)}function Xy(){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 Xy().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 qy=Jr.range,rn=1e3,be=rn*60,on=be*60,an=on*24,ah=an*7,jy=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()),Vy=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()),L9=iu.range,ou=Dt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*be)},(t,e)=>(e-t)/be,t=>t.getUTCMinutes()),C9=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()),E9=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()),R9=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),k9=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),I9=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)),N9=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),Zy=rr(2),Ky=rr(3),ir=rr(4),Qy=rr(5),Jy=rr(6),tb=ei.range,F9=To.range,G9=Zy.range,z9=Ky.range,O9=ir.range,Y9=Qy.range,U9=Jy.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),eb=or(2),nb=or(3),ar=or(4),rb=or(5),ib=or(6),ob=ni.range,B9=Lo.range,W9=eb.range,H9=nb.range,X9=ar.range,q9=rb.range,j9=ib.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()),V9=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()),Z9=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 K9=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 Q9=We.range;function ab(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,jy],[e,3,3*jy],[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[sb,ub]=ab(We,lu,ni,uh,su,ou),[lb,cb]=ab(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 fb(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),b=Ro(u),x={a:O,A:z,b:k,B:E,c:null,d:yb,e:yb,f:_L,g:CL,G:RL,H:bL,I:vL,j:xL,L:bb,m:wL,M:$L,p:T,q:G,Q:Sb,s:Ab,S:SL,u:AL,U:ML,V:PL,w:DL,W:TL,x:null,X:null,y:LL,Y:EL,Z:kL,"%":$b},v={a:q,A:Q,b:Y,B:Z,c:null,d:xb,e:xb,f:GL,g:jL,G:ZL,H:IL,I:NL,j:FL,L:_b,m:zL,M:OL,p:U,q:V,Q:Sb,s:Ab,S:YL,u:UL,U:BL,V:WL,w:HL,W:XL,x:null,X:null,y:qL,Y:VL,Z:KL,"%":$b},S={a:w,A,b:N,B:C,c:M,d:gb,e:gb,f:dL,g:db,G:pb,H:mb,I:mb,j:cL,L:pL,m:lL,M:fL,p:_,q:uL,Q:mL,s:yL,S:hL,u:rL,U:iL,V:oL,w:nL,W:aL,x:L,X:D,y:db,Y:pb,Z:sL,"%":gL};x.x=$(n,x),x.X=$(r,x),x.c=$(e,x),v.x=$(n,v),v.X=$(r,v),v.c=$(e,v);function $(X,rt){return function(ut){var H=[],mt=-1,ht=0,Bt=X.length,ee,st,Pt;for(ut instanceof Date||(ut=new Date(+ut));++mt<Bt;)X.charCodeAt(mt)===37&&(H.push(X.slice(ht,mt)),(st=hb[ee=X.charAt(++mt)])!=null?ee=X.charAt(++mt):st=ee==="e"?" ":"0",(Pt=rt[ee])&&(ee=Pt(ut,st)),H.push(ee),ht=mt+1);return H.push(X.slice(ht,mt)),H.join("")}}function R(X,rt){return function(ut){var H=Co(1900,void 0,1),mt=P(H,X,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 P(X,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 hb?rt.charAt(mt++):ee],!st||(H=st(X,ut,H))<0)return-1}else if(ee!=ut.charCodeAt(H++))return-1}return H}function _(X,rt,ut){var H=l.exec(rt.slice(ut));return H?(X.p=c.get(H[0].toLowerCase()),ut+H[0].length):-1}function w(X,rt,ut){var H=p.exec(rt.slice(ut));return H?(X.w=d.get(H[0].toLowerCase()),ut+H[0].length):-1}function A(X,rt,ut){var H=f.exec(rt.slice(ut));return H?(X.w=h.get(H[0].toLowerCase()),ut+H[0].length):-1}function N(X,rt,ut){var H=y.exec(rt.slice(ut));return H?(X.m=b.get(H[0].toLowerCase()),ut+H[0].length):-1}function C(X,rt,ut){var H=g.exec(rt.slice(ut));return H?(X.m=m.get(H[0].toLowerCase()),ut+H[0].length):-1}function M(X,rt,ut){return P(X,e,rt,ut)}function L(X,rt,ut){return P(X,n,rt,ut)}function D(X,rt,ut){return P(X,r,rt,ut)}function O(X){return a[X.getDay()]}function z(X){return o[X.getDay()]}function k(X){return u[X.getMonth()]}function E(X){return s[X.getMonth()]}function T(X){return i[+(X.getHours()>=12)]}function G(X){return 1+~~(X.getMonth()/3)}function q(X){return a[X.getUTCDay()]}function Q(X){return o[X.getUTCDay()]}function Y(X){return u[X.getUTCMonth()]}function Z(X){return s[X.getUTCMonth()]}function U(X){return i[+(X.getUTCHours()>=12)]}function V(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var rt=$(X+="",x);return rt.toString=function(){return X},rt},parse:function(X){var rt=R(X+="",!1);return rt.toString=function(){return X},rt},utcFormat:function(X){var rt=$(X+="",v);return rt.toString=function(){return X},rt},utcParse:function(X){var rt=R(X+="",!0);return rt.toString=function(){return X},rt}}}var hb={"-":"",_:" ",0:"0"},It=/^\s*\d+/,J9=/^%/,tL=/[\\^$*+?|[\]().{}]/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 eL(t){return t.replace(tL,"\\$&")}function Eo(t){return new RegExp("^(?:"+t.map(eL).join("|")+")","i")}function Ro(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function nL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function rL(t,e,n){var r=It.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function iL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function oL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function aL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function pb(t,e,n){var r=It.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function db(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 sL(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 uL(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 lL(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 gb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function cL(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 mb(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.H=+r[0],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],n+r[0].length):-1}function hL(t,e,n){var r=It.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function pL(t,e,n){var r=It.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function dL(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 gL(t,e,n){var r=J9.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mL(t,e,n){var r=It.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function yL(t,e,n){var r=It.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function yb(t,e){return gt(t.getDate(),e,2)}function bL(t,e){return gt(t.getHours(),e,2)}function vL(t,e){return gt(t.getHours()%12||12,e,2)}function xL(t,e){return gt(1+ti.count(Be(t),t),e,3)}function bb(t,e){return gt(t.getMilliseconds(),e,3)}function _L(t,e){return bb(t,e)+"000"}function wL(t,e){return gt(t.getMonth()+1,e,2)}function $L(t,e){return gt(t.getMinutes(),e,2)}function SL(t,e){return gt(t.getSeconds(),e,2)}function AL(t){var e=t.getDay();return e===0?7:e}function ML(t,e){return gt(ei.count(Be(t)-1,t),e,2)}function vb(t){var e=t.getDay();return e>=4||e===0?ir(t):ir.ceil(t)}function PL(t,e){return t=vb(t),gt(ir.count(Be(t),t)+(Be(t).getDay()===4),e,2)}function DL(t){return t.getDay()}function TL(t,e){return gt(To.count(Be(t)-1,t),e,2)}function LL(t,e){return gt(t.getFullYear()%100,e,2)}function CL(t,e){return t=vb(t),gt(t.getFullYear()%100,e,2)}function EL(t,e){return gt(t.getFullYear()%1e4,e,4)}function RL(t,e){var n=t.getDay();return t=n>=4||n===0?ir(t):ir.ceil(t),gt(t.getFullYear()%1e4,e,4)}function kL(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gt(e/60|0,"0",2)+gt(e%60,"0",2)}function xb(t,e){return gt(t.getUTCDate(),e,2)}function IL(t,e){return gt(t.getUTCHours(),e,2)}function NL(t,e){return gt(t.getUTCHours()%12||12,e,2)}function FL(t,e){return gt(1+Do.count(We(t),t),e,3)}function _b(t,e){return gt(t.getUTCMilliseconds(),e,3)}function GL(t,e){return _b(t,e)+"000"}function zL(t,e){return gt(t.getUTCMonth()+1,e,2)}function OL(t,e){return gt(t.getUTCMinutes(),e,2)}function YL(t,e){return gt(t.getUTCSeconds(),e,2)}function UL(t){var e=t.getUTCDay();return e===0?7:e}function BL(t,e){return gt(ni.count(We(t)-1,t),e,2)}function wb(t){var e=t.getUTCDay();return e>=4||e===0?ar(t):ar.ceil(t)}function WL(t,e){return t=wb(t),gt(ar.count(We(t),t)+(We(t).getUTCDay()===4),e,2)}function HL(t){return t.getUTCDay()}function XL(t,e){return gt(Lo.count(We(t)-1,t),e,2)}function qL(t,e){return gt(t.getUTCFullYear()%100,e,2)}function jL(t,e){return t=wb(t),gt(t.getUTCFullYear()%100,e,2)}function VL(t,e){return gt(t.getUTCFullYear()%1e4,e,4)}function ZL(t,e){var n=t.getUTCDay();return t=n>=4||n===0?ar(t):ar.ceil(t),gt(t.getUTCFullYear()%1e4,e,4)}function KL(){return"+0000"}function $b(){return"%"}function Sb(t){return+t}function Ab(t){return Math.floor(+t/1e3)}var ri,fh,Mb,cu,hh;Pb({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 Pb(t){return ri=fb(t),fh=ri.format,Mb=ri.parse,cu=ri.utcFormat,hh=ri.utcParse,ri}var Db="%Y-%m-%dT%H:%M:%S.%LZ";function QL(t){return t.toISOString()}var JL=Date.prototype.toISOString?QL:cu(Db);const tC=JL;function eC(t){var e=new Date(t);return isNaN(e)?null:e}var nC=+new Date("2000-01-01T00:00:00.000Z")?eC:hh(Db);const rC=nC;function iC(t){return new Date(t)}function oC(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"),b=l("%b %d"),x=l("%B"),v=l("%Y");function S($){return(u($)<$?p:s($)<$?d:a($)<$?g:o($)<$?m:r($)<$?i($)<$?y:b:n($)<$?x:v)($)}return c.invert=function($){return new Date(f($))},c.domain=function($){return arguments.length?h(Array.from($,oC)):h().map(iC)},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(Ry(R,$)):c},c.copy=function(){return Mo(c,ph(t,e,n,r,i,o,a,s,u,l))},c}function aC(){return ye.apply(ph(lb,cb,Be,uu,ei,ti,au,iu,sn,fh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function sC(){return ye.apply(ph(sb,ub,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 Tb(){var t=bn(fu()(te));return t.copy=function(){return vn(t,Tb())},nn.apply(t,arguments)}function Lb(){var t=eh(fu()).domain([1,10]);return t.copy=function(){return vn(t,Lb()).base(t.base())},nn.apply(t,arguments)}function Cb(){var t=nh(fu());return t.copy=function(){return vn(t,Cb()).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 uC(){return dh.apply(null,arguments).exponent(.5)}function Eb(){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 Eb(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,b,x;return arguments.length?([y,b,x]=m,l=R0(g,[y,b,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 Rb(){var t=bn(hu()(te));return t.copy=function(){return vn(t,Rb())},nn.apply(t,arguments)}function kb(){var t=eh(hu()).domain([.1,1,10]);return t.copy=function(){return vn(t,kb()).base(t.base())},nn.apply(t,arguments)}function Ib(){var t=nh(hu());return t.copy=function(){return vn(t,Ib()).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 lC(){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 cC=ct("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),fC=ct("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),hC=ct("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),pC=ct("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),dC=ct("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),gC=ct("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),mC=ct("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),yC=ct("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),bC=ct("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),vC=ct("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),xC=ct("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),vt=t=>b0(t[t.length-1]);var Nb=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(ct);const _C=vt(Nb);var Fb=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(ct);const wC=vt(Fb);var Gb=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(ct);const $C=vt(Gb);var zb=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(ct);const SC=vt(zb);var Ob=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(ct);const AC=vt(Ob);var Yb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(ct);const MC=vt(Yb);var Ub=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(ct);const PC=vt(Ub);var Bb=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(ct);const DC=vt(Bb);var Wb=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(ct);const TC=vt(Wb);var Hb=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(ct);const LC=vt(Hb);var Xb=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(ct);const CC=vt(Xb);var qb=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(ct);const EC=vt(qb);var jb=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(ct);const RC=vt(jb);var Vb=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(ct);const kC=vt(Vb);var Zb=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(ct);const IC=vt(Zb);var Kb=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(ct);const NC=vt(Kb);var Qb=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(ct);const FC=vt(Qb);var Jb=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(ct);const GC=vt(Jb);var tv=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(ct);const zC=vt(tv);var ev=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(ct);const OC=vt(ev);var nv=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(ct);const YC=vt(nv);var rv=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(ct);const UC=vt(rv);var iv=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(ct);const BC=vt(iv);var ov=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(ct);const WC=vt(ov);var av=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(ct);const HC=vt(av);var sv=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(ct);const XC=vt(sv);var uv=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(ct);const qC=vt(uv);function jC(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 VC=ja(Pe(300,.5,0),Pe(-240,.5,1));var ZC=ja(Pe(-100,.75,.35),Pe(80,1.5,.8)),KC=ja(Pe(260,.75,.35),Pe(80,1.5,.8)),pu=Pe();function QC(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(),JC=Math.PI/3,tE=Math.PI*2/3;function eE(t){var e;return t=(.5-t)*Math.PI,du.r=255*(e=Math.sin(t))*e,du.g=255*(e=Math.sin(t+JC))*e,du.b=255*(e=Math.sin(t+tE))*e,du+""}function nE(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 rE=gu(ct("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var iE=gu(ct("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),oE=gu(ct("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),aE=gu(ct("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function lt(t){return function(){return t}}const lv=Math.abs,Yt=Math.atan2,un=Math.cos,sE=Math.max,ii=Math.min,oe=Math.sin,xt=Math.sqrt,Ut=1e-12,xn=Math.PI,mu=xn/2,_n=2*xn;function uE(t){return t>1?0:t<-1?xn:Math.acos(t)}function cv(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 lE(t){return t.innerRadius}function cE(t){return t.outerRadius}function fE(t){return t.startAngle}function hE(t){return t.endAngle}function pE(t){return t&&t.padAngle}function dE(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,b=d-h,x=g-p,v=b*b+x*x,S=i-o,$=h*g-d*p,R=(x<0?-1:1)*xt(sE(0,S*S*v-$*$)),P=($*x-b*R)/v,_=(-$*b-x*R)/v,w=($*x+b*R)/v,A=(-$*b+x*R)/v,N=P-m,C=_-y,M=w-m,L=A-y;return N*N+C*C>M*M+L*L&&(P=w,_=A),{cx:P,cy:_,x01:-c,y01:-f,x11:P*(i/S-1),y11:_*(i/S-1)}}function bu(){var t=lE,e=cE,n=lt(0),r=null,i=fE,o=hE,a=pE,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=lv(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 b=d,x=g,v=d,S=g,$=m,R=m,P=a.apply(this,arguments)/2,_=P>Ut&&(r?+r.apply(this,arguments):xt(h*h+p*p)),w=ii(lv(p-h)/2,+n.apply(this,arguments)),A=w,N=w,C,M;if(_>Ut){var L=cv(_/h*oe(P)),D=cv(_/p*oe(P));($-=L*2)>Ut?(L*=y?1:-1,v+=L,S-=L):($=0,v=S=(d+g)/2),(R-=D*2)>Ut?(D*=y?1:-1,b+=D,x-=D):(R=0,b=x=(d+g)/2)}var O=p*un(b),z=p*oe(b),k=h*un(S),E=h*oe(S);if(w>Ut){var T=p*un(x),G=p*oe(x),q=h*un(v),Q=h*oe(v),Y;if(m<xn)if(Y=dE(O,z,q,Q,T,G,k,E)){var Z=O-Y[0],U=z-Y[1],V=T-Y[0],X=G-Y[1],rt=1/oe(uE((Z*V+U*X)/(xt(Z*Z+U*U)*xt(V*V+X*X)))/2),ut=xt(Y[0]*Y[0]+Y[1]*Y[1]);A=ii(w,(h-ut)/(rt-1)),N=ii(w,(p-ut)/(rt+1))}else A=N=0}R>Ut?N>Ut?(C=yu(q,Q,O,z,p,N,y),M=yu(T,G,k,E,p,N,y),s.moveTo(C.cx+C.x01,C.cy+C.y01),N<w?s.arc(C.cx,C.cy,N,Yt(C.y01,C.x01),Yt(M.y01,M.x01),!y):(s.arc(C.cx,C.cy,N,Yt(C.y01,C.x01),Yt(C.y11,C.x11),!y),s.arc(0,0,p,Yt(C.cy+C.y11,C.cx+C.x11),Yt(M.cy+M.y11,M.cx+M.x11),!y),s.arc(M.cx,M.cy,N,Yt(M.y11,M.x11),Yt(M.y01,M.x01),!y))):(s.moveTo(O,z),s.arc(0,0,p,b,x,!y)):s.moveTo(O,z),!(h>Ut)||!($>Ut)?s.lineTo(k,E):A>Ut?(C=yu(k,E,T,G,h,-A,y),M=yu(O,z,q,Q,h,-A,y),s.lineTo(C.cx+C.x01,C.cy+C.y01),A<w?s.arc(C.cx,C.cy,A,Yt(C.y01,C.x01),Yt(M.y01,M.x01),!y):(s.arc(C.cx,C.cy,A,Yt(C.y01,C.x01),Yt(C.y11,C.x11),!y),s.arc(0,0,h,Yt(C.cy+C.y11,C.cx+C.x11),Yt(M.cy+M.y11,M.cx+M.x11),y),s.arc(M.cx,M.cy,A,Yt(M.y11,M.x11),Yt(M.y01,M.x01),!y))):s.arc(0,0,h,S,v,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 gE=Array.prototype.slice;function vu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function fv(t){this._context=t}fv.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 fv(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,b,x=new Array(g),v=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(x[d],v[d]);s.lineEnd(),s.areaEnd()}y&&(x[h]=+t(m,h,f),v[h]=+e(m,h,f),s.point(r?+r(m,h,f):x[h],n?+n(m,h,f):v[h]))}if(b)return s=null,b+""||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 mE(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function yE(t){return t}function hv(){var t=yE,e=mE,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,b=Math.min(Math.abs(m)/l,o.apply(this,arguments)),x=b*(m<0?-1:1),v;for(u=0;u<l;++u)(v=d[p[u]=u]=+t(s[u],u,s))>0&&(h+=v);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],v=d[c],y=g+(v>0?v*f:0)+x,d[c]={data:s[c],index:u,value:v,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 pv=vh(xu);function dv(t){this._curve=t}dv.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 dv(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 gv(){return Io(_u().curve(pv))}function mv(){var t=bh().curve(pv),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 yv{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 bE{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 bv(t){return new yv(t,!0)}function vv(t){return new yv(t,!1)}function vE(t){return new bE(t)}function xE(t){return t.source}function _E(t){return t.target}function wu(t){let e=xE,n=_E,r=mh,i=yh,o=null,a=null,s=ko(u);function u(){let l;const c=gE.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 wE(){return wu(bv)}function $E(){return wu(vv)}function SE(){const t=wu(vE);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const AE=xt(3),xv={draw(t,e){const n=xt(e+ii(e/28,.75))*.59436,r=n/2,i=r*AE;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()}},wv=xt(1/3),ME=wv*2,$v={draw(t,e){const n=xt(e/ME),r=n*wv;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Sv={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()}},Av={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)}},Mv={draw(t,e){const n=xt(e),r=-n/2;t.rect(r,r,n,n)}},Pv={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()}},PE=.8908130915292852,Dv=oe(xn/10)/oe(7*xn/10),DE=oe(_n/10)*Dv,TE=-un(_n/10)*Dv,Tv={draw(t,e){const n=xt(e*PE),r=DE*n,i=TE*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),Lv={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()}},LE=xt(3),Cv={draw(t,e){const n=xt(e)*.6824,r=n/2,i=n*LE/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),CE=(_h/2+1)*3,Ev={draw(t,e){const n=xt(e/CE),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)}},Rv=[$u,_v,$v,Mv,Tv,Lv,Ev],EE=[$u,Av,wh,Cv,xv,Pv,Sv];function RE(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 kE(t){return new Au(t)}function kv(t){this._context=t}kv.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 IE(t){return new kv(t)}function Iv(t){this._context=t}Iv.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 NE(t){return new Iv(t)}function Nv(t,e){this._basis=new Au(t),this._beta=e}Nv.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 FE=function t(e){function n(r){return e===1?new Au(r):new Nv(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 GE=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 zE=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 OE=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 Fv(t,e){this._context=t,this._alpha=e}Fv.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 YE=function t(e){function n(r){return e?new Fv(r,e):new $h(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: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 UE=function t(e){function n(r){return e?new Gv(r,e):new Sh(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function zv(t,e){this._context=t,this._alpha=e}zv.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 BE=function t(e){function n(r){return e?new zv(r,e):new Ah(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Ov(t){this._context=t}Ov.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 WE(t){return new Ov(t)}function Yv(t){return t<0?-1:1}function Uv(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 Bv(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,Bv(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,Bv(this,n=Uv(this,t,e)),n);break;default:Ph(this,this._t0,n=Uv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function Wv(t){this._context=new Hv(t)}(Wv.prototype=Object.create(Pu.prototype)).point=function(t,e){Pu.prototype.point.call(this,e,t)};function Hv(t){this._context=t}Hv.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 HE(t){return new Pu(t)}function XE(t){return new Wv(t)}function Xv(t){this._context=t}Xv.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=qv(t),i=qv(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 qv(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 qE(t){return new Xv(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 jE(t){return new Du(t,.5)}function VE(t){return new Du(t,0)}function ZE(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 KE(t,e){return t[e]}function QE(t){const e=[];return e.key=t,e}function JE(){var t=lt([]),e=ai,n=oi,r=KE;function i(o){var a=Array.from(t.apply(this,arguments),QE),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 tR(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 eR(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 nR(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 rR(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 jv(t){var e=t.map(iR);return ai(t).sort(function(n,r){return e[n]-e[r]})}function iR(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 Vv(t){var e=t.map(Zv);return ai(t).sort(function(n,r){return e[n]-e[r]})}function Zv(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function oR(t){return Vv(t).reverse()}function aR(t){var e=t.length,n,r,i=t.map(Zv),o=jv(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 sR(t){return ai(t).reverse()}const Tu=t=>()=>t;function uR(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);Kv.prototype=He.prototype;function Kv(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 lR(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function cR(){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 Qv(){return this.__zoom||Lu}function fR(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function hR(){return navigator.maxTouchPoints||"ontouchstart"in this}function pR(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 Jv(){var t=lR,e=cR,n=pR,r=fR,i=hR,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,u=T0,l=Fn("start","zoom","end"),c,f,h,p=500,d=150,g=0,m=10;function y(M){M.property("__zoom",Qv).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",w).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(M,L,D,O){var z=M.selection?M.selection():M;z.property("__zoom",Qv),M!==z?S(M,L,D,O):z.interrupt().each(function(){$(this,arguments).event(O).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},y.scaleBy=function(M,L,D,O){y.scaleTo(M,function(){var z=this.__zoom.k,k=typeof L=="function"?L.apply(this,arguments):L;return z*k},D,O)},y.scaleTo=function(M,L,D,O){y.transform(M,function(){var z=e.apply(this,arguments),k=this.__zoom,E=D==null?v(z):typeof D=="function"?D.apply(this,arguments):D,T=k.invert(E),G=typeof L=="function"?L.apply(this,arguments):L;return n(x(b(k,G),E,T),z,a)},D,O)},y.translateBy=function(M,L,D,O){y.transform(M,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof D=="function"?D.apply(this,arguments):D),e.apply(this,arguments),a)},null,O)},y.translateTo=function(M,L,D,O,z){y.transform(M,function(){var k=e.apply(this,arguments),E=this.__zoom,T=O==null?v(k):typeof O=="function"?O.apply(this,arguments):O;return n(Lu.translate(T[0],T[1]).scale(E.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof D=="function"?-D.apply(this,arguments):-D),k,a)},O,z)};function b(M,L){return L=Math.max(o[0],Math.min(o[1],L)),L===M.k?M:new He(L,M.x,M.y)}function x(M,L,D){var O=L[0]-D[0]*M.k,z=L[1]-D[1]*M.k;return O===M.x&&z===M.y?M:new He(M.k,O,z)}function v(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function S(M,L,D,O){M.on("start.zoom",function(){$(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(O).end()}).tween("zoom",function(){var z=this,k=arguments,E=$(z,k).event(O),T=e.apply(z,k),G=D==null?v(T):typeof D=="function"?D.apply(z,k):D,q=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),Q=z.__zoom,Y=typeof L=="function"?L.apply(z,k):L,Z=u(Q.invert(G).concat(q/Q.k),Y.invert(G).concat(q/Y.k));return function(U){if(U===1)U=Y;else{var V=Z(U),X=q/V[2];U=new He(X,G[0]-V[0]*X,G[1]-V[1]*X)}E.zoom(null,U)}})}function $(M,L,D){return!D&&M.__zooming||new R(M,L)}function R(M,L){this.that=M,this.args=L,this.active=0,this.sourceEvent=null,this.extent=e.apply(M,L),this.taps=0}R.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,L){return this.mouse&&M!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&M!=="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(M){var L=j(this.that).datum();l.call(M,this.that,new uR(M,{sourceEvent:this.sourceEvent,target:y,type:M,transform:this.that.__zoom,dispatch:l}),L)}};function P(M,...L){if(!t.apply(this,arguments))return;var D=$(this,L).event(M),O=this.__zoom,z=Math.max(o[0],Math.min(o[1],O.k*Math.pow(2,r.apply(this,arguments)))),k=ue(M);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===z)return;D.mouse=[k,O.invert(k)],Hn(this),D.start()}Fo(M),D.wheel=setTimeout(E,d),D.zoom("mouse",n(x(b(O,z),D.mouse[0],D.mouse[1]),D.extent,a));function E(){D.wheel=null,D.end()}}function _(M,...L){if(h||!t.apply(this,arguments))return;var D=M.currentTarget,O=$(this,L,!0).event(M),z=j(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",q,!0),k=ue(M,D),E=M.clientX,T=M.clientY;Ra(M.view),Dh(M),O.mouse=[k,this.__zoom.invert(k)],Hn(this),O.start();function G(Q){if(Fo(Q),!O.moved){var Y=Q.clientX-E,Z=Q.clientY-T;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 q(Q){z.on("mousemove.zoom mouseup.zoom",null),ka(Q.view,O.moved),Fo(Q),O.event(Q).end()}}function w(M,...L){if(t.apply(this,arguments)){var D=this.__zoom,O=ue(M.changedTouches?M.changedTouches[0]:M,this),z=D.invert(O),k=D.k*(M.shiftKey?.5:2),E=n(x(b(D,k),O,z),e.apply(this,L),a);Fo(M),s>0?j(this).transition().duration(s).call(S,E,O,M):j(this).call(y.transform,E,O,M)}}function A(M,...L){if(t.apply(this,arguments)){var D=M.touches,O=D.length,z=$(this,L,M.changedTouches.length===O).event(M),k,E,T,G;for(Dh(M),E=0;E<O;++E)T=D[E],G=ue(T,this),G=[G,this.__zoom.invert(G),T.identifier],z.touch0?!z.touch1&&z.touch0[2]!==G[2]&&(z.touch1=G,z.taps=0):(z.touch0=G,k=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),k&&(z.taps<2&&(f=G[0],c=setTimeout(function(){c=null},p)),Hn(this),z.start())}}function N(M,...L){if(this.__zooming){var D=$(this,L).event(M),O=M.changedTouches,z=O.length,k,E,T,G;for(Fo(M),k=0;k<z;++k)E=O[k],T=ue(E,this),D.touch0&&D.touch0[2]===E.identifier?D.touch0[0]=T:D.touch1&&D.touch1[2]===E.identifier&&(D.touch1[0]=T);if(E=D.that.__zoom,D.touch1){var q=D.touch0[0],Q=D.touch0[1],Y=D.touch1[0],Z=D.touch1[1],U=(U=Y[0]-q[0])*U+(U=Y[1]-q[1])*U,V=(V=Z[0]-Q[0])*V+(V=Z[1]-Q[1])*V;E=b(E,Math.sqrt(U/V)),T=[(q[0]+Y[0])/2,(q[1]+Y[1])/2],G=[(Q[0]+Z[0])/2,(Q[1]+Z[1])/2]}else if(D.touch0)T=D.touch0[0],G=D.touch0[1];else return;D.zoom("touch",n(x(E,T,G),D.extent,a))}}function C(M,...L){if(this.__zooming){var D=$(this,L).event(M),O=M.changedTouches,z=O.length,k,E;for(Dh(M),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),k=0;k<z;++k)E=O[k],D.touch0&&D.touch0[2]===E.identifier?delete D.touch0:D.touch1&&D.touch1[2]===E.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&&(E=ue(E,this),Math.hypot(f[0]-E[0],f[1]-E[1])<m)){var T=j(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return y.wheelDelta=function(M){return arguments.length?(r=typeof M=="function"?M:Tu(+M),y):r},y.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Tu(!!M),y):t},y.touchable=function(M){return arguments.length?(i=typeof M=="function"?M:Tu(!!M),y):i},y.extent=function(M){return arguments.length?(e=typeof M=="function"?M:Tu([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),y):e},y.scaleExtent=function(M){return arguments.length?(o[0]=+M[0],o[1]=+M[1],y):[o[0],o[1]]},y.translateExtent=function(M){return arguments.length?(a[0][0]=+M[0][0],a[1][0]=+M[1][0],a[0][1]=+M[0][1],a[1][1]=+M[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(M){return arguments.length?(n=M,y):n},y.duration=function(M){return arguments.length?(s=+M,y):s},y.interpolate=function(M){return arguments.length?(u=M,y):u},y.on=function(){var M=l.on.apply(l,arguments);return M===l?y:M},y.clickDistance=function(M){return arguments.length?(g=(M=+M)*M,y):Math.sqrt(g)},y.tapDistance=function(M){return arguments.length?(m=+M,y):m},y}const Th=Object.freeze(Object.defineProperty({__proto__:null,Adder:Tt,Delaunay:zc,FormatSpecifier:ps,InternMap:Ci,InternSet:kn,Node:er,Path:Qi,Voronoi:ym,ZoomTransform:He,active:y4,arc:bu,area:bh,areaRadial:mv,ascending:_t,autoType:YP,axisBottom:Lg,axisLeft:Cg,axisRight:l5,axisTop:u5,bin:vg,bisect:Rn,bisectCenter:o3,bisectLeft:i3,bisectRight:ig,bisector:va,blob:WP,blur:a3,blur2:og,blurImage:s3,brush:L4,brushSelection:P4,brushX:D4,brushY:T4,buffer:XP,chord:E4,chordDirected:k4,chordTranspose:R4,cluster:iT,color:pn,contourDensity:aP,contours:kc,count:_a,create:W6,creator:La,cross:d3,csv:VP,csvFormat:LP,csvFormatBody:CP,csvFormatRow:RP,csvFormatRows:EP,csvFormatValue:kP,csvParse:_m,csvParseRows:TP,cubehelix:Pe,cumsum:g3,curveBasis:kE,curveBasisClosed:IE,curveBasisOpen:NE,curveBumpX:bv,curveBumpY:vv,curveBundle:FE,curveCardinal:GE,curveCardinalClosed:zE,curveCardinalOpen:OE,curveCatmullRom:YE,curveCatmullRomClosed:UE,curveCatmullRomOpen:BE,curveLinear:xu,curveLinearClosed:WE,curveMonotoneX:HE,curveMonotoneY:XE,curveNatural:qE,curveStep:jE,curveStepAfter:ZE,curveStepBefore:VE,descending:ng,deviation:ug,difference:Z3,disjoint:K3,dispatch:Fn,drag:Bg,dragDisable:Ra,dragEnable:ka,dsv:jP,dsvFormat:ls,easeBack:K0,easeBackIn:l4,easeBackInOut:K0,easeBackOut:c4,easeBounce:Vi,easeBounceIn:s4,easeBounceInOut:u4,easeBounceOut:Vi,easeCircle:Z0,easeCircleIn:KM,easeCircleInOut:Z0,easeCircleOut:QM,easeCubic:ji,easeCubicIn:BM,easeCubicInOut:ji,easeCubicOut:WM,easeElastic:Zi,easeElasticIn:f4,easeElasticInOut:h4,easeElasticOut:Zi,easeExp:V0,easeExpIn:VM,easeExpInOut:V0,easeExpOut:ZM,easeLinear:OM,easePoly:H0,easePolyIn:HM,easePolyInOut:H0,easePolyOut:XM,easeQuad:W0,easeQuadIn:YM,easeQuadInOut:W0,easeQuadOut:UM,easeSin:j0,easeSinIn:qM,easeSinInOut:j0,easeSinOut:jM,every:W3,extent:Li,fcumsum:y3,filter:X3,flatGroup:b3,flatRollup:v3,forceCenter:rD,forceCollide:Mm,forceLink:$D,forceManyBody:Lm,forceRadial:CD,forceSimulation:Tm,forceX:Cm,forceY:Em,get format(){return no},formatDefaultLocale:Om,formatLocale:zm,get formatPrefix(){return Hc},formatSpecifier:Br,fsum:m3,geoAlbers:ty,geoAlbersUsa:N7,geoArea:YD,geoAzimuthalEqualArea:F7,geoAzimuthalEqualAreaRaw:Cf,geoAzimuthalEquidistant:G7,geoAzimuthalEquidistantRaw:Ef,geoBounds:HD,geoCentroid:KD,geoCircle:QD,geoClipAntimeridian:cf,geoClipCircle:w1,geoClipExtent:o7,geoClipRectangle:Is,geoConicConformal:O7,geoConicConformalRaw:ry,geoConicEqualArea:qs,geoConicEqualAreaRaw:J1,geoConicEquidistant:U7,geoConicEquidistantRaw:iy,geoContains:h7,geoDistance:Gs,geoEqualEarth:W7,geoEqualEarthRaw:Rf,geoEquirectangular:Y7,geoEquirectangularRaw:vo,geoGnomonic:H7,geoGnomonicRaw:kf,geoGraticule:E1,geoGraticule10:p7,geoIdentity:X7,geoInterpolate:d7,geoLength:$1,geoMercator:z7,geoMercatorRaw:bo,geoNaturalEarth1:q7,geoNaturalEarth1Raw:If,geoOrthographic:j7,geoOrthographicRaw:Nf,geoPath:M7,geoProjection:Ue,geoProjectionMutator:Tf,geoRotation:d1,geoStereographic:V7,geoStereographicRaw:Ff,geoStream:Te,geoTransform:P7,geoTransverseMercator:Z7,geoTransverseMercatorRaw:Gf,gray:c8,greatest:xg,greatestIndex:z3,group:hg,groupSort:w3,groups:pg,hcl:Ua,hierarchy:Zs,histogram:vg,hsl:Ga,html:eD,image:KP,index:x3,indexes:_3,interpolate:je,interpolateArray:m8,interpolateBasis:d0,interpolateBasisClosed:g0,interpolateBlues:UC,interpolateBrBG:_C,interpolateBuGn:LC,interpolateBuPu:CC,interpolateCividis:jC,interpolateCool:KC,interpolateCubehelix:C8,interpolateCubehelixDefault:VC,interpolateCubehelixLong:ja,interpolateDate:_0,interpolateDiscrete:v8,interpolateGnBu:EC,interpolateGreens:BC,interpolateGreys:WC,interpolateHcl:T8,interpolateHclLong:L8,interpolateHsl:M8,interpolateHslLong:P8,interpolateHue:x8,interpolateInferno:oE,interpolateLab:D8,interpolateMagma:iE,interpolateNumber:de,interpolateNumberArray:oc,interpolateObject:w0,interpolateOrRd:RC,interpolateOranges:qC,interpolatePRGn:wC,interpolatePiYG:$C,interpolatePlasma:aE,interpolatePuBu:IC,interpolatePuBuGn:kC,interpolatePuOr:SC,interpolatePuRd:NC,interpolatePurples:HC,interpolateRainbow:QC,interpolateRdBu:AC,interpolateRdGy:MC,interpolateRdPu:FC,interpolateRdYlBu:PC,interpolateRdYlGn:DC,interpolateReds:XC,interpolateRgb:Yi,interpolateRgbBasis:b0,interpolateRgbBasisClosed:g8,interpolateRound:Xa,interpolateSinebow:eE,interpolateSpectral:TC,interpolateString:uc,interpolateTransformCss:M0,interpolateTransformSvg:P0,interpolateTurbo:nE,interpolateViridis:rE,interpolateWarm:ZC,interpolateYlGn:zC,interpolateYlGnBu:GC,interpolateYlOrBr:OC,interpolateYlOrRd:YC,interpolateZoom:T0,interrupt:Hn,intersection:Q3,interval:N8,isoFormat:tC,isoParse:rC,json:JP,lab:Ya,lch:f8,least:G3,leastIndex:$g,line:_u,lineRadial:gv,link:wu,linkHorizontal:wE,linkRadial:SE,linkVertical:$E,local:Yg,map:q3,matcher:Wl,max:Ei,maxIndex:Fl,mean:L3,median:C3,medianIndex:E3,merge:zl,min:Sa,minIndex:Gl,mode:k3,namespace:Ni,namespaces:Ul,nice:Il,now:Xi,pack:kT,packEnclose:DT,packSiblings:ET,pairs:I3,partition:IT,path:Rc,pathRound:F4,permute:bg,pie:hv,piecewise:R0,pointRadial:No,pointer:ue,pointers:X6,polygonArea:ZT,polygonCentroid:KT,polygonContains:e9,polygonHull:t9,polygonLength:n9,precisionFixed:Ym,precisionPrefix:Um,precisionRound:Bm,quadtree:fs,quantile:ki,quantileIndex:wg,quantileSorted:_g,quantize:E8,quickselect:Aa,radialArea:mv,radialLine:gv,randomBates:a9,randomBernoulli:l9,randomBeta:My,randomBinomial:Py,randomCauchy:f9,randomExponential:s9,randomGamma:jf,randomGeometric:Ay,randomInt:i9,randomIrwinHall:Sy,randomLcg:m9,randomLogNormal:o9,randomLogistic:h9,randomNormal:qf,randomPareto:u9,randomPoisson:p9,randomUniform:r9,randomWeibull:c9,range:fn,rank:F3,reduce:j3,reverse:V3,rgb:Cr,ribbon:H4,ribbonArrow:X4,rollup:gg,rollups:mg,scaleBand:Kf,scaleDiverging:Rb,scaleDivergingLog:kb,scaleDivergingPow:gh,scaleDivergingSqrt:lC,scaleDivergingSymlog:Ib,scaleIdentity:Ey,scaleImplicit:Vf,scaleLinear:Po,scaleLog:Fy,scaleOrdinal:Zf,scalePoint:Qf,scalePow:Qr,scaleQuantile:Wy,scaleQuantize:Hy,scaleRadial:By,scaleSequential:Tb,scaleSequentialLog:Lb,scaleSequentialPow:dh,scaleSequentialQuantile:Eb,scaleSequentialSqrt:uC,scaleSequentialSymlog:Cb,scaleSqrt:D9,scaleSymlog:Oy,scaleThreshold:Xy,scaleTime:aC,scaleUtc:sC,scan:O3,schemeAccent:fC,schemeBlues:rv,schemeBrBG:Nb,schemeBuGn:Hb,schemeBuPu:Xb,schemeCategory10:cC,schemeDark2:hC,schemeGnBu:qb,schemeGreens:iv,schemeGreys:ov,schemeObservable10:pC,schemeOrRd:jb,schemeOranges:uv,schemePRGn:Fb,schemePaired:dC,schemePastel1:gC,schemePastel2:mC,schemePiYG:Gb,schemePuBu:Zb,schemePuBuGn:Vb,schemePuOr:zb,schemePuRd:Kb,schemePurples:av,schemeRdBu:Ob,schemeRdGy:Yb,schemeRdPu:Qb,schemeRdYlBu:Ub,schemeRdYlGn:Bb,schemeReds:sv,schemeSet1:yC,schemeSet2:bC,schemeSet3:vC,schemeSpectral:Wb,schemeTableau10:xC,schemeYlGn:tv,schemeYlGnBu:Jb,schemeYlOrBr:ev,schemeYlOrRd:nv,select:j,selectAll:q6,selection:zn,selector:Ca,selectorAll:Bl,shuffle:Y3,shuffler:Sg,some:H3,sort:El,stack:JE,stackOffsetDiverging:eR,stackOffsetExpand:tR,stackOffsetNone:oi,stackOffsetSilhouette:nR,stackOffsetWiggle:rR,stackOrderAppearance:jv,stackOrderAscending:Vv,stackOrderDescending:oR,stackOrderInsideOut:aR,stackOrderNone:ai,stackOrderReverse:sR,stratify:zT,style:Gn,subset:t5,sum:Ag,superset:Pg,svg:nD,symbol:RE,symbolAsterisk:xv,symbolCircle:$u,symbolCross:_v,symbolDiamond:$v,symbolDiamond2:Sv,symbolPlus:Av,symbolSquare:Mv,symbolSquare2:Pv,symbolStar:Tv,symbolTimes:wh,symbolTriangle:Lv,symbolTriangle2:Cv,symbolWye:Ev,symbolX:wh,symbols:Rv,symbolsFill:Rv,symbolsStroke:EE,text:cs,thresholdFreedmanDiaconis:D3,thresholdScott:T3,thresholdSturges:Nl,tickFormat:Cy,tickIncrement:Nn,tickStep:$a,ticks:In,timeDay:ti,timeDays:k9,get timeFormat(){return fh},timeFormatDefaultLocale:Pb,timeFormatLocale:fb,timeFriday:Qy,timeFridays:Y9,timeHour:au,timeHours:E9,timeInterval:Dt,timeMillisecond:Jr,timeMilliseconds:qy,timeMinute:iu,timeMinutes:L9,timeMonday:To,timeMondays:F9,timeMonth:uu,timeMonths:V9,get timeParse(){return Mb},timeSaturday:Jy,timeSaturdays:U9,timeSecond:sn,timeSeconds:Vy,timeSunday:ei,timeSundays:tb,timeThursday:ir,timeThursdays:O9,timeTickInterval:cb,timeTicks:lb,timeTuesday:Zy,timeTuesdays:G9,timeWednesday:Ky,timeWednesdays:z9,timeWeek:ei,timeWeeks:tb,timeYear:Be,timeYears:K9,timeout:fc,timer:Qa,timerFlush:N0,transition:U0,transpose:Mg,tree:XT,treemap:wy,treemapBinary:qT,treemapDice:Ao,treemapResquarify:VT,treemapSlice:eu,treemapSliceDice:jT,treemapSquarify:Xf,tsv:ZP,tsvFormat:NP,tsvFormatBody:FP,tsvFormatRow:zP,tsvFormatRows:GP,tsvFormatValue:OP,tsvParse:wm,tsvParseRows:IP,union:e5,unixDay:uh,unixDays:N9,utcDay:Do,utcDays:I9,get utcFormat(){return cu},utcFriday:rb,utcFridays:q9,utcHour:su,utcHours:R9,utcMillisecond:Jr,utcMilliseconds:qy,utcMinute:ou,utcMinutes:C9,utcMonday:Lo,utcMondays:B9,utcMonth:lu,utcMonths:Z9,get utcParse(){return hh},utcSaturday:ib,utcSaturdays:j9,utcSecond:sn,utcSeconds:Vy,utcSunday:ni,utcSundays:ob,utcThursday:ar,utcThursdays:X9,utcTickInterval:ub,utcTicks:sb,utcTuesday:eb,utcTuesdays:W9,utcWednesday:nb,utcWednesdays:H9,utcWeek:ni,utcWeeks:ob,utcYear:We,utcYears:Q9,variance:sg,window:Hl,xml:tD,zip:B3,zoom:Jv,zoomIdentity:Lu,zoomTransform:Kv},Symbol.toStringTag,{value:"Module"}));function tx(t){try{return t.node().getBBox()}catch(e){throw new Error(e)}}function dR(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 Go(t){return t.substring(0,4)!=="ease"?ji:Th[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 Lh=(t,e)=>e instanceof Function?e(t):no(e)(t);function ex(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 gR(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 mR(t){const e=t.filter(n=>n.value!=null&&n.visible!=!1).map(n=>n.value);return gR(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 Ch(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,b,x)=>{j(x[b]).selectAll(`g.${u}`).data([b]).join(v=>v.append("g").classed(u,!0).attr("clip-path",`url(#${n})`).each((S,$,R)=>{j(R[$]).selectAll("defs").data([$]).join("defs"),j(R[$]).selectAll("g").data([$]).join("g").classed(l,!0)}),v=>v,v=>v.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],b=y.translate,x=y.scale;return`translate(${b[0]}, ${b[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}},nx=({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 d=h.computedData[0]?h.computedData[0].length-1:0,g=h.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[0]-h.fullDataFormatter.grid.groupAxis.scalePadding,m=h.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?d+h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[1]+h.fullDataFormatter.grid.groupAxis.scalePadding;return[g,m]}),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=tg({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 x={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},v=m(x),S=g(v),$=Math.ceil(p.groupScaleDomain[0]),R=S+$;return{groupIndex:R,groupLabel:p.scaleRangeGroupLabels[R]??""}};return h.next(y),function(){a.next(void 0)}})})},yR=({rootSelection:t,fullDataFormatter$:e,gridAxesSize$:n,computedData$:r,fullChartParams$:i,gridContainerPosition$:o,layout$:a})=>{const s=Ch(t,"mousemove"),u=B({fullDataFormatter:e,gridAxesSize:n,computedData:r}).pipe(W(async b=>b),F(b=>{const v=b.computedData[0]?b.computedData[0].length-1:0,S=b.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-b.fullDataFormatter.grid.groupAxis.scalePadding:b.fullDataFormatter.grid.groupAxis.scaleDomain[0]-b.fullDataFormatter.grid.groupAxis.scalePadding,$=b.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?v+b.fullDataFormatter.grid.groupAxis.scalePadding:b.fullDataFormatter.grid.groupAxis.scaleDomain[1]+b.fullDataFormatter.grid.groupAxis.scalePadding;return[S,$]}),St(1)),l=B({fullDataFormatter:e,computedData:r}).pipe(W(async b=>b),F(b=>b.fullDataFormatter.grid.seriesDirection==="row"?(b.computedData[0]??[]).map(x=>x.groupLabel):b.computedData.map(x=>x[0].groupLabel))),c=B({groupScaleDomain:u,groupLabels:l}).pipe(W(async b=>b),F(b=>b.groupLabels.filter((x,v)=>v>=b.groupScaleDomain[0]&&v<=b.groupScaleDomain[1]))),f=e.pipe(F(b=>b.grid.valueAxis.position==="right"||b.grid.valueAxis.position==="bottom")),h=B({reverse:f,gridAxesSize:n,scaleRangeGroupLabels:c,fullDataFormatter:e}).pipe(W(async b=>b),F(b=>tg({axisLabels:b.scaleRangeGroupLabels,axisWidth:b.gridAxesSize.width,padding:b.fullDataFormatter.grid.groupAxis.scalePadding,reverse:b.reverse}))),p=o.pipe(F(b=>b.reduce((v,S)=>S.columnIndex>v?S.columnIndex:v,0)+1),tt()),d=o.pipe(F(b=>b.reduce((v,S)=>S.rowIndex>v?S.rowIndex:v,0)+1),tt()),g=B({fullDataFormatter:e,fullChartParams:i,rootMousemove:s,columnAmount:p,rowAmount:d,layout:a}).pipe(W(async b=>b),F(b=>{const x={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"?x.offsetX-b.fullChartParams.padding.left:x.offsetY-b.fullChartParams.padding.top})),m=B({xIndexScale:h,axisValue:g,groupScaleDomain:u}).pipe(W(async b=>b),F(b=>{const x=b.xIndexScale(b.axisValue),v=Math.ceil(b.groupScaleDomain[0]);return x+v})),y=B({groupIndex:m,groupLabels:l}).pipe(W(async b=>b),F(b=>b.groupLabels[b.groupIndex]??""));return B({groupIndex:m,groupLabel:y}).pipe(W(async b=>b),F(b=>({groupIndex:b.groupIndex,groupLabel:b.groupLabel})))};function bR(t="curveLinear"){return _u().x(e=>e.axisX).y(e=>e.axisY).curve(Th[t])}function vR(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 xR({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 wR({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(Go(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 rx=(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$:x})=>{const v=new nt,S=Sn(t,"clipPath-box"),$=it(t,"path"),{seriesSelection$:R,axesSelection$:P,defsSelection$:_,graphicGSelection$:w}=sr({selection:e,pluginName:t,clipPathID:S,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),A=new dt(z=>{const k=l.pipe(I(v)).subscribe(E=>{if(!E)return;const T=bR(E.lineCurve);z.next(T)});return()=>{k.unsubscribe()}}),N=f.pipe(F(z=>z.transitionDuration),tt()),C=f.pipe(F(z=>z.transitionEase),tt());B({defsSelection:_,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:C}).pipe(I(v),W(async z=>z)).subscribe(z=>{const E=[{id:S,width:z.axisSize.width,height:z.axisSize.height}].concat(z.seriesLabels.map(T=>({id:`orbcharts__clipPath_${T}`,width:z.axisSize.width,height:z.axisSize.height})));wR({defsSelection:z.defsSelection,clipPathData:E,transitionDuration:z.transitionDuration,transitionEase:z.transitionEase})});const M=n.pipe(F(z=>{const k=new Map;return z.flat().forEach(E=>k.set(E.id,E)),k})),L=nx({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:y,layout$:b}),D=f.pipe(I(v),F(z=>z.highlightTarget),tt()),O=B({graphicGSelection:w,visibleComputedLayoutData:o,linePath:A,params:l}).pipe(I(v),W(async z=>z),F(z=>{let k=[];return z.graphicGSelection.each((E,T,G)=>{const q=vR(z.visibleComputedLayoutData[T]??[]);k[T]=xR({selection:j(G[T]),pathClassName:$,linePath:z.linePath,segmentData:q,params:z.params})}),k}));return B({pathSelectionArr:O,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:D,gridGroupPositionFn:L}).pipe(I(v),W(async z=>z)).subscribe(z=>{z.pathSelectionArr.forEach(k=>{k.on("mouseover",(E,T)=>{E.stopPropagation();const G=T[0]?T[0].seriesLabel:"",{groupIndex:q,groupLabel:Q}=z.gridGroupPositionFn(E),U=z.GroupDataMap.get(Q).find(V=>V.seriesLabel===G)??T[0];x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:z.highlightTarget,datum:U,gridIndex:U.gridIndex,series:z.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:z.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:E,data:z.computedData})}).on("mousemove",(E,T)=>{E.stopPropagation();const G=T[0]?T[0].seriesLabel:"",{groupIndex:q,groupLabel:Q}=z.gridGroupPositionFn(E),U=z.GroupDataMap.get(Q).find(V=>V.seriesLabel===G)??T[0];x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:z.highlightTarget,datum:U,gridIndex:U.gridIndex,series:z.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:z.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:E,data:z.computedData})}).on("mouseout",(E,T)=>{E.stopPropagation();const G=T[0]?T[0].seriesLabel:"",{groupIndex:q,groupLabel:Q}=z.gridGroupPositionFn(E),U=z.GroupDataMap.get(Q).find(V=>V.seriesLabel===G)??T[0];x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:z.highlightTarget,datum:U,gridIndex:U.gridIndex,series:z.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:z.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:E,data:z.computedData})}).on("click",(E,T)=>{E.stopPropagation();const G=T[0]?T[0].seriesLabel:"",{groupIndex:q,groupLabel:Q}=z.gridGroupPositionFn(E),U=z.GroupDataMap.get(Q).find(V=>V.seriesLabel===G)??T[0];x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:z.highlightTarget,datum:U,gridIndex:U.gridIndex,series:z.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:z.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:E,data:z.computedData})})})}),f.pipe(I(v),hi(z=>z.highlightTarget==="series"),W(z=>B({graphicGSelection:w,gridHighlight:g,DataMap:M,fullChartParams:f}).pipe(I(v),W(async k=>k)))).subscribe(z=>{const k=z.gridHighlight[0]?z.gridHighlight[0].seriesLabel:null;_R({selection:z.graphicGSelection,seriesLabel:k,fullChartParams:z.fullChartParams})}),()=>{v.next(void 0)}},ix="Lines",$R=se(ix,lr)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=rx(ix,{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 SR(t="curveLinear",e){return bh().x(n=>n.axisX).y0(n=>e).y1(n=>n.axisY).curve(Th[t])}function AR(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 MR({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 PR({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 DR({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
10
|
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
11
11
|
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
12
|
-
`})}function TR({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)=>{Z(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(Io(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$:b})=>{const x=new nt,v=$n(t,"clipPath-box"),$=at(t,"path"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),M=p.pipe(I(x),F(k=>-k.translate[1]/k.scale[1])),S=new dt(k=>{const E=Y({fullParams:l,valueAxisStart:M}).pipe(I(x)).subscribe(T=>{const N=SR(T.fullParams.lineCurve,T.valueAxisStart);k.next(N)});return()=>{E.unsubscribe()}}),G=f.pipe(F(k=>k.transitionDuration),tt()),C=f.pipe(F(k=>k.transitionEase),tt());Y({defsSelection:D,seriesLabels:a,axisSize:d,transitionDuration:G,transitionEase:C}).pipe(I(x),W(async k=>k)).subscribe(k=>{const T=[{id:v,width:k.axisSize.width,height:k.axisSize.height}].concat(k.seriesLabels.map(N=>({id:`orbcharts__clipPath_${N}`,width:k.axisSize.width,height:k.axisSize.height})));TR({defsSelection:k.defsSelection,clipPathData:T,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase})});const A=n.pipe(F(k=>{const E=new Map;return k.flat().forEach(T=>E.set(T.id,T)),E})),L=rx({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:m,layout$:y}),P=f.pipe(I(x),F(k=>k.highlightTarget),tt()),O=a.pipe(I(x),F(k=>k.map((E,T)=>$n(t,`lineargradient-${E}`)))),z=Y({graphicGSelection:_,defsSelection:D,visibleComputedLayoutData:o,linearGradientIds:O,areaPath:S,params:l}).pipe(I(x),W(async k=>k),F(k=>{let E=[];return k.graphicGSelection.each((T,N,j)=>{const Q=AR(k.visibleComputedLayoutData[N]??[]);E[N]=MR({selection:Z(j[N]),pathClassName:$,areaPath:k.areaPath,segmentData:Q,linearGradientIds:k.linearGradientIds,params:k.params}),PR({defsSelection:k.defsSelection,computedData:k.visibleComputedLayoutData,linearGradientIds:k.linearGradientIds,params:k.params})}),E}));return Y({pathSelectionArr:z,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:P,gridGroupPositionFn:L}).pipe(I(x),W(async k=>k)).subscribe(k=>{k.pathSelectionArr.forEach(E=>{E.on("mouseover",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})}).on("mousemove",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})}).on("mouseout",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})}).on("click",(T,N)=>{const j=N[0]?N[0].seriesLabel:"",{groupIndex:Q,groupLabel:U}=k.gridGroupPositionFn(T),q=k.GroupDataMap.get(U).find(V=>V.seriesLabel===j)??N[0];b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:k.highlightTarget,datum:q,gridIndex:q.gridIndex,series:k.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:k.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:T,data:k.computedData})})})}),f.pipe(I(x),li(k=>k.highlightTarget==="series"),W(k=>Y({graphicGSelection:_,gridHighlight:g,DataMap:A,fullChartParams:f}).pipe(I(x),W(async E=>E)))).subscribe(k=>{const E=k.gridHighlight[0]?k.gridHighlight[0].seriesLabel:null;DR({selection:k.graphicGSelection,seriesLabel:E,fullChartParams:k.fullChartParams})}),()=>{x.next(void 0)}},sx="LineAreas",LR=se(sx,ip)(({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 CR(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 ER(t,e){return t<=1?0:e/(t-1)*ux}function RR(t,e){return t<=1?e:e*(1-ux)}function kR({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)=>{Z(y[m]).selectAll(`rect.${e}`).data(n[m]??[],b=>b.id).join(b=>b.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",x=>0),b=>b,b=>b.remove()).attr("transform",(b,x)=>`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(Io(s.transitionEase)).delay((b,x)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero))}),t.selectAll(`rect.${e}`)}function IR({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)=>{Z(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 NR({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)?Z(o[i]).style("opacity",1):Z(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Eh=(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 x=new nt,v=$n(t,"clipPath-box"),$=at(t,"rect"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),M=o.pipe(I(x),F(E=>E.map(T=>T[0]?T[0].axisY-T[0].axisYFromZero:0)),tt()),S=Y({computedData:n,visibleComputedData:i,params:l,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async E=>E),F(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?lx({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):lx({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:E.visibleComputedData.length,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding})),tt()),G=Y({computedData:n,barWidth:S,params:l,gridGraphicReverseScale:p}).pipe(I(x),W(async E=>E),F(E=>{const T=E.barWidth/2,N=E.params.barRadius===!0?T:E.params.barRadius===!1?0:typeof E.params.barRadius=="number"?E.params.barRadius:0;return E.computedData.map((j,Q)=>{const U=E.gridGraphicReverseScale[Q]??E.gridGraphicReverseScale[0];let X=N*U[0],B=N*U[1];if(X>T){const q=T/X;X=X*q,B=B*q}return[X,B]})})),C=i.pipe(I(x),F(E=>{const T=new Set;return E.forEach(N=>{N.forEach(j=>{T.add(j.groupLabel)})}),Array.from(T)})),A=Y({seriesLabels:a,barWidth:S,params:l}).pipe(I(x),W(async E=>E),F(E=>CR(E.barWidth,E.seriesLabels,E.params))),L=c.pipe(I(x),F(E=>E.transitionDuration),tt()),P=new dt(E=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async T=>T)).subscribe(T=>{const N=ER(T.groupLabels.length,T.transitionDuration);E.next(N)})}).pipe(I(x),tt()),O=new dt(E=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async T=>T)).subscribe(T=>{const N=RR(T.groupLabels.length,T.transitionDuration);E.next(N)})}).pipe(I(x),tt());Y({defsSelection:D,gridAxesSize:d}).pipe(I(x),W(async E=>E)).subscribe(E=>{const T=[{id:v,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];IR({defsSelection:E.defsSelection,clipPathData:T})});const z=c.pipe(I(x),F(E=>E.highlightTarget),tt()),k=Y({graphicGSelection:_,visibleComputedLayoutData:o,zeroYArr:M,groupLabels:C,barScale:A,params:l,chartParams:c,highlightTarget:z,barWidth:S,transformedBarRadius:G,delayGroup:P,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async E=>E),F(E=>kR({graphicGSelection:E.graphicGSelection,rectClassName:$,visibleComputedLayoutData:E.visibleComputedLayoutData,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,transformedBarRadius:E.transformedBarRadius,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate})));return Y({barSelection:k,computedData:n,highlightTarget:z,SeriesDataMap:s,GroupDataMap:u}).pipe(I(x),W(async E=>E)).subscribe(E=>{E.barSelection.on("mouseover",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})}).on("mousemove",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})}).on("mouseout",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})}).on("click",(T,N)=>{T.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:N,gridIndex:N.gridIndex,series:E.SeriesDataMap.get(N.seriesLabel),seriesIndex:N.seriesIndex,seriesLabel:N.seriesLabel,groups:E.GroupDataMap.get(N.groupLabel),groupIndex:N.groupIndex,groupLabel:N.groupLabel,event:T,data:E.computedData})})}),Y({barSelection:k,highlight:g.pipe(F(E=>E.map(T=>T.id))),fullChartParams:c}).pipe(I(x),W(async E=>E)).subscribe(E=>{NR({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{x.next(void 0)}},cx="Bars",FR=se(cx,Go)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Eh(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",GR=se(fx,Go)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Eh(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$:Yo(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),hx=.3;function zR({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function OR(t,e){return t<=1?0:e/(t-1)*hx}function UR(t,e){return t<=1?e:e*(1-hx)}function BR({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)=>{Z(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(Io(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 YR({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)=>{Z(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 WR({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)?Z(o[i]).style("opacity",1):Z(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$:b,event$:x})=>{const v=new nt,$=$n(t,"clipPath-box"),w=at(t,"rect"),{seriesSelection$:R,axesSelection$:D,defsSelection$:_,graphicGSelection$:M}=ar({selection:e,pluginName:t,clipPathID:$,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),S=o.pipe(I(v),F(U=>U[0]&&U[0][0]?U[0][0].axisY-U[0][0].axisYFromZero:0),tt()),G=Y({computedData:n,params:l,axisSize:g,isSeriesSeprate:b}).pipe(I(v),W(async U=>U),F(U=>U.params.barWidth?U.params.barWidth:zR({axisWidth:U.axisSize.width,groupAmount:U.computedData[0]?U.computedData[0].length:0,barGroupPadding:U.params.barGroupPadding})),tt()),C=Y({computedData:n,barWidth:G,params:l,gridGraphicReverseScale:d}).pipe(I(v),W(async U=>U),F(U=>{const X=U.barWidth/2,B=U.params.barRadius===!0?X:U.params.barRadius===!1?0:typeof U.params.barRadius=="number"?U.params.barRadius:0;return U.computedData.map((q,V)=>{const rt=U.gridGraphicReverseScale[V]??U.gridGraphicReverseScale[0],ut=B*rt[0],H=B*rt[1];return[ut,H]})})),A=i.pipe(I(v),F(U=>{const X=new Set;return U.forEach(B=>{B.forEach(q=>{X.add(q.groupLabel)})}),Array.from(X)}),St(1)),L=f.pipe(I(v),F(U=>U.transitionDuration),tt()),P=new dt(U=>{Y({groupLabels:A,transitionDuration:L}).pipe(W(async X=>X)).subscribe(X=>{const B=OR(X.groupLabels.length,X.transitionDuration);U.next(B)})}).pipe(I(v),tt()),O=new dt(U=>{Y({groupLabels:A,transitionDuration:L}).pipe(W(async X=>X)).subscribe(X=>{const B=UR(X.groupLabels.length,X.transitionDuration);U.next(B)})}).pipe(I(v),tt()),z=Y({computedData:n,dataFormatter:c}).pipe(I(v),W(async U=>U),F(U=>{const B=U.computedData[0]?U.computedData[0].length-1:0,q=U.dataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0:U.dataFormatter.grid.groupAxis.scaleDomain[0],V=U.dataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?B:U.dataFormatter.grid.groupAxis.scaleDomain[1];return[q,V]})),k=Y({visibleComputedLayoutData:o,groupScaleDomain:z}).pipe(I(v),W(async U=>U),F(U=>{const X=U.groupScaleDomain[0],B=U.groupScaleDomain[1],V=U.visibleComputedLayoutData.map(mt=>mt.filter((ht,Yt)=>ht.groupIndex>=X&&ht.groupIndex<=B)).flat();if(V.length<=1)return 1;const rt=V.reduce((mt,ht)=>ht.value>mt.value?ht:mt,V[0]),ut=rt.groupIndex,H=V.filter(mt=>mt.groupIndex===ut).reduce((mt,ht)=>mt+ht.value,0);return rt.value/H})),E=Y({computedLayoutData:r,yRatio:k,zeroY:S}).pipe(I(v),F(U=>{let X=U.computedLayoutData[0]?U.computedLayoutData[0].map(()=>U.zeroY):[];return U.computedLayoutData.map((B,q)=>B.map((V,rt)=>{const ut=X[rt];let H=0;return V.visible&&(H=V.axisYFromZero*U.yRatio,X[rt]=X[rt]+H),{...V,_barStartY:ut,_barHeight:H}}))})),T=Y({computedLayoutData:r,zeroY:S}).pipe(I(v),F(U=>U.computedLayoutData.map((X,B)=>X.map((q,V)=>({...q,_barStartY:U.zeroY,_barHeight:q.axisYFromZero}))))),N=b.pipe(W(U=>c_(()=>U,T,E)));Y({defsSelection:_,gridAxesSize:g}).pipe(I(v),W(async U=>U)).subscribe(U=>{const X=[{id:$,width:U.gridAxesSize.width,height:U.gridAxesSize.height}];YR({defsSelection:U.defsSelection,clipPathData:X})});const j=f.pipe(I(v),F(U=>U.highlightTarget),tt()),Q=Y({graphicGSelection:M,graphicData:N,zeroY:S,groupLabels:A,params:l,chartParams:f,highlightTarget:j,barWidth:G,transformedBarRadius:C,delayGroup:P,transitionItem:O,isSeriesSeprate:b}).pipe(I(v),W(async U=>U),F(U=>BR({graphicGSelection:U.graphicGSelection,rectClassName:w,barData:U.graphicData,zeroY:U.zeroY,groupLabels:U.groupLabels,params:U.params,chartParams:U.chartParams,barWidth:U.barWidth,transformedBarRadius:U.transformedBarRadius,delayGroup:U.delayGroup,transitionItem:U.transitionItem,isSeriesSeprate:U.isSeriesSeprate})));return Y({barSelection:Q,computedData:n,highlightTarget:j,SeriesDataMap:s,GroupDataMap:u}).subscribe(U=>{U.barSelection.on("mouseover",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})}).on("mousemove",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})}).on("mouseout",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})}).on("click",(X,B)=>{X.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:U.highlightTarget,datum:B,gridIndex:B.gridIndex,series:U.SeriesDataMap.get(B.seriesLabel),seriesIndex:B.seriesIndex,seriesLabel:B.seriesLabel,groups:U.GroupDataMap.get(B.groupLabel),groupIndex:B.groupIndex,groupLabel:B.groupLabel,event:X,data:U.computedData})})}),Y({barSelection:Q,highlight:m.pipe(F(U=>U.map(X=>X.id))),fullChartParams:f}).pipe(I(v),W(async U=>U)).subscribe(U=>{WR({selection:U.barSelection,ids:U.highlight,fullChartParams:U.fullChartParams})}),()=>{v.next(void 0)}},dx="BarStack",HR=se(dx,ap)(({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 VR(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 jR(t,e){return t<=1?0:e/(t-1)*gx}function qR(t,e){return t<=1?e:e*(1-gx)}function XR({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)=>{Z(b[y]).selectAll(`g.${e}`).data(r[y]??[]).join(v=>{const $=v.append("g").classed(e,!0).attr("cursor","pointer");return $.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",w=>{const R=-d,D=o[y],_=o[y];return`M${R},${D} L${R+c/2},${_} ${R+c},${D}`}),$},v=>v,v=>v.remove()).attr("transform",v=>`translate(${p?0:s(v.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",v=>Math.abs(v.axisYFromZero)).attr("y",v=>v.axisY<o[y]?v.axisY:o[y]).attr("x",v=>p?0:s(v.seriesLabel)).style("fill",v=>`url(#${i[v.seriesIndex]})`).attr("stroke",v=>v.color).attr("transform",v=>`translate(${v?v.axisX:0}, 0)`).transition().duration(h).ease(Io(l.transitionEase)).delay((v,$)=>v.groupIndex*f).attr("d",v=>{const $=-d,w=o[y],R=v.axisY;return`M${$},${w} L${$+c/2},${R} ${$+c},${w}`})}),t.selectAll(`path.${n}`)}function ZR({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`
|
12
|
+
`})}function TR({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(Go(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 ox=(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 x=new nt,v=Sn(t,"clipPath-box"),S=it(t,"path"),{seriesSelection$:$,axesSelection$:R,defsSelection$:P,graphicGSelection$:_}=sr({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p}),w=p.pipe(I(x),F(k=>-k.translate[1]/k.scale[1])),A=new dt(k=>{const E=B({fullParams:l,valueAxisStart:w}).pipe(I(x)).subscribe(T=>{const G=SR(T.fullParams.lineCurve,T.valueAxisStart);k.next(G)});return()=>{E.unsubscribe()}}),N=f.pipe(F(k=>k.transitionDuration),tt()),C=f.pipe(F(k=>k.transitionEase),tt());B({defsSelection:P,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:C}).pipe(I(x),W(async k=>k)).subscribe(k=>{const T=[{id:v,width:k.axisSize.width,height:k.axisSize.height}].concat(k.seriesLabels.map(G=>({id:`orbcharts__clipPath_${G}`,width:k.axisSize.width,height:k.axisSize.height})));TR({defsSelection:k.defsSelection,clipPathData:T,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase})});const M=n.pipe(F(k=>{const E=new Map;return k.flat().forEach(T=>E.set(T.id,T)),E})),L=nx({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((E,T)=>Sn(t,`lineargradient-${E}`)))),z=B({graphicGSelection:_,defsSelection:P,visibleComputedLayoutData:o,linearGradientIds:O,areaPath:A,params:l}).pipe(I(x),W(async k=>k),F(k=>{let E=[];return k.graphicGSelection.each((T,G,q)=>{const Q=AR(k.visibleComputedLayoutData[G]??[]);E[G]=MR({selection:j(q[G]),pathClassName:S,areaPath:k.areaPath,segmentData:Q,linearGradientIds:k.linearGradientIds,params:k.params}),DR({defsSelection:k.defsSelection,computedData:k.visibleComputedLayoutData,linearGradientIds:k.linearGradientIds,params:k.params})}),E}));return B({pathSelectionArr:z,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:D,gridGroupPositionFn:L}).pipe(I(x),W(async k=>k)).subscribe(k=>{k.pathSelectionArr.forEach(E=>{E.on("mouseover",(T,G)=>{const q=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(T),V=k.GroupDataMap.get(Y).find(X=>X.seriesLabel===q)??G[0];b.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:T,data:k.computedData})}).on("mousemove",(T,G)=>{const q=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(T),V=k.GroupDataMap.get(Y).find(X=>X.seriesLabel===q)??G[0];b.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:T,data:k.computedData})}).on("mouseout",(T,G)=>{const q=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(T),V=k.GroupDataMap.get(Y).find(X=>X.seriesLabel===q)??G[0];b.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:T,data:k.computedData})}).on("click",(T,G)=>{const q=G[0]?G[0].seriesLabel:"",{groupIndex:Q,groupLabel:Y}=k.gridGroupPositionFn(T),V=k.GroupDataMap.get(Y).find(X=>X.seriesLabel===q)??G[0];b.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:T,data:k.computedData})})})}),f.pipe(I(x),hi(k=>k.highlightTarget==="series"),W(k=>B({graphicGSelection:_,gridHighlight:g,DataMap:M,fullChartParams:f}).pipe(I(x),W(async E=>E)))).subscribe(k=>{const E=k.gridHighlight[0]?k.gridHighlight[0].seriesLabel:null;PR({selection:k.graphicGSelection,seriesLabel:E,fullChartParams:k.fullChartParams})}),()=>{x.next(void 0)}},ax="LineAreas",LR=se(ax,ip)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ox(ax,{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()}}),sx=.3;function ux({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 CR(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 ER(t,e){return t<=1?0:e/(t-1)*sx}function RR(t,e){return t<=1?e:e*(1-sx)}function kR({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]??[],b=>b.id).join(b=>b.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",x=>0),b=>b,b=>b.remove()).attr("transform",(b,x)=>`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(Go(s.transitionEase)).delay((b,x)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero))}),t.selectAll(`rect.${e}`)}function IR({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 NR({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 Eh=(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 x=new nt,v=Sn(t,"clipPath-box"),S=it(t,"rect"),{seriesSelection$:$,axesSelection$:R,defsSelection$:P,graphicGSelection$:_}=sr({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),w=o.pipe(I(x),F(E=>E.map(T=>T[0]?T[0].axisY-T[0].axisYFromZero:0)),tt()),A=B({computedData:n,visibleComputedData:i,params:l,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async E=>E),F(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?ux({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):ux({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:E.visibleComputedData.length,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding})),tt()),N=B({computedData:n,barWidth:A,params:l,gridGraphicReverseScale:p}).pipe(I(x),W(async E=>E),F(E=>{const T=E.barWidth/2,G=E.params.barRadius===!0?T:E.params.barRadius===!1?0:typeof E.params.barRadius=="number"?E.params.barRadius:0;return E.computedData.map((q,Q)=>{const Y=E.gridGraphicReverseScale[Q]??E.gridGraphicReverseScale[0];let Z=G*Y[0],U=G*Y[1];if(Z>T){const V=T/Z;Z=Z*V,U=U*V}return[Z,U]})})),C=i.pipe(I(x),F(E=>{const T=new Set;return E.forEach(G=>{G.forEach(q=>{T.add(q.groupLabel)})}),Array.from(T)})),M=B({seriesLabels:a,barWidth:A,params:l}).pipe(I(x),W(async E=>E),F(E=>CR(E.barWidth,E.seriesLabels,E.params))),L=c.pipe(I(x),F(E=>E.transitionDuration),tt()),D=new dt(E=>{B({groupLabels:C,transitionDuration:L}).pipe(W(async T=>T)).subscribe(T=>{const G=ER(T.groupLabels.length,T.transitionDuration);E.next(G)})}).pipe(I(x),tt()),O=new dt(E=>{B({groupLabels:C,transitionDuration:L}).pipe(W(async T=>T)).subscribe(T=>{const G=RR(T.groupLabels.length,T.transitionDuration);E.next(G)})}).pipe(I(x),tt());B({defsSelection:P,gridAxesSize:d}).pipe(I(x),W(async E=>E)).subscribe(E=>{const T=[{id:v,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];IR({defsSelection:E.defsSelection,clipPathData:T})});const z=c.pipe(I(x),F(E=>E.highlightTarget),tt()),k=B({graphicGSelection:_,visibleComputedLayoutData:o,zeroYArr:w,groupLabels:C,barScale:M,params:l,chartParams:c,highlightTarget:z,barWidth:A,transformedBarRadius:N,delayGroup:D,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async E=>E),F(E=>kR({graphicGSelection:E.graphicGSelection,rectClassName:S,visibleComputedLayoutData:E.visibleComputedLayoutData,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,transformedBarRadius:E.transformedBarRadius,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate})));return B({barSelection:k,computedData:n,highlightTarget:z,SeriesDataMap:s,GroupDataMap:u}).pipe(I(x),W(async E=>E)).subscribe(E=>{E.barSelection.on("mouseover",(T,G)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:G,gridIndex:G.gridIndex,series:E.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:E.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:T,data:E.computedData})}).on("mousemove",(T,G)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:G,gridIndex:G.gridIndex,series:E.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:E.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:T,data:E.computedData})}).on("mouseout",(T,G)=>{T.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:G,gridIndex:G.gridIndex,series:E.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:E.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:T,data:E.computedData})}).on("click",(T,G)=>{T.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:G,gridIndex:G.gridIndex,series:E.SeriesDataMap.get(G.seriesLabel),seriesIndex:G.seriesIndex,seriesLabel:G.seriesLabel,groups:E.GroupDataMap.get(G.groupLabel),groupIndex:G.groupIndex,groupLabel:G.groupLabel,event:T,data:E.computedData})})}),B({barSelection:k,highlight:g.pipe(F(E=>E.map(T=>T.id))),fullChartParams:c}).pipe(I(x),W(async E=>E)).subscribe(E=>{NR({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{x.next(void 0)}},lx="Bars",FR=se(lx,Yo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Eh(lx,{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()}}),cx="BarsPN",GR=se(cx,Yo)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Eh(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$:Xo(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),fx=.3;function zR({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function OR(t,e){return t<=1?0:e/(t-1)*fx}function YR(t,e){return t<=1?e:e*(1-fx)}function UR({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",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(Go(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 BR({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 WR({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 hx=(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$:x})=>{const v=new nt,S=Sn(t,"clipPath-box"),$=it(t,"rect"),{seriesSelection$:R,axesSelection$:P,defsSelection$:_,graphicGSelection$:w}=sr({selection:e,pluginName:t,clipPathID:S,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),A=o.pipe(I(v),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:b}).pipe(I(v),W(async Y=>Y),F(Y=>Y.params.barWidth?Y.params.barWidth:zR({axisWidth:Y.axisSize.width,groupAmount:Y.computedData[0]?Y.computedData[0].length:0,barGroupPadding:Y.params.barGroupPadding})),tt()),C=B({computedData:n,barWidth:N,params:l,gridGraphicReverseScale:d}).pipe(I(v),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,X)=>{const rt=Y.gridGraphicReverseScale[X]??Y.gridGraphicReverseScale[0],ut=U*rt[0],H=U*rt[1];return[ut,H]})})),M=i.pipe(I(v),F(Y=>{const Z=new Set;return Y.forEach(U=>{U.forEach(V=>{Z.add(V.groupLabel)})}),Array.from(Z)}),St(1)),L=f.pipe(I(v),F(Y=>Y.transitionDuration),tt()),D=new dt(Y=>{B({groupLabels:M,transitionDuration:L}).pipe(W(async Z=>Z)).subscribe(Z=>{const U=OR(Z.groupLabels.length,Z.transitionDuration);Y.next(U)})}).pipe(I(v),tt()),O=new dt(Y=>{B({groupLabels:M,transitionDuration:L}).pipe(W(async Z=>Z)).subscribe(Z=>{const U=YR(Z.groupLabels.length,Z.transitionDuration);Y.next(U)})}).pipe(I(v),tt()),z=B({computedData:n,dataFormatter:c}).pipe(I(v),W(async Y=>Y),F(Y=>{const U=Y.computedData[0]?Y.computedData[0].length-1:0,V=Y.dataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0:Y.dataFormatter.grid.groupAxis.scaleDomain[0],X=Y.dataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?U:Y.dataFormatter.grid.groupAxis.scaleDomain[1];return[V,X]})),k=B({visibleComputedLayoutData:o,groupScaleDomain:z}).pipe(I(v),W(async Y=>Y),F(Y=>{const Z=Y.groupScaleDomain[0],U=Y.groupScaleDomain[1],X=Y.visibleComputedLayoutData.map(mt=>mt.filter((ht,Bt)=>ht.groupIndex>=Z&&ht.groupIndex<=U)).flat();if(X.length<=1)return 1;const rt=X.reduce((mt,ht)=>ht.value>mt.value?ht:mt,X[0]),ut=rt.groupIndex,H=X.filter(mt=>mt.groupIndex===ut).reduce((mt,ht)=>mt+ht.value,0);return rt.value/H})),E=B({computedLayoutData:r,yRatio:k,zeroY:A}).pipe(I(v),F(Y=>{let Z=Y.computedLayoutData[0]?Y.computedLayoutData[0].map(()=>Y.zeroY):[];return Y.computedLayoutData.map((U,V)=>U.map((X,rt)=>{const ut=Z[rt];let H=0;return X.visible&&(H=X.axisYFromZero*Y.yRatio,Z[rt]=Z[rt]+H),{...X,_barStartY:ut,_barHeight:H}}))})),T=B({computedLayoutData:r,zeroY:A}).pipe(I(v),F(Y=>Y.computedLayoutData.map((Z,U)=>Z.map((V,X)=>({...V,_barStartY:Y.zeroY,_barHeight:V.axisYFromZero}))))),G=b.pipe(W(Y=>l_(()=>Y,T,E)));B({defsSelection:_,gridAxesSize:g}).pipe(I(v),W(async Y=>Y)).subscribe(Y=>{const Z=[{id:S,width:Y.gridAxesSize.width,height:Y.gridAxesSize.height}];BR({defsSelection:Y.defsSelection,clipPathData:Z})});const q=f.pipe(I(v),F(Y=>Y.highlightTarget),tt()),Q=B({graphicGSelection:w,graphicData:G,zeroY:A,groupLabels:M,params:l,chartParams:f,highlightTarget:q,barWidth:N,transformedBarRadius:C,delayGroup:D,transitionItem:O,isSeriesSeprate:b}).pipe(I(v),W(async Y=>Y),F(Y=>UR({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:q,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(v),W(async Y=>Y)).subscribe(Y=>{WR({selection:Y.barSelection,ids:Y.highlight,fullChartParams:Y.fullChartParams})}),()=>{v.next(void 0)}},px="BarStack",HR=se(px,ap)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=hx(px,{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()}}),dx=.3;function gx({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 XR(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 qR(t,e){return t<=1?0:e/(t-1)*dx}function jR(t,e){return t<=1?e:e*(1-dx)}function VR({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)=>{j(b[y]).selectAll(`g.${e}`).data(r[y]??[]).join(v=>{const S=v.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,P=o[y],_=o[y];return`M${R},${P} L${R+c/2},${_} ${R+c},${P}`}),S},v=>v,v=>v.remove()).attr("transform",v=>`translate(${p?0:s(v.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",v=>Math.abs(v.axisYFromZero)).attr("y",v=>v.axisY<o[y]?v.axisY:o[y]).attr("x",v=>p?0:s(v.seriesLabel)).style("fill",v=>`url(#${i[v.seriesIndex]})`).attr("stroke",v=>v.color).attr("transform",v=>`translate(${v?v.axisX:0}, 0)`).transition().duration(h).ease(Go(l.transitionEase)).delay((v,S)=>v.groupIndex*f).attr("d",v=>{const S=-d,$=o[y],R=v.axisY;return`M${S},${$} L${S+c/2},${R} ${S+c},${$}`})}),t.selectAll(`path.${n}`)}function ZR({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
13
|
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
14
14
|
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
15
|
-
`})}function KR({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)=>{Z(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 QR({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)?Z(a[o]).style("opacity",1):Z(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$:b})=>{const x=new nt,v=$n(t,"clipPath-box"),$=at(t,"pathG"),w=at(t,"path"),{seriesSelection$:R,axesSelection$:D,defsSelection$:_,graphicGSelection$:M}=ar({selection:e,pluginName:t,clipPathID:v,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(x),F(T=>-T.translate[1]/T.scale[1]));const S=o.pipe(F(T=>T.map(N=>N[0]?N[0].axisY-N[0].axisYFromZero:0)),tt()),G=Y({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>T.params.barWidth?T.params.barWidth:T.isSeriesSeprate?mx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:1,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}):mx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:T.visibleComputedData.length,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}))),C=i.pipe(I(x),F(T=>{const N=new Set;return T.forEach(j=>{j.forEach(Q=>{N.add(Q.groupLabel)})}),Array.from(N)})),A=new dt(T=>{Y({seriesLabels:s,barWidth:G,params:c}).pipe(I(x),W(async N=>N)).subscribe(N=>{const j=VR(N.barWidth,N.seriesLabels,N.params);T.next(j)})}),L=f.pipe(I(x),F(T=>T.transitionDuration),tt()),P=new dt(T=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async N=>N)).subscribe(N=>{const j=jR(N.groupLabels.length,N.transitionDuration);T.next(j)})}).pipe(I(x),tt()),O=new dt(T=>{Y({groupLabels:C,transitionDuration:L}).pipe(W(async N=>N)).subscribe(N=>{const j=qR(N.groupLabels.length,N.transitionDuration);T.next(j)})}).pipe(I(x),tt());Y({defsSelection:_,gridAxesSize:d}).pipe(I(x),W(async T=>T)).subscribe(T=>{const N=[{id:v,width:T.gridAxesSize.width,height:T.gridAxesSize.height}];KR({defsSelection:T.defsSelection,clipPathData:N})});const z=f.pipe(I(x),F(T=>T.highlightTarget),tt()),k=s.pipe(I(x),F(T=>T.map((N,j)=>$n(t,`lineargradient-${N}`)))),E=Y({graphicGSelection:M,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:k,zeroYArr:S,groupLabels:C,barScale:A,params:c,chartParams:f,barWidth:G,delayGroup:P,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>(ZR({defsSelection:T.defsSelection,computedData:T.computedData,linearGradientIds:T.linearGradientIds,params:T.params}),XR({graphicGSelection:T.graphicGSelection,pathGClassName:$,pathClassName:w,visibleComputedLayoutData:T.visibleComputedLayoutData,linearGradientIds:T.linearGradientIds,zeroYArr:T.zeroYArr,groupLabels:T.groupLabels,barScale:T.barScale,params:T.params,chartParams:T.chartParams,barWidth:T.barWidth,delayGroup:T.delayGroup,transitionItem:T.transitionItem,isSeriesSeprate:T.isSeriesSeprate}))));return Y({barSelection:E,computedData:n,highlightTarget:z,SeriesDataMap:u,GroupDataMap:l}).subscribe(T=>{T.barSelection.on("mouseover",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("mousemove",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("mouseout",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})}).on("click",(N,j)=>{N.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:T.highlightTarget,datum:j,gridIndex:j.gridIndex,series:T.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,groups:T.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:N,data:T.computedData})})}),Y({barSelection:E,highlight:g.pipe(F(T=>T.map(N=>N.id))),fullChartParams:f}).pipe(I(x),W(async T=>T)).subscribe(T=>{QR({selection:T.barSelection,ids:T.highlight,fullChartParams:T.fullChartParams})}),()=>{x.next(void 0)}},bx="BarsTriangle",JR=se(bx,sp)(({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 tk({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)=>{Z(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)=>{Z(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)=>Tu({datum:m,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(m,y)=>Tu({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 ek({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)?Z(a[o]).style("opacity",1).transition("highlight").duration(200):Z(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function nk({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)=>{Z(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 b=new nt,x=$n(t,"clipPath-box"),v=at(t,"circleG"),$=at(t,"circle"),{seriesSelection$:w,axesSelection$:R,defsSelection$:D,graphicGSelection$:_}=ar({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),M=Y({computedData:n,gridGraphicReverseScale:p}).pipe(I(b),W(async A=>A),F(A=>A.computedData.map((L,P)=>A.gridGraphicReverseScale[P])));Y({defsSelection:D,gridAxesSize:d}).pipe(I(b),W(async A=>A)).subscribe(A=>{const L=[{id:x,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];nk({defsSelection:A.defsSelection,clipPathData:L})});const S=c.pipe(I(b),F(A=>A.highlightTarget),tt()),G=Y({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:M,fullChartParams:c,fullParams:l}).pipe(I(b),W(async A=>A),F(A=>tk({graphicGSelection:A.graphicGSelection,circleGClassName:v,circleClassName:$,visibleComputedLayoutData:A.visibleComputedLayoutData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale})));Y({graphicSelection:G,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:S}).pipe(I(b),W(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})}).on("mousemove",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:A.highlightTarget,data:A.computedData,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L})}).on("mouseout",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})}).on("click",(L,P)=>{L.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:A.highlightTarget,datum:P,gridIndex:P.gridIndex,series:A.SeriesDataMap.get(P.seriesLabel),seriesIndex:P.seriesIndex,seriesLabel:P.seriesLabel,groups:A.GroupDataMap.get(P.groupLabel),groupIndex:P.groupIndex,groupLabel:P.groupLabel,event:L,data:A.computedData})})});const C=l.pipe(I(b),F(A=>A.onlyShowHighlighted),tt());return Y({graphicSelection:G,highlight:g.pipe(F(A=>A.map(L=>L.id))),onlyShowHighlighted:C,fullChartParams:c}).pipe(I(b),W(async A=>A)).subscribe(A=>{ek({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,fullChartParams:A.fullChartParams})}),()=>{b.next(void 0)}},xx="Dots",rk=se(xx,op)(({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()}}),ik={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 Lu=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=at(t,"root-position"),u=at(t,"legend-card"),l=at(t,"legend-list"),c=at(t,"legend-item"),f=new nt,h=Y({seriesLabels:n,fullChartParams:o}).pipe(I(f),W(async _=>_),F(_=>{const M=new Map;let S=0;return _.seriesLabels.forEach((G,C)=>{if(!M.has(G)){const A=_x(S,_.fullChartParams);M.set(G,A),S++}}),M})),p=n.pipe(I(f),F(_=>{const M=new Set;let S=[];return _.forEach(G=>{M.has(G)?S.push(!1):S.push(!0),M.add(G)}),S})),d=r.pipe(I(f),F(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=Y({fullParams:r,layout:i}).pipe(I(f),W(async _=>_),F(_=>{const M=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-M:_.layout.rootHeight-M})),y=Y({layout:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let M=0,S=0;return _.fullParams.position==="bottom"?(S=_.layout.rootHeight,_.fullParams.justify==="start"?M=0:_.fullParams.justify==="center"?M=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(M=_.layout.rootWidth)):_.fullParams.position==="right"?(M=_.layout.rootWidth,_.fullParams.justify==="start"?S=0:_.fullParams.justify==="center"?S=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(S=_.layout.rootHeight)):_.fullParams.position==="top"?(S=0,_.fullParams.justify==="start"?M=0:_.fullParams.justify==="center"?M=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(M=_.layout.rootWidth)):_.fullParams.position==="left"&&(M=0,_.fullParams.justify==="start"?S=0:_.fullParams.justify==="center"?S=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(S=_.layout.rootHeight)),{x:M,y:S}})).pipe(I(f),F(_=>e.selectAll(`g.${s}`).data([_]).join(M=>M.append("g").classed(s,!0).attr("transform",S=>`translate(${S.x}, ${S.y})`),M=>M.transition().attr("transform",S=>`translate(${S.x}, ${S.y})`),M=>M.remove()))),b=r.pipe(I(f),F(_=>_.seriesList[0]?_.seriesList[0]:ik)),x=Y({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:b,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>_.seriesLabels.reduce((M,S,G)=>{if(!_.visibleList[G])return M;const C=nx(S,_.textSizePx),A=_.textSizePx*1.5+C,L=_.SeriesLabelColorMap.get(S),P=M[0]&&M[0][0]?M[M.length-1][M[M.length-1].length-1]:null,{translateX:O,translateY:z,lineIndex:k,itemIndex:E}=((N,j,Q)=>{let U=0,X=0,B=0,q=0;if(N.lineDirection==="column"){let V=Q?Q.translateY+N.textSizePx+N.fullParams.gap:0;if(V+N.textSizePx>N.lineMaxSize){B=Q.lineIndex+1,q=0,X=0;const rt=j[j.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);U=Q.translateX+rt+N.fullParams.gap}else B=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,X=V,U=Q?Q.translateX:0}else{let V=Q?Q.translateX+Q.itemWidth+N.fullParams.gap:0;V+A>N.lineMaxSize?(B=Q.lineIndex+1,q=0,U=0):(B=Q?Q.lineIndex:0,q=Q?Q.itemIndex+1:0,U=V),X=(N.textSizePx+N.fullParams.gap)*B}return{translateX:U,translateY:X,lineIndex:B,itemIndex:q}})(_,M,P);M[k]||(M[k]=[]);const T=_.fullParams.seriesList[E]?_.fullParams.seriesList[E]:_.defaultListStyle;return M[k].push({id:S,seriesLabel:S,seriesIndex:G,lineIndex:k,itemIndex:E,text:S,itemWidth:A,translateX:O,translateY:z,color:L,listRectWidth:T.listRectWidth,listRectHeight:T.listRectHeight,listRectRadius:T.listRectRadius}),M},[])),St(1)),v=Y({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const{width:M,height:S}=((G,C)=>{let A=0,L=0;if(!C.length||!C[0].length)return{width:A,height:L};const P=C[0][C[0].length-1];return G.lineDirection==="column"?(A=C.reduce((O,z)=>{const k=z.reduce((E,T)=>T.itemWidth>E?T.itemWidth:E,0);return O+k},0),A+=G.fullParams.gap*(C.length-1),L=P.translateY+G.textSizePx):(A=P.translateX+P.itemWidth,L=G.textSizePx*C.length+G.fullParams.gap*(C.length-1)),{width:A,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:M,height:S,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),St(1)),$=Y({fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>{const M=_.lengendList.width+_.fullParams.gap*2,S=_.lengendList.height+_.fullParams.gap*2;let G=0,C=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(G=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=_.fullParams.padding,C=-S/2):_.fullParams.justify==="end"&&(G=_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(G=-M-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=-M-_.fullParams.padding,C=-S/2):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(G=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(G=-M/2,C=_.fullParams.padding):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="start"?(G=_.fullParams.padding,C=-S-_.fullParams.padding):_.fullParams.justify==="center"?(G=-M/2,C=-S-_.fullParams.padding):_.fullParams.justify==="end"&&(G=-M-_.fullParams.padding,C=-S-_.fullParams.padding),{width:M,height:S,translateX:G,translateY:C}})),w=Y({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:$}).pipe(I(f),W(async _=>_),F(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(M=>M.append("g").classed(u,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.remove()).each((M,S,G)=>{Z(G[S]).selectAll("rect").data([M]).join("rect").attr("width",C=>C.width).attr("height",C=>C.height).attr("fill",Ct(_.fullParams.backgroundFill,_.fullChartParams)).attr("stroke",Ct(_.fullParams.backgroundStroke,_.fullChartParams))}))),R=Y({lengendCardSelection:w,fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(M=>M.append("g").classed(l,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),M=>M.remove())));return Y({lengendListSelection:R,fullParams:r,fullChartParams:o,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const M=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(M).join(S=>S.append("g").classed(c,!0).attr("cursor","default"),S=>S,S=>S.remove()).attr("transform",(S,G)=>`translate(${S.translateX}, ${S.translateY})`).each((S,G,C)=>{const A=_.textSizePx/2,L=-S.listRectWidth/2,P=-S.listRectHeight/2;Z(C[G]).selectAll("rect").data([S]).join("rect").attr("x",A).attr("y",A).attr("width",O=>O.listRectWidth).attr("height",O=>O.listRectHeight).attr("transform",O=>`translate(${L}, ${P})`).attr("fill",O=>O.color).attr("rx",O=>O.listRectRadius),Z(C[G]).selectAll("text").data([S]).join(O=>O.append("text").attr("dominant-baseline","hanging"),O=>O,O=>O.remove()).attr("x",_.textSizePx*1.5).attr("font-size",_.fullChartParams.styles.textSize).attr("fill",O=>_.fullParams.textColorType==="series"?_x(O.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(O=>O.text)})})).subscribe(),()=>{f.next(void 0)}},wx="GridLegend",ok=se(wx,cp)(({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=Lu(wx,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ak=6;function sk({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)=>{Z(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 uk({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:u,groupLabels:l,textReverseTransformWithRotate:c}){const f=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),h=Math.floor(u[1])-Math.ceil(u[0])+1;let p=0,d=0;o.grid.groupAxis.position==="left"?(p=0,d=-n.tickPadding):o.grid.groupAxis.position==="right"?(p=0,d=n.tickPadding):o.grid.groupAxis.position==="bottom"?(p=n.tickPadding,d=0):o.grid.groupAxis.position==="top"&&(p=-n.tickPadding,d=-0);const g=Cg(s).scale(s).ticks(n.ticks==="all"||n.ticks>h?h:n.ticks).tickSize(n.tickFullLine==!0?i.height:-ak).tickSizeOuter(0).tickFormat(b=>{const x=l[b]??"";return Lh(x,n.tickFormat)}).tickPadding(p),m=f.transition().duration(100).call(g);return m.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?Ct(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),m.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?Ct(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.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("x",d).style("transform",c).attr("dy",0),f}const $x=(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=at(t,"container"),p=at(t,"xAxisG"),d=at(t,"xAxis"),g=at(t,"groupingLabel"),m=Y({computedData:n.pipe(tt((_,M)=>_.length===M.length)),isSeriesSeprate:c}).pipe(I(f),W(async _=>_),F(_=>_.isSeriesSeprate?_.computedData:[_.computedData[0]]),F((_,M)=>e.selectAll(`g.${h}`).data(_,S=>S[0]?S[0].seriesIndex:M).join("g").classed(h,!0))),y=m.pipe(I(f),F((_,M)=>_.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));Y({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async _=>_)).subscribe(_=>{_.containerSelection.attr("transform",(M,S)=>{const G=_.gridContainerPosition[S]??_.gridContainerPosition[0],C=G.translate,A=G.scale;return`translate(${C[0]}, ${C[1]}) scale(${A[0]}, ${A[1]})`})}),Y({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async _=>_)).subscribe(_=>{_.axisSelection.style("transform",_.gridAxesTransform.value)});const b=Y({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async _=>_),F(_=>{const M=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,S=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,G=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${M} ${S} ${G}`}),tt()),x=Y({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>`${_.textReverseTransform} rotate(${_.fullParams.tickTextRotate}deg)`)),v=Y({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_),F(_=>{const S=_.computedData[0]?_.computedData[0].length-1:0,G=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?S+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding;return[G,C]}),St(1)),$=Y({groupScaleDomain:v,gridAxesSize:u}).pipe(I(f),W(async _=>_),F(_=>So().domain(_.groupScaleDomain).range([0,_.gridAxesSize.width]))),w=n.pipe(F(_=>(_[0]??[]).map(M=>M.groupLabel))),R=Y({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let M="middle",S="hanging";return _.fullDataFormatter.grid.groupAxis.position==="bottom"?(M=_.fullParams.tickTextRotate?"end":"middle",S="hanging"):_.fullDataFormatter.grid.groupAxis.position==="top"?(M=_.fullParams.tickTextRotate?"start":"middle",S="auto"):_.fullDataFormatter.grid.groupAxis.position==="left"?(M="end",S="middle"):_.fullDataFormatter.grid.groupAxis.position==="right"&&(M="start",S="middle"),{textAnchor:M,dominantBaseline:S}})),D=i.pipe(I(f),F(_=>{let M="start",S="hanging";return _.grid.groupAxis.position==="bottom"?S="hanging":_.grid.groupAxis.position==="top"?S="auto":_.grid.groupAxis.position==="left"?M="end":_.grid.groupAxis.position==="right"&&(M="start"),_.grid.valueAxis.position==="left"?M="start":_.grid.valueAxis.position==="right"?M="end":_.grid.valueAxis.position==="bottom"?S="auto":_.grid.valueAxis.position==="top"&&(S="hanging"),{textAnchor:M,dominantBaseline:S}}));return Y({axisSelection:y,fullParams:r,tickTextAlign:R,axisLabelAlign:D,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:v,groupLabels:w,textReverseTransform:b,textReverseTransformWithRotate:x}).pipe(I(f),W(async _=>_)).subscribe(_=>{uk({selection:_.axisSelection,xAxisClassName:d,fullParams:_.fullParams,tickTextAlign:_.tickTextAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,groupScale:_.groupScale,groupScaleDomain:_.groupScaleDomain,groupLabels:_.groupLabels,textReverseTransformWithRotate:_.textReverseTransformWithRotate}),sk({selection:_.axisSelection,groupingLabelClassName:g,fullParams:_.fullParams,axisLabelAlign:_.axisLabelAlign,gridAxesSize:_.gridAxesSize,fullDataFormatter:_.fullDataFormatter,chartParams:_.chartParams,textReverseTransform:_.textReverseTransform})}),()=>{f.next(void 0)}},Sx="GroupAxis",lk=se(Sx,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=$x(Sx,{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()}}),ck=6;function fk({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)=>{Z(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 hk({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=Eg(s).scale(s).ticks(f>n.ticks?n.ticks:l[0]===0&&l[1]===0?1:Math.ceil(f)).tickFormat(y=>Lh(y,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:ck).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 ai=(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=at(t,"container"),p=at(t,"yAxisG"),d=at(t,"yAxis"),g=at(t,"text"),m=Y({computedData:n.pipe(tt((D,_)=>D.length===_.length)),isSeriesSeprate:c}).pipe(I(f),W(async D=>D),F(D=>D.isSeriesSeprate?D.computedData:[D.computedData[0]]),F((D,_)=>e.selectAll(`g.${h}`).data(D,M=>M[0]?M[0].seriesIndex:_).join("g").classed(h,!0))),y=m.pipe(I(f),F((D,_)=>D.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));Y({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async D=>D)).subscribe(D=>{D.containerSelection.attr("transform",(_,M)=>{const S=D.gridContainerPosition[M]??D.gridContainerPosition[0],G=S.translate,C=S.scale;return`translate(${G[0]}, ${G[1]}) scale(${C[0]}, ${C[1]})`})}),Y({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async D=>D)).subscribe(D=>{D.axisSelection.style("transform",D.gridAxesTransform.value)});const b=Y({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async D=>D),F(D=>{const _=`rotateX(${D.gridAxesReverseTransform.rotateX}deg) rotateY(${D.gridAxesReverseTransform.rotateY}deg)`,M=`rotate(${D.gridAxesReverseTransform.rotate}deg)`,S=`scale(${1/D.gridContainerPosition[0].scale[0]}, ${1/D.gridContainerPosition[0].scale[1]})`;return`${_} ${M} ${S}`}),tt()),x=Y({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async D=>D),F(D=>`${D.textReverseTransform} rotate(${D.fullParams.tickTextRotate}deg)`)),v=new dt(D=>{Y({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_)).subscribe(_=>{const S=_.computedData[0]?_.computedData[0].length-1:0,G=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?S+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding,A=_.computedData.map((P,O)=>P.filter((z,k)=>k>=G&&k<=C)),L=mR(A.flat());L[0]===L[1]&&(L[0]=L[1]-1),D.next(L)})}),$=new dt(D=>{Y({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),W(async _=>_)).subscribe(_=>{const M=Jd({maxValue:_.minAndMax[1],minValue:_.minAndMax[0],axisWidth:_.gridAxesSize.height,scaleDomain:_.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:_.fullDataFormatter.grid.valueAxis.scaleRange});D.next(M)})}),w=Y({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async D=>D),F(D=>{let _="start",M="hanging";return D.fullDataFormatter.grid.valueAxis.position==="left"?(_="end",M="middle"):D.fullDataFormatter.grid.valueAxis.position==="right"?(_="start",M="middle"):D.fullDataFormatter.grid.valueAxis.position==="bottom"?(_=D.fullParams.tickTextRotate?"end":"middle",M="hanging"):D.fullDataFormatter.grid.valueAxis.position==="top"&&(_=D.fullParams.tickTextRotate?"start":"middle",M="auto"),{textAnchor:_,dominantBaseline:M}})),R=i.pipe(I(f),F(D=>{let _="start",M="hanging";return D.grid.groupAxis.position==="bottom"?M="auto":D.grid.groupAxis.position==="top"?M="hanging":D.grid.groupAxis.position==="left"?_="start":D.grid.groupAxis.position==="right"&&(_="end"),D.grid.valueAxis.position==="left"?_="end":D.grid.valueAxis.position==="right"?_="start":D.grid.valueAxis.position==="bottom"?M="hanging":D.grid.valueAxis.position==="top"&&(M="auto"),{textAnchor:_,dominantBaseline:M}}));return Y({axisSelection:y,fullParams:r,tickTextAlign:w,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:$,textReverseTransform:b,textReverseTransformWithRotate:x,minAndMax:v}).pipe(I(f),W(async D=>D)).subscribe(D=>{hk({selection:D.axisSelection,yAxisClassName:d,fullParams:D.fullParams,tickTextAlign:D.tickTextAlign,gridAxesSize:D.gridAxesSize,fullDataFormatter:D.fullDataFormatter,fullChartParams:D.fullChartParams,valueScale:D.valueScale,textReverseTransformWithRotate:D.textReverseTransformWithRotate,minAndMax:D.minAndMax}),fk({selection:D.axisSelection,textClassName:g,fullParams:D.fullParams,axisLabelAlign:D.axisLabelAlign,gridAxesSize:D.gridAxesSize,fullDataFormatter:D.fullDataFormatter,fullChartParams:D.fullChartParams,textReverseTransform:D.textReverseTransform})}),()=>{f.next(void 0)}},Ax="ValueAxis",pk=se(Ax,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ai(Ax,{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()}}),Mx="ValueStackAxis",dk=se(Mx,up)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=ai(Mx,{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()}}),Dx="ScalingArea",gk=at(Dx,"rect"),mk=se(Dx,lp)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=e.insert("rect","g").classed(gk,!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 Y({initGroupAxis:r.fullDataFormatter$.pipe(F(l=>l.grid.groupAxis),m_()),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]==="auto"?0-l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[0]-l.initGroupAxis.scalePadding,p=l.initGroupAxis.scaleDomain[1]==="auto"?f+l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[1]+l.initGroupAxis.scalePadding,g=Jd({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=tx().on("zoom",function(b){const x=b.transform,v=R=>{const D=Math.round(R);return Math.min(f,Math.max(0,D))},$=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(v):x.rescaleY(g).domain().map(v);$[0]<=0&&$[1]>=f?x.k<s.k&&(x.k=s.k,x.x=s.x,x.y=s.y):$[1]-$[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 w={...l.fullDataFormatter,grid:{...l.fullDataFormatter.grid,groupAxis:{...l.fullDataFormatter.grid.groupAxis,scaleDomain:$}}};i.dataFormatter$.next(w)});e.call(m)}),()=>{o.next(void 0),a.remove()}}),Cu="GroupAux",Rh=at(Cu,"label-box");function yk({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function bk({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=at(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 vk(t){t.selectAll("line").data([]).exit().remove()}function xk({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:Lh(t,n.labelTextFormat)}]:[]}function _k({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){const s=a+6,u=t.selectAll(`g.${Rh}`).data(e),l=u.enter().append("g").classed(Rh,!0).style("cursor","pointer"),c=l.merge(u);return l.attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.transition().duration(50).attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.exit().remove(),c.each((f,h,p)=>{const d=nx(f.text,a)+12;let g=-d/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=n.labelRotate?-d+s:-d/2,m=2):r.grid.groupAxis.position==="left"?(g=-d+2,m=-s/2):r.grid.groupAxis.position==="right"?(g=-2,m=-s/2):r.grid.groupAxis.position==="top"&&(g=n.labelRotate?-d+s:-d/2,m=-s+2);const y=Z(p[h]).selectAll("rect").data([f]),b=y.enter().append("rect").attr("height",`${s}px`).attr("fill",$=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m-2).attr("rx",5).attr("ry",5).style("cursor","pointer");y.merge(b).attr("width",$=>`${d}px`).style("transform",o),y.exit().remove();const x=Z(p[h]).selectAll("text").data([f]),v=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");x.merge(v).text($=>$.text).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()}),c}function wk(t){t.selectAll(`g.${Rh}`).data([]).exit().remove()}const $k=se(Cu,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(at(Cu,"rect"),!0).attr("opacity",0),{seriesSelection$:u,axesSelection$:l,defsSelection$:c,graphicGSelection$:f}=ar({selection:t,pluginName:Cu,clipPathID:"test",seriesLabels$:i.seriesLabels$,gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(I(o)).subscribe(w=>{s.attr("width",w.rootWidth).attr("height",w.rootHeight)});const h=Y({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(I(o),W(async w=>w),F(w=>{const D=w.computedData[0]?w.computedData[0].length-1:0,_=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,M=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?D+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding;return[_,M]}),St(1)),p=Y({groupScaleDomain:h,gridAxesSize:i.gridAxesSize$}).pipe(I(o),W(async w=>w),F(w=>So().domain(w.groupScaleDomain).range([0,w.gridAxesSize.width]))),d=i.fullChartParams$.pipe(I(o),F(w=>w.highlightTarget),tt()),g=Ch(e,"mousemove").pipe(I(o)),m=Y({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async w=>w),F(w=>{const R=`rotateX(${w.gridAxesReverseTransform.rotateX}deg) rotateY(${w.gridAxesReverseTransform.rotateY}deg)`,D=`rotate(${w.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/w.gridContainerPosition[0].scale[0]}, ${1/w.gridContainerPosition[0].scale[1]})`;return`${R} ${D} ${_}`}),tt()),y=Y({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async w=>w),F(w=>`${w.textReverseTransform} rotate(${w.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),F(w=>w.reduce((D,_)=>_.columnIndex>D?_.columnIndex:D,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F(w=>w.reduce((D,_)=>_.rowIndex>D?_.rowIndex:D,0)+1),tt()),v=yR({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(I(o));Y({axesSelection:l,columnAmount:b,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPosition:v,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$}).subscribe(w=>{const{groupIndex:R,groupLabel:D}=w.gridGroupPosition,_=w.groupScale(R)??0,M=yk({groupLabel:D,axisX:_,axisHeight:w.gridAxesSize.height,fullParams:w.fullParams});bk({selection:w.axesSelection,pluginName:n,lineData:M,fullParams:w.fullParams,fullChartParams:w.fullChartParams});const S=xk({groupLabel:D,axisX:_,fullParams:w.fullParams});_k({selection:w.axesSelection,labelData:S,fullParams:w.fullParams,fullDataFormatter:w.fullDataFormatter,fullChartParams:w.fullChartParams,textReverseTransformWithRotate:w.textReverseTransformWithRotate,textSizePx:w.textSizePx}).on("mouseover",(C,A)=>{C.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})}).on("mousemove",(C,A)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})}).on("click",(C,A)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:w.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:w.GroupDataMap.get(D)??[],groupIndex:R,groupLabel:D,event:C,data:w.computedData})})});const $=Ch(s,"mouseout").pipe(I(o));return Y({rootRectMouseout:$,axesSelection:l}).pipe(I(o),W(async w=>w)).subscribe(w=>{setTimeout(()=>{a!=!0&&(vk(w.axesSelection),wk(w.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Px={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"},kh={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]};kh.tickFormat.toString=()=>"text => text";const Eu={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]},Sk={...Eu},Tx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Lx={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Cx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Ex={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Rx={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},kx={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Ih={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]},Ix={...Ih},Nx="MultiGridLegend",Ak=pe(Nx,Px)(({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=>Y(l)),F(l=>l.flat())),a=Y({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=Y({fullParams:n.fullParams$,seriesList:a}).pipe(I(i),W(async l=>l),F(l=>({...l.fullParams,seriesList:l.seriesList}))),u=Lu(Nx,{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 Y({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(F(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Nh="MultiBars",Fx=at(Nh,"grid"),Mk=pe(Nh,Tx)(({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.${Fx}`).data(s).join("g").attr("class",Fx).each((u,l,c)=>{const f=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=Eh(Nh,{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())}}),Fh="MultiBarStack",Gx=at(Fh,"grid"),Dk=pe(Fh,Lx)(({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=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=px(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$,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",zx=at(Gh,"grid"),Pk=pe(Gh,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.${zx}`).data(s).join("g").attr("class",zx).each((u,l,c)=>{const f=Z(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())}}),zh="MultiLines",Ox=at(zh,"grid"),Tk=pe(zh,Ex)(({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.${Ox}`).data(l).join("g").attr("class",Ox).each((c,f,h)=>{const p=Z(h[f]);a[f]=ix(zh,{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())}}),Oh="MultiLineAreas",Ux=at(Oh,"grid"),Lk=pe(Oh,Rx)(({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.${Ux}`).data(u).join("g").attr("class",Ux).each((l,c,f)=>{const h=Z(f[c]);o[c]=ax(Oh,{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",Bx=at(Uh,"grid"),Ck=pe(Uh,kx)(({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.${Bx}`).data(s).join("g").attr("class",Bx).each((u,l,c)=>{const f=Z(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",Yx=at(Bh,"grid"),Ek=pe(Bh,kh)(({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=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=$x(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})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Yh="MultiValueAxis",Wx=at(Yh,"grid"),Rk=pe(Yh,Eu)(({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=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=ai(Yh,{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())}}),Wh="MultiValueStackAxis",Hx=at(Wh,"grid"),kk=pe(Wh,Eu)(({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=Z(c[l]),h=u.dataFormatter$.pipe(I(i),F(p=>p.grid.separateSeries),tt(),St(1));o[l]=ai(Wh,{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 Ik(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function Vx(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Ik(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 jx=({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=>(Y({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)}))},qx=({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)`}})),Xx=({computedData$:t,fullDataFormatter$:e,layout$:n})=>Y({computedData:t,fullDataFormatter:e,layout:n}).pipe(W(async i=>i),F(i=>{if(i.fullDataFormatter.grid.separateSeries)return Vx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=Vx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Zx=at(Hh,"grid"),Nk=pe(Hh,Ih)(({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=Y({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 Yo(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=jx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=Xx({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Zx}`).data(c).join("g").attr("class",Zx).each((f,h,p)=>{if(h>1)return;const d=Z(p[h]);o[h]=ai(Hh,{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())}}),Vh="OverlappingValueStackAxes",Kx=at(Vh,"grid"),Fk=pe(Vh,Ix)(({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=Y({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 Yo(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=jx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=Xx({computedData$:f.computedData$,fullDataFormatter$:u,layout$:r.layout$});return{...f,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:g}}))).pipe(I(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${Kx}`).data(c).join("g").attr("class",Kx).each((f,h,p)=>{if(h>1)return;const d=Z(p[h]);o[h]=ai(Vh,{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())}}),Qx={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) => {
|
15
|
+
`})}function KR({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 QR({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 mx=(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 x=new nt,v=Sn(t,"clipPath-box"),S=it(t,"pathG"),$=it(t,"path"),{seriesSelection$:R,axesSelection$:P,defsSelection$:_,graphicGSelection$:w}=sr({selection:e,pluginName:t,clipPathID:v,seriesLabels$:s,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(I(x),F(T=>-T.translate[1]/T.scale[1]));const A=o.pipe(F(T=>T.map(G=>G[0]?G[0].axisY-G[0].axisYFromZero:0)),tt()),N=B({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>T.params.barWidth?T.params.barWidth:T.isSeriesSeprate?gx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:1,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}):gx({axisWidth:T.gridAxesSize.width,groupAmount:T.computedData[0]?T.computedData[0].length:0,barAmountOfGroup:T.visibleComputedData.length,barPadding:T.params.barPadding,barGroupPadding:T.params.barGroupPadding}))),C=i.pipe(I(x),F(T=>{const G=new Set;return T.forEach(q=>{q.forEach(Q=>{G.add(Q.groupLabel)})}),Array.from(G)})),M=new dt(T=>{B({seriesLabels:s,barWidth:N,params:c}).pipe(I(x),W(async G=>G)).subscribe(G=>{const q=XR(G.barWidth,G.seriesLabels,G.params);T.next(q)})}),L=f.pipe(I(x),F(T=>T.transitionDuration),tt()),D=new dt(T=>{B({groupLabels:C,transitionDuration:L}).pipe(W(async G=>G)).subscribe(G=>{const q=qR(G.groupLabels.length,G.transitionDuration);T.next(q)})}).pipe(I(x),tt()),O=new dt(T=>{B({groupLabels:C,transitionDuration:L}).pipe(W(async G=>G)).subscribe(G=>{const q=jR(G.groupLabels.length,G.transitionDuration);T.next(q)})}).pipe(I(x),tt());B({defsSelection:_,gridAxesSize:d}).pipe(I(x),W(async T=>T)).subscribe(T=>{const G=[{id:v,width:T.gridAxesSize.width,height:T.gridAxesSize.height}];KR({defsSelection:T.defsSelection,clipPathData:G})});const z=f.pipe(I(x),F(T=>T.highlightTarget),tt()),k=s.pipe(I(x),F(T=>T.map((G,q)=>Sn(t,`lineargradient-${G}`)))),E=B({graphicGSelection:w,defsSelection:_,computedData:n,visibleComputedLayoutData:o,linearGradientIds:k,zeroYArr:A,groupLabels:C,barScale:M,params:c,chartParams:f,barWidth:N,delayGroup:D,transitionItem:O,isSeriesSeprate:y}).pipe(I(x),W(async T=>T),F(T=>(ZR({defsSelection:T.defsSelection,computedData:T.computedData,linearGradientIds:T.linearGradientIds,params:T.params}),VR({graphicGSelection:T.graphicGSelection,pathGClassName:S,pathClassName:$,visibleComputedLayoutData:T.visibleComputedLayoutData,linearGradientIds:T.linearGradientIds,zeroYArr:T.zeroYArr,groupLabels:T.groupLabels,barScale:T.barScale,params:T.params,chartParams:T.chartParams,barWidth:T.barWidth,delayGroup:T.delayGroup,transitionItem:T.transitionItem,isSeriesSeprate:T.isSeriesSeprate}))));return B({barSelection:E,computedData:n,highlightTarget:z,SeriesDataMap:u,GroupDataMap:l}).subscribe(T=>{T.barSelection.on("mouseover",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})}).on("mousemove",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})}).on("mouseout",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})}).on("click",(G,q)=>{G.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:T.highlightTarget,datum:q,gridIndex:q.gridIndex,series:T.SeriesDataMap.get(q.seriesLabel),seriesIndex:q.seriesIndex,seriesLabel:q.seriesLabel,groups:T.GroupDataMap.get(q.groupLabel),groupIndex:q.groupIndex,groupLabel:q.groupLabel,event:G,data:T.computedData})})}),B({barSelection:E,highlight:g.pipe(F(T=>T.map(G=>G.id))),fullChartParams:f}).pipe(I(x),W(async T=>T)).subscribe(T=>{QR({selection:T.barSelection,ids:T.highlight,fullChartParams:T.fullChartParams})}),()=>{x.next(void 0)}},yx="BarsTriangle",JR=se(yx,sp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=mx(yx,{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 tk({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,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)=>$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 ek({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 nk({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 bx=(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,x=Sn(t,"clipPath-box"),v=it(t,"circleG"),S=it(t,"circle"),{seriesSelection$:$,axesSelection$:R,defsSelection$:P,graphicGSelection$:_}=sr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:m,gridAxesTransform$:f,gridGraphicTransform$:h}),w=B({computedData:n,gridGraphicReverseScale:p}).pipe(I(b),W(async M=>M),F(M=>M.computedData.map((L,D)=>M.gridGraphicReverseScale[D])));B({defsSelection:P,gridAxesSize:d}).pipe(I(b),W(async M=>M)).subscribe(M=>{const L=[{id:x,width:M.gridAxesSize.width,height:M.gridAxesSize.height}];nk({defsSelection:M.defsSelection,clipPathData:L})});const A=c.pipe(I(b),F(M=>M.highlightTarget),tt()),N=B({graphicGSelection:_,visibleComputedLayoutData:o,graphicReverseScale:w,fullChartParams:c,fullParams:l}).pipe(I(b),W(async M=>M),F(M=>tk({graphicGSelection:M.graphicGSelection,circleGClassName:v,circleClassName:S,visibleComputedLayoutData:M.visibleComputedLayoutData,fullParams:M.fullParams,fullChartParams:M.fullChartParams,graphicReverseScale:M.graphicReverseScale})));B({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:u,highlightTarget:A}).pipe(I(b),W(async M=>M)).subscribe(M=>{M.graphicSelection.on("mouseover",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:M.highlightTarget,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L,data:M.computedData})}).on("mousemove",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:M.highlightTarget,data:M.computedData,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L})}).on("mouseout",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:M.highlightTarget,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L,data:M.computedData})}).on("click",(L,D)=>{L.stopPropagation(),y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:M.highlightTarget,datum:D,gridIndex:D.gridIndex,series:M.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:M.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:L,data:M.computedData})})});const C=l.pipe(I(b),F(M=>M.onlyShowHighlighted),tt());return B({graphicSelection:N,highlight:g.pipe(F(M=>M.map(L=>L.id))),onlyShowHighlighted:C,fullChartParams:c}).pipe(I(b),W(async M=>M)).subscribe(M=>{ek({selection:M.graphicSelection,ids:M.highlight,onlyShowHighlighted:M.onlyShowHighlighted,fullChartParams:M.fullChartParams})}),()=>{b.next(void 0)}},vx="Dots",rk=se(vx,op)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=bx(vx,{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()}}),ik={listRectWidth:14,listRectHeight:14,listRectRadius:0};function xx(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 _=>_),F(_=>{const w=new Map;let A=0;return _.seriesLabels.forEach((N,C)=>{if(!w.has(N)){const M=xx(A,_.fullChartParams);w.set(N,M),A++}}),w})),p=n.pipe(I(f),F(_=>{const w=new Set;let A=[];return _.forEach(N=>{w.has(N)?A.push(!1):A.push(!0),w.add(N)}),A})),d=r.pipe(I(f),F(_=>_.position==="bottom"||_.position==="top"?"row":"column")),g=B({fullParams:r,layout:i}).pipe(I(f),W(async _=>_),F(_=>{const w=_.fullParams.padding*2+_.fullParams.gap*2;return _.fullParams.position==="bottom"||_.fullParams.position==="top"?_.layout.rootWidth-w:_.layout.rootHeight-w})),y=B({layout:i,fullParams:r}).pipe(I(f),W(async _=>_),F(_=>{let w=0,A=0;return _.fullParams.position==="bottom"?(A=_.layout.rootHeight,_.fullParams.justify==="start"?w=0:_.fullParams.justify==="center"?w=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(w=_.layout.rootWidth)):_.fullParams.position==="right"?(w=_.layout.rootWidth,_.fullParams.justify==="start"?A=0:_.fullParams.justify==="center"?A=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(A=_.layout.rootHeight)):_.fullParams.position==="top"?(A=0,_.fullParams.justify==="start"?w=0:_.fullParams.justify==="center"?w=_.layout.rootWidth/2:_.fullParams.justify==="end"&&(w=_.layout.rootWidth)):_.fullParams.position==="left"&&(w=0,_.fullParams.justify==="start"?A=0:_.fullParams.justify==="center"?A=_.layout.rootHeight/2:_.fullParams.justify==="end"&&(A=_.layout.rootHeight)),{x:w,y:A}})).pipe(I(f),F(_=>e.selectAll(`g.${s}`).data([_]).join(w=>w.append("g").classed(s,!0).attr("transform",A=>`translate(${A.x}, ${A.y})`),w=>w.transition().attr("transform",A=>`translate(${A.x}, ${A.y})`),w=>w.remove()))),b=r.pipe(I(f),F(_=>_.seriesList[0]?_.seriesList[0]:ik)),x=B({visibleList:p,fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:d,lineMaxSize:g,defaultListStyle:b,SeriesLabelColorMap:h,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>_.seriesLabels.reduce((w,A,N)=>{if(!_.visibleList[N])return w;const C=ex(A,_.textSizePx),M=_.textSizePx*1.5+C,L=_.SeriesLabelColorMap.get(A),D=w[0]&&w[0][0]?w[w.length-1][w[w.length-1].length-1]:null,{translateX:O,translateY:z,lineIndex:k,itemIndex:E}=((G,q,Q)=>{let Y=0,Z=0,U=0,V=0;if(G.lineDirection==="column"){let X=Q?Q.translateY+G.textSizePx+G.fullParams.gap:0;if(X+G.textSizePx>G.lineMaxSize){U=Q.lineIndex+1,V=0,Z=0;const rt=q[q.length-1].reduce((ut,H)=>H.itemWidth>ut?H.itemWidth:ut,0);Y=Q.translateX+rt+G.fullParams.gap}else U=Q?Q.lineIndex:0,V=Q?Q.itemIndex+1:0,Z=X,Y=Q?Q.translateX:0}else{let X=Q?Q.translateX+Q.itemWidth+G.fullParams.gap:0;X+M>G.lineMaxSize?(U=Q.lineIndex+1,V=0,Y=0):(U=Q?Q.lineIndex:0,V=Q?Q.itemIndex+1:0,Y=X),Z=(G.textSizePx+G.fullParams.gap)*U}return{translateX:Y,translateY:Z,lineIndex:U,itemIndex:V}})(_,w,D);w[k]||(w[k]=[]);const T=_.fullParams.seriesList[E]?_.fullParams.seriesList[E]:_.defaultListStyle;return w[k].push({id:A,seriesLabel:A,seriesIndex:N,lineIndex:k,itemIndex:E,text:A,itemWidth:M,translateX:O,translateY:z,color:L,listRectWidth:T.listRectWidth,listRectHeight:T.listRectHeight,listRectRadius:T.listRectRadius}),w},[])),St(1)),v=B({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const{width:w,height:A}=((N,C)=>{let M=0,L=0;if(!C.length||!C[0].length)return{width:M,height:L};const D=C[0][C[0].length-1];return N.lineDirection==="column"?(M=C.reduce((O,z)=>{const k=z.reduce((E,T)=>T.itemWidth>E?T.itemWidth:E,0);return O+k},0),M+=N.fullParams.gap*(C.length-1),L=D.translateY+N.textSizePx):(M=D.translateX+D.itemWidth,L=N.textSizePx*C.length+N.fullParams.gap*(C.length-1)),{width:M,height:L}})(_,_.lengendItems);return{direction:_.lineDirection,width:w,height:A,translateX:_.fullParams.gap,translateY:_.fullParams.gap}}),St(1)),S=B({fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>{const w=_.lengendList.width+_.fullParams.gap*2,A=_.lengendList.height+_.fullParams.gap*2;let N=0,C=0;return _.fullParams.position==="left"?_.fullParams.justify==="start"?(N=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(N=_.fullParams.padding,C=-A/2):_.fullParams.justify==="end"&&(N=_.fullParams.padding,C=-A-_.fullParams.padding):_.fullParams.position==="right"?_.fullParams.justify==="start"?(N=-w-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(N=-w-_.fullParams.padding,C=-A/2):_.fullParams.justify==="end"&&(N=-w-_.fullParams.padding,C=-A-_.fullParams.padding):_.fullParams.position==="top"?_.fullParams.justify==="start"?(N=_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="center"?(N=-w/2,C=_.fullParams.padding):_.fullParams.justify==="end"&&(N=-w-_.fullParams.padding,C=_.fullParams.padding):_.fullParams.justify==="start"?(N=_.fullParams.padding,C=-A-_.fullParams.padding):_.fullParams.justify==="center"?(N=-w/2,C=-A-_.fullParams.padding):_.fullParams.justify==="end"&&(N=-w-_.fullParams.padding,C=-A-_.fullParams.padding),{width:w,height:A,translateX:N,translateY:C}})),$=B({rootPositionSelection:y,fullParams:r,fullChartParams:o,legendCard:S}).pipe(I(f),W(async _=>_),F(_=>_.rootPositionSelection.selectAll("g").data([_.legendCard]).join(w=>w.append("g").classed(u,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.remove()).each((w,A,N)=>{j(N[A]).selectAll("rect").data([w]).join("rect").attr("width",C=>C.width).attr("height",C=>C.height).attr("fill",Ct(_.fullParams.backgroundFill,_.fullChartParams)).attr("stroke",Ct(_.fullParams.backgroundStroke,_.fullChartParams))}))),R=B({lengendCardSelection:$,fullParams:r,lengendList:v}).pipe(I(f),W(async _=>_),F(_=>_.lengendCardSelection.selectAll("g").data([_.lengendList]).join(w=>w.append("g").classed(l,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),w=>w.remove())));return B({lengendListSelection:R,fullParams:r,fullChartParams:o,lengendItems:x,textSizePx:a}).pipe(I(f),W(async _=>_),F(_=>{const w=_.lengendItems[0]?_.lengendItems.flat():[];return _.lengendListSelection.selectAll(`g.${c}`).data(w).join(A=>A.append("g").classed(c,!0).attr("cursor","default"),A=>A,A=>A.remove()).attr("transform",(A,N)=>`translate(${A.translateX}, ${A.translateY})`).each((A,N,C)=>{const M=_.textSizePx/2,L=-A.listRectWidth/2,D=-A.listRectHeight/2;j(C[N]).selectAll("rect").data([A]).join("rect").attr("x",M).attr("y",M).attr("width",O=>O.listRectWidth).attr("height",O=>O.listRectHeight).attr("transform",O=>`translate(${L}, ${D})`).attr("fill",O=>O.color).attr("rx",O=>O.listRectRadius),j(C[N]).selectAll("text").data([A]).join(O=>O.append("text").attr("dominant-baseline","hanging"),O=>O,O=>O.remove()).attr("x",_.textSizePx*1.5).attr("font-size",_.fullChartParams.styles.textSize).attr("fill",O=>_.fullParams.textColorType==="series"?xx(O.seriesIndex,_.fullChartParams):Ct(_.fullParams.textColorType,_.fullChartParams)).text(O=>O.text)})})).subscribe(),()=>{e.select(`g.${s}`).remove(),f.next(void 0)}},_x="GridLegend",ok=se(_x,cp)(({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(_x,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ak=6;function sk({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 uk({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:u,groupLabels: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=Lg(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?i.height:-ak).tickSizeOuter(0).tickFormat(x=>{const v=l[x]??"";return Lh(v,n.tickFormat)}).tickPadding(d),y=h.transition().duration(100).call(m).on("end",(x,v)=>{y.selectAll(".tick text").each((S,$,R)=>{const _=(l[$]??"").split(`
|
16
|
+
`),w=j(R[$]).text(null),A=Number(w.attr("x"));let N=Number(w.attr("y"));o.grid.groupAxis.position==="top"&&(N-=(_.length-1)*f),w.selectAll("tspan").data(_).join("tspan").attr("x",A).attr("y",(C,M)=>N+M*f).text(C=>C)})});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).style("color",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 wx=(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((w,A)=>w.length===A.length)),isSeriesSeprate:c}).pipe(I(h),W(async w=>w),F(w=>w.isSeriesSeprate?w.computedData:[w.computedData[0]]),F((w,A)=>e.selectAll(`g.${p}`).data(w,N=>N[0]?N[0].seriesIndex:A).join("g").classed(p,!0))),b=y.pipe(I(h),F((w,A)=>w.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));B({containerSelection:y,gridContainerPosition:l}).pipe(I(h),W(async w=>w)).subscribe(w=>{w.containerSelection.attr("transform",(A,N)=>{const C=w.gridContainerPosition[N]??w.gridContainerPosition[0],M=C.translate,L=C.scale;return`translate(${M[0]}, ${M[1]}) scale(${L[0]}, ${L[1]})`})}),B({axisSelection:b,gridAxesTransform:a}).pipe(I(h),W(async w=>w)).subscribe(w=>{w.axisSelection.style("transform",w.gridAxesTransform.value)});const x=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(h),W(async w=>w),F(w=>{const A=`rotateX(${w.gridAxesReverseTransform.rotateX}deg) rotateY(${w.gridAxesReverseTransform.rotateY}deg)`,N=`rotate(${w.gridAxesReverseTransform.rotate}deg)`,C=`scale(${1/w.gridContainerPosition[0].scale[0]}, ${1/w.gridContainerPosition[0].scale[1]})`;return`${A} ${N} ${C}`}),tt()),v=B({textReverseTransform:x,fullParams:r}).pipe(I(h),W(async w=>w),F(w=>`${w.textReverseTransform} rotate(${w.fullParams.tickTextRotate}deg)`)),S=B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(h),W(async w=>w),F(w=>{const N=w.computedData[0]?w.computedData[0].length-1:0,C=w.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[0]-w.fullDataFormatter.grid.groupAxis.scalePadding,M=w.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?N+w.fullDataFormatter.grid.groupAxis.scalePadding:w.fullDataFormatter.grid.groupAxis.scaleDomain[1]+w.fullDataFormatter.grid.groupAxis.scalePadding;return[C,M]}),St(1)),$=B({groupScaleDomain:S,gridAxesSize:u}).pipe(I(h),W(async w=>w),F(w=>Po().domain(w.groupScaleDomain).range([0,w.gridAxesSize.width]))),R=n.pipe(F(w=>(w[0]??[]).map(A=>A.groupLabel))),P=B({fullDataFormatter:i,fullParams:r}).pipe(I(h),W(async w=>w),F(w=>{let A="middle",N="hanging";return w.fullDataFormatter.grid.groupAxis.position==="bottom"?(A=w.fullParams.tickTextRotate?"end":"middle",N="hanging"):w.fullDataFormatter.grid.groupAxis.position==="top"?(A=w.fullParams.tickTextRotate?"start":"middle",N="auto"):w.fullDataFormatter.grid.groupAxis.position==="left"?(A="end",N="middle"):w.fullDataFormatter.grid.groupAxis.position==="right"&&(A="start",N="middle"),{textAnchor:A,dominantBaseline:N}})),_=i.pipe(I(h),F(w=>{let A="start",N="hanging";return w.grid.groupAxis.position==="bottom"?N="hanging":w.grid.groupAxis.position==="top"?N="auto":w.grid.groupAxis.position==="left"?A="end":w.grid.groupAxis.position==="right"&&(A="start"),w.grid.valueAxis.position==="left"?A="start":w.grid.valueAxis.position==="right"?A="end":w.grid.valueAxis.position==="bottom"?N="auto":w.grid.valueAxis.position==="top"&&(N="hanging"),{textAnchor:A,dominantBaseline:N}}));return B({axisSelection:b,fullParams:r,tickTextAlign:P,axisLabelAlign:_,gridAxesSize:u,fullDataFormatter:i,chartParams:o,groupScale:$,groupScaleDomain:S,groupLabels:R,textReverseTransform:x,textReverseTransformWithRotate:v,textSizePx:f}).pipe(I(h),W(async w=>w)).subscribe(w=>{uk({selection:w.axisSelection,xAxisClassName:g,fullParams:w.fullParams,tickTextAlign:w.tickTextAlign,gridAxesSize:w.gridAxesSize,fullDataFormatter:w.fullDataFormatter,chartParams:w.chartParams,groupScale:w.groupScale,groupScaleDomain:w.groupScaleDomain,groupLabels:w.groupLabels,textReverseTransformWithRotate:w.textReverseTransformWithRotate,textSizePx:w.textSizePx}),sk({selection:w.axisSelection,groupingLabelClassName:m,fullParams:w.fullParams,axisLabelAlign:w.axisLabelAlign,gridAxesSize:w.gridAxesSize,fullDataFormatter:w.fullDataFormatter,chartParams:w.chartParams,textReverseTransform:w.textReverseTransform})}),()=>{h.next(void 0)}},$x="GroupAxis",lk=se($x,Fu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=wx($x,{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()}}),ck=6;function fk({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 hk({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=Cg(s).scale(s).ticks(f>n.ticks?n.ticks:l[0]===0&&l[1]===0?1:Math.ceil(f)).tickFormat(y=>Lh(y,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:ck).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((P,_)=>P.length===_.length)),isSeriesSeprate:c}).pipe(I(f),W(async P=>P),F(P=>P.isSeriesSeprate?P.computedData:[P.computedData[0]]),F((P,_)=>e.selectAll(`g.${h}`).data(P,w=>w[0]?w[0].seriesIndex:_).join("g").classed(h,!0))),y=m.pipe(I(f),F((P,_)=>P.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));B({containerSelection:m,gridContainerPosition:l}).pipe(I(f),W(async P=>P)).subscribe(P=>{P.containerSelection.attr("transform",(_,w)=>{const A=P.gridContainerPosition[w]??P.gridContainerPosition[0],N=A.translate,C=A.scale;return`translate(${N[0]}, ${N[1]}) scale(${C[0]}, ${C[1]})`})}),B({axisSelection:y,gridAxesTransform:a}).pipe(I(f),W(async P=>P)).subscribe(P=>{P.axisSelection.style("transform",P.gridAxesTransform.value)});const b=B({gridAxesReverseTransform:s,gridContainerPosition:l}).pipe(I(f),W(async P=>P),F(P=>{const _=`rotateX(${P.gridAxesReverseTransform.rotateX}deg) rotateY(${P.gridAxesReverseTransform.rotateY}deg)`,w=`rotate(${P.gridAxesReverseTransform.rotate}deg)`,A=`scale(${1/P.gridContainerPosition[0].scale[0]}, ${1/P.gridContainerPosition[0].scale[1]})`;return`${_} ${w} ${A}`}),tt()),x=B({textReverseTransform:b,fullParams:r}).pipe(I(f),W(async P=>P),F(P=>`${P.textReverseTransform} rotate(${P.fullParams.tickTextRotate}deg)`)),v=new dt(P=>{B({fullDataFormatter:i,gridAxesSize:u,computedData:n}).pipe(I(f),W(async _=>_)).subscribe(_=>{const A=_.computedData[0]?_.computedData[0].length-1:0,N=_.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[0]-_.fullDataFormatter.grid.groupAxis.scalePadding,C=_.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?A+_.fullDataFormatter.grid.groupAxis.scalePadding:_.fullDataFormatter.grid.groupAxis.scaleDomain[1]+_.fullDataFormatter.grid.groupAxis.scalePadding,M=_.computedData.map((D,O)=>D.filter((z,k)=>k>=N&&k<=C)),L=mR(M.flat());L[0]===L[1]&&(L[0]=L[1]-1),P.next(L)})}),S=new dt(P=>{B({fullDataFormatter:i,gridAxesSize:u,minAndMax:v}).pipe(I(f),W(async _=>_)).subscribe(_=>{const w=Jd({maxValue:_.minAndMax[1],minValue:_.minAndMax[0],axisWidth:_.gridAxesSize.height,scaleDomain:_.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:_.fullDataFormatter.grid.valueAxis.scaleRange});P.next(w)})}),$=B({fullDataFormatter:i,fullParams:r}).pipe(I(f),W(async P=>P),F(P=>{let _="start",w="hanging";return P.fullDataFormatter.grid.valueAxis.position==="left"?(_="end",w="middle"):P.fullDataFormatter.grid.valueAxis.position==="right"?(_="start",w="middle"):P.fullDataFormatter.grid.valueAxis.position==="bottom"?(_=P.fullParams.tickTextRotate?"end":"middle",w="hanging"):P.fullDataFormatter.grid.valueAxis.position==="top"&&(_=P.fullParams.tickTextRotate?"start":"middle",w="auto"),{textAnchor:_,dominantBaseline:w}})),R=i.pipe(I(f),F(P=>{let _="start",w="hanging";return P.grid.groupAxis.position==="bottom"?w="auto":P.grid.groupAxis.position==="top"?w="hanging":P.grid.groupAxis.position==="left"?_="start":P.grid.groupAxis.position==="right"&&(_="end"),P.grid.valueAxis.position==="left"?_="end":P.grid.valueAxis.position==="right"?_="start":P.grid.valueAxis.position==="bottom"?w="hanging":P.grid.valueAxis.position==="top"&&(w="auto"),{textAnchor:_,dominantBaseline:w}}));return B({axisSelection:y,fullParams:r,tickTextAlign:$,axisLabelAlign:R,computedData:n,gridAxesSize:u,fullDataFormatter:i,fullChartParams:o,valueScale:S,textReverseTransform:b,textReverseTransformWithRotate:x,minAndMax:v}).pipe(I(f),W(async P=>P)).subscribe(P=>{hk({selection:P.axisSelection,yAxisClassName:d,fullParams:P.fullParams,tickTextAlign:P.tickTextAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,valueScale:P.valueScale,textReverseTransformWithRotate:P.textReverseTransformWithRotate,minAndMax:P.minAndMax}),fk({selection:P.axisSelection,textClassName:g,fullParams:P.fullParams,axisLabelAlign:P.axisLabelAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,textReverseTransform:P.textReverseTransform})}),()=>{f.next(void 0)}},Sx="ValueAxis",pk=se(Sx,Gu)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(Sx,{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()}}),Ax="ValueStackAxis",dk=se(Ax,up)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,o=si(Ax,{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()}}),Mx="ScalingArea",gk=it(Mx,"rect"),mk=se(Mx,lp)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new nt,a=e.insert("rect","g").classed(gk,!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),g_()),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]==="auto"?0-l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[0]-l.initGroupAxis.scalePadding,p=l.initGroupAxis.scaleDomain[1]==="auto"?f+l.initGroupAxis.scalePadding:l.initGroupAxis.scaleDomain[1]+l.initGroupAxis.scalePadding,g=Jd({maxValue:l.groupMaxIndex,minValue:0,axisWidth:l.axisSize.width,scaleDomain:[h,p],scaleRange:[0,1]}).copy(),m=Jv().on("zoom",function(b){const x=b.transform,v=R=>{const P=Math.round(R);return Math.min(f,Math.max(0,P))},S=l.fullDataFormatter.grid.groupAxis.position==="bottom"||l.fullDataFormatter.grid.groupAxis.position==="top"?x.rescaleX(g).domain().map(v):x.rescaleY(g).domain().map(v);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()}}),Ru="GroupAux",Rh=it(Ru,"label-box");function yk({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function bk({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 vk(t){t.selectAll("line").data([]).exit().remove()}function xk({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:Lh(t,n.labelTextFormat)}]:[]}function _k({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){const s=a+6,u=t.selectAll(`g.${Rh}`).data(e),l=u.enter().append("g").classed(Rh,!0).style("cursor","pointer"),c=l.merge(u);return l.attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.transition().duration(50).attr("transform",(f,h)=>`translate(${f.x}, ${f.y})`),u.exit().remove(),c.each((f,h,p)=>{const d=ex(f.text,a)+12;let g=-d/2,m=-2;r.grid.groupAxis.position==="bottom"?(g=n.labelRotate?-d+s:-d/2,m=2):r.grid.groupAxis.position==="left"?(g=-d+2,m=-s/2):r.grid.groupAxis.position==="right"?(g=-2,m=-s/2):r.grid.groupAxis.position==="top"&&(g=n.labelRotate?-d+s:-d/2,m=-s+2);const y=j(p[h]).selectAll("rect").data([f]),b=y.enter().append("rect").attr("height",`${s}px`).attr("fill",S=>Ct(n.labelColorType,i)).attr("x",g).attr("y",m-2).attr("rx",5).attr("ry",5).style("cursor","pointer");y.merge(b).attr("width",S=>`${d}px`).style("transform",o),y.exit().remove();const x=j(p[h]).selectAll("text").data([f]),v=x.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");x.merge(v).text(S=>S.text).style("transform",o).attr("fill",S=>Ct(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+6).attr("y",m),x.exit().remove()}),c}function wk(t){t.selectAll(`g.${Rh}`).data([]).exit().remove()}const $k=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.seriesLabels$,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 P=$.computedData[0]?$.computedData[0].length-1:0,_=$.fullDataFormatter.grid.groupAxis.scaleDomain[0]==="auto"?0-$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[0]-$.fullDataFormatter.grid.groupAxis.scalePadding,w=$.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="auto"?P+$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[1]+$.fullDataFormatter.grid.groupAxis.scalePadding;return[_,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=Ch(e,"mousemove").pipe(I(o)),m=B({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(I(o),W(async $=>$),F($=>{const R=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${R} ${P} ${_}`}),tt()),y=B({textReverseTransform:m,fullParams:i.fullParams$}).pipe(I(o),W(async $=>$),F($=>`${$.textReverseTransform} rotate(${$.fullParams.labelRotate}deg)`)),b=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((P,_)=>_.columnIndex>P?_.columnIndex:P,0)+1),tt()),x=i.gridContainerPosition$.pipe(I(o),F($=>$.reduce((P,_)=>_.rowIndex>P?_.rowIndex:P,0)+1),tt()),v=yR({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:b,rowAmount:x,layout:i.layout$,rootMousemove:g,gridGroupPosition:v,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$}).subscribe($=>{const{groupIndex:R,groupLabel:P}=$.gridGroupPosition,_=$.groupScale(R)??0,w=yk({groupLabel:P,axisX:_,axisHeight:$.gridAxesSize.height,fullParams:$.fullParams});bk({selection:$.axesSelection,pluginName:n,lineData:w,fullParams:$.fullParams,fullChartParams:$.fullChartParams});const A=xk({groupLabel:P,axisX:_,fullParams:$.fullParams});_k({selection:$.axesSelection,labelData:A,fullParams:$.fullParams,fullDataFormatter:$.fullDataFormatter,fullChartParams:$.fullChartParams,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}).on("mouseover",(C,M)=>{C.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(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})}).on("mousemove",(C,M)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})}).on("click",(C,M)=>{C.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:$.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:$.GroupDataMap.get(P)??[],groupIndex:R,groupLabel:P,event:C,data:$.computedData})})});const S=Ch(s,"mouseout").pipe(I(o));return B({rootRectMouseout:S,axesSelection:l}).pipe(I(o),W(async $=>$)).subscribe($=>{setTimeout(()=>{a!=!0&&(vk($.axesSelection),wk($.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Px={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"},kh={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]};kh.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]},Sk={...ku},Dx={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Tx={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},Lx={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Cx={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Ex={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},Rx={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Ih={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]},kx={...Ih},Ix="MultiGridLegend",Ak=pe(Ix,Px)(({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(Ix,{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])))},Nh="MultiBars",Nx=it(Nh,"grid"),Mk=pe(Nh,Dx)(({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.${Nx}`).data(s).join("g").attr("class",Nx).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]=Eh(Nh,{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())}}),Fh="MultiBarStack",Fx=it(Fh,"grid"),Pk=pe(Fh,Tx)(({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.${Fx}`).data(s).join("g").attr("class",Fx).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]=hx(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$,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",Gx=it(Gh,"grid"),Dk=pe(Gh,Lx)(({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]=mx(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())}}),zh="MultiLines",zx=it(zh,"grid"),Tk=pe(zh,Cx)(({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.${zx}`).data(l).join("g").attr("class",zx).each((c,f,h)=>{const p=j(h[f]);a[f]=rx(zh,{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())}}),Oh="MultiLineAreas",Ox=it(Oh,"grid"),Lk=pe(Oh,Ex)(({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.${Ox}`).data(u).join("g").attr("class",Ox).each((l,c,f)=>{const h=j(f[c]);o[c]=ox(Oh,{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())}}),Yh="MultiDots",Yx=it(Yh,"grid"),Ck=pe(Yh,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]);o[l]=bx(Yh,{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())}}),Uh="MultiGroupAxis",Ux=it(Uh,"grid"),Ek=pe(Uh,kh)(({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.${Ux}`).data(s).join("g").attr("class",Ux).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]=wx(Uh,{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())}}),Bh="MultiValueAxis",Bx=it(Bh,"grid"),Rk=pe(Bh,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.${Bx}`).data(s).join("g").attr("class",Bx).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(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})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Wh="MultiValueStackAxis",Wx=it(Wh,"grid"),kk=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.${Wx}`).data(s).join("g").attr("class",Wx).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.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 Ik(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function Hx(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Ik(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 Xx=({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)}))},qx=({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)`}})),jx=({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 Hx(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=Hx(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Hh="OverlappingValueAxes",Vx=it(Hh,"grid"),Nk=pe(Hh,Ih)(({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=>{console.log("data",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=Xx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=jx({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.${Vx}`).data(c).join("g").attr("class",Vx).each((f,h,p)=>{if(h>1)return;const d=j(p[h]);o[h]=si(Hh,{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())}}),Xh="OverlappingValueStackAxes",Zx=it(Xh,"grid"),Fk=pe(Xh,kx)(({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=Xx({fullDataFormatter$:u,layout$:r.layout$}),d=qx({gridAxesTransform$:p}),g=jx({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.${Zx}`).data(c).join("g").attr("class",Zx).each((f,h,p)=>{if(h>1)return;const d=j(p[h]);o[h]=si(Xh,{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())}}),Gk={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},qh={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};qh.textRenderFn.toString=()=>`(eventData) => {
|
16
17
|
if (eventData.highlightTarget === 'datum' && eventData.datum) {
|
17
18
|
return [\`\${eventData.datum.label}: \${eventData.datum.value}\`]
|
18
19
|
} else if (eventData.highlightTarget === 'series') {
|
@@ -50,7 +51,10 @@
|
|
50
51
|
return [label, value]
|
51
52
|
}
|
52
53
|
return []
|
53
|
-
}`;const
|
54
|
+
}`;const jh="Tooltip",Kx=it(jh,"g"),zk=it(jh,"box");function Ok(t,e){const n=e.textSizePx*1.5,i=(t==null?[]:Array.isArray(t)?t:typeof t=="string"?t.split(`
|
55
|
+
`):[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">
|
56
|
+
${i}
|
57
|
+
</text>`:""}function Yk({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.${Kx}`).data(u).join(v=>v.append("g").classed(Kx,!0).attr("pointer-events","none"),v=>v,v=>v.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${zk}`).data(l).join(v=>v.append("g").classed(it(e,"box"),!0)),h=f.selectAll("rect").data(l).join(v=>v.append("rect").attr("rx",s).attr("ry",s)).attr("fill",v=>v.backgroundColor).attr("stroke",v=>v.strokeColor).attr("opacity",v=>v.backgroundOpacity),p=f.selectAll("g").data(u).join(v=>v.append("g").classed(it(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));u.length&&dR(p,u[0]);const d=p!=null&&p.node()?tx(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()?tx(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],x=a.offsetY+o.offset[1]>y?y-a.offsetY:o.offset[1];f.attr("transform",v=>`translate(${b}, ${x})`),f.attr("transform",v=>`translate(${b}, ${x})`)}const Uk=e3(jh,qh)(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new nt,s=o.event$.pipe(I(a),hi(g=>g.eventName==="mouseover"||g.eventName==="mousemove")),u=o.event$.pipe(I(a),hi(g=>g.eventName==="mouseout")),l=JA(i.fullChartParams$),c=B({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$,textSizePx:l}).pipe(I(a),W(async g=>g),F(g=>({backgroundColor:Ct(g.fullParams.backgroundColorType,g.fullChartParams),backgroundOpacity:g.fullParams.backgroundOpacity,strokeColor:Ct(g.fullParams.strokeColorType,g.fullChartParams),offset:g.fullParams.offset,padding:g.fullParams.padding,textSize:g.fullChartParams.styles.textSize,textSizePx:g.textSizePx,textColor:Ct(g.fullParams.textColorType,g.fullChartParams)}))),f=B({fullParams:i.fullParams$,tooltipStyle:c}).pipe(I(a),W(async g=>g),F(g=>g.fullParams.svgRenderFn?g.fullParams.svgRenderFn:m=>{const y=g.fullParams.textRenderFn(m);return Ok(y,g.tooltipStyle)})),h=B({event:s,contentRenderFn:f}).pipe(I(a),W(async g=>g),F(g=>g.contentRenderFn(g.event))),p=u.pipe(I(a),F(g=>"")),d=Qu(s,u).pipe(I(a),F(g=>g.event));return B({svgString:Qu(h,p),event:d,layout:i.layout$,tooltipStyle:c}).pipe(I(a),W(async g=>g)).subscribe(g=>{Yk({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)}}),Qx={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},arcScaleType:"area"},Jx={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},Vh={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"}]};Vh.eventFn.toString=()=>`(eventData: EventSeries, eventName: EventName, t: number) => {
|
54
58
|
if (eventName === 'mouseover' || eventName === 'mousemove') {
|
55
59
|
return [String(eventData.datum!.value)]
|
56
60
|
}
|
@@ -65,4 +69,6 @@
|
|
65
69
|
)
|
66
70
|
)
|
67
71
|
]
|
68
|
-
}`;const Zh={outerRadius:.95,outerRadiusWhileHighlight:1,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.3,labelColorType:"primary",labelFn:t=>String(t.label)};Zh.labelFn.toString=()=>"d => String(d.label)";const n2={outerRadius:.95,cornerRadius:0,arcScaleType:"area",mouseoverAngleIncrease:.05},Kh={outerRadius:.95,labelCentroid:2.5,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};Kh.labelFn.toString=()=>"d => String(d.label)";const r2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};function Yk(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 x=0,v=p.length;x<v;++x){const $=(g.text?g.text+b:"")+p[x],w=u($);(m+w)/2<d?(g.width=m=w,g.text=$):(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,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 x=p.select("text");x.size()||(x=p.append("text")),x.attr("transform",`translate(0,0) scale(${n/b})`);const v=x.selectAll("tspan").data(y),$=v.enter().append("tspan").attr("x",0).merge(v).attr("y",(w,R)=>(R-y.length/2+.8)*r).text(w=>w.text);return v.exit().remove(),v.merge($)}return h(t,e)}let Sn;function Wk(t,e){return Lm().velocityDecay(e.force.velocityDecay).force("collision",Dm().radius(n=>n.r+e.force.collisionSpacing)).force("charge",Cm().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function Hk({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=Kr().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/Mg(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=Z(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(Yk,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function jk(){return Wg().on("start",(t,e)=>{t.active||Sn.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Sn.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function qk({fullParams:t,SeriesContainerPositionMap:e}){Sn.force("x",Em().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",Rm().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Sn.alpha(1).restart()}function Xk({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=Z(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(ji).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const Zk=Cn("Bubbles",t2)(({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=Y({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),W(async f=>f),F(f=>Hk({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=Y({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),W(async f=>f),F(f=>{Sn&&Sn.stop();const h=Vk({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Sn=Wk(h,f.fullParams),Sn.nodes(f.bubblesData),qk({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return Y({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(jk())}),Y({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=>{Xk({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function i2({data:t,startAngle:e,endAngle:n}){return pv().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 Kk({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=at(e,"series");return Y({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 No=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=Kk({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return Y({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})`})}),Y({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}},Qh="Pie";function Qk({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 Jh(a,i.startAngle,i.endAngle,1)}:o=>Jh(n,i.startAngle,i.endAngle,o)}function Jh(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 o2({selection:t,data:e,arc:n,pathClassName:r}){return t.selectAll("path").data(e,o=>o.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(o,a)=>o.data.color).attr("d",(o,a)=>n(o))}function Jk({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=Z(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(ji).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function tI(t,e){const n=new nt,r=at(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=>{Y({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=i2({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new dt(h=>{Y({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Pu({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=>{Y({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Pu({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=>{Y({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=Qk({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,x)=>v=>{o=y(v),o2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r})}).on("end",(b,x)=>{o=Jh(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const v=o2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r});h.next(v),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 Y({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})})}),Y({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=>{Jk({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const eI=Cn(Qh,e2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=No({selection:t,pluginName:Qh,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=Z(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]=tI(Qh,{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())}}),Ru="PieEventTexts",a2=at(Ru,"text");function tp(t,e){const n=t.selectAll(`text.${a2}`).data(e),r=n.enter().append("text").classed(a2,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=Z(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 ep({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 nI(t,e){const n=new nt;let r;const i=e.fullChartParams$.pipe(I(n),F(o=>o.highlightTarget),tt());return Y({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=ep({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});tp(e.containerSelection,l)}).on("end",(a,s)=>{const u=ep({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});tp(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=ep({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});tp(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const rI=Cn(Ru,Xh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,{seriesCenterSelection$:o}=No({selection:t,pluginName:Ru,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=Z(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]=nI(Ru,{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())}}),ku="PieLabels",iI=at(ku,"text");function oI(t,e,n,r){return t.map((i,o)=>{const[a,s]=e.centroid(i),[u,l]=n.centroid(i);return{pieDatum:i,arcIndex:o,arcLabel:i.data.label,x:a*r,y:s*r,mouseoverX:u*r,mouseoverY:l*r}}).filter(i=>i.pieDatum.data.visible)}function aI(t,e,n,r){let i=t.selectAll("text").data(e,u=>u.pieDatum.id),o=i.enter().append("text").classed(iI,!0),a=i.exit();o.append("text");const s=i.merge(o);return s.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",u=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(u=>n.labelFn(u.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(u,l)=>Tu({datum:u.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",u=>"translate("+u.x+","+u.y+")"),a.remove(),s}function sI({labelSelection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition().duration(200).attr("transform",r=>"translate("+r.x+","+r.y+")").style("opacity",1);return}t.each((r,i,o)=>{const a=Z(o[i]);e.includes(r.pieDatum.id)?a.style("opacity",1).transition().duration(200).attr("transform",s=>"translate("+s.mouseoverX+","+s.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",s=>"translate("+s.x+","+s.y+")")})}function uI(t,e){const n=new nt;let r=new nt,i=[];const o=e.seriesContainerPosition$.pipe(I(n),F(a=>a.width<a.height?a.width:a.height),tt());return Y({shorterSideWith:o,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),W(async a=>a)).subscribe(a=>{const s=Pu({axisWidth:a.shorterSideWith,innerRadius:0,outerRadius:a.fullParams.outerRadius,padAngle:0,cornerRadius:0}),u=Pu({axisWidth:a.shorterSideWith,innerRadius:0,outerRadius:a.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),l=i2({data:a.containerVisibleComputedLayoutData,startAngle:a.fullParams.startAngle,endAngle:a.fullParams.endAngle});i=oI(l,s,u,a.fullParams.labelCentroid);const c=aI(e.containerSelection,i,a.fullParams,a.fullChartParams);r.next(c)}),Y({labelSelection:r,highlight:e.seriesHighlight$.pipe(F(a=>a.map(s=>s.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async a=>a)).subscribe(a=>{sI({labelSelection:a.labelSelection,ids:a.highlight,fullChartParams:a.fullChartParams})}),()=>{n.next(void 0)}}const lI=Cn(ku,Zh)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=No({selection:t,pluginName:ku,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=Z(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]=uI(ku,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),np="Rose",cI=Math.PI*2,s2=0;function fI({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i}){const o=n/2*e,a=i==="area"?.5:1,s=Kr().domain([0,r]).range([0,o]).exponent(a);return u=>{const l=s(u.prevValue),c=s(u.value),f=qe(l,c);return h=>{const p=f(h);return gu().innerRadius(0).outerRadius(p).padAngle(s2).padRadius(p).cornerRadius(t)(u)}}}function hI({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=Z(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(ji).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.mouseoverAngleIncrease,endAngle:l.endAngle+n.mouseoverAngleIncrease})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function pI(t,e){const n=new nt,r=at(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),F(p=>p.width<p.height?p.width:p.height),tt()),a=Y({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p),F(p=>{const d=cI/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:s2,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=Y({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),W(async p=>p),F(p=>fI({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType}))),c=e.fullChartParams$.pipe(I(n),F(p=>p.transitionDuration),tt()),f=new D2(!1),h=new dt(p=>{Y({pieData:a,tweenArc:l,transitionDuration:c}).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);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 Y({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})})}),Y({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),li(p=>!p.isTransitionMoving)).subscribe(p=>{hI({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const dI=Cn(np,n2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=No({selection:t,pluginName:np,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=Z(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]=pI(np,{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())}}),Iu="RoseLabels",gI=at(Iu,"text");function mI({pieData:t,centroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o}){const a=i/2*o,s=n==="area"?.5:1,u=Kr().domain([0,r]).range([0,a]).exponent(s);return t.map((l,c)=>{const f=u(l.value),h=gu().innerRadius(0).outerRadius(f).padAngle(0).padRadius(f).cornerRadius(0),[p,d]=h.centroid(l),[g,m]=[p,d];return{pieDatum:l,arcIndex:c,arcLabel:l.data.label,x:p*e,y:d*e,mouseoverX:g*e,mouseoverY:m*e}}).filter(l=>l.pieDatum.data.visible)}function yI(t,e,n,r){let i=t.selectAll("text").data(e,u=>u.pieDatum.id),o=i.enter().append("text").classed(gI,!0),a=i.exit();o.append("text");const s=i.merge(o);return s.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",u=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(u=>n.labelFn(u.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(u,l)=>Tu({datum:u.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",u=>"translate("+u.x+","+u.y+")"),a.remove(),s}function bI({labelSelection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition().duration(200).attr("transform",r=>"translate("+r.x+","+r.y+")").style("opacity",1);return}t.each((r,i,o)=>{const a=Z(o[i]);e.includes(r.pieDatum.data.id)?a.style("opacity",1).transition().duration(200).attr("transform",s=>"translate("+s.mouseoverX+","+s.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",s=>"translate("+s.x+","+s.y+")")})}function vI(t,e){const n=new nt;let r=new nt,i=[];const o=e.seriesContainerPosition$.pipe(I(n),F(s=>s.width<s.height?s.width:s.height),tt()),a=e.visibleComputedLayoutData$.pipe(F(s=>Math.max(...s.flat().map(u=>u.value))),tt());return Y({shorterSideWith:o,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:a,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),W(async s=>s)).subscribe(s=>{const u=Math.PI*2/s.containerVisibleComputedLayoutData.length,l=s.containerVisibleComputedLayoutData.map((f,h)=>({id:f.id,data:f,index:h,value:f.value,startAngle:u*h,endAngle:u*(h+1),padAngle:0}));i=mI({pieData:l,centroid:s.fullParams.labelCentroid,arcScaleType:s.fullParams.arcScaleType,maxValue:s.maxValue,axisWidth:s.shorterSideWith,outerRadius:s.fullParams.outerRadius});const c=yI(e.containerSelection,i,s.fullParams,s.fullChartParams);r.next(c)}),Y({labelSelection:r,highlight:e.seriesHighlight$.pipe(F(s=>s.map(u=>u.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async s=>s)).subscribe(s=>{bI({labelSelection:s.labelSelection,ids:s.highlight,fullChartParams:s.fullChartParams})}),()=>{n.next(void 0)}}const xI=Cn(Iu,Kh)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=No({selection:t,pluginName:Iu,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=Z(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]=vI(Iu,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),u2="SeriesLegend",_I=Cn(u2,r2)(({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=Lu(u2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),rp={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};rp.sort.toString=()=>"(a, b) => b.value - a.value";const l2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},c2="TreeLegend",wI=ng(c2,l2)(({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=Lu(c2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),sr="TreeMap",f2=at(sr,"tree"),h2=at(sr,"tile");function $I({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=Z(c[l]);f.selectAll(`rect.${h2}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",h2).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)=>{Z(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=Z(this),b=m.data.label.split(/\s+/).reverse();let x,v=[];const $=y.attr("x");let w=y.attr("y"),R=0,D=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",$).attr("y",w);for(;x=b.pop();)v.push(x),D.text(v.join(" ")),D.node().getComputedTextLength()>m.x1-m.x0-o&&(v.pop(),D.text(v.join(" ")),v=[x],R+=a,D=y.append("tspan").attr("cursor","pointer").attr("fill",Ct(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",$).attr("y",w).attr("dy",R+"px").text(x))})})}),s}function SI({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)?Z(o[i]).style("opacity",1):Z(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const AI=ng(sr,rp)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=Y({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=$y().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Vf.ratio(u.fullParams.squarifyRatio)),c=js(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=Y({selection:Yo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),W(async u=>u),F(u=>$I({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 Y({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:sr,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:sr,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:sr,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:sr,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})})}),Y({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=>{SI({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});K.BarStack=HR,K.Bars=FR,K.BarsPN=GR,K.BarsTriangle=JR,K.Bubbles=Zk,K.CONTAINER_PLUGIN_PARAMS=Qx,K.Container=Gk,K.DEFAULT_BARS_DIVERGING_PARAMS=p2,K.DEFAULT_BARS_PARAMS=Go,K.DEFAULT_BARS_TRIANGLE_PARAMS=sp,K.DEFAULT_BAR_STACK_PARAMS=ap,K.DEFAULT_BUBBLES_PARAMS=t2,K.DEFAULT_DOTS_PARAMS=op,K.DEFAULT_GRID_LEGEND_PARAMS=cp,K.DEFAULT_GROUP_AREA_PARAMS=Nu,K.DEFAULT_GROUP_AXIS_PARAMS=Fu,K.DEFAULT_LINES_PARAMS=ur,K.DEFAULT_LINE_AREAS_PARAMS=ip,K.DEFAULT_MULTI_BARS_PARAMS=Tx,K.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=Cx,K.DEFAULT_MULTI_BAR_STACK_PARAMS=Lx,K.DEFAULT_MULTI_DOTS_PARAMS=kx,K.DEFAULT_MULTI_GRID_LEGEND_PARAMS=Px,K.DEFAULT_MULTI_GROUP_AXIS_PARAMS=kh,K.DEFAULT_MULTI_LINES_PARAMS=Ex,K.DEFAULT_MULTI_LINE_AREAS_PARAMS=Rx,K.DEFAULT_MULTI_VALUE_AXIS_PARAMS=Eu,K.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=Sk,K.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Ih,K.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=Ix,K.DEFAULT_PIE_EVENT_TEXTS_PARAMS=Xh,K.DEFAULT_PIE_LABELS_PARAMS=Zh,K.DEFAULT_PIE_PARAMS=e2,K.DEFAULT_ROSE_LABELS_PARAMS=Kh,K.DEFAULT_ROSE_PARAMS=n2,K.DEFAULT_SCALING_AREA_PARAMS=lp,K.DEFAULT_SERIES_LEGEND_PARAMS=r2,K.DEFAULT_TREE_LEGEND_PARAMS=l2,K.DEFAULT_TREE_MAP_PARAMS=rp,K.DEFAULT_VALUE_AXIS_PARAMS=Gu,K.DEFAULT_VALUE_STACK_AXIS_PARAMS=up,K.Dots=rk,K.GridLegend=ok,K.GroupAux=$k,K.GroupAxis=lk,K.LineAreas=LR,K.Lines=$R,K.MultiBarStack=Dk,K.MultiBars=Mk,K.MultiBarsTriangle=Pk,K.MultiDots=Ck,K.MultiGridLegend=Ak,K.MultiGroupAxis=Ek,K.MultiLineAreas=Lk,K.MultiLines=Tk,K.MultiValueAxis=Rk,K.MultiValueStackAxis=kk,K.OverlappingValueAxes=Nk,K.OverlappingValueStackAxes=Fk,K.Pie=eI,K.PieEventTexts=rI,K.PieLabels=lI,K.Rose=dI,K.RoseLabels=xI,K.ScalingArea=mk,K.SeriesLegend=_I,K.TOOLTIP_PARAMS=jh,K.Tooltip=Bk,K.TreeLegend=wI,K.TreeMap=AI,K.ValueAxis=pk,K.ValueStackAxis=dk,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
72
|
+
}`;const Zh={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:t=>String(t.label)};Zh.labelFn.toString=()=>"d => String(d.label)";const t2={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},Kh={outerRadius:.85,labelCentroid:2.1,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};Kh.labelFn.toString=()=>"d => String(d.label)";const e2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};function Bk(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 x=0,v=p.length;x<v;++x){const S=(g.text?g.text+b:"")+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,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 x=p.select("text");x.size()||(x=p.append("text")),x.attr("transform",`translate(0,0) scale(${n/b})`);const v=x.selectAll("tspan").data(y),S=v.enter().append("tspan").attr("x",0).merge(v).attr("y",($,R)=>(R-y.length/2+.8)*r).text($=>$.text);return v.exit().remove(),v.merge(S)}return h(t,e)}let An;function Wk(t,e){return Tm().velocityDecay(e.force.velocityDecay).force("collision",Mm().radius(n=>n.r+e.force.collisionSpacing)).force("charge",Lm().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function Hk({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/Ag(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 Xk({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(Bk,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function qk(){return Bg().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 jk({fullParams:t,SeriesContainerPositionMap:e}){An.force("x",Cm().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",Em().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),An.alpha(1).restart()}function Vk({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 Zk=En("Bubbles",Qx)(({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=>Hk({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=Xk({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return An=Wk(h,f.fullParams),An.nodes(f.bubblesData),jk({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(qk())}),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=>{Vk({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function n2({data:t,startAngle:e,endAngle:n}){return hv().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 Kk({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 zo=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=Kk({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}},Qh="Pie";function Qk({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 Jh(a,i.startAngle,i.endAngle,1)}:o=>Jh(n,i.startAngle,i.endAngle,o)}function Jh(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 r2({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 Jk({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 tI(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=n2({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,b=>b.id),g=d.enter(),m=d.exit(),y=Qk({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,x)=>v=>{o=y(v),r2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,x)=>{o=Jh(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const v=r2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(v),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=>{Jk({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const eI=En(Qh,Jx)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=zo({selection:t,pluginName:Qh,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]=tI(Qh,{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",i2=it(Iu,"text");function tp(t,e){const n=t.selectAll(`text.${i2}`).data(e),r=n.enter().append("text").classed(i2,!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 ep({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 nI(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=ep({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});tp(e.containerSelection,l)}).on("end",(a,s)=>{const u=ep({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});tp(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=ep({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});tp(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const rI=En(Iu,Vh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,{seriesCenterSelection$:o}=zo({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]=nI(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",iI=it(ui,"label-g"),oI=it(ui,"line-g"),aI=it(ui,"text"),o2=2;function sI({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(`
|
73
|
+
`),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 uI({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(aI,!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)=>{j(u[s]).selectAll("tspan").data(a.arcLabels).join("tspan").attr("x",0).attr("y",(l,c)=>a.quadrant==1||a.quadrant==2?-(a.arcLabels.length-1-c)*i:c*i).text(l=>l)});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function lI(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 cI({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 fI({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 hI(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(oI,!0);const i=e.containerSelection.append("g");i.classed(iI,!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>=o2?o2: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=n2({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=sI({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=uI({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{lI(d,s,c.textSizePx);const g=cI({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=>{fI({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const pI=En(ui,Zh)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=zo({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]=hI(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)}}),np="Rose",dI=Math.PI*2;function gI({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 mI({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 yI(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=dI/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=>gI({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 M2(!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,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)=>$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=>{mI({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const bI=En(np,t2)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=zo({selection:t,pluginName:np,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]=yI(np,{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",vI=it(li,"label-g"),xI=it(li,"line-g"),_I=it(li,"text"),a2=2;function wI({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,b]=[g,m],x=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:x.split(`
|
74
|
+
`),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 $I({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(_I,!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)=>{j(u[s]).selectAll("tspan").data(a.arcLabels).join("tspan").attr("x",0).attr("y",(l,c)=>a.quadrant==1||a.quadrant==2?-(a.arcLabels.length-1-c)*i:c*i).text(l=>l)});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function SI(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 AI({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 MI({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 PI(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(xI,!0);const i=e.containerSelection.append("g");i.classed(vI,!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>=a2?a2: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=wI({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=$I({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{SI(d,s,f.textSizePx);const g=AI({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=>{MI({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const DI=En(li,Kh)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=zo({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]=PI(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)}}),s2="SeriesLegend",TI=En(s2,e2)(({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(s2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),rp={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};rp.sort.toString=()=>"(a, b) => b.value - a.value";const u2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},l2="TreeLegend",LI=eg(l2,u2)(({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(l2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),ur="TreeMap",c2=it(ur,"tree"),f2=it(ur,"tile");function CI({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${c2}`).data(e,u=>u.data.id).join("g").attr("class",c2);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.${f2}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",f2).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),b=m.data.label.split(/\s+/).reverse();let x,v=[];const S=y.attr("x");let $=y.attr("y"),R=0,P=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=b.pop();)v.push(x),P.text(v.join(" ")),P.node().getComputedTextLength()>m.x1-m.x0-o&&(v.pop(),P.text(v.join(" ")),v=[x],R+=a,P=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",R+"px").text(x))})})}),s}function EI({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 RI=eg(ur,rp)(({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=wy().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=>CI({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=>{EI({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});K.BarStack=HR,K.Bars=FR,K.BarsPN=GR,K.BarsTriangle=JR,K.Bubbles=Zk,K.CONTAINER_PLUGIN_PARAMS=Gk,K.DEFAULT_BARS_DIVERGING_PARAMS=h2,K.DEFAULT_BARS_PARAMS=Yo,K.DEFAULT_BARS_TRIANGLE_PARAMS=sp,K.DEFAULT_BAR_STACK_PARAMS=ap,K.DEFAULT_BUBBLES_PARAMS=Qx,K.DEFAULT_DOTS_PARAMS=op,K.DEFAULT_GRID_LEGEND_PARAMS=cp,K.DEFAULT_GROUP_AREA_PARAMS=Nu,K.DEFAULT_GROUP_AXIS_PARAMS=Fu,K.DEFAULT_LINES_PARAMS=lr,K.DEFAULT_LINE_AREAS_PARAMS=ip,K.DEFAULT_MULTI_BARS_PARAMS=Dx,K.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=Lx,K.DEFAULT_MULTI_BAR_STACK_PARAMS=Tx,K.DEFAULT_MULTI_DOTS_PARAMS=Rx,K.DEFAULT_MULTI_GRID_LEGEND_PARAMS=Px,K.DEFAULT_MULTI_GROUP_AXIS_PARAMS=kh,K.DEFAULT_MULTI_LINES_PARAMS=Cx,K.DEFAULT_MULTI_LINE_AREAS_PARAMS=Ex,K.DEFAULT_MULTI_VALUE_AXIS_PARAMS=ku,K.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=Sk,K.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Ih,K.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=kx,K.DEFAULT_PIE_EVENT_TEXTS_PARAMS=Vh,K.DEFAULT_PIE_LABELS_PARAMS=Zh,K.DEFAULT_PIE_PARAMS=Jx,K.DEFAULT_ROSE_LABELS_PARAMS=Kh,K.DEFAULT_ROSE_PARAMS=t2,K.DEFAULT_SCALING_AREA_PARAMS=lp,K.DEFAULT_SERIES_LEGEND_PARAMS=e2,K.DEFAULT_TREE_LEGEND_PARAMS=u2,K.DEFAULT_TREE_MAP_PARAMS=rp,K.DEFAULT_VALUE_AXIS_PARAMS=Gu,K.DEFAULT_VALUE_STACK_AXIS_PARAMS=up,K.Dots=rk,K.GridLegend=ok,K.GroupAux=$k,K.GroupAxis=lk,K.LineAreas=LR,K.Lines=$R,K.MultiBarStack=Pk,K.MultiBars=Mk,K.MultiBarsTriangle=Dk,K.MultiDots=Ck,K.MultiGridLegend=Ak,K.MultiGroupAxis=Ek,K.MultiLineAreas=Lk,K.MultiLines=Tk,K.MultiValueAxis=Rk,K.MultiValueStackAxis=kk,K.OverlappingValueAxes=Nk,K.OverlappingValueStackAxes=Fk,K.Pie=eI,K.PieEventTexts=rI,K.PieLabels=pI,K.Rose=bI,K.RoseLabels=DI,K.ScalingArea=mk,K.SeriesLegend=TI,K.TOOLTIP_PARAMS=qh,K.Tooltip=Uk,K.TreeLegend=LI,K.TreeMap=RI,K.ValueAxis=pk,K.ValueStackAxis=dk,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|