@orbcharts/plugins-basic 3.0.0-alpha.27 → 3.0.0-alpha.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -19049,7 +19049,7 @@ const nL = ev(wh, xC)(({ selection: t, rootSelection: e, name: n, chartType: r,
19049
19049
  lineLengthMin: 4
19050
19050
  },
19051
19051
  highlightRIncrease: 0,
19052
- scaleType: "area"
19052
+ bubbleScaleType: "area"
19053
19053
  }, AC = {
19054
19054
  // padding: {
19055
19055
  // top: 50,
@@ -19257,7 +19257,7 @@ const rL = Mo("Bubbles", MC)(({ selection: t, name: e, observer: n, subject: r }
19257
19257
  });
19258
19258
  const c = n.fullParams$.pipe(
19259
19259
  R(i),
19260
- G((h) => h.scaleType),
19260
+ G((h) => h.bubbleScaleType),
19261
19261
  K()
19262
19262
  ), s = new et((h) => {
19263
19263
  q({
@@ -9,4 +9,4 @@
9
9
  `):"",this.name="UnsubscriptionError",this.errors=e}});function ps(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var _o=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 u=Kr(a),c=u.next();!c.done;c=u.next()){var s=c.value;s.remove(this)}}catch(g){e={error:g}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else a.remove(this);var f=this.initialTeardown;if(Et(f))try{f()}catch(g){o=g instanceof ah?g.errors:[g]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=Kr(h),p=l.next();!p.done;p=l.next()){var d=p.value;try{b2(d)}catch(g){o=o??[],g instanceof ah?o=xo(xo([],vo(o)),vo(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}if(o)throw new ah(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)b2(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)&&ps(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ps(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),m2=_o.EMPTY;function y2(t){return t instanceof _o||t&&"closed"in t&&Et(t.remove)&&Et(t.add)&&Et(t.unsubscribe)}function b2(t){Et(t)?t():t.unsubscribe()}var v2={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},VE={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,xo([t,e],vo(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function x2(t){VE.setTimeout(function(){throw t})}function uh(){}function ds(t){t()}var sh=function(t){on(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,y2(n)&&n.add(r)):r.destination=QE,r}return e.create=function(n,r,i){return new wo(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}(_o),jE=Function.prototype.bind;function ch(t,e){return jE.call(t,e)}var ZE=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){gs(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){gs(r)}else gs(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){gs(n)}},t}(),wo=function(t){on(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(Et(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;o&&v2.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&ch(n.next,u),error:n.error&&ch(n.error,u),complete:n.complete&&ch(n.complete,u)}):a=n}return o.destination=new ZE(a),o}return e}(sh);function gs(t){x2(t)}function KE(t){throw t}var QE={closed:!0,next:uh,error:KE,complete:uh},lh=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _2(t){return t}function JE(t){return t.length===0?_2:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var Te=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=eN(e)?e:new wo(e,n,r);return ds(function(){var a=i,u=a.operator,c=a.source;o.add(u?u.call(o,c):c?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=w2(n),new n(function(i,o){var a=new wo({next:function(u){try{e(u)}catch(c){o(c),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[lh]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return JE(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=w2(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 w2(t){var e;return(e=t??v2.Promise)!==null&&e!==void 0?e:Promise}function tN(t){return t&&Et(t.next)&&Et(t.error)&&Et(t.complete)}function eN(t){return t&&t instanceof sh||tN(t)&&y2(t)}function nN(t){return Et(t==null?void 0:t.lift)}function tr(t){return function(e){if(nN(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 Ao(t,e,n,r,i){return new rN(t,e,n,r,i)}var rN=function(t){on(e,t);function e(n,r,i,o,a,u){var c=t.call(this,n)||this;return c.onFinalize=a,c.shouldUnsubscribe=u,c._next=r?function(s){try{r(s)}catch(f){n.error(f)}}:t.prototype._next,c._error=o?function(s){try{o(s)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(s){n.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,c}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}(sh),iN=oh(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),$o=function(t){on(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 A2(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new iN},e.prototype.next=function(n){var r=this;ds(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Kr(r.currentObservers),u=a.next();!u.done;u=a.next()){var c=u.value;c.next(n)}}catch(s){i={error:s}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;ds(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;ds(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,u=i.observers;return o||a?m2:(this.currentObservers=null,u.push(n),new _o(function(){r.currentObservers=null,ps(u,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 Te;return n.source=this,n},e.create=function(n,r){return new A2(n,r)},e}(Te),A2=function(t){on(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:m2},e}($o),fh={now:function(){return(fh.delegate||Date).now()},delegate:void 0},oN=function(t){on(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=fh);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,u=r._timestampProvider,c=r._windowTime;i||(o.push(n),!a&&o.push(u.now()+c)),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,u=a.slice(),c=0;c<u.length&&!n.closed;c+=o?1:2)n.next(u[c]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,u=(a?1:2)*r;if(r<1/0&&u<o.length&&o.splice(0,o.length-u),!a){for(var c=i.now(),s=0,f=1;f<o.length&&o[f]<=c;f+=2)s=f;s&&o.splice(0,s+1)}},e}($o),aN=function(t){on(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(_o),$2={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,xo([t,e],vo(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},uN=function(t){on(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),$2.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&&$2.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,ps(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(aN),M2=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=fh.now,t}(),sN=function(t){on(e,t);function e(n,r){r===void 0&&(r=M2.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}(M2);new sN(uN);function cN(t){return t&&Et(t.schedule)}function lN(t){return t[t.length-1]}function S2(t){return cN(lN(t))?t.pop():void 0}var T2=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function P2(t){return Et(t==null?void 0:t.then)}function D2(t){return Et(t[lh])}function k2(t){return Symbol.asyncIterator&&Et(t==null?void 0:t[Symbol.asyncIterator])}function E2(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 fN(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var N2=fN();function L2(t){return Et(t==null?void 0:t[N2])}function C2(t){return HE(this,arguments,function(){var e,n,r,i;return g2(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,Qr(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Qr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Qr(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 I2(t){return Et(t==null?void 0:t.getReader)}function xn(t){if(t instanceof Te)return t;if(t!=null){if(D2(t))return hN(t);if(T2(t))return pN(t);if(P2(t))return dN(t);if(k2(t))return R2(t);if(L2(t))return gN(t);if(I2(t))return mN(t)}throw E2(t)}function hN(t){return new Te(function(e){var n=t[lh]();if(Et(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function pN(t){return new Te(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function dN(t){return new Te(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,x2)})}function gN(t){return new Te(function(e){var n,r;try{for(var i=Kr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function R2(t){return new Te(function(e){yN(t,e).catch(function(n){return e.error(n)})})}function mN(t){return R2(C2(t))}function yN(t,e){var n,r,i,o;return WE(this,void 0,void 0,function(){var a,u;return g2(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=XE(t),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=c.sent(),i={error:u},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:c.sent(),c.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 er(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 F2(t,e){return e===void 0&&(e=0),tr(function(n,r){n.subscribe(Ao(r,function(i){return er(r,t,function(){return r.next(i)},e)},function(){return er(r,t,function(){return r.complete()},e)},function(i){return er(r,t,function(){return r.error(i)},e)}))})}function z2(t,e){return e===void 0&&(e=0),tr(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function bN(t,e){return xn(t).pipe(z2(e),F2(e))}function vN(t,e){return xn(t).pipe(z2(e),F2(e))}function xN(t,e){return new Te(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function _N(t,e){return new Te(function(n){var r;return er(n,e,function(){r=t[N2](),er(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(u){n.error(u);return}a?n.complete():n.next(o)},0,!0)}),function(){return Et(r==null?void 0:r.return)&&r.return()}})}function O2(t,e){if(!t)throw new Error("Iterable cannot be null");return new Te(function(n){er(n,e,function(){var r=t[Symbol.asyncIterator]();er(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function wN(t,e){return O2(C2(t),e)}function AN(t,e){if(t!=null){if(D2(t))return bN(t,e);if(T2(t))return xN(t,e);if(P2(t))return vN(t,e);if(k2(t))return O2(t,e);if(L2(t))return _N(t,e);if(I2(t))return wN(t,e)}throw E2(t)}function $N(t,e){return e?AN(t,e):xn(t)}oh(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function G2(t,e){return tr(function(n,r){var i=0;n.subscribe(Ao(r,function(o){r.next(t.call(e,o,i++))}))})}function MN(t,e,n,r,i,o,a,u){var c=[],s=0,f=0,h=!1,l=function(){h&&!c.length&&!s&&e.complete()},p=function(g){return s<r?d(g):c.push(g)},d=function(g){s++;var m=!1;xn(n(g,f++)).subscribe(Ao(e,function(b){e.next(b)},function(){m=!0},void 0,function(){if(m)try{s--;for(var b=function(){var x=c.shift();a||d(x)};c.length&&s<r;)b();l()}catch(x){e.error(x)}}))};return t.subscribe(Ao(e,p,function(){h=!0,l()})),function(){}}function U2(t,e,n){return n===void 0&&(n=1/0),Et(e)?U2(function(r,i){return G2(function(o,a){return e(r,o,i,a)})(xn(t(r,i)))},n):(typeof e=="number"&&(n=e),tr(function(r,i){return MN(r,i,t,n)}))}function SN(t){return U2(_2,t)}function TN(){return SN(1)}function Y2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return TN()($N(t,S2(t)))}function PN(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new $o}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,u=t.resetOnRefCountZero,c=u===void 0?!0:u;return function(s){var f,h,l,p=0,d=!1,g=!1,m=function(){h==null||h.unsubscribe(),h=void 0},b=function(){m(),f=l=void 0,d=g=!1},x=function(){var _=f;b(),_==null||_.unsubscribe()};return tr(function(_,v){p++,!g&&!d&&m();var w=l=l??n();v.add(function(){p--,p===0&&!g&&!d&&(h=hh(x,c))}),w.subscribe(v),!f&&p>0&&(f=new wo({next:function(y){return w.next(y)},error:function(y){g=!0,m(),h=hh(b,i,y),w.error(y)},complete:function(){d=!0,m(),h=hh(b,a),w.complete()}}),xn(_).subscribe(f))})(s)}}function hh(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 wo({next:function(){i.unsubscribe(),t()}});return xn(e.apply(void 0,xo([],vo(n)))).subscribe(i)}}function DN(t,e,n){var r,i=!1;return r=t,PN({connector:function(){return new oN(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function kN(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=S2(t);return tr(function(r,i){(n?Y2(t,r,n):Y2(t,r)).subscribe(i)})}function EN(t){return tr(function(e,n){xn(t).subscribe(Ao(n,function(){return n.complete()},uh)),!n.closed&&e.subscribe(n)})}const ph=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=Wr.scaleDomain,scaleRange:i=Wr.scaleRange})=>{const o=r[0]??Wr.scaleDomain[0],a=r[1]??Wr.scaleDomain[1],u=i[0]??Wr.scaleRange[0],c=i[1]??Wr.scaleRange[1],s=o==="auto"?e:o,f=a==="auto"?t:a;let h=n*u,l=n*c;return h2().domain([s,f]).range([h,l])},B2=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return IE().domain(t).range(r).padding(n)},NN=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let i=t.map((o,a)=>a);return r&&i.reverse(),p2().domain([-0,e+0]).range(i)};function LN({name:t,defaultParams:e,initFn:n}){const r=new $o,i=new $o,o=new WeakMap;let a=()=>{},u,c=e;return{params$:i,name:t,defaultParams:e,init(){u&&(a=n(u)??(()=>{}),o.set(u.selection,u))},destroy(){a(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:s=>{c=d2(s,e)},setContext:s=>{u=s,u.observer.fullParams$=i.pipe(EN(r),kN({}),G2(f=>d2(f,c)),DN(1))}}}const dh=()=>function(t,e){return function(n){return class{constructor(){const r=LN({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}}}},Mo=dh(),Pe=dh(),q2=dh();function W2(t){try{return t.node().getBBox()}catch(e){throw new Error(e)}}function CN(t,e){function n(i){var u;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&&((u=o==null?void 0:o.firstChild)!=null&&u.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 Jr(t){return t.substring(0,4)!=="ease"?vi:Ly[t]??vi}function ms({axisWidth:t,innerRadius:e,outerRadius:n,padAngle:r,cornerRadius:i}){const o=jl().domain([0,1]).range([0,t/2]),a=o(n);return Ym().innerRadius(o(e)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const ys=(t,e)=>e instanceof Function?e(t):Si(e)(t);function H2(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 X2(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 IN(t){const e=t.filter(n=>n.value!=null&&n.visible!=!1).map(n=>n.value);return X2(e)}function Pt(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 RN(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]}function gh({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 ft(t,e,n){const r=n?`--${n}`:"";return`orbcharts-${t}__${e}${r}`}function ti(t,e){const r=Math.random().toString(36).substr(2,5);return ft(t,e,r)}function V2({fullDataFormatter$:t,gridAxesSize$:e,computedData$:n,fullChartParams$:r}){const i=new pt,o=new nt(a=>{q({dataFormatter:t,computedData:n}).pipe(R(i),U(async u=>u)).subscribe(u=>{const s=u.computedData[0]?u.computedData[0].length-1:0,f=u.dataFormatter.groupAxis.scaleDomain[0]==="auto"?0-u.dataFormatter.groupAxis.scalePadding:u.dataFormatter.groupAxis.scaleDomain[0]-u.dataFormatter.groupAxis.scalePadding,h=u.dataFormatter.groupAxis.scaleDomain[1]==="auto"?s+u.dataFormatter.groupAxis.scalePadding:u.dataFormatter.groupAxis.scaleDomain[1]+u.dataFormatter.groupAxis.scalePadding,p=(u.dataFormatter.grid.seriesType==="row"?(u.computedData[0]??[]).map(d=>d.groupLabel):u.computedData.map(d=>d[0].groupLabel)).filter((d,g)=>g>=f&&g<=h);a.next(p)})});return new nt(a=>{q({dataFormatter:t,axisSize:e,fullChartParams:r,scaleRangeGroupLabels:o}).pipe(R(i),U(async u=>u)).subscribe(u=>{const c=u.dataFormatter.valueAxis.position==="right"||u.dataFormatter.valueAxis.position==="bottom",s=NN({axisLabels:u.scaleRangeGroupLabels,axisWidth:u.axisSize.width,reverse:c}),f=l=>u.dataFormatter.groupAxis.position==="bottom"||u.dataFormatter.groupAxis.position==="top"?l.offsetX-u.fullChartParams.padding.left:l.offsetY-u.fullChartParams.padding.top,h=l=>{const p=f(l),d=s(p);return{groupIndex:d,groupLabel:u.scaleRangeGroupLabels[d]??""}};return a.next(h),function(){i.next(void 0)}})})}const bs="Lines",FN=ft(bs,"g"),zN=ft(bs,"path");function ON(t="curveLinear"){return Du().x(e=>e.axisX).y(e=>e.axisY).curve(Ly[t])}function GN(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 UN({selection:t,segmentData:e,linePath:n,params:r}){return t.selectAll("path").data(e,(o,a)=>o.length?`${o[0].id}_${o[o.length-1].id}`:a).join(o=>o.append("path").classed(zN,!0).attr("fill","none").attr("pointer-events","visibleStroke").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),o=>o,o=>o.remove()).attr("stroke-width",r.lineWidth).attr("stroke",(o,a)=>o[0]&&o[0].color).attr("d",o=>n(o))}function YN({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 BN({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(u=>{const c=u.append("rect");return c.transition().duration(n).ease(Jr(r)).tween("tween",(s,f,h)=>l=>{const p=s.width*l;c.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),c},u=>u.attr("x",0).attr("y",0).attr("width",c=>c.width).attr("height",c=>c.height),u=>u.remove())})}const qN=Pe(bs,rr)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=ti(bs,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;n.gridAxesTransform$.pipe(R(i),O(x=>x.value),K()).subscribe(x=>{a.style("transform",x)}),n.gridGraphicTransform$.pipe(R(i),O(x=>x.value),K()).subscribe(x=>{c.transition().duration(50).style("transform",x)});const f=new nt(x=>{const _=n.fullParams$.pipe(R(i)).subscribe(v=>{if(!v)return;const w=ON(v.lineCurve);x.next(w)});return()=>{_.unsubscribe()}}),h=new nt(x=>{n.computedData$.pipe(R(i),U(async _=>_)).subscribe(_=>{const v=_[0]&&_[0][0]?_.map(w=>w[0].seriesLabel):[];x.next(v)})}),l=n.fullChartParams$.pipe(O(x=>x.transitionDuration),K()),p=n.fullChartParams$.pipe(O(x=>x.transitionEase),K());q({seriesLabels:h,axisSize:n.gridAxesSize$,transitionDuration:l,transitionEase:p}).pipe(R(i),U(async x=>x)).subscribe(x=>{const v=[{id:o,width:x.axisSize.width,height:x.axisSize.height}].concat(x.seriesLabels.map(w=>({id:`orbcharts__clipPath_${w}`,width:x.axisSize.width,height:x.axisSize.height})));BN({defsSelection:u,clipPathData:v,transitionDuration:x.transitionDuration,transitionEase:x.transitionEase})});const d=n.computedData$.pipe(O(x=>{const _=new Map;return x.flat().forEach(v=>_.set(v.id,v)),_})),g=V2({fullDataFormatter$:n.fullDataFormatter$,gridAxesSize$:n.gridAxesSize$,computedData$:n.computedData$,fullChartParams$:n.fullChartParams$}),m=n.fullChartParams$.pipe(R(i),O(x=>x.highlightTarget),K());q({seriesLabels:h,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,GroupDataMap:n.GroupDataMap$,linePath:f,params:n.fullParams$,highlightTarget:m,gridGroupPositionFn:g}).pipe(R(i),U(async x=>x)).subscribe(x=>{const _=c.selectAll("g").data(x.seriesLabels,(y,A)=>y),v=_.enter().append("g").classed(FN,!0);_.exit().remove();const w=_.merge(v).attr("clip-path",(y,A)=>`url(#orbcharts__clipPath_${y})`);w.each((y,A,M)=>{const $=GN(x.computedData[A]??[]);UN({selection:j(M[A]),linePath:x.linePath,segmentData:$,params:x.params}).on("mouseover",(S,L)=>{S.stopPropagation();const E=L[0]?L[0].seriesLabel:"",{groupIndex:T,groupLabel:k}=x.gridGroupPositionFn(S),I=x.GroupDataMap.get(k).find(C=>C.seriesLabel===E)??L[0];r.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:x.highlightTarget,datum:I,series:x.SeriesDataMap.get(I.seriesLabel),seriesIndex:I.seriesIndex,seriesLabel:I.seriesLabel,groups:x.GroupDataMap.get(I.groupLabel),groupIndex:I.groupIndex,groupLabel:I.groupLabel,event:S,data:x.computedData})}).on("mousemove",(S,L)=>{S.stopPropagation();const E=L[0]?L[0].seriesLabel:"",{groupIndex:T,groupLabel:k}=x.gridGroupPositionFn(S),I=x.GroupDataMap.get(k).find(C=>C.seriesLabel===E)??L[0];r.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:x.highlightTarget,datum:I,series:x.SeriesDataMap.get(I.seriesLabel),seriesIndex:I.seriesIndex,seriesLabel:I.seriesLabel,groups:x.GroupDataMap.get(I.groupLabel),groupIndex:I.groupIndex,groupLabel:I.groupLabel,event:S,data:x.computedData})}).on("mouseout",(S,L)=>{S.stopPropagation();const E=L[0]?L[0].seriesLabel:"",{groupIndex:T,groupLabel:k}=x.gridGroupPositionFn(S),I=x.GroupDataMap.get(k).find(C=>C.seriesLabel===E)??L[0];r.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:x.highlightTarget,datum:I,series:x.SeriesDataMap.get(I.seriesLabel),seriesIndex:I.seriesIndex,seriesLabel:I.seriesLabel,groups:x.GroupDataMap.get(I.groupLabel),groupIndex:I.groupIndex,groupLabel:I.groupLabel,event:S,data:x.computedData})}).on("click",(S,L)=>{S.stopPropagation();const E=L[0]?L[0].seriesLabel:"",{groupIndex:T,groupLabel:k}=x.gridGroupPositionFn(S),I=x.GroupDataMap.get(k).find(C=>C.seriesLabel===E)??L[0];r.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:x.highlightTarget,datum:I,series:x.SeriesDataMap.get(I.seriesLabel),seriesIndex:I.seriesIndex,seriesLabel:I.seriesLabel,groups:x.GroupDataMap.get(I.groupLabel),groupIndex:I.groupIndex,groupLabel:I.groupLabel,event:S,data:x.computedData})})}),s.next(w)});const b=n.gridHighlight$.subscribe();return n.fullChartParams$.pipe(R(i),Bu(x=>x.highlightTarget==="series"),U(x=>q({graphicSelection:s,highlight:n.gridHighlight$,DataMap:d,fullChartParams:n.fullChartParams$}).pipe(R(i),U(async _=>_)))).subscribe(x=>{const _=x.DataMap.get(x.highlight[0]);YN({selection:x.graphicSelection,seriesLabel:_&&_.seriesLabel?_.seriesLabel:null,fullChartParams:x.fullChartParams})}),()=>{b.unsubscribe(),i.next(void 0)}}),vs="Bars",j2=ft(vs,"g"),Z2=ft(vs,"rect"),K2=.3;function WN({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 HN(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Hl().domain(e).range([-i/2+r,i/2-r])}function XN(t,e){return t<=1?0:e/(t-1)*K2}function VN(t,e){return t<=1?e:e*(1-K2)}function jN({selection:t,data:e,zeroY:n,groupLabels:r,barScale:i,params:o,chartParams:a,barWidth:u,transformedBarRadius:c,delayGroup:s,transitionItem:f}){const h=u/2;return t.selectAll(`g.${j2}`).data(e,(d,g)=>r[g]).join(d=>d.append("g").classed(j2,!0).attr("cursor","pointer"),d=>d,d=>d.remove()).attr("transform",(d,g)=>`translate(${d[0]?d[0].axisX:0}, 0)`).each((d,g,m)=>{j(m[g]).selectAll("rect").data(d,b=>b.id).join(b=>b.append("rect").classed(Z2,!0).attr("height",x=>0),b=>b,b=>b.remove()).attr("fill",b=>b.color).attr("y",b=>b.axisY<n?b.axisY:n).attr("x",b=>i(b.seriesLabel)).attr("width",u).attr("transform",`translate(${-h}, 0)`).attr("rx",c[0]).attr("ry",c[1]).transition().duration(f).ease(Jr(a.transitionEase)).delay((b,x)=>b.groupIndex*s).attr("height",b=>Math.abs(b.axisYFromZero))}).selectAll(`rect.${Z2}`)}function ZN({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 KN({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?j(o[i]).style("opacity",1):j(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const QN=Pe(vs,Ph)(({selection:t,name:e,subject:n,observer:r})=>{const i=new pt,o=ti(vs,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;r.gridAxesTransform$.pipe(R(i),O(y=>y.value),K()).subscribe(y=>{a.style("transform",y)}),r.gridGraphicTransform$.pipe(R(i),O(y=>y.value),K()).subscribe(y=>{c.transition().duration(50).style("transform",y)});const f=r.visibleComputedData$.pipe(O(y=>y[0]&&y[0][0]?y[0][0].axisY-y[0][0].axisYFromZero:0),K()),h=new nt(y=>{q({computedData:r.computedData$,visibleComputedData:r.visibleComputedData$,params:r.fullParams$,gridAxesSize:r.gridAxesSize$}).pipe(U(async A=>A)).subscribe(A=>{const M=A.params.barWidth?A.params.barWidth:WN({axisWidth:A.gridAxesSize.width,groupAmount:A.computedData[0]?A.computedData[0].length:0,barAmountOfGroup:A.visibleComputedData.length,barPadding:A.params.barPadding,barGroupPadding:A.params.barGroupPadding});y.next(M)})}).pipe(R(i),K()),l=q({gridGraphicTransform:r.gridGraphicTransform$,barWidth:h,params:r.fullParams$}).pipe(R(i),U(async y=>y),O(y=>{const A=y.barWidth/2,M=y.params.barRadius===!0?A:y.params.barRadius===!1?0:typeof y.params.barRadius=="number"?y.params.barRadius:0,$=M==0?0:M/y.gridGraphicTransform.scale[0],P=M==0?0:M/y.gridGraphicTransform.scale[1];return[$,P]})),p=r.visibleComputedData$.pipe(R(i),O(y=>{const A=new Set;return y.forEach(M=>{M.forEach($=>{A.add($.seriesLabel)})}),Array.from(A)})),d=r.visibleComputedData$.pipe(R(i),O(y=>{const A=new Set;return y.forEach(M=>{M.forEach($=>{A.add($.groupLabel)})}),Array.from(A)})),g=new nt(y=>{q({seriesLabels:p,barWidth:h,params:r.fullParams$}).pipe(R(i),U(async A=>A)).subscribe(A=>{const M=HN(A.barWidth,A.seriesLabels,A.params);y.next(M)})}),m=r.fullChartParams$.pipe(R(i),O(y=>y.transitionDuration),K()),b=new nt(y=>{q({groupLabels:d,transitionDuration:m}).pipe(U(async A=>A)).subscribe(A=>{const M=XN(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),x=new nt(y=>{q({groupLabels:d,transitionDuration:m}).pipe(U(async A=>A)).subscribe(A=>{const M=VN(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),_=r.visibleComputedData$.pipe(R(i),O(y=>{const A=y.length,M=y.reduce((P,S)=>Math.max(P,S.length),0),$=new Array(M).fill(null).map(()=>new Array(A).fill(null));for(let P=0;P<A;P++)for(let S=0;S<M;S++)$[S][P]=y[P][S];return $}));r.gridAxesSize$.pipe(R(i)).subscribe(y=>{const A=[{id:o,width:y.width,height:y.height}];ZN({defsSelection:u,clipPathData:A})});const v=r.fullChartParams$.pipe(R(i),O(y=>y.highlightTarget),K());q({computedData:r.computedData$,barData$:_,zeroY:f,groupLabels:d,barScale:g,params:r.fullParams$,chartParams:r.fullChartParams$,highlightTarget:v,barWidth:h,transformedBarRadius:l,delayGroup:b,transitionItem:x,SeriesDataMap:r.SeriesDataMap$,GroupDataMap:r.GroupDataMap$}).pipe(R(i),U(async y=>y)).subscribe(y=>{const A=jN({selection:c,data:y.barData$,zeroY:y.zeroY,groupLabels:y.groupLabels,barScale:y.barScale,params:y.params,chartParams:y.chartParams,barWidth:y.barWidth,transformedBarRadius:y.transformedBarRadius,delayGroup:y.delayGroup,transitionItem:y.transitionItem});A.on("mouseover",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("mousemove",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("mouseout",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("click",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}),s.next(A)});const w=r.gridHighlight$.subscribe();return q({barSelection:s,highlight:r.gridHighlight$,fullChartParams:r.fullChartParams$}).pipe(R(i),U(async y=>y)).subscribe(y=>{KN({selection:y.barSelection,ids:y.highlight,fullChartParams:y.fullChartParams})}),()=>{i.next(void 0),w.unsubscribe()}}),xs="BarStack",Q2=ft(xs,"g"),J2=ft(xs,"g-content"),tv=.3;function JN({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=t/(e-1)-n;return i>1?i:1}function tL(t,e){return t<=1?0:e/(t-1)*tv}function eL(t,e){return t<=1?e:e*(1-tv)}function nL({selection:t,data:e,zeroY:n,groupLabels:r,params:i,chartParams:o,barWidth:a,transformedBarRadius:u,delayGroup:c,transitionItem:s}){const f=a/2;return t.selectAll(`g.${Q2}`).data(e,(p,d)=>r[d]).join(p=>p.append("g").classed(Q2,!0).attr("cursor","pointer"),p=>p,p=>p.remove()).attr("transform",(p,d)=>`translate(${p[0]?p[0].axisX:0}, 0)`).each((p,d,g)=>{j(g[d]).selectAll("g").data(p,m=>m.id).join(m=>m.append("g").classed(J2,!0),m=>m,m=>m.remove()).each((m,b,x)=>{j(x[b]).selectAll("rect").data([m],_=>_.id).join(_=>_.append("rect").attr("y",v=>n).attr("height",v=>0),_=>_,_=>_.remove()).attr("rx",u[0]).attr("ry",u[1]).attr("fill",_=>_.color).attr("transform",`translate(${-f}, 0)`).attr("x",_=>0).attr("width",a).transition().duration(s).ease(Jr(o.transitionEase)).delay((_,v)=>_.groupIndex*c).attr("y",_=>_._barStartY).attr("height",_=>Math.abs(_._barHeight))})}).selectAll(`g.${J2}`)}function rL({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 iL({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 oL=Pe(xs,Dh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new pt,o=ti(xs,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;r.gridAxesTransform$.pipe(R(i),O(y=>y.value),K()).subscribe(y=>{a.style("transform",y)}),r.gridGraphicTransform$.pipe(R(i),U(async y=>y.value),K()).subscribe(y=>{c.transition().duration(50).style("transform",y)});const f=r.visibleComputedData$.pipe(O(y=>y[0]&&y[0][0]?y[0][0].axisY-y[0][0].axisYFromZero:0),K()),h=new nt(y=>{q({computedData:r.computedData$,params:r.fullParams$,axisSize:r.gridAxesSize$}).pipe(U(async A=>A)).subscribe(A=>{const M=A.params.barWidth?A.params.barWidth:JN({axisWidth:A.axisSize.width,groupAmount:A.computedData[0]?A.computedData[0].length:0,barGroupPadding:A.params.barGroupPadding});y.next(M)})}).pipe(R(i),K()),l=q({gridGraphicTransform:r.gridGraphicTransform$,barWidth:h,params:r.fullParams$}).pipe(R(i),U(async y=>y),O(y=>{const A=y.barWidth/2,M=y.params.barRadius===!0?A:y.params.barRadius===!1?0:typeof y.params.barRadius=="number"?y.params.barRadius:0,$=M==0?0:M/y.gridGraphicTransform.scale[0],P=M==0?0:M/y.gridGraphicTransform.scale[1];return[$,P]})),p=r.visibleComputedData$.pipe(R(i),O(y=>{const A=new Set;return y.forEach(M=>{M.forEach($=>{A.add($.groupLabel)})}),Array.from(A)})),d=r.fullChartParams$.pipe(R(i),O(y=>y.transitionDuration),K()),g=new nt(y=>{q({groupLabels:p,transitionDuration:d}).pipe(U(async A=>A)).subscribe(A=>{const M=tL(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),m=new nt(y=>{q({groupLabels:p,transitionDuration:d}).pipe(U(async A=>A)).subscribe(A=>{const M=eL(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),b=r.visibleComputedData$.pipe(R(i),O(y=>{console.log("visibleComputedData",y);const A=y.length,M=y.reduce((P,S)=>Math.max(P,S.length),0),$=new Array(M).fill(null).map(()=>new Array(A).fill(null));for(let P=0;P<A;P++)for(let S=0;S<M;S++)$[S][P]=y[P][S];return $})),x=q({transposedVisibleData:b,dataFormatter:r.fullDataFormatter$}).pipe(R(i),U(async y=>y),O(y=>{const M=y.transposedVisibleData.length-1,$=y.dataFormatter.groupAxis.scaleDomain[0]==="auto"?0-y.dataFormatter.groupAxis.scalePadding:y.dataFormatter.groupAxis.scaleDomain[0]-y.dataFormatter.groupAxis.scalePadding,P=y.dataFormatter.groupAxis.scaleDomain[1]==="auto"?M+y.dataFormatter.groupAxis.scalePadding:y.dataFormatter.groupAxis.scaleDomain[1]+y.dataFormatter.groupAxis.scalePadding,S=y.transposedVisibleData.map(L=>L.filter((E,T)=>E.groupIndex>=$&&E.groupIndex<=P));if(S.flat().length){const L=S.flat().map(D=>D.axisYFromZero),E=Math.max(...L),T=S.map(D=>D.reduce((N,I)=>N+I.axisYFromZero,0)),k=Math.max(...T);return E/k}else return 1})),_=q({transposedVisibleData:b,yRatio:x,zeroY:f}).pipe(R(i),O(y=>(console.log(y.transposedVisibleData),y.transposedVisibleData.map(A=>{let M=y.zeroY;return A.map($=>{const P=M,S=$.axisYFromZero*y.yRatio;return M=M+S,{...$,_barStartY:P,_barHeight:S}})}))));r.gridAxesSize$.pipe(R(i)).subscribe(y=>{const A=[{id:o,width:y.width,height:y.height}];rL({defsSelection:u,clipPathData:A})});const v=r.fullChartParams$.pipe(R(i),O(y=>y.highlightTarget),K());q({graphicData:_,zeroY:f,groupLabels:p,params:r.fullParams$,chartParams:r.fullChartParams$,highlightTarget:v,barWidth:h,transformedBarRadius:l,delayGroup:g,transitionItem:m,SeriesDataMap:r.SeriesDataMap$,GroupDataMap:r.GroupDataMap$}).pipe(R(i),U(async y=>y)).subscribe(y=>{const A=nL({selection:c,data: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});A.on("mouseover",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.graphicData})}).on("mousemove",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.graphicData})}).on("mouseout",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.graphicData})}).on("click",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.graphicData})}),s.next(A)});const w=r.gridHighlight$.subscribe();return q({barSelection:s,highlight:r.gridHighlight$,fullChartParams:r.fullChartParams$}).pipe(R(i),U(async y=>y)).subscribe(y=>{iL({selection:y.barSelection,ids:y.highlight,fullChartParams:y.fullChartParams})}),()=>{i.next(void 0),w.unsubscribe()}}),_s="BarsTriangle",ev=ft(_s,"g"),nv=ft(_s,"g-content"),rv=.3;function aL({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const o=(t/e-i)/n-r;return o>1?o:1}function uL(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Hl().domain(e).range([-i/2+r,i/2-r])}function sL(t,e){return t<=1?0:e/(t-1)*rv}function cL(t,e){return t<=1?e:e*(1-rv)}function lL({selection:t,barData:e,zeroY:n,groupLabels:r,barScale:i,params:o,chartParams:a,barWidth:u,delayGroup:c,transitionItem:s}){const f=t.selectAll(`g.${ev}`).data(e,(g,m)=>r[m]),h=f.enter().append("g").classed(ev,!0).attr("cursor","pointer");f.exit().remove();const l=f.merge(h);h.attr("transform",(g,m)=>`translate(${g[0]?g[0].axisX:0}, 0)`),f.attr("transform",(g,m)=>`translate(${g[0]?g[0].axisX:0}, 0)`);const p=u/2;return l.each((g,m,b)=>{const x=j(b[m]).selectAll("g").data(g,v=>v.id),_=x.enter().append("g").classed(nv,!0);_.append("path").style("vector-effect","non-scaling-stroke").attr("height",v=>0).attr("d",v=>{const w=i(v.seriesLabel),y=n,A=y;return`M${w-u/2},${y} L${w},${A} ${w+u/2},${y}`}),x.merge(_).select("path").style("fill",v=>`url(#${v.linearGradientId})`).attr("stroke",v=>v.color).attr("transform",`translate(${-p}, 0)`).transition().duration(s).ease(Jr(a.transitionEase)).delay((v,w)=>v.groupIndex*c).attr("transform",`translate(${-p}, 0)`).attr("height",v=>Math.abs(v.axisYFromZero)).attr("d",v=>{const w=i(v.seriesLabel),y=n,A=v.axisY;return`M${w},${y} L${w+u/2},${A} ${w+u},${y}`}),x.exit().remove()}),l.selectAll(`g.${nv}`)}function fL({defsSelection:t,barData:e,params:n}){const r=t.selectAll("linearGradient").data(e[0]??[],o=>o.seriesLabel),i=r.enter().append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad");r.merge(i).attr("id",(o,a)=>o.linearGradientId).html((o,a)=>`
10
10
  <stop offset="0%" stop-color="${o.color}" stop-opacity="${n.linearGradientOpacity[0]}"/>
11
11
  <stop offset="100%" stop-color="${o.color}" stop-opacity="${n.linearGradientOpacity[1]}"/>
12
- `),r.exit().remove()}function hL({defsSelection:t,clipPathData:e}){const n=t.selectAll("clipPath").data(e),r=n.enter().append("clipPath");n.merge(r).attr("id",i=>i.id),n.exit().remove(),n.merge(r).each((i,o,a)=>{const u=j(a[o]).selectAll("rect").data([i]),c=u.enter().append("rect");u.merge(c).attr("x",0).attr("y",0).attr("width",s=>s.width).attr("height",s=>s.height),u.exit().remove()})}function pL({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 dL=Pe(_s,kh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new pt,o=ti(_s,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;r.gridAxesTransform$.pipe(R(i),O(y=>y.value),K()).subscribe(y=>{a.style("transform",y)}),r.gridGraphicTransform$.pipe(R(i),U(async y=>y.value),K()).subscribe(y=>{c.transition().duration(50).style("transform",y)});const f=r.computedData$.pipe(O(y=>y[0]&&y[0][0]?y[0][0].axisY-y[0][0].axisYFromZero:0),K()),h=new nt(y=>{q({computedData:r.computedData$,params:r.fullParams$,axisSize:r.gridAxesSize$}).pipe(U(async A=>A)).subscribe(A=>{const M=aL({axisWidth:A.axisSize.width,groupAmount:A.computedData[0]?A.computedData[0].length:0,barAmountOfGroup:A.computedData.length,barPadding:A.params.barPadding,barGroupPadding:A.params.barGroupPadding});y.next(M)})}).pipe(R(i),K()),l=r.computedData$.pipe(R(i),O(y=>y.map((A,M)=>A[0]?A[0].seriesLabel:String(M)))),p=r.computedData$.pipe(R(i),O(y=>y[0]?y[0].map(A=>A.groupLabel):[])),d=new nt(y=>{q({seriesLabels:l,barWidth:h,params:r.fullParams$}).pipe(R(i),U(async A=>A)).subscribe(A=>{const M=uL(A.barWidth,A.seriesLabels,A.params);y.next(M)})}),g=r.fullChartParams$.pipe(R(i),O(y=>y.transitionDuration),K()),m=new nt(y=>{q({groupLabels:p,transitionDuration:g}).pipe(U(async A=>A)).subscribe(A=>{const M=sL(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),b=new nt(y=>{q({groupLabels:p,transitionDuration:g}).pipe(U(async A=>A)).subscribe(A=>{const M=cL(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),_=r.computedData$.pipe(R(i),O(y=>{const A=y.length,M=y.reduce((P,S)=>Math.max(P,S.length),0),$=new Array(M).fill(null).map(()=>new Array(A).fill(null));for(let P=0;P<A;P++)for(let S=0;S<M;S++)$[S][P]=y[P][S];return $})).pipe(R(i),O(y=>{const A=y.length?y[0].map(M=>ti(e,`lineargradient-${M.seriesLabel}`)):[];return y.map(M=>M.map(($,P)=>({linearGradientId:A[P],...$})))}));r.gridAxesSize$.pipe(R(i)).subscribe(y=>{const A=[{id:o,width:y.width,height:y.height}];hL({defsSelection:u,clipPathData:A})});const v=r.fullChartParams$.pipe(R(i),O(y=>y.highlightTarget),K());q({barData:_,computedData:r.computedData$,zeroY:f,groupLabels:p,barScale:d,params:r.fullParams$,chartParams:r.fullChartParams$,highlightTarget:v,barWidth:h,delayGroup:m,transitionItem:b,SeriesDataMap:r.SeriesDataMap$,GroupDataMap:r.GroupDataMap$}).pipe(R(i),U(async y=>y)).subscribe(y=>{const A=lL({selection:c,barData:y.barData,zeroY:y.zeroY,groupLabels:y.groupLabels,barScale:y.barScale,params:y.params,chartParams:y.chartParams,barWidth:y.barWidth,delayGroup:y.delayGroup,transitionItem:y.transitionItem});fL({defsSelection:u,barData:y.barData,params:y.params}),A.on("mouseover",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("mousemove",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("mouseout",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("click",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}),s.next(A)});const w=r.gridHighlight$.subscribe();return q({pathSelection:s,highlight:r.gridHighlight$,fullChartParams:r.fullChartParams$}).pipe(R(i),U(async y=>y)).subscribe(y=>{pL({selection:y.pathSelection,ids:y.highlight,fullChartParams:y.fullChartParams})}),()=>{i.next(void 0),w.unsubscribe()}}),ws="Dots",gL=ft(ws,"g"),mL=ft(ws,"circle");function yL({selection:t,data:e,fullParams:n,fullChartParams:r,graphicOppositeScale:i}){const o=c=>{const s=c.size();return r.transitionDuration/s};let a=0;return t.selectAll("g").data(e,c=>c.id).join(c=>(a=o(c),c.append("g").classed(gL,!0)),c=>c,c=>c.remove()).attr("transform",c=>`translate(${c.axisX}, ${c.axisY})`).each((c,s,f)=>{j(f[s]).selectAll("circle").data([c]).join(h=>h.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(mL,!0).attr("opacity",0).transition().delay((l,p)=>s*a).attr("opacity",1),h=>h.transition().duration(50).attr("opacity",1),h=>h.remove()).attr("r",n.radius).attr("fill",(h,l)=>gh({datum:h,colorType:n.fillColorType,fullChartParams:r})).attr("stroke",(h,l)=>gh({datum:h,colorType:n.strokeColorType,fullChartParams:r})).attr("stroke-width",n.strokeWidth).attr("transform",`scale(${i[0]}, ${i[1]})`)})}function bL({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 vL({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 xL=Pe(ws,Sh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new pt,o=ti(ws,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;r.gridAxesTransform$.pipe(R(i),O(d=>d.value),K()).subscribe(d=>{a.style("transform",d)}),r.gridGraphicTransform$.pipe(R(i),U(async d=>d.value),K()).subscribe(d=>{c.transition().duration(50).style("transform",d)});const f=r.gridGraphicTransform$.pipe(R(i),O(d=>[1/d.scale[0],1/d.scale[1]]));r.gridAxesSize$.pipe(R(i),U(async d=>d)).subscribe(d=>{const g=[{id:o,width:d.width,height:d.height}];vL({defsSelection:u,clipPathData:g})});const h=r.fullChartParams$.pipe(R(i),O(d=>d.highlightTarget),K());q({computedData:r.computedData$,visibleComputedData:r.visibleComputedData$,SeriesDataMap:r.SeriesDataMap$,GroupDataMap:r.GroupDataMap$,graphicOppositeScale:f,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$,highlightTarget:h}).pipe(R(i),U(async d=>d)).subscribe(d=>{const g=yL({selection:c,data:d.visibleComputedData.flat(),fullParams:d.fullParams,fullChartParams:d.fullChartParams,graphicOppositeScale:d.graphicOppositeScale});g.on("mouseover",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:d.highlightTarget,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m,data:d.computedData})}).on("mousemove",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:d.highlightTarget,data:d.computedData,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m})}).on("mouseout",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:d.highlightTarget,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m,data:d.computedData})}).on("click",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:d.highlightTarget,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m,data:d.computedData})}),s.next(g)});const l=r.gridHighlight$.subscribe(),p=r.fullParams$.pipe(R(i),O(d=>d.onlyShowHighlighted),K());return r.fullChartParams$.pipe(R(i),U(d=>q({graphicSelection:s,highlight:r.gridHighlight$,onlyShowHighlighted:p,fullChartParams:r.fullChartParams$}).pipe(R(i),U(async g=>g)))).subscribe(d=>{bL({selection:d.graphicSelection,ids:d.highlight,onlyShowHighlighted:d.onlyShowHighlighted,fullChartParams:d.fullChartParams})}),()=>{l.unsubscribe(),i.next(void 0)}}),iv=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o})=>{const a=ft(t,"root-position"),u=ft(t,"legend-card"),c=ft(t,"legend-list"),s=ft(t,"legend-item"),f=new pt,h=r.pipe(R(f),O(w=>w.position==="bottom"||w.position==="top"?"row":"column")),l=q({fullParams:r,layout:i}).pipe(R(f),U(async w=>w),O(w=>{const y=w.fullParams.padding*2+w.fullParams.gap*2;return w.fullParams.position==="bottom"||w.fullParams.position==="top"?w.layout.rootWidth-y:w.layout.rootHeight-y})),d=q({layout:i,fullParams:r}).pipe(R(f),U(async w=>w),O(w=>{let y=0,A=0;return w.fullParams.position==="bottom"?(A=w.layout.rootHeight,w.fullParams.justify==="start"?y=0:w.fullParams.justify==="center"?y=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(y=w.layout.rootWidth)):w.fullParams.position==="right"?(y=w.layout.rootWidth,w.fullParams.justify==="start"?A=0:w.fullParams.justify==="center"?A=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(A=w.layout.rootHeight)):w.fullParams.position==="top"?(A=0,w.fullParams.justify==="start"?y=0:w.fullParams.justify==="center"?y=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(y=w.layout.rootWidth)):w.fullParams.position==="left"&&(y=0,w.fullParams.justify==="start"?A=0:w.fullParams.justify==="center"?A=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(A=w.layout.rootHeight)),{x:y,y:A}})).pipe(R(f),O(w=>e.selectAll(`g.${a}`).data([w]).join(y=>y.append("g").classed(a,!0).attr("transform",A=>`translate(${A.x}, ${A.y})`),y=>y.transition().attr("transform",A=>`translate(${A.x}, ${A.y})`),y=>y.remove()))),g=q({fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:h,lineMaxSize:l}).pipe(R(f),U(async w=>w),O(w=>w.seriesLabels.reduce((y,A,M)=>{const $=H2(A,w.fullChartParams.styles.textSize),P=w.fullChartParams.styles.textSize*1.5+$,S=RN(M,w.fullChartParams),L=y[0]&&y[0][0]?y[y.length-1][y[y.length-1].length-1]:null,{translateX:E,translateY:T,lineIndex:k,itemIndex:D}=((N,I,C)=>{let z=0,Y=0,W=0,st=0;if(N.lineDirection==="column"){let rt=C?C.translateY+N.fullChartParams.styles.textSize+N.fullParams.gap:0;if(rt+N.fullChartParams.styles.textSize>N.lineMaxSize){W=C.lineIndex+1,st=0,Y=0;const at=I[I.length-1].reduce((_t,ct)=>ct.itemWidth>_t?ct.itemWidth:_t,0);z=C.translateX+at+N.fullParams.gap}else W=C?C.lineIndex:0,st=C?C.itemIndex+1:0,Y=rt,z=C?C.translateX:0}else{let rt=C?C.translateX+C.itemWidth+N.fullParams.gap:0;rt+P>N.lineMaxSize?(W=C.lineIndex+1,st=0,z=0):(W=C?C.lineIndex:0,st=C?C.itemIndex+1:0,z=rt),Y=(N.fullChartParams.styles.textSize+N.fullParams.gap)*W}return{translateX:z,translateY:Y,lineIndex:W,itemIndex:st}})(w,y,L);return y[k]||(y[k]=[]),y[k].push({id:A,seriesLabel:A,seriesIndex:M,lineIndex:k,itemIndex:D,text:A,itemWidth:P,translateX:E,translateY:T,color:S}),console.log("items",y),y},[]))),m=q({fullParams:r,fullChartParams:o,lineDirection:h,lengendItems:g}).pipe(R(f),U(async w=>w),O(w=>{const{width:y,height:A}=((M,$)=>{let P=0,S=0;if(!$.length||!$[0].length)return{width:P,height:S};const L=$[0][$[0].length-1];return M.lineDirection==="column"?(P=$.reduce((E,T)=>{const k=T.reduce((D,N)=>N.itemWidth>D?N.itemWidth:D,0);return E+k},0),P+=M.fullParams.gap*($.length-1),S=L.translateY+M.fullChartParams.styles.textSize):(P=L.translateX+L.itemWidth,S=M.fullChartParams.styles.textSize*$.length+M.fullParams.gap*($.length-1)),{width:P,height:S}})(w,w.lengendItems);return{direction:w.lineDirection,width:y,height:A,translateX:w.fullParams.gap,translateY:w.fullParams.gap}})),b=q({fullParams:r,lengendList:m}).pipe(R(f),U(async w=>w),O(w=>{const y=w.lengendList.width+w.fullParams.gap*2,A=w.lengendList.height+w.fullParams.gap*2;let M=0,$=0;return w.fullParams.position==="left"?w.fullParams.justify==="start"?(M=w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="center"?(M=w.fullParams.padding,$=-A/2):w.fullParams.justify==="end"&&(M=w.fullParams.padding,$=-A-w.fullParams.padding):w.fullParams.position==="right"?w.fullParams.justify==="start"?(M=-y-w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="center"?(M=-y-w.fullParams.padding,$=-A/2):w.fullParams.justify==="end"&&(M=-y-w.fullParams.padding,$=-A-w.fullParams.padding):w.fullParams.position==="top"?w.fullParams.justify==="start"?(M=w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="center"?(M=-y/2,$=w.fullParams.padding):w.fullParams.justify==="end"&&(M=-y-w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="start"?(M=w.fullParams.padding,$=-A-w.fullParams.padding):w.fullParams.justify==="center"?(M=-y/2,$=-A-w.fullParams.padding):w.fullParams.justify==="end"&&(M=-y-w.fullParams.padding,$=-A-w.fullParams.padding),{width:y,height:A,translateX:M,translateY:$}})),x=q({rootPositionSelection:d,fullParams:r,fullChartParams:o,legendCard:b}).pipe(R(f),U(async w=>w),O(w=>w.rootPositionSelection.selectAll("g").data([w.legendCard]).join(y=>y.append("g").classed(u,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.remove()).each((y,A,M)=>{j(M[A]).selectAll("rect").data([y]).join("rect").attr("width",$=>$.width).attr("height",$=>$.height).attr("fill",Pt(w.fullParams.backgroundFill,w.fullChartParams)).attr("stroke",Pt(w.fullParams.backgroundStroke,w.fullChartParams))}))),_=q({lengendCardSelection:x,fullParams:r,lengendList:m}).pipe(R(f),U(async w=>w),O(w=>w.lengendCardSelection.selectAll("g").data([w.lengendList]).join(y=>y.append("g").classed(c,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.remove())));return q({lengendListSelection:_,fullParams:r,fullChartParams:o,lengendItems:g}).pipe(R(f),U(async w=>w),O(w=>{const y=w.lengendItems[0]?w.lengendItems.flat():[];return w.lengendListSelection.selectAll(`g.${s}`).data(y).join(A=>A.append("g").classed(s,!0).attr("cursor","default"),A=>A,A=>A.remove()).attr("transform",(A,M)=>`translate(${A.translateX}, ${A.translateY})`).each((A,M,$)=>{const P=w.fullChartParams.styles.textSize/2,S=w.fullParams.listRectWidth,L=w.fullParams.listRectHeight;j($[M]).selectAll("rect").data([A]).join("rect").attr("x",P).attr("y",P).attr("width",S).attr("height",L).attr("transform",`translate(${-S/2}, ${-L/2})`).attr("fill",E=>E.color).attr("rx",w.fullParams.listRectRadius),j($[M]).selectAll("text").data([A]).join(E=>E.append("text").attr("dominant-baseline","hanging"),E=>E,E=>E.remove()).attr("x",w.fullChartParams.styles.textSize*1.5).attr("font-size",w.fullChartParams.styles.textSize).text(E=>E.text)})})).subscribe(),()=>{f.next(void 0)}},ov="GridLegend",_L=Pe(ov,Ch)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new pt,o=n.SeriesDataMap$.pipe(R(i),O(u=>Array.from(u.keys()))),a=iv(ov,{rootSelection:e,seriesLabels$:o,fullParams$:n.fullParams$,layout$:n.layout$,fullChartParams$:n.fullChartParams$});return()=>{i.next(void 0),a()}}),mh="GroupAxis",av=ft(mh,"xAxis"),uv=ft(mh,"groupingLabel"),yh=6;function wL({selection:t,params:e,tickTextAlign:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:u,contentTransform:c}){const s=t.selectAll(`g.${av}`).data([e]).join("g").classed(av,!0);t.selectAll(`g.${uv}`).data([e]).join("g").classed(uv,!0).each((l,p,d)=>{j(d[p]).selectAll("text").data([l]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).style("font-size",`${a.styles.textSize}px`).style("fill",Pt(e.labelColorType,a)).style("transform",c).text(g=>o.groupAxis.label)}).attr("transform",l=>`translate(${i.width+l.tickPadding+e.labelOffset[0]}, ${-l.tickPadding-yh-e.labelOffset[1]})`);const f=s0(u).scale(u).tickSize(e.tickFullLine==!0?-i.height:yh).tickSizeOuter(0).tickFormat(l=>ys(l,e.tickFormat)).tickPadding(e.tickPadding),h=s.transition().duration(100).call(f);return h.selectAll("line").style("fill","none").style("stroke",e.tickLineVisible==!0?Pt(e.tickColorType,a):"none").style("stroke-dasharray",e.tickFullLineDasharray).attr("pointer-events","none"),h.selectAll("path").style("fill","none").style("stroke",e.axisLineVisible==!0?Pt(e.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),s.selectAll("text").style("font-family","sans-serif").style("font-size",`${a.styles.textSize}px`).style("color",Pt(e.tickTextColorType,a)).attr("text-anchor",n.textAnchor).attr("dominant-baseline",n.dominantBaseline).attr("transform-origin",`0 -${e.tickPadding+yh}`).style("transform",c),s}const AL=Pe(mh,Eh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");n.gridAxesTransform$.pipe(R(i),O(f=>f.value),K()).subscribe(f=>{o.style("transform",f).attr("opacity",0).transition().attr("opacity",1)});const a=q({fullParams:n.fullParams$,gridAxesOppositeTransform:n.gridAxesOppositeTransform$}).pipe(R(i),U(async f=>{const h=f.gridAxesOppositeTransform.rotate+f.fullParams.tickTextRotate;return`translate(${f.gridAxesOppositeTransform.translate[0]}px, ${f.gridAxesOppositeTransform.translate[1]}px) rotate(${h}deg) rotateX(${f.gridAxesOppositeTransform.rotateX}deg) rotateY(${f.gridAxesOppositeTransform.rotateY}deg)`}),K()),u=new nt(f=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,computedData:n.computedData$}).pipe(R(i),U(async h=>h)).subscribe(h=>{const p=h.computedData[0]?h.computedData[0].length-1:0,d=h.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-h.fullDataFormatter.groupAxis.scalePadding:h.fullDataFormatter.groupAxis.scaleDomain[0]-h.fullDataFormatter.groupAxis.scalePadding,g=h.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?p+h.fullDataFormatter.groupAxis.scalePadding:h.fullDataFormatter.groupAxis.scaleDomain[1]+h.fullDataFormatter.groupAxis.scalePadding,m=h.computedData[0]?h.computedData[0].length:0;let b=h.fullDataFormatter.grid.seriesType==="row"?(h.computedData[0]??[]).map(w=>w.groupLabel):h.computedData.map(w=>w[0].groupLabel);const x=new Array(m).fill(0).map((w,y)=>b[y]!=null?b[y]:String(y)).filter((w,y)=>y>=d&&y<=g),_=h.fullDataFormatter.groupAxis.scalePadding,v=B2({axisLabels:x,axisWidth:h.gridAxesSize.width,padding:_});f.next(v)})}),c=n.fullDataFormatter$.pipe(R(i),O(f=>{let h="middle",l="hanging";return f.groupAxis.position==="bottom"?(h="middle",l="hanging"):f.groupAxis.position==="top"?(h="middle",l="auto"):f.groupAxis.position==="left"?(h="end",l="middle"):f.groupAxis.position==="right"&&(h="start",l="middle"),{textAnchor:h,dominantBaseline:l}})),s=n.fullDataFormatter$.pipe(R(i),O(f=>{let h="start",l="hanging";return f.groupAxis.position==="bottom"?l="hanging":f.groupAxis.position==="top"?l="auto":f.groupAxis.position==="left"?h="end":f.groupAxis.position==="right"&&(h="start"),f.valueAxis.position==="left"?h="start":f.valueAxis.position==="right"?h="end":f.valueAxis.position==="bottom"?l="auto":f.valueAxis.position==="top"&&(l="hanging"),{textAnchor:h,dominantBaseline:l}}));return q({params:n.fullParams$,tickTextAlign:c,axisLabelAlign:s,gridAxesSize:n.gridAxesSize$,fullDataFormatter:n.fullDataFormatter$,chartParams:n.fullChartParams$,groupScale:u,contentTransform:a}).pipe(R(i),U(async f=>f)).subscribe(f=>{wL({selection:o,params:f.params,tickTextAlign:f.tickTextAlign,axisLabelAlign:f.axisLabelAlign,gridAxesSize:f.gridAxesSize,fullDataFormatter:f.fullDataFormatter,chartParams:f.chartParams,groupScale:f.groupScale,contentTransform:f.contentTransform})}),()=>{i.next(void 0)}}),bh="ValueAxis",sv=ft(bh,"g"),cv=ft(bh,"text"),lv=6;function $L({selection:t,fullParams:e,tickTextAlign:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:u,contentTransform:c,minAndMax:s}){const f=t.selectAll(`g.${sv}`).data([e]).join("g").classed(sv,!0);t.selectAll(`g.${cv}`).data([e]).join("g").classed(cv,!0).each((g,m,b)=>{j(b[m]).selectAll("text").data([g]).join(x=>x.append("text").style("font-weight","bold"),x=>x,x=>x.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).style("font-size",`${a.styles.textSize}px`).style("fill",Pt(e.labelColorType,a)).style("transform",c).text(x=>o.valueAxis.label)}).attr("transform",g=>`translate(${-g.tickPadding+e.labelOffset[0]}, ${i.height+g.tickPadding+e.labelOffset[1]})`);const h=s[1]-s[0],l=Is(u).scale(u).ticks(h>e.ticks?e.ticks:s[0]===0&&s[1]===0?1:Math.ceil(h)).tickFormat(g=>ys(g,e.tickFormat)).tickSize(e.tickFullLine==!0?-i.width:lv).tickPadding(e.tickPadding),p=f.transition().duration(100).call(l);return p.selectAll("line").style("fill","none").style("stroke",e.tickLineVisible==!0?Pt(e.tickColorType,a):"none").style("stroke-dasharray",e.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",e.axisLineVisible==!0?Pt(e.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").style("font-family","sans-serif").style("font-size",`${a.styles.textSize}px`).style("color",Pt(e.tickTextColorType,a)).attr("text-anchor",n.textAnchor).attr("dominant-baseline",n.dominantBaseline).attr("transform-origin",`-${e.tickPadding+lv} 0`).style("transform",c),f}const ML=Pe(bh,As)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");n.gridAxesTransform$.pipe(R(i),O(h=>h.value),K()).subscribe(h=>{o.style("transform",h).attr("opacity",0).transition().attr("opacity",1)});const a=q({fullParams:n.fullParams$,gridAxesOppositeTransform:n.gridAxesOppositeTransform$}).pipe(R(i),U(async h=>{const l=h.gridAxesOppositeTransform.rotate+h.fullParams.tickTextRotate;return`translate(${h.gridAxesOppositeTransform.translate[0]}px, ${h.gridAxesOppositeTransform.translate[1]}px) rotate(${l}deg) rotateX(${h.gridAxesOppositeTransform.rotateX}deg) rotateY(${h.gridAxesOppositeTransform.rotateY}deg)`}),K()),u=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,computedData:n.computedData$}).pipe(R(i),U(async l=>l)).subscribe(l=>{const d=l.computedData[0]?l.computedData[0].length-1:0,g=l.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[0]-l.fullDataFormatter.groupAxis.scalePadding,m=l.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?d+l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[1]+l.fullDataFormatter.groupAxis.scalePadding,b=l.computedData.map((_,v)=>_.filter((w,y)=>y>=g&&y<=m)),x=IN(b.flat());h.next(x)})}),c=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,minAndMax:u}).pipe(R(i),U(async l=>l)).subscribe(l=>{const p=ph({maxValue:l.minAndMax[1],minValue:l.minAndMax[0],axisWidth:l.gridAxesSize.height,scaleDomain:l.fullDataFormatter.valueAxis.scaleDomain,scaleRange:l.fullDataFormatter.valueAxis.scaleRange});h.next(p)})}),s=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.valueAxis.position==="left"?(l="end",p="middle"):h.valueAxis.position==="right"?(l="start",p="middle"):h.valueAxis.position==="bottom"?(l="middle",p="hanging"):h.valueAxis.position==="top"&&(l="middle",p="auto"),{textAnchor:l,dominantBaseline:p}})),f=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.groupAxis.position==="bottom"?p="auto":h.groupAxis.position==="top"?p="hanging":h.groupAxis.position==="left"?l="start":h.groupAxis.position==="right"&&(l="end"),h.valueAxis.position==="left"?l="end":h.valueAxis.position==="right"?l="start":h.valueAxis.position==="bottom"?p="hanging":h.valueAxis.position==="top"&&(p="auto"),{textAnchor:l,dominantBaseline:p}}));return q({fullParams:n.fullParams$,tickTextAlign:s,axisLabelAlign:f,computedData:n.computedData$,gridAxesSize:n.gridAxesSize$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,valueScale:c,contentTransform:a,minAndMax:u}).pipe(R(i),U(async h=>h)).subscribe(h=>{$L({selection:o,fullParams:h.fullParams,tickTextAlign:h.tickTextAlign,axisLabelAlign:h.axisLabelAlign,gridAxesSize:h.gridAxesSize,fullDataFormatter:h.fullDataFormatter,fullChartParams:h.fullChartParams,valueScale:h.valueScale,contentTransform:h.contentTransform,minAndMax:h.minAndMax})}),()=>{i.next(void 0)}}),vh="ValueStackAxis",fv=ft(vh,"g"),hv=ft(vh,"text"),pv=6;function SL({selection:t,fullParams:e,tickTextAlign:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:u,contentTransform:c,minAndMax:s}){const f=t.selectAll(`g.${fv}`).data([e]).join("g").classed(fv,!0);t.selectAll(`g.${hv}`).data([e]).join("g").classed(hv,!0).each((g,m,b)=>{j(b[m]).selectAll("text").data([g]).join(x=>x.append("text").style("font-weight","bold"),x=>x,x=>x.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).style("font-size",`${a.styles.textSize}px`).style("fill",Pt(e.labelColorType,a)).style("transform",c).text(x=>o.valueAxis.label)}).attr("transform",g=>`translate(${-g.tickPadding+e.labelOffset[0]}, ${i.height+g.tickPadding+e.labelOffset[1]})`);const h=s[1]-s[0],l=Is(u).scale(u).ticks(h>e.ticks?e.ticks:s[0]===0&&s[1]===0?1:Math.ceil(h)).tickFormat(g=>ys(g,e.tickFormat)).tickSize(e.tickFullLine==!0?-i.width:pv).tickPadding(e.tickPadding),p=f.transition().duration(100).call(l);return p.selectAll("line").style("fill","none").style("stroke",e.tickLineVisible==!0?Pt(e.tickColorType,a):"none").style("stroke-dasharray",e.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",e.axisLineVisible==!0?Pt(e.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").style("font-family","sans-serif").style("font-size",`${a.styles.textSize}px`).style("color",Pt(e.tickTextColorType,a)).attr("text-anchor",n.textAnchor).attr("dominant-baseline",n.dominantBaseline).attr("transform-origin",`-${e.tickPadding+pv} 0`).style("transform",c),f}const TL=Pe(vh,Nh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");n.gridAxesTransform$.pipe(R(i),O(h=>h.value),K()).subscribe(h=>{o.style("transform",h).attr("opacity",0).transition().attr("opacity",1)});const a=q({fullParams:n.fullParams$,gridAxesOppositeTransform:n.gridAxesOppositeTransform$}).pipe(R(i),U(async h=>{const l=h.gridAxesOppositeTransform.rotate+h.fullParams.tickTextRotate;return`translate(${h.gridAxesOppositeTransform.translate[0]}px, ${h.gridAxesOppositeTransform.translate[1]}px) rotate(${l}deg) rotateX(${h.gridAxesOppositeTransform.rotateX}deg) rotateY(${h.gridAxesOppositeTransform.rotateY}deg)`}),K()),u=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,computedData:n.computedData$}).pipe(R(i),U(async l=>l)).subscribe(l=>{const d=l.computedData[0]?l.computedData[0].length-1:0,g=l.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[0]-l.fullDataFormatter.groupAxis.scalePadding,m=l.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?d+l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[1]+l.fullDataFormatter.groupAxis.scalePadding,b=l.computedData.map((v,w)=>v.filter((y,A)=>A>=g&&A<=m)),x=new Array(b[0]?b[0].length:0).fill(null).map((v,w)=>b.reduce((y,A)=>{if(A&&A[w]){const M=A[w].value==null||A[w].visible==!1?0:A[w].value;return y+M}return y},0)),_=X2(x);h.next(_)})}),c=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,minAndMax:u}).pipe(R(i),U(async l=>l)).subscribe(l=>{const p=ph({maxValue:l.minAndMax[1],minValue:l.minAndMax[0],axisWidth:l.gridAxesSize.height,scaleDomain:l.fullDataFormatter.valueAxis.scaleDomain,scaleRange:l.fullDataFormatter.valueAxis.scaleRange});h.next(p)})}),s=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.valueAxis.position==="left"?(l="end",p="middle"):h.valueAxis.position==="right"?(l="start",p="middle"):h.valueAxis.position==="bottom"?(l="middle",p="hanging"):h.valueAxis.position==="top"&&(l="middle",p="auto"),{textAnchor:l,dominantBaseline:p}})),f=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.groupAxis.position==="bottom"?p="auto":h.groupAxis.position==="top"?p="hanging":h.groupAxis.position==="left"?l="start":h.groupAxis.position==="right"&&(l="end"),h.valueAxis.position==="left"?l="end":h.valueAxis.position==="right"?l="start":h.valueAxis.position==="bottom"?p="hanging":h.valueAxis.position==="top"&&(p="auto"),{textAnchor:l,dominantBaseline:p}}));return q({fullParams:n.fullParams$,tickTextAlign:s,axisLabelAlign:f,computedData:n.computedData$,gridAxesSize:n.gridAxesSize$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,valueScale:c,contentTransform:a,minAndMax:u}).pipe(R(i),U(async h=>h)).subscribe(h=>{SL({selection:o,fullParams:h.fullParams,tickTextAlign:h.tickTextAlign,axisLabelAlign:h.axisLabelAlign,gridAxesSize:h.gridAxesSize,fullDataFormatter:h.fullDataFormatter,fullChartParams:h.fullChartParams,valueScale:h.valueScale,contentTransform:h.contentTransform,minAndMax:h.minAndMax})}),()=>{i.next(void 0)}}),dv="ScalingArea",PL=ft(dv,"rect"),DL=Pe(dv,Lh)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new pt,a=e.insert("rect","g").classed(PL,!0).attr("opacity",0);let u={k:1,x:0,y:0};r.layout$.pipe(R(o)).subscribe(s=>{a.attr("width",s.width).attr("height",s.height).attr("x",s.left).attr("y",s.top)});const c=r.computedData$.pipe(O(s=>s[0]?s[0].length-1:0),K());return q({initGroupAxis:r.fullDataFormatter$.pipe(O(s=>s.groupAxis),so()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:c,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(R(o),U(async s=>s)).subscribe(s=>{const h=s.groupMaxIndex,l=s.initGroupAxis.scaleDomain[0]==="auto"?0-s.initGroupAxis.scalePadding:s.initGroupAxis.scaleDomain[0]-s.initGroupAxis.scalePadding,p=s.initGroupAxis.scaleDomain[1]==="auto"?h+s.initGroupAxis.scalePadding:s.initGroupAxis.scaleDomain[1]+s.initGroupAxis.scalePadding,d=s.fullDataFormatter.valueAxis.position==="left"||s.fullDataFormatter.valueAxis.position==="top"?[0,1]:[1,0],m=ph({maxValue:s.groupMaxIndex,minValue:0,axisWidth:s.axisSize.width,scaleDomain:[l,p],scaleRange:d}).copy(),b=Ny().on("zoom",function(_){const v=_.transform,w=A=>{const M=Math.round(A);return Math.min(h,Math.max(0,M))},y=s.fullDataFormatter.groupAxis.position==="bottom"||s.fullDataFormatter.groupAxis.position==="top"?v.rescaleX(m).domain().map(w):v.rescaleY(m).domain().map(w);y[0]<=0&&y[1]>=h?v.k<u.k&&(v.k=u.k,v.x=u.x,v.y=u.y):y[1]-y[0]<=1&&v.k>u.k&&(v.k=u.k,v.x=u.x,v.y=u.y),u.k=v.k,u.x=v.x,u.y=v.y,i.dataFormatter$.next({...s.fullDataFormatter,groupAxis:{...s.fullDataFormatter.groupAxis,scaleDomain:y}})});e.call(b)}),()=>{o.next(void 0),a.remove()}});function kL(t,e){let n=new nt(()=>{});return t.each(function(){const r=Ff(this,e);n=zf(n,r)}),n}const xh="GroupArea",_h=ft(xh,"label-box");function EL({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function NL({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=ft(e,"auxline"),a=t.selectAll(`line.${o}`).data(n),u=a.enter().append("line").classed(o,!0).style("stroke",s=>Pt(r.lineColorType,i)).style("stroke-width",1).style("stroke-dasharray",r.lineDashArray??"none").style("pointer-events","none"),c=a.merge(u);return a.exit().remove(),u.attr("x1",s=>s.x1).attr("y1",s=>s.y1).attr("x2",s=>s.x2).attr("y2",s=>s.y2),a.transition().duration(50).attr("x1",s=>s.x1).attr("y1",s=>s.y1).attr("x2",s=>s.x2).attr("y2",s=>s.y2),c}function LL(t){t.selectAll("line").data([]).exit().remove()}function CL({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:ys(t,n.labelTextFormat)}]:[]}function IL({selection:t,labelData:e,fullParams:n,fullChartParams:r,gridAxesOppositeTransformValue:i}){const o=r.styles.textSize+4,a=t.selectAll(`g.${_h}`).data(e),u=a.enter().append("g").classed(_h,!0).style("cursor","pointer"),c=u.merge(a);return u.attr("transform",(s,f)=>`translate(${s.x}, ${s.y})`),a.transition().duration(50).attr("transform",(s,f)=>`translate(${s.x}, ${s.y})`),a.exit().remove(),c.each((s,f,h)=>{const l=H2(s.text,r.styles.textSize)+12,p=-l/2,d=j(h[f]).selectAll("rect").data([s]),g=d.enter().append("rect").attr("height",`${o}px`).attr("fill",x=>Pt(n.labelColorType,r)).attr("x",p).attr("y",-2).attr("rx",5).attr("ry",5).style("cursor","pointer");d.merge(g).attr("width",x=>`${l}px`).style("transform",i),d.exit().remove();const m=j(h[f]).selectAll("text").data([s]),b=m.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");m.merge(b).text(x=>x.text).style("transform",i).attr("fill",x=>Pt(n.labelTextColorType,r)).attr("font-size",r.styles.textSize).attr("x",p+6),m.exit().remove()}),c}function RL(t){t.selectAll(`g.${_h}`).data([]).exit().remove()}const FL=Pe(xh,Th)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new pt,a=e.insert("rect","g").classed(ft(xh,"rect"),!0).attr("opacity",0),u=t.append("g");i.layout$.pipe(R(o)).subscribe(l=>{a.attr("width",l.rootWidth).attr("height",l.rootHeight)}),i.gridAxesTransform$.pipe(R(o),O(l=>l.value),K()).subscribe(l=>{u.style("transform",l)});const c=new nt(l=>{q({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(R(o),U(async p=>p)).subscribe(p=>{const g=p.computedData[0]?p.computedData[0].length-1:0,m=p.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-p.fullDataFormatter.groupAxis.scalePadding:p.fullDataFormatter.groupAxis.scaleDomain[0]-p.fullDataFormatter.groupAxis.scalePadding,b=p.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?g+p.fullDataFormatter.groupAxis.scalePadding:p.fullDataFormatter.groupAxis.scaleDomain[1]+p.fullDataFormatter.groupAxis.scalePadding,x=p.computedData[0]?p.computedData[0].length:0;let _=p.fullDataFormatter.grid.seriesType==="row"?(p.computedData[0]??[]).map(A=>A.groupLabel):p.computedData.map(A=>A[0].groupLabel);const v=new Array(x).fill(0).map((A,M)=>_[M]!=null?_[M]:String(M)).filter((A,M)=>M>=m&&M<=b),w=p.fullDataFormatter.groupAxis.scalePadding,y=B2({axisLabels:v,axisWidth:p.gridAxesSize.width,padding:w});l.next(y)})}),s=V2({fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$}),f=i.fullChartParams$.pipe(R(o),O(l=>l.highlightTarget),K());return q({computedData:i.computedData$,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullChartParams:i.fullChartParams$,highlightTarget:f,SeriesDataMap:i.SeriesDataMap$,GroupDataMap:i.GroupDataMap$,gridGroupPositionFn:s,groupScale:c}).pipe(R(o),U(async l=>l)).subscribe(l=>{e.on("mouseover",(p,d)=>{const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})}).on("mousemove",(p,d)=>{const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})}).on("mouseout",(p,d)=>{const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})}).on("click",(p,d)=>{p.stopPropagation();const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})})}),q({event:r.event$.pipe(Bu(l=>l.eventName==="mouseover"||l.eventName==="mousemove")),computedData:i.computedData$,groupScale:c,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullChartParams:i.fullChartParams$,highlightTarget:f,gridAxesOppositeTransform:i.gridAxesOppositeTransform$,GroupDataMap:i.GroupDataMap$,gridGroupPositionFn:s}).pipe(R(o),U(async l=>l)).subscribe(l=>{const p=l.groupScale(l.event.groupLabel)??0,d=EL({groupLabel:l.event.groupLabel,axisX:p,axisHeight:l.gridAxesSize.height,fullParams:l.fullParams});NL({selection:u,pluginName:n,lineData:d,fullParams:l.fullParams,fullChartParams:l.fullChartParams});const g=CL({groupLabel:l.event.groupLabel,axisX:p,fullParams:l.fullParams});IL({selection:u,labelData:g,fullParams:l.fullParams,fullChartParams:l.fullChartParams,gridAxesOppositeTransformValue:l.gridAxesOppositeTransform.value}).on("mouseover",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})}).on("mousemove",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})}).on("mouseout",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})}).on("click",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})})}),kL(a,"mouseout").pipe(R(o)).subscribe(l=>{console.log("rootMouseout"),LL(u),RL(u)}),()=>{o.next(void 0),a.remove()}}),gv={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},mv={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.map(r=>r.value).join(",");return[e,n]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.groups.map(r=>r.value).join(",");return[e,n]}return[]},svgRenderFn:null},zL=q2("Container",gv)(({selection:t})=>function(){}),wh="Tooltip",yv=ft(wh,"g"),OL=ft(wh,"box");function GL(t,e){const n=e.textSize*1.5;return t.filter(r=>r!="").map((r,i)=>{const o=i*n;return`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="${o}" style="dominant-baseline:text-before-edge">${r}</text>`}).join()}function UL({rootSelection:t,pluginName:e,rootWidth:n,rootHeight:r,svgString:i,tooltipStyle:o,event:a}){t.interrupt("fadeout");const u=5,c=i?[i]:[],s=i?[o]:[],h=t.selectAll(`g.${yv}`).data(c).join(v=>v.append("g").classed(yv,!0).attr("pointer-events","none"),v=>v,v=>v.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${OL}`).data(s).join(v=>v.append("g").classed(ft(e,"box"),!0)),l=h.selectAll("rect").data(s).join(v=>v.append("rect").attr("rx",u).attr("ry",u)).attr("fill",v=>v.backgroundColor).attr("stroke",v=>v.strokeColor).attr("opacity",v=>v.backgroundOpacity),p=h.selectAll("g").data(c).join(v=>v.append("g").classed(ft(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));c.length&&CN(p,c[0]);const d=p!=null&&p.node()?W2(p):{width:0,height:0};l.attr("width",d.width+o.padding*2).attr("height",d.height+o.padding*2);const g=h!=null&&h.node()?W2(h):{width:0,height:0},m=n-g.width,b=r-g.height,x=a.offsetX+o.offset[0]>m?m-a.offsetX:o.offset[0],_=a.offsetY+o.offset[1]>b?b-a.offsetY:o.offset[1];h.attr("transform",v=>`translate(${x}, ${_})`),h.attr("transform",v=>`translate(${x}, ${_})`)}const YL=q2(wh,mv)(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new pt,u=o.event$.pipe(R(a),Bu(d=>d.eventName==="mouseover"||d.eventName==="mousemove")),c=o.event$.pipe(R(a),Bu(d=>d.eventName==="mouseout")),s=q({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$}).pipe(R(a),U(async d=>d),O(d=>({backgroundColor:Pt(d.fullParams.backgroundColorType,d.fullChartParams),backgroundOpacity:d.fullParams.backgroundOpacity,strokeColor:Pt(d.fullParams.strokeColorType,d.fullChartParams),offset:d.fullParams.offset,padding:d.fullParams.padding,textSize:d.fullChartParams.styles.textSize,textColor:Pt(d.fullParams.textColorType,d.fullChartParams)}))),f=q({fullParams:i.fullParams$,tooltipStyle:s}).pipe(R(a),U(async d=>d),O(d=>d.fullParams.svgRenderFn?d.fullParams.svgRenderFn:g=>{const m=d.fullParams.textRenderFn(g);return GL(m,d.tooltipStyle)})),h=q({event:u,contentRenderFn:f}).pipe(R(a),U(async d=>d),O(d=>d.contentRenderFn(d.event))),l=c.pipe(R(a),O(d=>"")),p=zf(u,c).pipe(R(a),O(d=>d.event));return q({svgString:zf(h,l),event:p,layout:i.layout$,tooltipStyle:s}).pipe(R(a),U(async d=>d)).subscribe(d=>{UL({rootSelection:e,pluginName:n,rootWidth:d.layout.rootWidth,rootHeight:d.layout.rootHeight,svgString:d.svgString,tooltipStyle:d.tooltipStyle,event:d.event})}),function(){a.next(void 0)}}),bv={force:{strength:.03,velocityDecay:.2,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},highlightRIncrease:0,scaleType:"area"},vv={outerRadius:.95,innerRadius:0,outerMouseoverRadius:1,enterDuration:800,startAngle:0,endAngle:Math.PI*2,padAngle:.02,cornerRadius:0},xv={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+(i.value??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"}]},_v={outerRadius:.95,outerMouseoverRadius:1,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.3,labelColorType:"series",labelFn:t=>String(t.value)},wv={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0};function BL(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 u(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function c(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 s(p){const d=c(p.trim());return Math.sqrt(d*r)}function f(p,d){let g={width:0,text:""},m=1/0;const b=[];let x=" ";i&&(x="");for(let _=0,v=p.length;_<v;++_){const w=(g.text?g.text+x:"")+p[_],y=c(w);(m+y)/2<d?(g.width=m=y,g.text=w):(m=c(p[_]),g={width:m,text:p[_]},b.push(g))}return b}function h(p){let d=0;for(let g=0,m=p.length;g<m;++g){const b=(Math.abs(g-m/2+.5)+.5)*r,x=p[g].width/2;d=Math.max(d,Math.sqrt(x**2+b**2))}return d}function l(p,d){o>0&&(d=u(d,o));const g=a(d),m=s(d),b=f(g,m),x=h(b);let _=p.select("text");_.size()||(_=p.append("text")),_.attr("transform",`translate(0,0) scale(${n/x})`);const v=_.selectAll("tspan").data(b),w=v.enter().append("tspan").attr("x",0).merge(v).attr("y",(y,A)=>(A-b.length/2+.8)*r).text(y=>y.text);return v.exit().remove(),v.merge(w)}return l(t,e)}let nr;function qL(t,e){return ad().velocityDecay(e.force.velocityDecay).force("collision",rd().radius(n=>n.r+e.force.collisionSpacing)).force("charge",ud().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function WL({data:t,bubbleGroupR:e,maxValue:n,avgValue:r}){const i=e/Math.sqrt(t.length),a=i*i*Math.PI/r,u=n*a;return Math.pow(u/Math.PI,.5)*.75}function HL({data:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,scaleType:i}){const o=Math.min(n,r)/2,a=t.flat().filter(p=>p.value!=null&&p.visible!=!1),u=Math.max(...a.map(p=>p.value)),c=a.reduce((p,d)=>p+(d.value??0),0)/a.length,s=WL({data:a,bubbleGroupR:o,maxValue:u,avgValue:c}),f=i==="area"?.5:1,h=hu().domain([0,u]).range([0,s]).exponent(f);return a.map(p=>{const d=p,g=e.get(p.id);g?(d.x=g.x,d.y=g.y):(d.x=Math.random()*n,d.y=Math.random()*r);const m=h(d.value??0);return d.r=m,d._originR=m,d})}function Av({graphicSelection:t,bubblesData:e,fullParams:n}){let r=t.selectAll("g").data(e,a=>a.id),i=r.enter().append("g").attr("cursor","pointer");i.style("font-size",12).style("fill","#ffffff").attr("text-anchor","middle").attr("transform",a=>`translate(${a.x},${a.y})`),i.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",a=>a.color),i.append("text").style("opacity",.8).attr("pointer-events","none"),r.exit().remove();const o=r.merge(i);return o.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),o.each((a,u,c)=>{const s=j(c[u]);let f=!0;a.label.length<=n.bubbleText.lineLengthMin&&(f=!1),s.call(BL,{text:a.label,radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:f})}),o}function XL({data:t,highlightRIncrease:e,highlightIds:n}){if(e!=0){if(!n.length){t.forEach(r=>r.r=r._originR);return}t.forEach(r=>{n.includes(r.id)?r.r=r._originR+e:r.r=r._originR})}}function VL(){return x0().on("start",(t,e)=>{t.active||nr.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||nr.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function $v({fullParams:t,graphicWidth:e,graphicHeight:n}){nr.force("x",sd().strength(t.force.strength).x(0)).force("y",cd().strength(t.force.strength).y(0)),nr.alpha(1).restart()}function jL({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(fa).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const ZL=Mo("Bubbles",bv)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g"),a=new pt;let u=new Map;n.layout$.pipe(so()).subscribe(h=>{t.attr("transform",`translate(${h.width/2}, ${h.height/2})`),n.layout$.pipe(R(i)).subscribe(l=>{t.transition().attr("transform",`translate(${l.width/2}, ${l.height/2})`)})});const c=n.fullParams$.pipe(R(i),O(h=>h.scaleType),K()),s=new nt(h=>{q({layout:n.layout$,computedData:n.computedData$,scaleType:c}).pipe(R(i),U(async l=>l)).subscribe(l=>{const p=HL({data:l.computedData,LastBubbleDataMap:u,graphicWidth:l.layout.width,graphicHeight:l.layout.height,scaleType:l.scaleType});h.next(p)})});s.subscribe(h=>{u=new Map(h.map(l=>[l.id,l]))});const f=n.fullChartParams$.pipe(R(i),O(h=>h.highlightTarget),K());return q({layout:n.layout$,computedData:n.computedData$,bubblesData:s,SeriesDataMap:n.SeriesDataMap$,fullParams:n.fullParams$,highlightTarget:f}).pipe(R(i),U(async h=>h)).subscribe(h=>{const l=Av({graphicSelection:o,bubblesData:h.bubblesData,fullParams:h.fullParams});nr=qL(l,h.fullParams),l.on("mouseover",(p,d)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).call(VL()),nr.nodes(h.bubblesData),$v({fullParams:h.fullParams,graphicWidth:h.layout.width,graphicHeight:h.layout.height}),a.next(l)}),q({bubblesSelection:a,bubblesData:s,highlight:n.seriesHighlight$,fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,layout:n.layout$}).pipe(R(i),U(async h=>h)).subscribe(h=>{jL({bubblesSelection:h.bubblesSelection,highlightIds:h.highlight,fullChartParams:h.fullChartParams}),h.fullParams.highlightRIncrease&&(XL({data:h.bubblesData,highlightRIncrease:h.fullParams.highlightRIncrease,highlightIds:h.highlight}),Av({graphicSelection:o,bubblesData:h.bubblesData,fullParams:h.fullParams})),$v({fullParams:h.fullParams,graphicWidth:h.layout.width,graphicHeight:h.layout.height}),nr.nodes(h.bubblesData)}),()=>{i.next(void 0)}});function Mv({computedDataSeries:t,startAngle:e,endAngle:n}){return Wm().startAngle(e).endAngle(n).value(o=>o.visible==!1?0:o.value).sort((o,a)=>o.sortedIndex-a.sortedIndex)(t).map((o,a)=>{let u=o;return u.id=o.data.id,u})}const Sv="Pie",KL=ft(Sv,"path");function QL({enter:t,exit:e,data:n,lastData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((u,c)=>{const s=r[c]??{startAngle:0,endAngle:0,value:0};return{...u,startAngle:u.startAngle*o+s.startAngle*(1-o),endAngle:u.endAngle*o+s.endAngle*(1-o),value:u.value*o+s.value*(1-o)}});return Ah(a,i.startAngle,i.endAngle,1)}:o=>Ah(n,i.startAngle,i.endAngle,o)}function Ah(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,u=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:u}})}function Tv({selection:t,renderData:e,arc:n}){let r=t.selectAll("path").data(e,u=>u.id),i=r.enter().append("path").classed(KL,!0),o=r.exit();i.append("path");const a=r.merge(i);return a.style("cursor","pointer").attr("fill",(u,c)=>u.data.color).attr("d",(u,c)=>n(u)),o.remove(),a}function JL({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcMouseover:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,u)=>{const c=j(u[a]);e.includes(o.data.id)?c.style("opacity",1).transition("highlight").ease(fa).duration(500).attr("d",s=>i(s)):c.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",s=>r(s))})}const tC=Mo(Sv,vv)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g"),a=new pt;let u=[],c=[];n.layout$.pipe(so()).subscribe(d=>{t.attr("transform",`translate(${d.width/2}, ${d.height/2})`),n.layout$.pipe(R(i)).subscribe(g=>{t.transition().attr("transform",`translate(${g.width/2}, ${g.height/2})`)})});const s=n.layout$.pipe(R(i),O(d=>d.width<d.height?d.width:d.height)),f=new nt(d=>{q({computedData:n.computedData$,fullParams:n.fullParams$}).pipe(R(i),U(async g=>g)).subscribe(g=>{const m=Mv({computedDataSeries:g.computedData,startAngle:g.fullParams.startAngle,endAngle:g.fullParams.endAngle});d.next(m)})}),h=new nt(d=>{q({shorterSideWith:s,fullParams:n.fullParams$}).pipe(R(i),U(async g=>g)).subscribe(g=>{const m=ms({axisWidth:g.shorterSideWith,innerRadius:g.fullParams.innerRadius,outerRadius:g.fullParams.outerRadius,padAngle:g.fullParams.padAngle,cornerRadius:g.fullParams.cornerRadius});d.next(m)})}),l=new nt(d=>{q({shorterSideWith:s,fullParams:n.fullParams$}).pipe(R(i),U(async g=>g)).subscribe(g=>{const m=ms({axisWidth:g.shorterSideWith,innerRadius:g.fullParams.innerRadius,outerRadius:g.fullParams.outerMouseoverRadius,padAngle:g.fullParams.padAngle,cornerRadius:g.fullParams.cornerRadius});d.next(m)})}),p=n.fullChartParams$.pipe(R(i),O(d=>d.highlightTarget),K());return q({pieData:f,SeriesDataMap:n.SeriesDataMap$,arc:h,arcMouseover:l,computedData:n.computedData$,fullParams:n.fullParams$,fullChartParams:n.fullChartParams$,highlightTarget:p}).pipe(R(i),U(async d=>d)).subscribe(d=>{o.interrupt("graphicMove");let g=t.selectAll("path").data(d.pieData,_=>_.data.id),m=g.enter(),b=g.exit();const x=QL({enter:m,exit:b,data:d.pieData,lastData:u,fullParams:d.fullParams});o.transition("graphicMove").duration(d.fullChartParams.transitionDuration).ease(Jr(d.fullChartParams.transitionEase)).tween("move",(_,v)=>w=>{c=x(w),Tv({selection:o,renderData:c,arc:d.arc}),r.event$.next({type:"series",pluginName:e,eventName:"transitionMove",event:void 0,highlightTarget:d.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:d.computedData})}).on("end",(_,v)=>{c=Ah(d.pieData,d.fullParams.startAngle,d.fullParams.endAngle,1);const w=Tv({selection:o,renderData:c,arc:d.arc});a.next(w),u=Object.assign([],d.pieData),r.event$.next({type:"series",pluginName:e,eventName:"transitionEnd",event:void 0,highlightTarget:d.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:d.computedData}),w.on("mouseover",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})}).on("mousemove",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})}).on("mouseout",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})}).on("click",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})})})}),q({pathSelection:a,highlight:n.seriesHighlight$,fullChartParams:n.fullChartParams$,arc:h,arcMouseover:l}).pipe(R(i),U(async d=>d)).subscribe(d=>{JL({pathSelection:d.pathSelection,ids:d.highlight,fullChartParams:d.fullChartParams,arc:d.arc,arcMouseover:d.arcMouseover})}),()=>{i.next(void 0)}}),Pv="PieEventTexts",Dv=ft(Pv,"text");function $h(t,e){const n=t.selectAll(`text.${Dv}`).data(e),r=n.enter().append("text").classed(Dv,!0),i=n.merge(r);return i.each((o,a,u)=>{const c=j(u[a]).text(o.text);Object.keys(o.attr).forEach(s=>{c.attr(s,o.attr[s])}),Object.keys(o.style).forEach(s=>{c.style(s,o.style[s])})}),n.exit().remove(),i}function Mh({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((u,c)=>({text:u,attr:i[c],style:o[c]}))}const eC=Mo(Pv,xv)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");let a;n.layout$.pipe(so()).subscribe(c=>{t.attr("transform",`translate(${c.width/2}, ${c.height/2})`),n.layout$.pipe(R(i)).subscribe(s=>{t.transition().attr("transform",`translate(${s.width/2}, ${s.height/2})`)})});const u=n.fullChartParams$.pipe(R(i),O(c=>c.highlightTarget),K());return q({computedData:n.computedData$,fullParams:n.fullParams$,fullChartParams:n.fullChartParams$,highlightTarget:u}).pipe(R(i),U(async c=>c)).subscribe(c=>{o.transition().duration(c.fullChartParams.transitionDuration).ease(Jr(c.fullChartParams.transitionEase)).tween("move",(s,f)=>h=>{const l=Mh({eventData:{type:"series",pluginName:e,eventName:"transitionMove",event:s,highlightTarget:c.highlightTarget,data:c.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:h,eventFn:c.fullParams.eventFn,textAttrs:c.fullParams.textAttrs,textStyles:c.fullParams.textStyles});$h(o,l)}).on("end",(s,f)=>{const h=Mh({eventData:{type:"series",pluginName:e,eventName:"transitionEnd",event:s,highlightTarget:c.highlightTarget,data:c.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:c.fullParams.eventFn,textAttrs:c.fullParams.textAttrs,textStyles:c.fullParams.textStyles});$h(o,h),a&&a.unsubscribe(),a=r.event$.subscribe(l=>{const p=Mh({eventData:l,eventName:l.eventName,t:1,eventFn:c.fullParams.eventFn,textAttrs:c.fullParams.textAttrs,textStyles:c.fullParams.textStyles});$h(o,p)})})}),()=>{i.next(void 0)}}),kv="PieLabels",nC=ft(kv,"text");function rC(t,e,n,r){return t.map((i,o)=>{const[a,u]=e.centroid(i),[c,s]=n.centroid(i);return{pieDatum:i,arcIndex:o,arcLabel:i.data.label,x:a*r,y:u*r,mouseoverX:c*r,mouseoverY:s*r}}).filter(i=>i.pieDatum.data.visible)}function iC(t,e,n,r){let i=t.selectAll("text").data(e,c=>c.pieDatum.id),o=i.enter().append("text").classed(nC,!0),a=i.exit();o.append("text");const u=i.merge(o);return u.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",c=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(c=>n.labelFn(c.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(c,s)=>gh({datum:c.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",c=>"translate("+c.x+","+c.y+")"),a.remove(),u}function oC({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=j(o[i]);e.includes(r.pieDatum.id)?a.style("opacity",1).transition().duration(200).attr("transform",u=>"translate("+u.mouseoverX+","+u.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",u=>"translate("+u.x+","+u.y+")")})}const aC=Mo(kv,_v)(({selection:t,observer:e,subject:n})=>{const r=new pt,i=t.append("g");let o=new pt,a=[];return e.layout$.pipe(so()).subscribe(u=>{t.attr("transform",`translate(${u.width/2}, ${u.height/2})`),e.layout$.pipe(R(r)).subscribe(c=>{t.transition().attr("transform",`translate(${c.width/2}, ${c.height/2})`)})}),q({layout:e.layout$,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(R(r),U(async u=>u)).subscribe(u=>{const c=u.layout.width<u.layout.height?u.layout.width:u.layout.height,s=ms({axisWidth:c,innerRadius:0,outerRadius:u.fullParams.outerRadius,padAngle:0,cornerRadius:0}),f=ms({axisWidth:c,innerRadius:0,outerRadius:u.fullParams.outerMouseoverRadius,padAngle:0,cornerRadius:0}),h=Mv({computedDataSeries:u.computedData,startAngle:u.fullParams.startAngle,endAngle:u.fullParams.endAngle});a=rC(h,s,f,u.fullParams.labelCentroid);const l=iC(i,a,u.fullParams,u.fullChartParams);o.next(l)}),q({labelSelection:o,highlight:e.seriesHighlight$,fullChartParams:e.fullChartParams$}).pipe(R(r),U(async u=>u)).subscribe(u=>{oC({labelSelection:u.labelSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{r.next(void 0)}}),Ev="SeriesLegend",uC=Mo(Ev,wv)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new pt,o=n.SeriesDataMap$.pipe(R(i),O(u=>Array.from(u.keys()))),a=iv(Ev,{rootSelection:e,seriesLabels$:o,fullParams$:n.fullParams$,layout$:n.layout$,fullChartParams$:n.fullChartParams$});return()=>{i.next(void 0),a()}});et.BarStack=oL,et.Bars=QN,et.BarsTriangle=dL,et.Bubbles=ZL,et.CONTAINER_PLUGIN_PARAMS=gv,et.Container=zL,et.DEFAULT_BARS_PLUGIN_PARAMS=Ph,et.DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS=kh,et.DEFAULT_BAR_STACK_PLUGIN_PARAMS=Dh,et.DEFAULT_BUBBLES_PLUGIN_PARAMS=bv,et.DEFAULT_DOTS_PLUGIN_PARAMS=Sh,et.DEFAULT_GRID_LEGEND_PARAMS=Ch,et.DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS=Eh,et.DEFAULT_GROUP_AREA_PLUGIN_PARAMS=Th,et.DEFAULT_LINES_PLUGIN_PARAMS=rr,et.DEFAULT_PIE_EVENT_TEXTS_PARAMS=xv,et.DEFAULT_PIE_LABELS_PARAMS=_v,et.DEFAULT_PIE_PLUGIN_PARAMS=vv,et.DEFAULT_SCALING_AREA_PLUGIN_PARAMS=Lh,et.DEFAULT_SERIES_LEGEND_PARAMS=wv,et.DEFAULT_VALUE_AXIS_PLUGIN_PARAMS=As,et.DEFAULT_VALUE_STACK_AXIS_PLUGIN_PARAMS=Nh,et.Dots=xL,et.GridLegend=_L,et.GroupArea=FL,et.GroupAxis=AL,et.Lines=qN,et.Pie=tC,et.PieEventTexts=eC,et.PieLabels=aC,et.ScalingArea=DL,et.SeriesLegend=uC,et.TOOLTIP_PARAMS=mv,et.Tooltip=YL,et.ValueAxis=ML,et.ValueStackAxis=TL,Object.defineProperty(et,Symbol.toStringTag,{value:"Module"})});
12
+ `),r.exit().remove()}function hL({defsSelection:t,clipPathData:e}){const n=t.selectAll("clipPath").data(e),r=n.enter().append("clipPath");n.merge(r).attr("id",i=>i.id),n.exit().remove(),n.merge(r).each((i,o,a)=>{const u=j(a[o]).selectAll("rect").data([i]),c=u.enter().append("rect");u.merge(c).attr("x",0).attr("y",0).attr("width",s=>s.width).attr("height",s=>s.height),u.exit().remove()})}function pL({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 dL=Pe(_s,kh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new pt,o=ti(_s,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;r.gridAxesTransform$.pipe(R(i),O(y=>y.value),K()).subscribe(y=>{a.style("transform",y)}),r.gridGraphicTransform$.pipe(R(i),U(async y=>y.value),K()).subscribe(y=>{c.transition().duration(50).style("transform",y)});const f=r.computedData$.pipe(O(y=>y[0]&&y[0][0]?y[0][0].axisY-y[0][0].axisYFromZero:0),K()),h=new nt(y=>{q({computedData:r.computedData$,params:r.fullParams$,axisSize:r.gridAxesSize$}).pipe(U(async A=>A)).subscribe(A=>{const M=aL({axisWidth:A.axisSize.width,groupAmount:A.computedData[0]?A.computedData[0].length:0,barAmountOfGroup:A.computedData.length,barPadding:A.params.barPadding,barGroupPadding:A.params.barGroupPadding});y.next(M)})}).pipe(R(i),K()),l=r.computedData$.pipe(R(i),O(y=>y.map((A,M)=>A[0]?A[0].seriesLabel:String(M)))),p=r.computedData$.pipe(R(i),O(y=>y[0]?y[0].map(A=>A.groupLabel):[])),d=new nt(y=>{q({seriesLabels:l,barWidth:h,params:r.fullParams$}).pipe(R(i),U(async A=>A)).subscribe(A=>{const M=uL(A.barWidth,A.seriesLabels,A.params);y.next(M)})}),g=r.fullChartParams$.pipe(R(i),O(y=>y.transitionDuration),K()),m=new nt(y=>{q({groupLabels:p,transitionDuration:g}).pipe(U(async A=>A)).subscribe(A=>{const M=sL(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),b=new nt(y=>{q({groupLabels:p,transitionDuration:g}).pipe(U(async A=>A)).subscribe(A=>{const M=cL(A.groupLabels.length,A.transitionDuration);y.next(M)})}).pipe(R(i),K()),_=r.computedData$.pipe(R(i),O(y=>{const A=y.length,M=y.reduce((P,S)=>Math.max(P,S.length),0),$=new Array(M).fill(null).map(()=>new Array(A).fill(null));for(let P=0;P<A;P++)for(let S=0;S<M;S++)$[S][P]=y[P][S];return $})).pipe(R(i),O(y=>{const A=y.length?y[0].map(M=>ti(e,`lineargradient-${M.seriesLabel}`)):[];return y.map(M=>M.map(($,P)=>({linearGradientId:A[P],...$})))}));r.gridAxesSize$.pipe(R(i)).subscribe(y=>{const A=[{id:o,width:y.width,height:y.height}];hL({defsSelection:u,clipPathData:A})});const v=r.fullChartParams$.pipe(R(i),O(y=>y.highlightTarget),K());q({barData:_,computedData:r.computedData$,zeroY:f,groupLabels:p,barScale:d,params:r.fullParams$,chartParams:r.fullChartParams$,highlightTarget:v,barWidth:h,delayGroup:m,transitionItem:b,SeriesDataMap:r.SeriesDataMap$,GroupDataMap:r.GroupDataMap$}).pipe(R(i),U(async y=>y)).subscribe(y=>{const A=lL({selection:c,barData:y.barData,zeroY:y.zeroY,groupLabels:y.groupLabels,barScale:y.barScale,params:y.params,chartParams:y.chartParams,barWidth:y.barWidth,delayGroup:y.delayGroup,transitionItem:y.transitionItem});fL({defsSelection:u,barData:y.barData,params:y.params}),A.on("mouseover",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("mousemove",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("mouseout",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}).on("click",(M,$)=>{M.stopPropagation(),n.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:y.highlightTarget,datum:$,series:y.SeriesDataMap.get($.seriesLabel),seriesIndex:$.seriesIndex,seriesLabel:$.seriesLabel,groups:y.GroupDataMap.get($.groupLabel),groupIndex:$.groupIndex,groupLabel:$.groupLabel,event:M,data:y.computedData})}),s.next(A)});const w=r.gridHighlight$.subscribe();return q({pathSelection:s,highlight:r.gridHighlight$,fullChartParams:r.fullChartParams$}).pipe(R(i),U(async y=>y)).subscribe(y=>{pL({selection:y.pathSelection,ids:y.highlight,fullChartParams:y.fullChartParams})}),()=>{i.next(void 0),w.unsubscribe()}}),ws="Dots",gL=ft(ws,"g"),mL=ft(ws,"circle");function yL({selection:t,data:e,fullParams:n,fullChartParams:r,graphicOppositeScale:i}){const o=c=>{const s=c.size();return r.transitionDuration/s};let a=0;return t.selectAll("g").data(e,c=>c.id).join(c=>(a=o(c),c.append("g").classed(gL,!0)),c=>c,c=>c.remove()).attr("transform",c=>`translate(${c.axisX}, ${c.axisY})`).each((c,s,f)=>{j(f[s]).selectAll("circle").data([c]).join(h=>h.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(mL,!0).attr("opacity",0).transition().delay((l,p)=>s*a).attr("opacity",1),h=>h.transition().duration(50).attr("opacity",1),h=>h.remove()).attr("r",n.radius).attr("fill",(h,l)=>gh({datum:h,colorType:n.fillColorType,fullChartParams:r})).attr("stroke",(h,l)=>gh({datum:h,colorType:n.strokeColorType,fullChartParams:r})).attr("stroke-width",n.strokeWidth).attr("transform",`scale(${i[0]}, ${i[1]})`)})}function bL({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 vL({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 xL=Pe(ws,Sh)(({selection:t,name:e,subject:n,observer:r})=>{const i=new pt,o=ti(ws,"clipPath-box"),a=t.append("g").attr("clip-path",`url(#${o})`),u=a.append("defs"),c=a.append("g"),s=new pt;r.gridAxesTransform$.pipe(R(i),O(d=>d.value),K()).subscribe(d=>{a.style("transform",d)}),r.gridGraphicTransform$.pipe(R(i),U(async d=>d.value),K()).subscribe(d=>{c.transition().duration(50).style("transform",d)});const f=r.gridGraphicTransform$.pipe(R(i),O(d=>[1/d.scale[0],1/d.scale[1]]));r.gridAxesSize$.pipe(R(i),U(async d=>d)).subscribe(d=>{const g=[{id:o,width:d.width,height:d.height}];vL({defsSelection:u,clipPathData:g})});const h=r.fullChartParams$.pipe(R(i),O(d=>d.highlightTarget),K());q({computedData:r.computedData$,visibleComputedData:r.visibleComputedData$,SeriesDataMap:r.SeriesDataMap$,GroupDataMap:r.GroupDataMap$,graphicOppositeScale:f,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$,highlightTarget:h}).pipe(R(i),U(async d=>d)).subscribe(d=>{const g=yL({selection:c,data:d.visibleComputedData.flat(),fullParams:d.fullParams,fullChartParams:d.fullChartParams,graphicOppositeScale:d.graphicOppositeScale});g.on("mouseover",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:d.highlightTarget,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m,data:d.computedData})}).on("mousemove",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:d.highlightTarget,data:d.computedData,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m})}).on("mouseout",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:d.highlightTarget,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m,data:d.computedData})}).on("click",(m,b)=>{m.stopPropagation(),n.event$.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:d.highlightTarget,datum:b,series:d.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,groups:d.GroupDataMap.get(b.groupLabel),groupIndex:b.groupIndex,groupLabel:b.groupLabel,event:m,data:d.computedData})}),s.next(g)});const l=r.gridHighlight$.subscribe(),p=r.fullParams$.pipe(R(i),O(d=>d.onlyShowHighlighted),K());return r.fullChartParams$.pipe(R(i),U(d=>q({graphicSelection:s,highlight:r.gridHighlight$,onlyShowHighlighted:p,fullChartParams:r.fullChartParams$}).pipe(R(i),U(async g=>g)))).subscribe(d=>{bL({selection:d.graphicSelection,ids:d.highlight,onlyShowHighlighted:d.onlyShowHighlighted,fullChartParams:d.fullChartParams})}),()=>{l.unsubscribe(),i.next(void 0)}}),iv=(t,{rootSelection:e,seriesLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o})=>{const a=ft(t,"root-position"),u=ft(t,"legend-card"),c=ft(t,"legend-list"),s=ft(t,"legend-item"),f=new pt,h=r.pipe(R(f),O(w=>w.position==="bottom"||w.position==="top"?"row":"column")),l=q({fullParams:r,layout:i}).pipe(R(f),U(async w=>w),O(w=>{const y=w.fullParams.padding*2+w.fullParams.gap*2;return w.fullParams.position==="bottom"||w.fullParams.position==="top"?w.layout.rootWidth-y:w.layout.rootHeight-y})),d=q({layout:i,fullParams:r}).pipe(R(f),U(async w=>w),O(w=>{let y=0,A=0;return w.fullParams.position==="bottom"?(A=w.layout.rootHeight,w.fullParams.justify==="start"?y=0:w.fullParams.justify==="center"?y=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(y=w.layout.rootWidth)):w.fullParams.position==="right"?(y=w.layout.rootWidth,w.fullParams.justify==="start"?A=0:w.fullParams.justify==="center"?A=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(A=w.layout.rootHeight)):w.fullParams.position==="top"?(A=0,w.fullParams.justify==="start"?y=0:w.fullParams.justify==="center"?y=w.layout.rootWidth/2:w.fullParams.justify==="end"&&(y=w.layout.rootWidth)):w.fullParams.position==="left"&&(y=0,w.fullParams.justify==="start"?A=0:w.fullParams.justify==="center"?A=w.layout.rootHeight/2:w.fullParams.justify==="end"&&(A=w.layout.rootHeight)),{x:y,y:A}})).pipe(R(f),O(w=>e.selectAll(`g.${a}`).data([w]).join(y=>y.append("g").classed(a,!0).attr("transform",A=>`translate(${A.x}, ${A.y})`),y=>y.transition().attr("transform",A=>`translate(${A.x}, ${A.y})`),y=>y.remove()))),g=q({fullParams:r,fullChartParams:o,seriesLabels:n,lineDirection:h,lineMaxSize:l}).pipe(R(f),U(async w=>w),O(w=>w.seriesLabels.reduce((y,A,M)=>{const $=H2(A,w.fullChartParams.styles.textSize),P=w.fullChartParams.styles.textSize*1.5+$,S=RN(M,w.fullChartParams),L=y[0]&&y[0][0]?y[y.length-1][y[y.length-1].length-1]:null,{translateX:E,translateY:T,lineIndex:k,itemIndex:D}=((N,I,C)=>{let z=0,Y=0,W=0,st=0;if(N.lineDirection==="column"){let rt=C?C.translateY+N.fullChartParams.styles.textSize+N.fullParams.gap:0;if(rt+N.fullChartParams.styles.textSize>N.lineMaxSize){W=C.lineIndex+1,st=0,Y=0;const at=I[I.length-1].reduce((_t,ct)=>ct.itemWidth>_t?ct.itemWidth:_t,0);z=C.translateX+at+N.fullParams.gap}else W=C?C.lineIndex:0,st=C?C.itemIndex+1:0,Y=rt,z=C?C.translateX:0}else{let rt=C?C.translateX+C.itemWidth+N.fullParams.gap:0;rt+P>N.lineMaxSize?(W=C.lineIndex+1,st=0,z=0):(W=C?C.lineIndex:0,st=C?C.itemIndex+1:0,z=rt),Y=(N.fullChartParams.styles.textSize+N.fullParams.gap)*W}return{translateX:z,translateY:Y,lineIndex:W,itemIndex:st}})(w,y,L);return y[k]||(y[k]=[]),y[k].push({id:A,seriesLabel:A,seriesIndex:M,lineIndex:k,itemIndex:D,text:A,itemWidth:P,translateX:E,translateY:T,color:S}),console.log("items",y),y},[]))),m=q({fullParams:r,fullChartParams:o,lineDirection:h,lengendItems:g}).pipe(R(f),U(async w=>w),O(w=>{const{width:y,height:A}=((M,$)=>{let P=0,S=0;if(!$.length||!$[0].length)return{width:P,height:S};const L=$[0][$[0].length-1];return M.lineDirection==="column"?(P=$.reduce((E,T)=>{const k=T.reduce((D,N)=>N.itemWidth>D?N.itemWidth:D,0);return E+k},0),P+=M.fullParams.gap*($.length-1),S=L.translateY+M.fullChartParams.styles.textSize):(P=L.translateX+L.itemWidth,S=M.fullChartParams.styles.textSize*$.length+M.fullParams.gap*($.length-1)),{width:P,height:S}})(w,w.lengendItems);return{direction:w.lineDirection,width:y,height:A,translateX:w.fullParams.gap,translateY:w.fullParams.gap}})),b=q({fullParams:r,lengendList:m}).pipe(R(f),U(async w=>w),O(w=>{const y=w.lengendList.width+w.fullParams.gap*2,A=w.lengendList.height+w.fullParams.gap*2;let M=0,$=0;return w.fullParams.position==="left"?w.fullParams.justify==="start"?(M=w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="center"?(M=w.fullParams.padding,$=-A/2):w.fullParams.justify==="end"&&(M=w.fullParams.padding,$=-A-w.fullParams.padding):w.fullParams.position==="right"?w.fullParams.justify==="start"?(M=-y-w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="center"?(M=-y-w.fullParams.padding,$=-A/2):w.fullParams.justify==="end"&&(M=-y-w.fullParams.padding,$=-A-w.fullParams.padding):w.fullParams.position==="top"?w.fullParams.justify==="start"?(M=w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="center"?(M=-y/2,$=w.fullParams.padding):w.fullParams.justify==="end"&&(M=-y-w.fullParams.padding,$=w.fullParams.padding):w.fullParams.justify==="start"?(M=w.fullParams.padding,$=-A-w.fullParams.padding):w.fullParams.justify==="center"?(M=-y/2,$=-A-w.fullParams.padding):w.fullParams.justify==="end"&&(M=-y-w.fullParams.padding,$=-A-w.fullParams.padding),{width:y,height:A,translateX:M,translateY:$}})),x=q({rootPositionSelection:d,fullParams:r,fullChartParams:o,legendCard:b}).pipe(R(f),U(async w=>w),O(w=>w.rootPositionSelection.selectAll("g").data([w.legendCard]).join(y=>y.append("g").classed(u,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.remove()).each((y,A,M)=>{j(M[A]).selectAll("rect").data([y]).join("rect").attr("width",$=>$.width).attr("height",$=>$.height).attr("fill",Pt(w.fullParams.backgroundFill,w.fullChartParams)).attr("stroke",Pt(w.fullParams.backgroundStroke,w.fullChartParams))}))),_=q({lengendCardSelection:x,fullParams:r,lengendList:m}).pipe(R(f),U(async w=>w),O(w=>w.lengendCardSelection.selectAll("g").data([w.lengendList]).join(y=>y.append("g").classed(c,!0).attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.transition().attr("transform",A=>`translate(${A.translateX}, ${A.translateY})`),y=>y.remove())));return q({lengendListSelection:_,fullParams:r,fullChartParams:o,lengendItems:g}).pipe(R(f),U(async w=>w),O(w=>{const y=w.lengendItems[0]?w.lengendItems.flat():[];return w.lengendListSelection.selectAll(`g.${s}`).data(y).join(A=>A.append("g").classed(s,!0).attr("cursor","default"),A=>A,A=>A.remove()).attr("transform",(A,M)=>`translate(${A.translateX}, ${A.translateY})`).each((A,M,$)=>{const P=w.fullChartParams.styles.textSize/2,S=w.fullParams.listRectWidth,L=w.fullParams.listRectHeight;j($[M]).selectAll("rect").data([A]).join("rect").attr("x",P).attr("y",P).attr("width",S).attr("height",L).attr("transform",`translate(${-S/2}, ${-L/2})`).attr("fill",E=>E.color).attr("rx",w.fullParams.listRectRadius),j($[M]).selectAll("text").data([A]).join(E=>E.append("text").attr("dominant-baseline","hanging"),E=>E,E=>E.remove()).attr("x",w.fullChartParams.styles.textSize*1.5).attr("font-size",w.fullChartParams.styles.textSize).text(E=>E.text)})})).subscribe(),()=>{f.next(void 0)}},ov="GridLegend",_L=Pe(ov,Ch)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new pt,o=n.SeriesDataMap$.pipe(R(i),O(u=>Array.from(u.keys()))),a=iv(ov,{rootSelection:e,seriesLabels$:o,fullParams$:n.fullParams$,layout$:n.layout$,fullChartParams$:n.fullChartParams$});return()=>{i.next(void 0),a()}}),mh="GroupAxis",av=ft(mh,"xAxis"),uv=ft(mh,"groupingLabel"),yh=6;function wL({selection:t,params:e,tickTextAlign:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:u,contentTransform:c}){const s=t.selectAll(`g.${av}`).data([e]).join("g").classed(av,!0);t.selectAll(`g.${uv}`).data([e]).join("g").classed(uv,!0).each((l,p,d)=>{j(d[p]).selectAll("text").data([l]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).style("font-size",`${a.styles.textSize}px`).style("fill",Pt(e.labelColorType,a)).style("transform",c).text(g=>o.groupAxis.label)}).attr("transform",l=>`translate(${i.width+l.tickPadding+e.labelOffset[0]}, ${-l.tickPadding-yh-e.labelOffset[1]})`);const f=s0(u).scale(u).tickSize(e.tickFullLine==!0?-i.height:yh).tickSizeOuter(0).tickFormat(l=>ys(l,e.tickFormat)).tickPadding(e.tickPadding),h=s.transition().duration(100).call(f);return h.selectAll("line").style("fill","none").style("stroke",e.tickLineVisible==!0?Pt(e.tickColorType,a):"none").style("stroke-dasharray",e.tickFullLineDasharray).attr("pointer-events","none"),h.selectAll("path").style("fill","none").style("stroke",e.axisLineVisible==!0?Pt(e.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),s.selectAll("text").style("font-family","sans-serif").style("font-size",`${a.styles.textSize}px`).style("color",Pt(e.tickTextColorType,a)).attr("text-anchor",n.textAnchor).attr("dominant-baseline",n.dominantBaseline).attr("transform-origin",`0 -${e.tickPadding+yh}`).style("transform",c),s}const AL=Pe(mh,Eh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");n.gridAxesTransform$.pipe(R(i),O(f=>f.value),K()).subscribe(f=>{o.style("transform",f).attr("opacity",0).transition().attr("opacity",1)});const a=q({fullParams:n.fullParams$,gridAxesOppositeTransform:n.gridAxesOppositeTransform$}).pipe(R(i),U(async f=>{const h=f.gridAxesOppositeTransform.rotate+f.fullParams.tickTextRotate;return`translate(${f.gridAxesOppositeTransform.translate[0]}px, ${f.gridAxesOppositeTransform.translate[1]}px) rotate(${h}deg) rotateX(${f.gridAxesOppositeTransform.rotateX}deg) rotateY(${f.gridAxesOppositeTransform.rotateY}deg)`}),K()),u=new nt(f=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,computedData:n.computedData$}).pipe(R(i),U(async h=>h)).subscribe(h=>{const p=h.computedData[0]?h.computedData[0].length-1:0,d=h.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-h.fullDataFormatter.groupAxis.scalePadding:h.fullDataFormatter.groupAxis.scaleDomain[0]-h.fullDataFormatter.groupAxis.scalePadding,g=h.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?p+h.fullDataFormatter.groupAxis.scalePadding:h.fullDataFormatter.groupAxis.scaleDomain[1]+h.fullDataFormatter.groupAxis.scalePadding,m=h.computedData[0]?h.computedData[0].length:0;let b=h.fullDataFormatter.grid.seriesType==="row"?(h.computedData[0]??[]).map(w=>w.groupLabel):h.computedData.map(w=>w[0].groupLabel);const x=new Array(m).fill(0).map((w,y)=>b[y]!=null?b[y]:String(y)).filter((w,y)=>y>=d&&y<=g),_=h.fullDataFormatter.groupAxis.scalePadding,v=B2({axisLabels:x,axisWidth:h.gridAxesSize.width,padding:_});f.next(v)})}),c=n.fullDataFormatter$.pipe(R(i),O(f=>{let h="middle",l="hanging";return f.groupAxis.position==="bottom"?(h="middle",l="hanging"):f.groupAxis.position==="top"?(h="middle",l="auto"):f.groupAxis.position==="left"?(h="end",l="middle"):f.groupAxis.position==="right"&&(h="start",l="middle"),{textAnchor:h,dominantBaseline:l}})),s=n.fullDataFormatter$.pipe(R(i),O(f=>{let h="start",l="hanging";return f.groupAxis.position==="bottom"?l="hanging":f.groupAxis.position==="top"?l="auto":f.groupAxis.position==="left"?h="end":f.groupAxis.position==="right"&&(h="start"),f.valueAxis.position==="left"?h="start":f.valueAxis.position==="right"?h="end":f.valueAxis.position==="bottom"?l="auto":f.valueAxis.position==="top"&&(l="hanging"),{textAnchor:h,dominantBaseline:l}}));return q({params:n.fullParams$,tickTextAlign:c,axisLabelAlign:s,gridAxesSize:n.gridAxesSize$,fullDataFormatter:n.fullDataFormatter$,chartParams:n.fullChartParams$,groupScale:u,contentTransform:a}).pipe(R(i),U(async f=>f)).subscribe(f=>{wL({selection:o,params:f.params,tickTextAlign:f.tickTextAlign,axisLabelAlign:f.axisLabelAlign,gridAxesSize:f.gridAxesSize,fullDataFormatter:f.fullDataFormatter,chartParams:f.chartParams,groupScale:f.groupScale,contentTransform:f.contentTransform})}),()=>{i.next(void 0)}}),bh="ValueAxis",sv=ft(bh,"g"),cv=ft(bh,"text"),lv=6;function $L({selection:t,fullParams:e,tickTextAlign:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:u,contentTransform:c,minAndMax:s}){const f=t.selectAll(`g.${sv}`).data([e]).join("g").classed(sv,!0);t.selectAll(`g.${cv}`).data([e]).join("g").classed(cv,!0).each((g,m,b)=>{j(b[m]).selectAll("text").data([g]).join(x=>x.append("text").style("font-weight","bold"),x=>x,x=>x.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).style("font-size",`${a.styles.textSize}px`).style("fill",Pt(e.labelColorType,a)).style("transform",c).text(x=>o.valueAxis.label)}).attr("transform",g=>`translate(${-g.tickPadding+e.labelOffset[0]}, ${i.height+g.tickPadding+e.labelOffset[1]})`);const h=s[1]-s[0],l=Is(u).scale(u).ticks(h>e.ticks?e.ticks:s[0]===0&&s[1]===0?1:Math.ceil(h)).tickFormat(g=>ys(g,e.tickFormat)).tickSize(e.tickFullLine==!0?-i.width:lv).tickPadding(e.tickPadding),p=f.transition().duration(100).call(l);return p.selectAll("line").style("fill","none").style("stroke",e.tickLineVisible==!0?Pt(e.tickColorType,a):"none").style("stroke-dasharray",e.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",e.axisLineVisible==!0?Pt(e.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").style("font-family","sans-serif").style("font-size",`${a.styles.textSize}px`).style("color",Pt(e.tickTextColorType,a)).attr("text-anchor",n.textAnchor).attr("dominant-baseline",n.dominantBaseline).attr("transform-origin",`-${e.tickPadding+lv} 0`).style("transform",c),f}const ML=Pe(bh,As)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");n.gridAxesTransform$.pipe(R(i),O(h=>h.value),K()).subscribe(h=>{o.style("transform",h).attr("opacity",0).transition().attr("opacity",1)});const a=q({fullParams:n.fullParams$,gridAxesOppositeTransform:n.gridAxesOppositeTransform$}).pipe(R(i),U(async h=>{const l=h.gridAxesOppositeTransform.rotate+h.fullParams.tickTextRotate;return`translate(${h.gridAxesOppositeTransform.translate[0]}px, ${h.gridAxesOppositeTransform.translate[1]}px) rotate(${l}deg) rotateX(${h.gridAxesOppositeTransform.rotateX}deg) rotateY(${h.gridAxesOppositeTransform.rotateY}deg)`}),K()),u=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,computedData:n.computedData$}).pipe(R(i),U(async l=>l)).subscribe(l=>{const d=l.computedData[0]?l.computedData[0].length-1:0,g=l.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[0]-l.fullDataFormatter.groupAxis.scalePadding,m=l.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?d+l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[1]+l.fullDataFormatter.groupAxis.scalePadding,b=l.computedData.map((_,v)=>_.filter((w,y)=>y>=g&&y<=m)),x=IN(b.flat());h.next(x)})}),c=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,minAndMax:u}).pipe(R(i),U(async l=>l)).subscribe(l=>{const p=ph({maxValue:l.minAndMax[1],minValue:l.minAndMax[0],axisWidth:l.gridAxesSize.height,scaleDomain:l.fullDataFormatter.valueAxis.scaleDomain,scaleRange:l.fullDataFormatter.valueAxis.scaleRange});h.next(p)})}),s=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.valueAxis.position==="left"?(l="end",p="middle"):h.valueAxis.position==="right"?(l="start",p="middle"):h.valueAxis.position==="bottom"?(l="middle",p="hanging"):h.valueAxis.position==="top"&&(l="middle",p="auto"),{textAnchor:l,dominantBaseline:p}})),f=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.groupAxis.position==="bottom"?p="auto":h.groupAxis.position==="top"?p="hanging":h.groupAxis.position==="left"?l="start":h.groupAxis.position==="right"&&(l="end"),h.valueAxis.position==="left"?l="end":h.valueAxis.position==="right"?l="start":h.valueAxis.position==="bottom"?p="hanging":h.valueAxis.position==="top"&&(p="auto"),{textAnchor:l,dominantBaseline:p}}));return q({fullParams:n.fullParams$,tickTextAlign:s,axisLabelAlign:f,computedData:n.computedData$,gridAxesSize:n.gridAxesSize$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,valueScale:c,contentTransform:a,minAndMax:u}).pipe(R(i),U(async h=>h)).subscribe(h=>{$L({selection:o,fullParams:h.fullParams,tickTextAlign:h.tickTextAlign,axisLabelAlign:h.axisLabelAlign,gridAxesSize:h.gridAxesSize,fullDataFormatter:h.fullDataFormatter,fullChartParams:h.fullChartParams,valueScale:h.valueScale,contentTransform:h.contentTransform,minAndMax:h.minAndMax})}),()=>{i.next(void 0)}}),vh="ValueStackAxis",fv=ft(vh,"g"),hv=ft(vh,"text"),pv=6;function SL({selection:t,fullParams:e,tickTextAlign:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:u,contentTransform:c,minAndMax:s}){const f=t.selectAll(`g.${fv}`).data([e]).join("g").classed(fv,!0);t.selectAll(`g.${hv}`).data([e]).join("g").classed(hv,!0).each((g,m,b)=>{j(b[m]).selectAll("text").data([g]).join(x=>x.append("text").style("font-weight","bold"),x=>x,x=>x.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).style("font-size",`${a.styles.textSize}px`).style("fill",Pt(e.labelColorType,a)).style("transform",c).text(x=>o.valueAxis.label)}).attr("transform",g=>`translate(${-g.tickPadding+e.labelOffset[0]}, ${i.height+g.tickPadding+e.labelOffset[1]})`);const h=s[1]-s[0],l=Is(u).scale(u).ticks(h>e.ticks?e.ticks:s[0]===0&&s[1]===0?1:Math.ceil(h)).tickFormat(g=>ys(g,e.tickFormat)).tickSize(e.tickFullLine==!0?-i.width:pv).tickPadding(e.tickPadding),p=f.transition().duration(100).call(l);return p.selectAll("line").style("fill","none").style("stroke",e.tickLineVisible==!0?Pt(e.tickColorType,a):"none").style("stroke-dasharray",e.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",e.axisLineVisible==!0?Pt(e.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").style("font-family","sans-serif").style("font-size",`${a.styles.textSize}px`).style("color",Pt(e.tickTextColorType,a)).attr("text-anchor",n.textAnchor).attr("dominant-baseline",n.dominantBaseline).attr("transform-origin",`-${e.tickPadding+pv} 0`).style("transform",c),f}const TL=Pe(vh,Nh)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");n.gridAxesTransform$.pipe(R(i),O(h=>h.value),K()).subscribe(h=>{o.style("transform",h).attr("opacity",0).transition().attr("opacity",1)});const a=q({fullParams:n.fullParams$,gridAxesOppositeTransform:n.gridAxesOppositeTransform$}).pipe(R(i),U(async h=>{const l=h.gridAxesOppositeTransform.rotate+h.fullParams.tickTextRotate;return`translate(${h.gridAxesOppositeTransform.translate[0]}px, ${h.gridAxesOppositeTransform.translate[1]}px) rotate(${l}deg) rotateX(${h.gridAxesOppositeTransform.rotateX}deg) rotateY(${h.gridAxesOppositeTransform.rotateY}deg)`}),K()),u=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,computedData:n.computedData$}).pipe(R(i),U(async l=>l)).subscribe(l=>{const d=l.computedData[0]?l.computedData[0].length-1:0,g=l.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[0]-l.fullDataFormatter.groupAxis.scalePadding,m=l.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?d+l.fullDataFormatter.groupAxis.scalePadding:l.fullDataFormatter.groupAxis.scaleDomain[1]+l.fullDataFormatter.groupAxis.scalePadding,b=l.computedData.map((v,w)=>v.filter((y,A)=>A>=g&&A<=m)),x=new Array(b[0]?b[0].length:0).fill(null).map((v,w)=>b.reduce((y,A)=>{if(A&&A[w]){const M=A[w].value==null||A[w].visible==!1?0:A[w].value;return y+M}return y},0)),_=X2(x);h.next(_)})}),c=new nt(h=>{q({fullDataFormatter:n.fullDataFormatter$,gridAxesSize:n.gridAxesSize$,minAndMax:u}).pipe(R(i),U(async l=>l)).subscribe(l=>{const p=ph({maxValue:l.minAndMax[1],minValue:l.minAndMax[0],axisWidth:l.gridAxesSize.height,scaleDomain:l.fullDataFormatter.valueAxis.scaleDomain,scaleRange:l.fullDataFormatter.valueAxis.scaleRange});h.next(p)})}),s=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.valueAxis.position==="left"?(l="end",p="middle"):h.valueAxis.position==="right"?(l="start",p="middle"):h.valueAxis.position==="bottom"?(l="middle",p="hanging"):h.valueAxis.position==="top"&&(l="middle",p="auto"),{textAnchor:l,dominantBaseline:p}})),f=n.fullDataFormatter$.pipe(R(i),O(h=>{let l="start",p="hanging";return h.groupAxis.position==="bottom"?p="auto":h.groupAxis.position==="top"?p="hanging":h.groupAxis.position==="left"?l="start":h.groupAxis.position==="right"&&(l="end"),h.valueAxis.position==="left"?l="end":h.valueAxis.position==="right"?l="start":h.valueAxis.position==="bottom"?p="hanging":h.valueAxis.position==="top"&&(p="auto"),{textAnchor:l,dominantBaseline:p}}));return q({fullParams:n.fullParams$,tickTextAlign:s,axisLabelAlign:f,computedData:n.computedData$,gridAxesSize:n.gridAxesSize$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,valueScale:c,contentTransform:a,minAndMax:u}).pipe(R(i),U(async h=>h)).subscribe(h=>{SL({selection:o,fullParams:h.fullParams,tickTextAlign:h.tickTextAlign,axisLabelAlign:h.axisLabelAlign,gridAxesSize:h.gridAxesSize,fullDataFormatter:h.fullDataFormatter,fullChartParams:h.fullChartParams,valueScale:h.valueScale,contentTransform:h.contentTransform,minAndMax:h.minAndMax})}),()=>{i.next(void 0)}}),dv="ScalingArea",PL=ft(dv,"rect"),DL=Pe(dv,Lh)(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new pt,a=e.insert("rect","g").classed(PL,!0).attr("opacity",0);let u={k:1,x:0,y:0};r.layout$.pipe(R(o)).subscribe(s=>{a.attr("width",s.width).attr("height",s.height).attr("x",s.left).attr("y",s.top)});const c=r.computedData$.pipe(O(s=>s[0]?s[0].length-1:0),K());return q({initGroupAxis:r.fullDataFormatter$.pipe(O(s=>s.groupAxis),so()),fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:c,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(R(o),U(async s=>s)).subscribe(s=>{const h=s.groupMaxIndex,l=s.initGroupAxis.scaleDomain[0]==="auto"?0-s.initGroupAxis.scalePadding:s.initGroupAxis.scaleDomain[0]-s.initGroupAxis.scalePadding,p=s.initGroupAxis.scaleDomain[1]==="auto"?h+s.initGroupAxis.scalePadding:s.initGroupAxis.scaleDomain[1]+s.initGroupAxis.scalePadding,d=s.fullDataFormatter.valueAxis.position==="left"||s.fullDataFormatter.valueAxis.position==="top"?[0,1]:[1,0],m=ph({maxValue:s.groupMaxIndex,minValue:0,axisWidth:s.axisSize.width,scaleDomain:[l,p],scaleRange:d}).copy(),b=Ny().on("zoom",function(_){const v=_.transform,w=A=>{const M=Math.round(A);return Math.min(h,Math.max(0,M))},y=s.fullDataFormatter.groupAxis.position==="bottom"||s.fullDataFormatter.groupAxis.position==="top"?v.rescaleX(m).domain().map(w):v.rescaleY(m).domain().map(w);y[0]<=0&&y[1]>=h?v.k<u.k&&(v.k=u.k,v.x=u.x,v.y=u.y):y[1]-y[0]<=1&&v.k>u.k&&(v.k=u.k,v.x=u.x,v.y=u.y),u.k=v.k,u.x=v.x,u.y=v.y,i.dataFormatter$.next({...s.fullDataFormatter,groupAxis:{...s.fullDataFormatter.groupAxis,scaleDomain:y}})});e.call(b)}),()=>{o.next(void 0),a.remove()}});function kL(t,e){let n=new nt(()=>{});return t.each(function(){const r=Ff(this,e);n=zf(n,r)}),n}const xh="GroupArea",_h=ft(xh,"label-box");function EL({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function NL({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=ft(e,"auxline"),a=t.selectAll(`line.${o}`).data(n),u=a.enter().append("line").classed(o,!0).style("stroke",s=>Pt(r.lineColorType,i)).style("stroke-width",1).style("stroke-dasharray",r.lineDashArray??"none").style("pointer-events","none"),c=a.merge(u);return a.exit().remove(),u.attr("x1",s=>s.x1).attr("y1",s=>s.y1).attr("x2",s=>s.x2).attr("y2",s=>s.y2),a.transition().duration(50).attr("x1",s=>s.x1).attr("y1",s=>s.y1).attr("x2",s=>s.x2).attr("y2",s=>s.y2),c}function LL(t){t.selectAll("line").data([]).exit().remove()}function CL({groupLabel:t,axisX:e,fullParams:n}){return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding,text:ys(t,n.labelTextFormat)}]:[]}function IL({selection:t,labelData:e,fullParams:n,fullChartParams:r,gridAxesOppositeTransformValue:i}){const o=r.styles.textSize+4,a=t.selectAll(`g.${_h}`).data(e),u=a.enter().append("g").classed(_h,!0).style("cursor","pointer"),c=u.merge(a);return u.attr("transform",(s,f)=>`translate(${s.x}, ${s.y})`),a.transition().duration(50).attr("transform",(s,f)=>`translate(${s.x}, ${s.y})`),a.exit().remove(),c.each((s,f,h)=>{const l=H2(s.text,r.styles.textSize)+12,p=-l/2,d=j(h[f]).selectAll("rect").data([s]),g=d.enter().append("rect").attr("height",`${o}px`).attr("fill",x=>Pt(n.labelColorType,r)).attr("x",p).attr("y",-2).attr("rx",5).attr("ry",5).style("cursor","pointer");d.merge(g).attr("width",x=>`${l}px`).style("transform",i),d.exit().remove();const m=j(h[f]).selectAll("text").data([s]),b=m.enter().append("text").style("dominant-baseline","hanging").style("cursor","pointer");m.merge(b).text(x=>x.text).style("transform",i).attr("fill",x=>Pt(n.labelTextColorType,r)).attr("font-size",r.styles.textSize).attr("x",p+6),m.exit().remove()}),c}function RL(t){t.selectAll(`g.${_h}`).data([]).exit().remove()}const FL=Pe(xh,Th)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new pt,a=e.insert("rect","g").classed(ft(xh,"rect"),!0).attr("opacity",0),u=t.append("g");i.layout$.pipe(R(o)).subscribe(l=>{a.attr("width",l.rootWidth).attr("height",l.rootHeight)}),i.gridAxesTransform$.pipe(R(o),O(l=>l.value),K()).subscribe(l=>{u.style("transform",l)});const c=new nt(l=>{q({fullDataFormatter:i.fullDataFormatter$,gridAxesSize:i.gridAxesSize$,computedData:i.computedData$}).pipe(R(o),U(async p=>p)).subscribe(p=>{const g=p.computedData[0]?p.computedData[0].length-1:0,m=p.fullDataFormatter.groupAxis.scaleDomain[0]==="auto"?0-p.fullDataFormatter.groupAxis.scalePadding:p.fullDataFormatter.groupAxis.scaleDomain[0]-p.fullDataFormatter.groupAxis.scalePadding,b=p.fullDataFormatter.groupAxis.scaleDomain[1]==="auto"?g+p.fullDataFormatter.groupAxis.scalePadding:p.fullDataFormatter.groupAxis.scaleDomain[1]+p.fullDataFormatter.groupAxis.scalePadding,x=p.computedData[0]?p.computedData[0].length:0;let _=p.fullDataFormatter.grid.seriesType==="row"?(p.computedData[0]??[]).map(A=>A.groupLabel):p.computedData.map(A=>A[0].groupLabel);const v=new Array(x).fill(0).map((A,M)=>_[M]!=null?_[M]:String(M)).filter((A,M)=>M>=m&&M<=b),w=p.fullDataFormatter.groupAxis.scalePadding,y=B2({axisLabels:v,axisWidth:p.gridAxesSize.width,padding:w});l.next(y)})}),s=V2({fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$}),f=i.fullChartParams$.pipe(R(o),O(l=>l.highlightTarget),K());return q({computedData:i.computedData$,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullChartParams:i.fullChartParams$,highlightTarget:f,SeriesDataMap:i.SeriesDataMap$,GroupDataMap:i.GroupDataMap$,gridGroupPositionFn:s,groupScale:c}).pipe(R(o),U(async l=>l)).subscribe(l=>{e.on("mouseover",(p,d)=>{const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})}).on("mousemove",(p,d)=>{const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})}).on("mouseout",(p,d)=>{const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})}).on("click",(p,d)=>{p.stopPropagation();const{groupIndex:g,groupLabel:m}=l.gridGroupPositionFn(p);r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.GroupDataMap.get(m)??[],groupIndex:g,groupLabel:m,event:p,data:l.computedData})})}),q({event:r.event$.pipe(Bu(l=>l.eventName==="mouseover"||l.eventName==="mousemove")),computedData:i.computedData$,groupScale:c,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullChartParams:i.fullChartParams$,highlightTarget:f,gridAxesOppositeTransform:i.gridAxesOppositeTransform$,GroupDataMap:i.GroupDataMap$,gridGroupPositionFn:s}).pipe(R(o),U(async l=>l)).subscribe(l=>{const p=l.groupScale(l.event.groupLabel)??0,d=EL({groupLabel:l.event.groupLabel,axisX:p,axisHeight:l.gridAxesSize.height,fullParams:l.fullParams});NL({selection:u,pluginName:n,lineData:d,fullParams:l.fullParams,fullChartParams:l.fullChartParams});const g=CL({groupLabel:l.event.groupLabel,axisX:p,fullParams:l.fullParams});IL({selection:u,labelData:g,fullParams:l.fullParams,fullChartParams:l.fullChartParams,gridAxesOppositeTransformValue:l.gridAxesOppositeTransform.value}).on("mouseover",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})}).on("mousemove",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})}).on("mouseout",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})}).on("click",(b,x)=>{const{groupIndex:_,groupLabel:v}=l.gridGroupPositionFn(b);r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:l.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",groups:l.event.groups,groupIndex:_,groupLabel:v,event:b,data:l.computedData})})}),kL(a,"mouseout").pipe(R(o)).subscribe(l=>{console.log("rootMouseout"),LL(u),RL(u)}),()=>{o.next(void 0),a.remove()}}),gv={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},mv={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.map(r=>r.value).join(",");return[e,n]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.groups.map(r=>r.value).join(",");return[e,n]}return[]},svgRenderFn:null},zL=q2("Container",gv)(({selection:t})=>function(){}),wh="Tooltip",yv=ft(wh,"g"),OL=ft(wh,"box");function GL(t,e){const n=e.textSize*1.5;return t.filter(r=>r!="").map((r,i)=>{const o=i*n;return`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="${o}" style="dominant-baseline:text-before-edge">${r}</text>`}).join()}function UL({rootSelection:t,pluginName:e,rootWidth:n,rootHeight:r,svgString:i,tooltipStyle:o,event:a}){t.interrupt("fadeout");const u=5,c=i?[i]:[],s=i?[o]:[],h=t.selectAll(`g.${yv}`).data(c).join(v=>v.append("g").classed(yv,!0).attr("pointer-events","none"),v=>v,v=>v.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${OL}`).data(s).join(v=>v.append("g").classed(ft(e,"box"),!0)),l=h.selectAll("rect").data(s).join(v=>v.append("rect").attr("rx",u).attr("ry",u)).attr("fill",v=>v.backgroundColor).attr("stroke",v=>v.strokeColor).attr("opacity",v=>v.backgroundOpacity),p=h.selectAll("g").data(c).join(v=>v.append("g").classed(ft(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));c.length&&CN(p,c[0]);const d=p!=null&&p.node()?W2(p):{width:0,height:0};l.attr("width",d.width+o.padding*2).attr("height",d.height+o.padding*2);const g=h!=null&&h.node()?W2(h):{width:0,height:0},m=n-g.width,b=r-g.height,x=a.offsetX+o.offset[0]>m?m-a.offsetX:o.offset[0],_=a.offsetY+o.offset[1]>b?b-a.offsetY:o.offset[1];h.attr("transform",v=>`translate(${x}, ${_})`),h.attr("transform",v=>`translate(${x}, ${_})`)}const YL=q2(wh,mv)(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new pt,u=o.event$.pipe(R(a),Bu(d=>d.eventName==="mouseover"||d.eventName==="mousemove")),c=o.event$.pipe(R(a),Bu(d=>d.eventName==="mouseout")),s=q({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$}).pipe(R(a),U(async d=>d),O(d=>({backgroundColor:Pt(d.fullParams.backgroundColorType,d.fullChartParams),backgroundOpacity:d.fullParams.backgroundOpacity,strokeColor:Pt(d.fullParams.strokeColorType,d.fullChartParams),offset:d.fullParams.offset,padding:d.fullParams.padding,textSize:d.fullChartParams.styles.textSize,textColor:Pt(d.fullParams.textColorType,d.fullChartParams)}))),f=q({fullParams:i.fullParams$,tooltipStyle:s}).pipe(R(a),U(async d=>d),O(d=>d.fullParams.svgRenderFn?d.fullParams.svgRenderFn:g=>{const m=d.fullParams.textRenderFn(g);return GL(m,d.tooltipStyle)})),h=q({event:u,contentRenderFn:f}).pipe(R(a),U(async d=>d),O(d=>d.contentRenderFn(d.event))),l=c.pipe(R(a),O(d=>"")),p=zf(u,c).pipe(R(a),O(d=>d.event));return q({svgString:zf(h,l),event:p,layout:i.layout$,tooltipStyle:s}).pipe(R(a),U(async d=>d)).subscribe(d=>{UL({rootSelection:e,pluginName:n,rootWidth:d.layout.rootWidth,rootHeight:d.layout.rootHeight,svgString:d.svgString,tooltipStyle:d.tooltipStyle,event:d.event})}),function(){a.next(void 0)}}),bv={force:{strength:.03,velocityDecay:.2,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},highlightRIncrease:0,bubbleScaleType:"area"},vv={outerRadius:.95,innerRadius:0,outerMouseoverRadius:1,enterDuration:800,startAngle:0,endAngle:Math.PI*2,padAngle:.02,cornerRadius:0},xv={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+(i.value??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"}]},_v={outerRadius:.95,outerMouseoverRadius:1,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.3,labelColorType:"series",labelFn:t=>String(t.value)},wv={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0};function BL(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 u(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function c(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 s(p){const d=c(p.trim());return Math.sqrt(d*r)}function f(p,d){let g={width:0,text:""},m=1/0;const b=[];let x=" ";i&&(x="");for(let _=0,v=p.length;_<v;++_){const w=(g.text?g.text+x:"")+p[_],y=c(w);(m+y)/2<d?(g.width=m=y,g.text=w):(m=c(p[_]),g={width:m,text:p[_]},b.push(g))}return b}function h(p){let d=0;for(let g=0,m=p.length;g<m;++g){const b=(Math.abs(g-m/2+.5)+.5)*r,x=p[g].width/2;d=Math.max(d,Math.sqrt(x**2+b**2))}return d}function l(p,d){o>0&&(d=u(d,o));const g=a(d),m=s(d),b=f(g,m),x=h(b);let _=p.select("text");_.size()||(_=p.append("text")),_.attr("transform",`translate(0,0) scale(${n/x})`);const v=_.selectAll("tspan").data(b),w=v.enter().append("tspan").attr("x",0).merge(v).attr("y",(y,A)=>(A-b.length/2+.8)*r).text(y=>y.text);return v.exit().remove(),v.merge(w)}return l(t,e)}let nr;function qL(t,e){return ad().velocityDecay(e.force.velocityDecay).force("collision",rd().radius(n=>n.r+e.force.collisionSpacing)).force("charge",ud().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function WL({data:t,bubbleGroupR:e,maxValue:n,avgValue:r}){const i=e/Math.sqrt(t.length),a=i*i*Math.PI/r,u=n*a;return Math.pow(u/Math.PI,.5)*.75}function HL({data:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,scaleType:i}){const o=Math.min(n,r)/2,a=t.flat().filter(p=>p.value!=null&&p.visible!=!1),u=Math.max(...a.map(p=>p.value)),c=a.reduce((p,d)=>p+(d.value??0),0)/a.length,s=WL({data:a,bubbleGroupR:o,maxValue:u,avgValue:c}),f=i==="area"?.5:1,h=hu().domain([0,u]).range([0,s]).exponent(f);return a.map(p=>{const d=p,g=e.get(p.id);g?(d.x=g.x,d.y=g.y):(d.x=Math.random()*n,d.y=Math.random()*r);const m=h(d.value??0);return d.r=m,d._originR=m,d})}function Av({graphicSelection:t,bubblesData:e,fullParams:n}){let r=t.selectAll("g").data(e,a=>a.id),i=r.enter().append("g").attr("cursor","pointer");i.style("font-size",12).style("fill","#ffffff").attr("text-anchor","middle").attr("transform",a=>`translate(${a.x},${a.y})`),i.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",a=>a.color),i.append("text").style("opacity",.8).attr("pointer-events","none"),r.exit().remove();const o=r.merge(i);return o.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),o.each((a,u,c)=>{const s=j(c[u]);let f=!0;a.label.length<=n.bubbleText.lineLengthMin&&(f=!1),s.call(BL,{text:a.label,radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:f})}),o}function XL({data:t,highlightRIncrease:e,highlightIds:n}){if(e!=0){if(!n.length){t.forEach(r=>r.r=r._originR);return}t.forEach(r=>{n.includes(r.id)?r.r=r._originR+e:r.r=r._originR})}}function VL(){return x0().on("start",(t,e)=>{t.active||nr.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||nr.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function $v({fullParams:t,graphicWidth:e,graphicHeight:n}){nr.force("x",sd().strength(t.force.strength).x(0)).force("y",cd().strength(t.force.strength).y(0)),nr.alpha(1).restart()}function jL({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(fa).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const ZL=Mo("Bubbles",bv)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g"),a=new pt;let u=new Map;n.layout$.pipe(so()).subscribe(h=>{t.attr("transform",`translate(${h.width/2}, ${h.height/2})`),n.layout$.pipe(R(i)).subscribe(l=>{t.transition().attr("transform",`translate(${l.width/2}, ${l.height/2})`)})});const c=n.fullParams$.pipe(R(i),O(h=>h.bubbleScaleType),K()),s=new nt(h=>{q({layout:n.layout$,computedData:n.computedData$,scaleType:c}).pipe(R(i),U(async l=>l)).subscribe(l=>{const p=HL({data:l.computedData,LastBubbleDataMap:u,graphicWidth:l.layout.width,graphicHeight:l.layout.height,scaleType:l.scaleType});h.next(p)})});s.subscribe(h=>{u=new Map(h.map(l=>[l.id,l]))});const f=n.fullChartParams$.pipe(R(i),O(h=>h.highlightTarget),K());return q({layout:n.layout$,computedData:n.computedData$,bubblesData:s,SeriesDataMap:n.SeriesDataMap$,fullParams:n.fullParams$,highlightTarget:f}).pipe(R(i),U(async h=>h)).subscribe(h=>{const l=Av({graphicSelection:o,bubblesData:h.bubblesData,fullParams:h.fullParams});nr=qL(l,h.fullParams),l.on("mouseover",(p,d)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:h.highlightTarget,datum:d,series:h.SeriesDataMap.get(d.seriesLabel),seriesIndex:d.seriesIndex,seriesLabel:d.seriesLabel,event:p,data:h.computedData})}).call(VL()),nr.nodes(h.bubblesData),$v({fullParams:h.fullParams,graphicWidth:h.layout.width,graphicHeight:h.layout.height}),a.next(l)}),q({bubblesSelection:a,bubblesData:s,highlight:n.seriesHighlight$,fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,layout:n.layout$}).pipe(R(i),U(async h=>h)).subscribe(h=>{jL({bubblesSelection:h.bubblesSelection,highlightIds:h.highlight,fullChartParams:h.fullChartParams}),h.fullParams.highlightRIncrease&&(XL({data:h.bubblesData,highlightRIncrease:h.fullParams.highlightRIncrease,highlightIds:h.highlight}),Av({graphicSelection:o,bubblesData:h.bubblesData,fullParams:h.fullParams})),$v({fullParams:h.fullParams,graphicWidth:h.layout.width,graphicHeight:h.layout.height}),nr.nodes(h.bubblesData)}),()=>{i.next(void 0)}});function Mv({computedDataSeries:t,startAngle:e,endAngle:n}){return Wm().startAngle(e).endAngle(n).value(o=>o.visible==!1?0:o.value).sort((o,a)=>o.sortedIndex-a.sortedIndex)(t).map((o,a)=>{let u=o;return u.id=o.data.id,u})}const Sv="Pie",KL=ft(Sv,"path");function QL({enter:t,exit:e,data:n,lastData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((u,c)=>{const s=r[c]??{startAngle:0,endAngle:0,value:0};return{...u,startAngle:u.startAngle*o+s.startAngle*(1-o),endAngle:u.endAngle*o+s.endAngle*(1-o),value:u.value*o+s.value*(1-o)}});return Ah(a,i.startAngle,i.endAngle,1)}:o=>Ah(n,i.startAngle,i.endAngle,o)}function Ah(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,u=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:u}})}function Tv({selection:t,renderData:e,arc:n}){let r=t.selectAll("path").data(e,u=>u.id),i=r.enter().append("path").classed(KL,!0),o=r.exit();i.append("path");const a=r.merge(i);return a.style("cursor","pointer").attr("fill",(u,c)=>u.data.color).attr("d",(u,c)=>n(u)),o.remove(),a}function JL({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcMouseover:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,u)=>{const c=j(u[a]);e.includes(o.data.id)?c.style("opacity",1).transition("highlight").ease(fa).duration(500).attr("d",s=>i(s)):c.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",s=>r(s))})}const tC=Mo(Sv,vv)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g"),a=new pt;let u=[],c=[];n.layout$.pipe(so()).subscribe(d=>{t.attr("transform",`translate(${d.width/2}, ${d.height/2})`),n.layout$.pipe(R(i)).subscribe(g=>{t.transition().attr("transform",`translate(${g.width/2}, ${g.height/2})`)})});const s=n.layout$.pipe(R(i),O(d=>d.width<d.height?d.width:d.height)),f=new nt(d=>{q({computedData:n.computedData$,fullParams:n.fullParams$}).pipe(R(i),U(async g=>g)).subscribe(g=>{const m=Mv({computedDataSeries:g.computedData,startAngle:g.fullParams.startAngle,endAngle:g.fullParams.endAngle});d.next(m)})}),h=new nt(d=>{q({shorterSideWith:s,fullParams:n.fullParams$}).pipe(R(i),U(async g=>g)).subscribe(g=>{const m=ms({axisWidth:g.shorterSideWith,innerRadius:g.fullParams.innerRadius,outerRadius:g.fullParams.outerRadius,padAngle:g.fullParams.padAngle,cornerRadius:g.fullParams.cornerRadius});d.next(m)})}),l=new nt(d=>{q({shorterSideWith:s,fullParams:n.fullParams$}).pipe(R(i),U(async g=>g)).subscribe(g=>{const m=ms({axisWidth:g.shorterSideWith,innerRadius:g.fullParams.innerRadius,outerRadius:g.fullParams.outerMouseoverRadius,padAngle:g.fullParams.padAngle,cornerRadius:g.fullParams.cornerRadius});d.next(m)})}),p=n.fullChartParams$.pipe(R(i),O(d=>d.highlightTarget),K());return q({pieData:f,SeriesDataMap:n.SeriesDataMap$,arc:h,arcMouseover:l,computedData:n.computedData$,fullParams:n.fullParams$,fullChartParams:n.fullChartParams$,highlightTarget:p}).pipe(R(i),U(async d=>d)).subscribe(d=>{o.interrupt("graphicMove");let g=t.selectAll("path").data(d.pieData,_=>_.data.id),m=g.enter(),b=g.exit();const x=QL({enter:m,exit:b,data:d.pieData,lastData:u,fullParams:d.fullParams});o.transition("graphicMove").duration(d.fullChartParams.transitionDuration).ease(Jr(d.fullChartParams.transitionEase)).tween("move",(_,v)=>w=>{c=x(w),Tv({selection:o,renderData:c,arc:d.arc}),r.event$.next({type:"series",pluginName:e,eventName:"transitionMove",event:void 0,highlightTarget:d.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:d.computedData})}).on("end",(_,v)=>{c=Ah(d.pieData,d.fullParams.startAngle,d.fullParams.endAngle,1);const w=Tv({selection:o,renderData:c,arc:d.arc});a.next(w),u=Object.assign([],d.pieData),r.event$.next({type:"series",pluginName:e,eventName:"transitionEnd",event:void 0,highlightTarget:d.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:d.computedData}),w.on("mouseover",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})}).on("mousemove",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})}).on("mouseout",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})}).on("click",(y,A)=>{y.stopPropagation(),r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:d.highlightTarget,datum:A.data,series:d.SeriesDataMap.get(A.data.seriesLabel),seriesIndex:A.data.seriesIndex,seriesLabel:A.data.seriesLabel,event:y,data:d.computedData})})})}),q({pathSelection:a,highlight:n.seriesHighlight$,fullChartParams:n.fullChartParams$,arc:h,arcMouseover:l}).pipe(R(i),U(async d=>d)).subscribe(d=>{JL({pathSelection:d.pathSelection,ids:d.highlight,fullChartParams:d.fullChartParams,arc:d.arc,arcMouseover:d.arcMouseover})}),()=>{i.next(void 0)}}),Pv="PieEventTexts",Dv=ft(Pv,"text");function $h(t,e){const n=t.selectAll(`text.${Dv}`).data(e),r=n.enter().append("text").classed(Dv,!0),i=n.merge(r);return i.each((o,a,u)=>{const c=j(u[a]).text(o.text);Object.keys(o.attr).forEach(s=>{c.attr(s,o.attr[s])}),Object.keys(o.style).forEach(s=>{c.style(s,o.style[s])})}),n.exit().remove(),i}function Mh({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((u,c)=>({text:u,attr:i[c],style:o[c]}))}const eC=Mo(Pv,xv)(({selection:t,name:e,observer:n,subject:r})=>{const i=new pt,o=t.append("g");let a;n.layout$.pipe(so()).subscribe(c=>{t.attr("transform",`translate(${c.width/2}, ${c.height/2})`),n.layout$.pipe(R(i)).subscribe(s=>{t.transition().attr("transform",`translate(${s.width/2}, ${s.height/2})`)})});const u=n.fullChartParams$.pipe(R(i),O(c=>c.highlightTarget),K());return q({computedData:n.computedData$,fullParams:n.fullParams$,fullChartParams:n.fullChartParams$,highlightTarget:u}).pipe(R(i),U(async c=>c)).subscribe(c=>{o.transition().duration(c.fullChartParams.transitionDuration).ease(Jr(c.fullChartParams.transitionEase)).tween("move",(s,f)=>h=>{const l=Mh({eventData:{type:"series",pluginName:e,eventName:"transitionMove",event:s,highlightTarget:c.highlightTarget,data:c.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:h,eventFn:c.fullParams.eventFn,textAttrs:c.fullParams.textAttrs,textStyles:c.fullParams.textStyles});$h(o,l)}).on("end",(s,f)=>{const h=Mh({eventData:{type:"series",pluginName:e,eventName:"transitionEnd",event:s,highlightTarget:c.highlightTarget,data:c.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:c.fullParams.eventFn,textAttrs:c.fullParams.textAttrs,textStyles:c.fullParams.textStyles});$h(o,h),a&&a.unsubscribe(),a=r.event$.subscribe(l=>{const p=Mh({eventData:l,eventName:l.eventName,t:1,eventFn:c.fullParams.eventFn,textAttrs:c.fullParams.textAttrs,textStyles:c.fullParams.textStyles});$h(o,p)})})}),()=>{i.next(void 0)}}),kv="PieLabels",nC=ft(kv,"text");function rC(t,e,n,r){return t.map((i,o)=>{const[a,u]=e.centroid(i),[c,s]=n.centroid(i);return{pieDatum:i,arcIndex:o,arcLabel:i.data.label,x:a*r,y:u*r,mouseoverX:c*r,mouseoverY:s*r}}).filter(i=>i.pieDatum.data.visible)}function iC(t,e,n,r){let i=t.selectAll("text").data(e,c=>c.pieDatum.id),o=i.enter().append("text").classed(nC,!0),a=i.exit();o.append("text");const u=i.merge(o);return u.attr("font-weight","bold").attr("text-anchor","middle").style("dominant-baseline","middle").style("cursor",c=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").text(c=>n.labelFn(c.pieDatum.data)).attr("font-size",r.styles.textSize).attr("fill",(c,s)=>gh({datum:c.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).transition().attr("transform",c=>"translate("+c.x+","+c.y+")"),a.remove(),u}function oC({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=j(o[i]);e.includes(r.pieDatum.id)?a.style("opacity",1).transition().duration(200).attr("transform",u=>"translate("+u.mouseoverX+","+u.mouseoverY+")"):a.style("opacity",n.styles.unhighlightedOpacity).transition().duration(200).attr("transform",u=>"translate("+u.x+","+u.y+")")})}const aC=Mo(kv,_v)(({selection:t,observer:e,subject:n})=>{const r=new pt,i=t.append("g");let o=new pt,a=[];return e.layout$.pipe(so()).subscribe(u=>{t.attr("transform",`translate(${u.width/2}, ${u.height/2})`),e.layout$.pipe(R(r)).subscribe(c=>{t.transition().attr("transform",`translate(${c.width/2}, ${c.height/2})`)})}),q({layout:e.layout$,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(R(r),U(async u=>u)).subscribe(u=>{const c=u.layout.width<u.layout.height?u.layout.width:u.layout.height,s=ms({axisWidth:c,innerRadius:0,outerRadius:u.fullParams.outerRadius,padAngle:0,cornerRadius:0}),f=ms({axisWidth:c,innerRadius:0,outerRadius:u.fullParams.outerMouseoverRadius,padAngle:0,cornerRadius:0}),h=Mv({computedDataSeries:u.computedData,startAngle:u.fullParams.startAngle,endAngle:u.fullParams.endAngle});a=rC(h,s,f,u.fullParams.labelCentroid);const l=iC(i,a,u.fullParams,u.fullChartParams);o.next(l)}),q({labelSelection:o,highlight:e.seriesHighlight$,fullChartParams:e.fullChartParams$}).pipe(R(r),U(async u=>u)).subscribe(u=>{oC({labelSelection:u.labelSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{r.next(void 0)}}),Ev="SeriesLegend",uC=Mo(Ev,wv)(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new pt,o=n.SeriesDataMap$.pipe(R(i),O(u=>Array.from(u.keys()))),a=iv(Ev,{rootSelection:e,seriesLabels$:o,fullParams$:n.fullParams$,layout$:n.layout$,fullChartParams$:n.fullChartParams$});return()=>{i.next(void 0),a()}});et.BarStack=oL,et.Bars=QN,et.BarsTriangle=dL,et.Bubbles=ZL,et.CONTAINER_PLUGIN_PARAMS=gv,et.Container=zL,et.DEFAULT_BARS_PLUGIN_PARAMS=Ph,et.DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS=kh,et.DEFAULT_BAR_STACK_PLUGIN_PARAMS=Dh,et.DEFAULT_BUBBLES_PLUGIN_PARAMS=bv,et.DEFAULT_DOTS_PLUGIN_PARAMS=Sh,et.DEFAULT_GRID_LEGEND_PARAMS=Ch,et.DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS=Eh,et.DEFAULT_GROUP_AREA_PLUGIN_PARAMS=Th,et.DEFAULT_LINES_PLUGIN_PARAMS=rr,et.DEFAULT_PIE_EVENT_TEXTS_PARAMS=xv,et.DEFAULT_PIE_LABELS_PARAMS=_v,et.DEFAULT_PIE_PLUGIN_PARAMS=vv,et.DEFAULT_SCALING_AREA_PLUGIN_PARAMS=Lh,et.DEFAULT_SERIES_LEGEND_PARAMS=wv,et.DEFAULT_VALUE_AXIS_PLUGIN_PARAMS=As,et.DEFAULT_VALUE_STACK_AXIS_PLUGIN_PARAMS=Nh,et.Dots=xL,et.GridLegend=_L,et.GroupArea=FL,et.GroupAxis=AL,et.Lines=qN,et.Pie=tC,et.PieEventTexts=eC,et.PieLabels=aC,et.ScalingArea=DL,et.SeriesLegend=uC,et.TOOLTIP_PARAMS=mv,et.Tooltip=YL,et.ValueAxis=ML,et.ValueStackAxis=TL,Object.defineProperty(et,Symbol.toStringTag,{value:"Module"})});
@@ -1,4 +1,4 @@
1
- import { LinesPluginParams, GroupAreaPluginParams, DotsPluginParams, BarsPluginParams, BarStackPluginParams, BarsTrianglePluginParams, GroupingAxisParams, ValueAxisParams, ValueStackAxisParams, ScalingAreaParams, GridLegendParams } from './types';
1
+ import { LinesPluginParams, GroupAreaPluginParams, DotsPluginParams, BarsPluginParams, BarStackPluginParams, BarsTrianglePluginParams, GroupAxisParams, ValueAxisParams, ValueStackAxisParams, ScalingAreaParams, GridLegendParams } from './types';
2
2
 
3
3
  export declare const DEFAULT_LINES_PLUGIN_PARAMS: LinesPluginParams;
4
4
  export declare const DEFAULT_DOTS_PLUGIN_PARAMS: DotsPluginParams;
@@ -6,7 +6,7 @@ export declare const DEFAULT_GROUP_AREA_PLUGIN_PARAMS: GroupAreaPluginParams;
6
6
  export declare const DEFAULT_BARS_PLUGIN_PARAMS: BarsPluginParams;
7
7
  export declare const DEFAULT_BAR_STACK_PLUGIN_PARAMS: BarStackPluginParams;
8
8
  export declare const DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS: BarsTrianglePluginParams;
9
- export declare const DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS: GroupingAxisParams;
9
+ export declare const DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS: GroupAxisParams;
10
10
  export declare const DEFAULT_VALUE_AXIS_PLUGIN_PARAMS: ValueAxisParams;
11
11
  export declare const DEFAULT_VALUE_STACK_AXIS_PLUGIN_PARAMS: ValueStackAxisParams;
12
12
  export declare const DEFAULT_SCALING_AREA_PLUGIN_PARAMS: ScalingAreaParams;
@@ -1,3 +1,3 @@
1
- import { GroupingAxisParams } from '../types';
1
+ import { GroupAxisParams } from '../types';
2
2
 
3
- export declare const GroupAxis: import('@orbcharts/core').PluginConstructor<"grid", string, GroupingAxisParams>;
3
+ export declare const GroupAxis: import('@orbcharts/core').PluginConstructor<"grid", string, GroupAxisParams>;
@@ -39,7 +39,7 @@ export interface BarsTrianglePluginParams {
39
39
  barGroupPadding: number;
40
40
  linearGradientOpacity: [number, number];
41
41
  }
42
- export interface GroupingAxisParams {
42
+ export interface GroupAxisParams {
43
43
  labelOffset: [number, number];
44
44
  labelColorType: ColorType;
45
45
  axisLineVisible: boolean;
@@ -1,7 +1,7 @@
1
1
  import { ComputedDatumSeries, EventSeries, EventName, ColorType } from '@orbcharts/core';
2
2
  import { BaseLegendParams } from '../base/BaseLegend';
3
3
 
4
- export type ScaleType = 'area' | 'radius';
4
+ export type BubbleScaleType = 'area' | 'radius';
5
5
  export interface BubblesPluginParams {
6
6
  force: {
7
7
  strength: number;
@@ -14,7 +14,7 @@ export interface BubblesPluginParams {
14
14
  lineLengthMin: number;
15
15
  };
16
16
  highlightRIncrease: number;
17
- scaleType: ScaleType;
17
+ bubbleScaleType: BubbleScaleType;
18
18
  }
19
19
  export interface PiePluginParams {
20
20
  outerRadius: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.27",
3
+ "version": "3.0.0-alpha.28",
4
4
  "description": "plugins for OrbCharts",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -5,7 +5,7 @@ import type {
5
5
  BarsPluginParams,
6
6
  BarStackPluginParams,
7
7
  BarsTrianglePluginParams,
8
- GroupingAxisParams,
8
+ GroupAxisParams,
9
9
  ValueAxisParams,
10
10
  ValueStackAxisParams,
11
11
  ScalingAreaParams,
@@ -56,7 +56,7 @@ export const DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS: BarsTrianglePluginParams = {
56
56
  linearGradientOpacity: [1, 0]
57
57
  }
58
58
 
59
- export const DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS: GroupingAxisParams = {
59
+ export const DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS: GroupAxisParams = {
60
60
  // labelAnchor: 'start',
61
61
  labelOffset: [0, 0],
62
62
  labelColorType: 'primary',
@@ -15,7 +15,7 @@ import type {
15
15
  DataFormatterGrid,
16
16
  ChartParams,
17
17
  TransformData } from '@orbcharts/core'
18
- import type { GroupingAxisParams } from '../types'
18
+ import type { GroupAxisParams } from '../types'
19
19
  import { DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS } from '../defaults'
20
20
  import { parseTickFormatValue } from '../../utils/d3Utils'
21
21
  import { getColor, getClassName } from '../../utils/orbchartsUtils'
@@ -32,7 +32,7 @@ const defaultTickSize = 6
32
32
 
33
33
  function renderPointAxis ({ selection, params, tickTextAlign, axisLabelAlign, gridAxesSize, fullDataFormatter, chartParams, groupScale, contentTransform }: {
34
34
  selection: d3.Selection<SVGGElement, any, any, any>,
35
- params: GroupingAxisParams
35
+ params: GroupAxisParams
36
36
  tickTextAlign: TextAlign
37
37
  axisLabelAlign: TextAlign
38
38
  gridAxesSize: { width: number, height: number }
@@ -44,19 +44,19 @@ function renderPointAxis ({ selection, params, tickTextAlign, axisLabelAlign, gr
44
44
  }) {
45
45
 
46
46
  const xAxisSelection = selection
47
- .selectAll<SVGGElement, GroupingAxisParams>(`g.${xAxisClassName}`)
47
+ .selectAll<SVGGElement, GroupAxisParams>(`g.${xAxisClassName}`)
48
48
  .data([params])
49
49
  .join('g')
50
50
  .classed(xAxisClassName, true)
51
51
 
52
52
  const axisLabelSelection = selection
53
- .selectAll<SVGGElement, GroupingAxisParams>(`g.${groupingLabelClassName}`)
53
+ .selectAll<SVGGElement, GroupAxisParams>(`g.${groupingLabelClassName}`)
54
54
  .data([params])
55
55
  .join('g')
56
56
  .classed(groupingLabelClassName, true)
57
57
  .each((d, i, g) => {
58
58
  const text = d3.select(g[i])
59
- .selectAll<SVGTextElement, GroupingAxisParams>('text')
59
+ .selectAll<SVGTextElement, GroupAxisParams>('text')
60
60
  .data([d])
61
61
  .join(
62
62
  enter => {
package/src/grid/types.ts CHANGED
@@ -56,7 +56,7 @@ export interface BarsTrianglePluginParams {
56
56
  linearGradientOpacity: [number, number]
57
57
  }
58
58
 
59
- export interface GroupingAxisParams {
59
+ export interface GroupAxisParams {
60
60
  // xLabel: string
61
61
  // labelAnchor: 'start' | 'end'
62
62
  labelOffset: [number, number]
@@ -19,7 +19,7 @@ export const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesPluginParams = {
19
19
  lineLengthMin: 4
20
20
  },
21
21
  highlightRIncrease: 0,
22
- scaleType: 'area'
22
+ bubbleScaleType: 'area'
23
23
  }
24
24
 
25
25
  export const DEFAULT_PIE_PLUGIN_PARAMS: PiePluginParams = {
@@ -17,7 +17,7 @@ import type {
17
17
  ComputedDatumSeries } from '@orbcharts/core'
18
18
  import {
19
19
  defineSeriesPlugin } from '@orbcharts/core'
20
- import type { BubblesPluginParams, ScaleType } from '../types'
20
+ import type { BubblesPluginParams, BubbleScaleType } from '../types'
21
21
  import { DEFAULT_BUBBLES_PLUGIN_PARAMS } from '../defaults'
22
22
  import { renderCircleText } from '../../utils/d3Graphics'
23
23
 
@@ -86,7 +86,7 @@ function createBubblesData ({ data, LastBubbleDataMap, graphicWidth, graphicHeig
86
86
  LastBubbleDataMap: Map<string, BubblesDatum>
87
87
  graphicWidth: number
88
88
  graphicHeight: number
89
- scaleType: ScaleType
89
+ scaleType: BubbleScaleType
90
90
  // highlightIds: string[]
91
91
  }) {
92
92
  const bubbleGroupR = Math.min(...[graphicWidth, graphicHeight]) / 2
@@ -363,7 +363,7 @@ export const Bubbles = defineSeriesPlugin('Bubbles', DEFAULT_BUBBLES_PLUGIN_PARA
363
363
 
364
364
  const scaleType$ = observer.fullParams$.pipe(
365
365
  takeUntil(destroy$),
366
- map(d => d.scaleType),
366
+ map(d => d.bubbleScaleType),
367
367
  distinctUntilChanged()
368
368
  )
369
369
 
@@ -1,7 +1,7 @@
1
1
  import type { ComputedDatumSeries, EventSeries, EventName, ColorType } from '@orbcharts/core'
2
2
  import type { BaseLegendParams } from '../base/BaseLegend'
3
3
 
4
- export type ScaleType = 'area' | 'radius'
4
+ export type BubbleScaleType = 'area' | 'radius'
5
5
 
6
6
  export interface BubblesPluginParams {
7
7
  force: {
@@ -15,7 +15,7 @@ export interface BubblesPluginParams {
15
15
  lineLengthMin: number
16
16
  }
17
17
  highlightRIncrease: number
18
- scaleType: ScaleType
18
+ bubbleScaleType: BubbleScaleType
19
19
  }
20
20
 
21
21
  export interface PiePluginParams {