billboard.js 3.17.1 → 3.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +10 -7
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +9 -9
- package/dist/billboard.pkgd.js +10 -7
- package/dist/billboard.pkgd.min.js +11 -11
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +9 -3
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +9 -3
- package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-tableview.js +9 -3
- package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-textoverlap.js +9 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +9 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +9 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +9 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +9 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +3 -3
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +11 -5
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +9 -3
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +1 -1
- package/src/ChartInternal/data/convert.ts +10 -2
- package/src/module/util.ts +8 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.17.
|
|
8
|
+
* @version 3.17.2
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.11
|
|
@@ -27,32 +27,32 @@
|
|
|
27
27
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`}),(function(x,b,n){var u=n(3);u({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})}),(function(x,b,n){var u=n(3),d=n(323);u({target:"Number",stat:!0},{isFinite:d})}),(function(x,b,n){var u=n(4),d=u.isFinite;x.exports=Number.isFinite||function(v){return typeof v=="number"&&d(v)}}),(function(x,b,n){var u=n(3),d=n(325);u({target:"Number",stat:!0},{isInteger:d})}),(function(x,b,n){var u=n(20),d=Math.floor;x.exports=Number.isInteger||function(v){return!u(v)&&isFinite(v)&&d(v)===v}}),(function(x,b,n){var u=n(3);u({target:"Number",stat:!0},{isNaN:function(h){return h!==h}})}),(function(x,b,n){var u=n(3),d=n(325),h=Math.abs;u({target:"Number",stat:!0},{isSafeInteger:function(y){return d(y)&&h(y)<=9007199254740991}})}),(function(x,b,n){var u=n(3);u({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})}),(function(x,b,n){var u=n(3);u({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})}),(function(x,b,n){var u=n(3),d=n(331);u({target:"Number",stat:!0,forced:Number.parseFloat!==d},{parseFloat:d})}),(function(x,b,n){var u=n(4),d=n(7),h=n(14),v=n(68),y=n(319).trim,T=n(320),S=h("".charAt),$=u.parseFloat,A=u.Symbol,I=A&&A.iterator,R=1/$(T+"-0")!==-1/0||I&&!d(function(){$(Object(I))});x.exports=R?function(O){var P=y(v(O)),M=$(P);return M===0&&S(P,0)==="-"?-0:M}:$}),(function(x,b,n){var u=n(3),d=n(333);u({target:"Number",stat:!0,forced:Number.parseInt!==d},{parseInt:d})}),(function(x,b,n){var u=n(4),d=n(7),h=n(14),v=n(68),y=n(319).trim,T=n(320),S=u.parseInt,$=u.Symbol,A=$&&$.iterator,I=/^[+-]?0x/i,R=h(I.exec),C=S(T+"08")!==8||S(T+"0x16")!==22||A&&!d(function(){S(Object(A))});x.exports=C?function(P,M){var L=y(v(P));return S(L,M>>>0||(R(I,L)?16:10))}:S}),(function(x,b,n){var u=n(3),d=n(14),h=n(61),v=n(318),y=n(248),T=n(308),S=n(7),$=RangeError,A=String,I=isFinite,R=Math.abs,C=Math.floor,O=Math.pow,P=Math.round,M=d(1.1.toExponential),L=d(y),B=d("".slice),F=M(-69e-12,4)==="-6.9000e-11"&&M(1.255,2)==="1.25e+0"&&M(12345,3)==="1.235e+4"&&M(25,0)==="3e+1",z=function(){return S(function(){M(1,1/0)})&&S(function(){M(1,-1/0)})},j=function(){return!S(function(){M(1/0,1/0),M(NaN,1/0)})},G=!F||!z()||!j();u({target:"Number",proto:!0,forced:G},{toExponential:function(X){var W=v(this);if(X===void 0)return M(W);var H=h(X);if(!I(W))return String(W);if(H<0||H>20)throw new $("Incorrect fraction digits");if(F)return M(W,H);var Z="",_,k,q,et;if(W<0&&(Z="-",W=-W),W===0)k=0,_=L("0",H+1);else{var rt=T(W);k=C(rt);var at=O(10,k-H),dt=P(W/at);2*W>=(2*dt+1)*at&&(dt+=1),dt>=O(10,H+1)&&(dt/=10,k+=1),_=A(dt)}return H!==0&&(_=B(_,0,1)+"."+B(_,1)),k===0?(q="+",et="0"):(q=k>0?"+":"-",et=A(R(k))),_+="e"+q+et,Z+_}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(61),v=n(318),y=n(248),T=n(7),S=RangeError,$=String,A=Math.floor,I=d(y),R=d("".slice),C=d(1.1.toFixed),O=function(z,j,G){return j===0?G:j%2===1?O(z,j-1,G*z):O(z*z,j/2,G)},P=function(z){for(var j=0,G=z;G>=4096;)j+=12,G/=4096;for(;G>=2;)j+=1,G/=2;return j},M=function(z,j,G){for(var V=-1,X=G;++V<6;)X+=j*z[V],z[V]=X%1e7,X=A(X/1e7)},L=function(z,j){for(var G=6,V=0;--G>=0;)V+=z[G],z[G]=A(V/j),V=V%j*1e7},B=function(z){for(var j=6,G="";--j>=0;)if(G!==""||j===0||z[j]!==0){var V=$(z[j]);G=G===""?V:G+I("0",7-V.length)+V}return G},F=T(function(){return C(8e-5,3)!=="0.000"||C(.9,0)!=="1"||C(1.255,2)!=="1.25"||C(0xde0b6b3a7640080,0)!=="1000000000000000128"})||!T(function(){C({})});u({target:"Number",proto:!0,forced:F},{toFixed:function(j){var G=v(this),V=h(j),X=[0,0,0,0,0,0],W="",H="0",Z,_,k,q;if(V<0||V>20)throw new S("Incorrect fraction digits");if(G!==G)return"NaN";if(G<=-1e21||G>=1e21)return $(G);if(G<0&&(W="-",G=-G),G>1e-21)if(Z=P(G*O(2,69,1))-69,_=Z<0?G*O(2,-Z,1):G/O(2,Z,1),_*=4503599627370496,Z=52-Z,Z>0){for(M(X,0,_),k=V;k>=7;)M(X,1e7,0),k-=7;for(M(X,O(10,k,1),0),k=Z-1;k>=23;)L(X,8388608),k-=23;L(X,1<<k),M(X,1,1),L(X,2),H=B(X)}else M(X,0,_),M(X,1<<-Z,0),H=B(X)+I("0",V);return V>0?(q=H.length,H=W+(q<=V?"0."+I("0",V-q)+H:R(H,0,q-V)+"."+R(H,q-V))):H=W+H,H}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(7),v=n(318),y=d(1.1.toPrecision),T=h(function(){return y(1,void 0)!=="1"})||!h(function(){y({})});u({target:"Number",proto:!0,forced:T},{toPrecision:function($){return $===void 0?y(v(this)):y(v(this),$)}})}),(function(x,b,n){var u=n(3),d=n(338);u({target:"Object",stat:!0,arity:2,forced:Object.assign!==d},{assign:d})}),(function(x,b,n){var u=n(6),d=n(14),h=n(8),v=n(7),y=n(73),T=n(66),S=n(10),$=n(39),A=n(13),I=Object.assign,R=Object.defineProperty,C=d([].concat);x.exports=!I||v(function(){if(u&&I({b:1},I(R({},"a",{enumerable:!0,get:function(){R(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var O={},P={},M=Symbol("assign detection"),L="abcdefghijklmnopqrst";return O[M]=7,L.split("").forEach(function(B){P[B]=B}),I({},O)[M]!==7||y(I({},P)).join("")!==L})?function(P,M){for(var L=$(P),B=arguments.length,F=1,z=T.f,j=S.f;B>F;)for(var G=A(arguments[F++]),V=z?C(y(G),z(G)):y(G),X=V.length,W=0,H;X>W;)H=V[W++],(!u||h(j,G,H))&&(L[H]=G[H]);return L}:I}),(function(x,b,n){var u=n(3),d=n(6),h=n(71);u({target:"Object",stat:!0,sham:!d},{create:h})}),(function(x,b,n){var u=n(3),d=n(6),h=n(341),v=n(30),y=n(39),T=n(44);d&&u({target:"Object",proto:!0,forced:h},{__defineGetter__:function($,A){T.f(y(this),$,{get:v(A),enumerable:!0,configurable:!0})}})}),(function(x,b,n){var u=n(36),d=n(4),h=n(7),v=n(196);x.exports=u||!h(function(){if(!(v&&v<535)){var y=Math.random();__defineSetter__.call(null,y,function(){}),delete d[y]}})}),(function(x,b,n){var u=n(3),d=n(6),h=n(72).f;u({target:"Object",stat:!0,forced:Object.defineProperties!==h,sham:!d},{defineProperties:h})}),(function(x,b,n){var u=n(3),d=n(6),h=n(44).f;u({target:"Object",stat:!0,forced:Object.defineProperty!==h,sham:!d},{defineProperty:h})}),(function(x,b,n){var u=n(3),d=n(6),h=n(341),v=n(30),y=n(39),T=n(44);d&&u({target:"Object",proto:!0,forced:h},{__defineSetter__:function($,A){T.f(y(this),$,{set:v(A),enumerable:!0,configurable:!0})}})}),(function(x,b,n){var u=n(3),d=n(346).entries;u({target:"Object",stat:!0},{entries:function(v){return d(v)}})}),(function(x,b,n){var u=n(6),d=n(7),h=n(14),v=n(131),y=n(73),T=n(12),S=n(10).f,$=h(S),A=h([].push),I=u&&d(function(){var C=Object.create(null);return C[2]=2,!$(C,2)}),R=function(C){return function(O){for(var P=T(O),M=y(P),L=I&&v(P)===null,B=M.length,F=0,z=[],j;B>F;)j=M[F++],(!u||(L?j in P:$(P,j)))&&A(z,C?[j,P[j]]:P[j]);return z}};x.exports={entries:R(!0),values:R(!1)}}),(function(x,b,n){var u=n(3),d=n(290),h=n(7),v=n(20),y=n(287).onFreeze,T=Object.freeze,S=h(function(){T(1)});u({target:"Object",stat:!0,forced:S,sham:!d},{freeze:function(A){return T&&v(A)?T(y(A)):A}})}),(function(x,b,n){var u=n(3),d=n(133),h=n(145);u({target:"Object",stat:!0},{fromEntries:function(y){var T={};return d(y,function(S,$){h(T,S,$)},{AS_ENTRIES:!0}),T}})}),(function(x,b,n){var u=n(3),d=n(7),h=n(12),v=n(5).f,y=n(6),T=!y||d(function(){v(1)});u({target:"Object",stat:!0,forced:T,sham:!y},{getOwnPropertyDescriptor:function($,A){return v(h($),A)}})}),(function(x,b,n){var u=n(3),d=n(6),h=n(56),v=n(12),y=n(5),T=n(145);u({target:"Object",stat:!0,sham:!d},{getOwnPropertyDescriptors:function($){for(var A=v($),I=y.f,R=h(A),C={},O=0,P,M;R.length>O;)M=I(A,P=R[O++]),M!==void 0&&T(C,P,M);return C}})}),(function(x,b,n){var u=n(3),d=n(7),h=n(75).f,v=d(function(){return!Object.getOwnPropertyNames(1)});u({target:"Object",stat:!0,forced:v},{getOwnPropertyNames:h})}),(function(x,b,n){var u=n(3),d=n(7),h=n(39),v=n(131),y=n(132),T=d(function(){v(1)});u({target:"Object",stat:!0,forced:T,sham:!y},{getPrototypeOf:function($){return v(h($))}})}),(function(x,b,n){var u=n(3),d=n(145),h=n(23),v=n(14),y=n(30),T=n(16),S=n(18),$=n(133),A=n(7),I=Object.groupBy,R=h("Object","create"),C=v([].push),O=!I||A(function(){return I("ab",function(P){return P}).a.length!==1});u({target:"Object",stat:!0,forced:O},{groupBy:function(M,L){T(M),y(L);var B=R(null),F=0;return $(M,function(z){var j=S(L(z,F++));j in B?C(B[j],z):d(B,j,[z])}),B}})}),(function(x,b,n){var u=n(3),d=n(38);u({target:"Object",stat:!0},{hasOwn:d})}),(function(x,b,n){var u=n(3),d=n(356);u({target:"Object",stat:!0},{is:d})}),(function(x){x.exports=Object.is||function(n,u){return n===u?n!==0||1/n===1/u:n!==n&&u!==u}}),(function(x,b,n){var u=n(3),d=n(288);u({target:"Object",stat:!0,forced:Object.isExtensible!==d},{isExtensible:d})}),(function(x,b,n){var u=n(3),d=n(7),h=n(20),v=n(15),y=n(289),T=Object.isFrozen,S=y||d(function(){T(1)});u({target:"Object",stat:!0,forced:S},{isFrozen:function(A){return!h(A)||y&&v(A)==="ArrayBuffer"?!0:T?T(A):!1}})}),(function(x,b,n){var u=n(3),d=n(7),h=n(20),v=n(15),y=n(289),T=Object.isSealed,S=y||d(function(){T(1)});u({target:"Object",stat:!0,forced:S},{isSealed:function(A){return!h(A)||y&&v(A)==="ArrayBuffer"?!0:T?T(A):!1}})}),(function(x,b,n){var u=n(3),d=n(39),h=n(73),v=n(7),y=v(function(){h(1)});u({target:"Object",stat:!0,forced:y},{keys:function(S){return h(d(S))}})}),(function(x,b,n){var u=n(3),d=n(6),h=n(341),v=n(39),y=n(18),T=n(131),S=n(5).f;d&&u({target:"Object",proto:!0,forced:h},{__lookupGetter__:function(A){var I=v(this),R=y(A),C;do if(C=S(I,R))return C.get;while(I=T(I))}})}),(function(x,b,n){var u=n(3),d=n(6),h=n(341),v=n(39),y=n(18),T=n(131),S=n(5).f;d&&u({target:"Object",proto:!0,forced:h},{__lookupSetter__:function(A){var I=v(this),R=y(A),C;do if(C=S(I,R))return C.set;while(I=T(I))}})}),(function(x,b,n){var u=n(3),d=n(20),h=n(287).onFreeze,v=n(290),y=n(7),T=Object.preventExtensions,S=y(function(){T(1)});u({target:"Object",stat:!0,forced:S,sham:!v},{preventExtensions:function(A){return T&&d(A)?T(h(A)):A}})}),(function(x,b,n){var u=n(6),d=n(77),h=n(20),v=n(118),y=n(39),T=n(16),S=Object.getPrototypeOf,$=Object.setPrototypeOf,A=Object.prototype,I="__proto__";if(u&&S&&$&&!(I in A))try{d(A,I,{configurable:!0,get:function(){return S(y(this))},set:function(C){var O=T(this);v(C)&&h(O)&&$(O,C)}})}catch(R){}}),(function(x,b,n){var u=n(3),d=n(20),h=n(287).onFreeze,v=n(290),y=n(7),T=Object.seal,S=y(function(){T(1)});u({target:"Object",stat:!0,forced:S,sham:!v},{seal:function(A){return T&&d(A)?T(h(A)):A}})}),(function(x,b,n){var u=n(3),d=n(115);u({target:"Object",stat:!0},{setPrototypeOf:d})}),(function(x,b,n){var u=n(70),d=n(47),h=n(368);u||d(Object.prototype,"toString",h,{unsafe:!0})}),(function(x,b,n){var u=n(70),d=n(69);x.exports=u?{}.toString:function(){return"[object "+d(this)+"]"}}),(function(x,b,n){var u=n(3),d=n(346).values;u({target:"Object",stat:!0},{values:function(v){return d(v)}})}),(function(x,b,n){var u=n(3),d=n(331);u({global:!0,forced:parseFloat!==d},{parseFloat:d})}),(function(x,b,n){var u=n(3),d=n(333);u({global:!0,forced:parseInt!==d},{parseInt:d})}),(function(x,b,n){n(373),n(389),n(391),n(392),n(393),n(394)}),(function(x,b,n){var u=n(3),d=n(36),h=n(186),v=n(4),y=n(80),T=n(8),S=n(47),$=n(115),A=n(82),I=n(198),R=n(30),C=n(21),O=n(20),P=n(215),M=n(374),L=n(376).set,B=n(379),F=n(384),z=n(385),j=n(381),G=n(51),V=n(386),X=n(387),W=n(388),H="Promise",Z=X.CONSTRUCTOR,_=X.REJECTION_EVENT,k=X.SUBCLASSING,q=G.getterFor(H),et=G.set,rt=V&&V.prototype,at=V,dt=rt,xt=v.TypeError,gt=v.document,ht=v.process,Mt=W.f,$t=Mt,zt=!!(gt&>.createEvent&&v.dispatchEvent),Ht="unhandledrejection",_t="rejectionhandled",Ee=0,ue=1,te=2,Nt=1,Yt=2,ne,fe,ee,le,Me=function(Lt){var Jt;return O(Lt)&&C(Jt=Lt.then)?Jt:!1},Ne=function(Lt,Jt){var Qt=Jt.value,Gt=Jt.state===ue,me=Gt?Lt.ok:Lt.fail,He=Lt.resolve,ft=Lt.reject,Rt=Lt.domain,Ct,Pt,Ft;try{me?(Gt||(Jt.rejection===Yt&&ge(Jt),Jt.rejection=Nt),me===!0?Ct=Qt:(Rt&&Rt.enter(),Ct=me(Qt),Rt&&(Rt.exit(),Ft=!0)),Ct===Lt.promise?ft(new xt("Promise-chain cycle")):(Pt=Me(Ct))?T(Pt,Ct,He,ft):He(Ct)):ft(Qt)}catch(Et){Rt&&!Ft&&Rt.exit(),ft(Et)}},$e=function(Lt,Jt){Lt.notified||(Lt.notified=!0,B(function(){for(var Qt=Lt.reactions,Gt;Gt=Qt.get();)Ne(Gt,Lt);Lt.notified=!1,Jt&&!Lt.rejection&&Ae(Lt)}))},ae=function(Lt,Jt,Qt){var Gt,me;zt?(Gt=gt.createEvent("Event"),Gt.promise=Jt,Gt.reason=Qt,Gt.initEvent(Lt,!1,!0),v.dispatchEvent(Gt)):Gt={promise:Jt,reason:Qt},!_&&(me=v["on"+Lt])?me(Gt):Lt===Ht&&F("Unhandled promise rejection",Qt)},Ae=function(Lt){T(L,v,function(){var Jt=Lt.facade,Qt=Lt.value,Gt=xe(Lt),me;if(Gt&&(me=z(function(){h?ht.emit("unhandledRejection",Qt,Jt):ae(Ht,Jt,Qt)}),Lt.rejection=h||xe(Lt)?Yt:Nt,me.error))throw me.value})},xe=function(Lt){return Lt.rejection!==Nt&&!Lt.parent},ge=function(Lt){T(L,v,function(){var Jt=Lt.facade;h?ht.emit("rejectionHandled",Jt):ae(_t,Jt,Lt.value)})},bt=function(Lt,Jt,Qt){return function(Gt){Lt(Jt,Gt,Qt)}},Ut=function(Lt,Jt,Qt){Lt.done||(Lt.done=!0,Qt&&(Lt=Qt),Lt.value=Jt,Lt.state=te,$e(Lt,!0))},ie=function(Lt,Jt,Qt){if(!Lt.done){Lt.done=!0,Qt&&(Lt=Qt);try{if(Lt.facade===Jt)throw new xt("Promise can't be resolved itself");var Gt=Me(Jt);Gt?B(function(){var me={done:!1};try{T(Gt,Jt,bt(ie,me,Lt),bt(Ut,me,Lt))}catch(He){Ut(me,He,Lt)}}):(Lt.value=Jt,Lt.state=ue,$e(Lt,!1))}catch(me){Ut({done:!1},me,Lt)}}};if(Z&&(at=function(Jt){P(this,dt),R(Jt),T(ne,this);var Qt=q(this);try{Jt(bt(ie,Qt),bt(Ut,Qt))}catch(Gt){Ut(Qt,Gt)}},dt=at.prototype,ne=function(Jt){et(this,{type:H,done:!1,notified:!1,parent:!1,reactions:new j,rejection:!1,state:Ee,value:null})},ne.prototype=S(dt,"then",function(Jt,Qt){var Gt=q(this),me=Mt(M(this,at));return Gt.parent=!0,me.ok=C(Jt)?Jt:!0,me.fail=C(Qt)&&Qt,me.domain=h?ht.domain:void 0,Gt.state===Ee?Gt.reactions.add(me):B(function(){Ne(me,Gt)}),me.promise}),fe=function(){var Lt=new ne,Jt=q(Lt);this.promise=Lt,this.resolve=bt(ie,Jt),this.reject=bt(Ut,Jt)},W.f=Mt=function(Lt){return Lt===at||Lt===ee?new fe(Lt):$t(Lt)},!d&&C(V)&&rt!==Object.prototype)){le=rt.then,k||S(rt,"then",function(Jt,Qt){var Gt=this;return new at(function(me,He){T(le,Gt,me,He)}).then(Jt,Qt)},{unsafe:!0});try{delete rt.constructor}catch(Lt){}$&&$(rt,dt)}u({global:!0,constructor:!0,wrap:!0,forced:Z},{Promise:at}),ee=y.Promise,A(at,H,!1,!0),I(H)}),(function(x,b,n){var u=n(46),d=n(375),h=n(17),v=n(33),y=v("species");x.exports=function(T,S){var $=u(T).constructor,A;return $===void 0||h(A=u($)[y])?S:d(A)}}),(function(x,b,n){var u=n(89),d=n(31),h=TypeError;x.exports=function(v){if(u(v))return v;throw new h(d(v)+" is not a constructor")}}),(function(x,b,n){var u=n(4),d=n(94),h=n(84),v=n(21),y=n(38),T=n(7),S=n(74),$=n(76),A=n(42),I=n(377),R=n(378),C=n(186),O=u.setImmediate,P=u.clearImmediate,M=u.process,L=u.Dispatch,B=u.Function,F=u.MessageChannel,z=u.String,j=0,G={},V="onreadystatechange",X,W,H,Z;T(function(){X=u.location});var _=function(rt){if(y(G,rt)){var at=G[rt];delete G[rt],at()}},k=function(rt){return function(){_(rt)}},q=function(rt){_(rt.data)},et=function(rt){u.postMessage(z(rt),X.protocol+"//"+X.host)};(!O||!P)&&(O=function(at){I(arguments.length,1);var dt=v(at)?at:B(at),xt=$(arguments,1);return G[++j]=function(){d(dt,void 0,xt)},W(j),j},P=function(at){delete G[at]},C?W=function(rt){M.nextTick(k(rt))}:L&&L.now?W=function(rt){L.now(k(rt))}:F&&!R?(H=new F,Z=H.port2,H.port1.onmessage=q,W=h(Z.postMessage,Z)):u.addEventListener&&v(u.postMessage)&&!u.importScripts&&X&&X.protocol!=="file:"&&!T(et)?(W=et,u.addEventListener("message",q,!1)):V in A("script")?W=function(rt){S.appendChild(A("script"))[V]=function(){S.removeChild(this),_(rt)}}:W=function(rt){setTimeout(k(rt),0)}),x.exports={set:O,clear:P}}),(function(x){var b=TypeError;x.exports=function(n,u){if(n<u)throw new b("Not enough arguments");return n}}),(function(x,b,n){var u=n(28);x.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(u)}),(function(x,b,n){var u=n(4),d=n(380),h=n(84),v=n(376).set,y=n(381),T=n(378),S=n(382),$=n(383),A=n(186),I=u.MutationObserver||u.WebKitMutationObserver,R=u.document,C=u.process,O=u.Promise,P=d("queueMicrotask"),M,L,B,F,z;if(!P){var j=new y,G=function(){var V,X;for(A&&(V=C.domain)&&V.exit();X=j.get();)try{X()}catch(W){throw j.head&&M(),W}V&&V.enter()};!T&&!A&&!$&&I&&R?(L=!0,B=R.createTextNode(""),new I(G).observe(B,{characterData:!0}),M=function(){B.data=L=!L}):!S&&O&&O.resolve?(F=O.resolve(void 0),F.constructor=O,z=h(F.then,F),M=function(){z(G)}):A?M=function(){C.nextTick(G)}:(v=h(v,u),M=function(){v(G)}),P=function(V){j.head||M(),j.add(V)}}x.exports=P}),(function(x,b,n){var u=n(4),d=n(6),h=Object.getOwnPropertyDescriptor;x.exports=function(v){if(!d)return u[v];var y=h(u,v);return y&&y.value}}),(function(x){var b=function(){this.head=null,this.tail=null};b.prototype={add:function(n){var u={item:n,next:null},d=this.tail;d?d.next=u:this.head=u,this.tail=u},get:function(){var n=this.head;if(n){var u=this.head=n.next;return u===null&&(this.tail=null),n.item}}},x.exports=b}),(function(x,b,n){var u=n(28);x.exports=/ipad|iphone|ipod/i.test(u)&&typeof Pebble!="undefined"}),(function(x,b,n){var u=n(28);x.exports=/web0s(?!.*chrome)/i.test(u)}),(function(x){x.exports=function(b,n){try{arguments.length===1?console.error(b):console.error(b,n)}catch(u){}}}),(function(x){x.exports=function(b){try{return{error:!1,value:b()}}catch(n){return{error:!0,value:n}}}}),(function(x,b,n){var u=n(4);x.exports=u.Promise}),(function(x,b,n){var u=n(4),d=n(386),h=n(21),v=n(67),y=n(50),T=n(33),S=n(187),$=n(36),A=n(27),I=d&&d.prototype,R=T("species"),C=!1,O=h(u.PromiseRejectionEvent),P=v("Promise",function(){var M=y(d),L=M!==String(d);if(!L&&A===66||$&&!(I.catch&&I.finally))return!0;if(!A||A<51||!/native code/.test(M)){var B=new d(function(j){j(1)}),F=function(j){j(function(){},function(){})},z=B.constructor={};if(z[R]=F,C=B.then(function(){})instanceof F,!C)return!0}return!L&&(S==="BROWSER"||S==="DENO")&&!O});x.exports={CONSTRUCTOR:P,REJECTION_EVENT:O,SUBCLASSING:C}}),(function(x,b,n){var u=n(30),d=TypeError,h=function(v){var y,T;this.promise=new v(function(S,$){if(y!==void 0||T!==void 0)throw new d("Bad Promise constructor");y=S,T=$}),this.resolve=u(y),this.reject=u(T)};x.exports.f=function(v){return new h(v)}}),(function(x,b,n){var u=n(3),d=n(8),h=n(30),v=n(388),y=n(385),T=n(133),S=n(390);u({target:"Promise",stat:!0,forced:S},{all:function(A){var I=this,R=v.f(I),C=R.resolve,O=R.reject,P=y(function(){var M=h(I.resolve),L=[],B=0,F=1;T(A,function(z){var j=B++,G=!1;F++,d(M,I,z).then(function(V){G||(G=!0,L[j]=V,--F||C(L))},O)}),--F||C(L)});return P.error&&O(P.value),R.promise}})}),(function(x,b,n){var u=n(386),d=n(168),h=n(387).CONSTRUCTOR;x.exports=h||!d(function(v){u.all(v).then(void 0,function(){})})}),(function(x,b,n){var u=n(3),d=n(36),h=n(387).CONSTRUCTOR,v=n(386),y=n(23),T=n(21),S=n(47),$=v&&v.prototype;if(u({target:"Promise",proto:!0,forced:h,real:!0},{catch:function(I){return this.then(void 0,I)}}),!d&&T(v)){var A=y("Promise").prototype.catch;$.catch!==A&&S($,"catch",A,{unsafe:!0})}}),(function(x,b,n){var u=n(3),d=n(8),h=n(30),v=n(388),y=n(385),T=n(133),S=n(390);u({target:"Promise",stat:!0,forced:S},{race:function(A){var I=this,R=v.f(I),C=R.reject,O=y(function(){var P=h(I.resolve);T(A,function(M){d(P,I,M).then(R.resolve,C)})});return O.error&&C(O.value),R.promise}})}),(function(x,b,n){var u=n(3),d=n(388),h=n(387).CONSTRUCTOR;u({target:"Promise",stat:!0,forced:h},{reject:function(y){var T=d.f(this),S=T.reject;return S(y),T.promise}})}),(function(x,b,n){var u=n(3),d=n(23),h=n(36),v=n(386),y=n(387).CONSTRUCTOR,T=n(395),S=d("Promise"),$=h&&!y;u({target:"Promise",stat:!0,forced:h||y},{resolve:function(I){return T($&&this===S?v:this,I)}})}),(function(x,b,n){var u=n(46),d=n(20),h=n(388);x.exports=function(v,y){if(u(v),d(y)&&y.constructor===v)return y;var T=h.f(v),S=T.resolve;return S(y),T.promise}}),(function(x,b,n){var u=n(3),d=n(8),h=n(30),v=n(388),y=n(385),T=n(133),S=n(390);u({target:"Promise",stat:!0,forced:S},{allSettled:function(A){var I=this,R=v.f(I),C=R.resolve,O=R.reject,P=y(function(){var M=h(I.resolve),L=[],B=0,F=1;T(A,function(z){var j=B++,G=!1;F++,d(M,I,z).then(function(V){G||(G=!0,L[j]={status:"fulfilled",value:V},--F||C(L))},function(V){G||(G=!0,L[j]={status:"rejected",reason:V},--F||C(L))})}),--F||C(L)});return P.error&&O(P.value),R.promise}})}),(function(x,b,n){var u=n(3),d=n(8),h=n(30),v=n(23),y=n(388),T=n(385),S=n(133),$=n(390),A="No one promise resolved";u({target:"Promise",stat:!0,forced:$},{any:function(R){var C=this,O=v("AggregateError"),P=y.f(C),M=P.resolve,L=P.reject,B=T(function(){var F=h(C.resolve),z=[],j=0,G=1,V=!1;S(R,function(X){var W=j++,H=!1;G++,d(F,C,X).then(function(Z){H||V||(V=!0,M(Z))},function(Z){H||V||(H=!0,z[W]=Z,--G||L(new O(z,A)))})}),--G||L(new O(z,A))});return B.error&&L(B.value),P.promise}})}),(function(x,b,n){var u=n(3),d=n(36),h=n(386),v=n(7),y=n(23),T=n(21),S=n(374),$=n(395),A=n(47),I=h&&h.prototype,R=!!h&&v(function(){I.finally.call({then:function(){}},function(){})});if(u({target:"Promise",proto:!0,real:!0,forced:R},{finally:function(O){var P=S(this,y("Promise")),M=T(O);return this.then(M?function(L){return $(P,O()).then(function(){return L})}:O,M?function(L){return $(P,O()).then(function(){throw L})}:O)}}),!d&&T(h)){var C=y("Promise").prototype.finally;I.finally!==C&&A(I,"finally",C,{unsafe:!0})}}),(function(x,b,n){var u=n(3),d=n(4),h=n(94),v=n(76),y=n(388),T=n(30),S=n(385),$=d.Promise,A=!1,I=!$||!$.try||S(function(){$.try(function(R){A=R===8},8)}).error||!A;u({target:"Promise",stat:!0,forced:I},{try:function(R){var C=arguments.length>1?v(arguments,1):[],O=y.f(this),P=S(function(){return h(T(R),void 0,C)});return(P.error?O.reject:O.resolve)(P.value),O.promise}})}),(function(x,b,n){var u=n(3),d=n(388);u({target:"Promise",stat:!0},{withResolvers:function(){var v=d.f(this);return{promise:v.promise,resolve:v.resolve,reject:v.reject}}})}),(function(x,b,n){var u=n(3),d=n(402),h=n(7),v=Array.fromAsync,y=!v||h(function(){var T=0;return v.call(function(){return T++,[]},{length:0}),T!==1});u({target:"Array",stat:!0,forced:y},{fromAsync:d})}),(function(x,b,n){var u=n(84),d=n(14),h=n(39),v=n(89),y=n(403),T=n(136),S=n(264),$=n(137),A=n(29),I=n(23),R=n(204),C=n(33),O=n(404),P=n(406).toArray,M=C("asyncIterator"),L=d(R("Array","values")),B=d(L([]).next),F=function(){return new z(this)},z=function(j){this.iterator=L(j)};z.prototype.next=function(){return B(this.iterator)},x.exports=function(G){var V=this,X=arguments.length,W=X>1?arguments[1]:void 0,H=X>2?arguments[2]:void 0;return new(I("Promise"))(function(Z){var _=h(G);W!==void 0&&(W=u(W,H));var k=A(_,M),q=k?void 0:$(_)||F,et=v(V)?new V:[],rt=k?y(_,k):new O(S(T(_,q)));Z(P(rt,W,et))})}}),(function(x,b,n){var u=n(8),d=n(404),h=n(46),v=n(136),y=n(264),T=n(29),S=n(33),$=S("asyncIterator");x.exports=function(A,I){var R=arguments.length<2?T(A,$):I;return R?h(u(R,A)):new d(y(v(A)))}}),(function(x,b,n){var u=n(8),d=n(46),h=n(71),v=n(29),y=n(214),T=n(51),S=n(138),$=n(23),A=n(405),I=n(176),R=$("Promise"),C="AsyncFromSyncIterator",O=T.set,P=T.getterFor(C),M=function(B,F,z,j,G){var V=B.done;R.resolve(B.value).then(function(X){F(I(X,V))},function(X){if(!V&&G)try{S(j,"throw",X)}catch(W){X=W}z(X)})},L=function(F){F.type=C,O(this,F)};L.prototype=y(h(A),{next:function(){var F=P(this);return new R(function(z,j){var G=d(u(F.next,F.iterator));M(G,z,j,F.iterator,!0)})},return:function(){var B=P(this).iterator;return new R(function(F,z){var j=v(B,"return");if(j===void 0)return F(I(void 0,!0));var G=d(u(j,B));M(G,F,z,B)})}}),x.exports=L}),(function(x,b,n){var u=n(4),d=n(35),h=n(21),v=n(71),y=n(131),T=n(47),S=n(33),$=n(36),A="USE_FUNCTION_CONSTRUCTOR",I=S("asyncIterator"),R=u.AsyncIterator,C=d.AsyncIteratorPrototype,O,P;if(C)O=C;else if(h(R))O=R.prototype;else if(d[A]||u[A])try{P=y(y(y(Function("return async function*(){}()")()))),y(P)===Object.prototype&&(O=P)}catch(M){}O?$&&(O=v(O)):O={},h(O[I])||T(O,I,function(){return this}),x.exports=O}),(function(x,b,n){var u=n(8),d=n(30),h=n(46),v=n(20),y=n(144),T=n(23),S=n(264),$=n(407),A=function(I){var R=I===0,C=I===1,O=I===2,P=I===3;return function(M,L,B){h(M);var F=L!==void 0;(F||!R)&&d(L);var z=S(M),j=T("Promise"),G=z.iterator,V=z.next,X=0;return new j(function(W,H){var Z=function(k){$(G,H,k,H)},_=function(){try{if(F)try{y(X)}catch(k){Z(k)}j.resolve(h(u(V,G))).then(function(k){try{if(h(k).done)R?(B.length=X,W(B)):W(P?!1:O||void 0);else{var q=k.value;try{if(F){var et=L(q,X),rt=function(at){if(C)_();else if(O)at?_():$(G,W,!1,H);else if(R)try{B[X++]=at,_()}catch(dt){Z(dt)}else at?$(G,W,P||q,H):_()};v(et)?j.resolve(et).then(rt,Z):rt(et)}else B[X++]=q,_()}catch(at){Z(at)}}}catch(at){H(at)}},H)}catch(k){H(k)}};_()})}};x.exports={toArray:A(0),forEach:A(1),every:A(2),some:A(3),find:A(4)}}),(function(x,b,n){var u=n(8),d=n(23),h=n(29);x.exports=function(v,y,T,S){try{var $=h(v,"return");if($)return d("Promise").resolve(u($,v)).then(function(){y(T)},function(A){S(A)})}catch(A){return S(A)}y(T)}}),(function(x,b,n){var u=n(3),d=n(6),h=n(23),v=n(30),y=n(215),T=n(47),S=n(214),$=n(77),A=n(33),I=n(51),R=n(254),C=n(27),O=h("Promise"),P=h("SuppressedError"),M=ReferenceError,L=A("asyncDispose"),B=A("toStringTag"),F="AsyncDisposableStack",z=I.set,j=I.getterFor(F),G="async-dispose",V="disposed",X="pending",W=function(k){var q=j(k);if(q.state===V)throw new M(F+" already disposed");return q},H=function(){z(y(this,Z),{type:F,state:X,stack:[]}),d||(this.disposed=!1)},Z=H.prototype;S(Z,{disposeAsync:function(){var q=this;return new O(function(et,rt){var at=j(q);if(at.state===V)return et(void 0);at.state=V,d||(q.disposed=!0);var dt=at.stack,xt=dt.length,gt=!1,ht,Mt=function(zt){gt?ht=new P(zt,ht):(gt=!0,ht=zt),$t()},$t=function(){if(xt){var zt=dt[--xt];dt[xt]=null;try{O.resolve(zt()).then($t,Mt)}catch(Ht){Mt(Ht)}}else at.stack=null,gt?rt(ht):et(void 0)};$t()})},use:function(q){return R(W(this),q,G),q},adopt:function(q,et){var rt=W(this);return v(et),R(rt,void 0,G,function(){return et(q)}),q},defer:function(q){var et=W(this);v(q),R(et,void 0,G,q)},move:function(){var q=W(this),et=new H;return j(et).stack=q.stack,q.stack=[],q.state=V,d||(this.disposed=!0),et}}),d&&$(Z,"disposed",{configurable:!0,get:function(){return j(this).state===V}}),T(Z,L,Z.disposeAsync,{name:"disposeAsync"}),T(Z,B,F,{nonWritable:!0});var _=C&&C<136;u({global:!0,constructor:!0,forced:_},{AsyncDisposableStack:H})}),(function(x,b,n){var u=n(8),d=n(47),h=n(23),v=n(29),y=n(38),T=n(33),S=n(405),$=T("asyncDispose"),A=h("Promise");y(S,$)||d(S,$,function(){var I=this;return new A(function(R,C){var O=v(I,"return");O?A.resolve(u(O,I)).then(function(){R(void 0)},C):R(void 0)})})}),(function(x,b,n){var u=n(3),d=n(94),h=n(30),v=n(46),y=n(7),T=!y(function(){Reflect.apply(function(){})});u({target:"Reflect",stat:!0,forced:T},{apply:function($,A,I){return d(h($),A,v(I))}})}),(function(x,b,n){var u=n(3),d=n(23),h=n(94),v=n(257),y=n(375),T=n(46),S=n(20),$=n(71),A=n(7),I=d("Reflect","construct"),R=Object.prototype,C=[].push,O=A(function(){function L(){}return!(I(function(){},[],L)instanceof L)}),P=!A(function(){I(function(){})}),M=O||P;u({target:"Reflect",stat:!0,forced:M,sham:M},{construct:function(B,F){y(B),T(F);var z=arguments.length<3?B:y(arguments[2]);if(P&&!O)return I(B,F,z);if(B===z){switch(F.length){case 0:return new B;case 1:return new B(F[0]);case 2:return new B(F[0],F[1]);case 3:return new B(F[0],F[1],F[2]);case 4:return new B(F[0],F[1],F[2],F[3])}var j=[null];return h(C,j,F),new(h(v,B,j))}var G=z.prototype,V=$(S(G)?G:R),X=h(B,V,F);return S(X)?X:V}})}),(function(x,b,n){var u=n(3),d=n(6),h=n(46),v=n(18),y=n(44),T=n(7),S=T(function(){Reflect.defineProperty(y.f({},1,{value:1}),1,{value:2})});u({target:"Reflect",stat:!0,forced:S,sham:!d},{defineProperty:function(A,I,R){h(A);var C=v(I);h(R);try{return y.f(A,C,R),!0}catch(O){return!1}}})}),(function(x,b,n){var u=n(3),d=n(46),h=n(5).f;u({target:"Reflect",stat:!0},{deleteProperty:function(y,T){var S=h(d(y),T);return S&&!S.configurable?!1:delete y[T]}})}),(function(x,b,n){var u=n(3),d=n(8),h=n(20),v=n(46),y=n(415),T=n(5),S=n(131);function $(A,I){var R=arguments.length<3?A:arguments[2],C,O;if(v(A)===R)return A[I];if(C=T.f(A,I),C)return y(C)?C.value:C.get===void 0?void 0:d(C.get,R);if(h(O=S(A)))return $(O,I,R)}u({target:"Reflect",stat:!0},{get:$})}),(function(x,b,n){var u=n(38);x.exports=function(d){return d!==void 0&&(u(d,"value")||u(d,"writable"))}}),(function(x,b,n){var u=n(3),d=n(6),h=n(46),v=n(5);u({target:"Reflect",stat:!0,sham:!d},{getOwnPropertyDescriptor:function(T,S){return v.f(h(T),S)}})}),(function(x,b,n){var u=n(3),d=n(46),h=n(131),v=n(132);u({target:"Reflect",stat:!0,sham:!v},{getPrototypeOf:function(T){return h(d(T))}})}),(function(x,b,n){var u=n(3);u({target:"Reflect",stat:!0},{has:function(h,v){return v in h}})}),(function(x,b,n){var u=n(3),d=n(46),h=n(288);u({target:"Reflect",stat:!0},{isExtensible:function(y){return d(y),h(y)}})}),(function(x,b,n){var u=n(3),d=n(56);u({target:"Reflect",stat:!0},{ownKeys:d})}),(function(x,b,n){var u=n(3),d=n(23),h=n(46),v=n(290);u({target:"Reflect",stat:!0,sham:!v},{preventExtensions:function(T){h(T);try{var S=d("Object","preventExtensions");return S&&S(T),!0}catch($){return!1}}})}),(function(x,b,n){var u=n(3),d=n(8),h=n(46),v=n(20),y=n(415),T=n(7),S=n(44),$=n(5),A=n(131),I=n(11);function R(O,P,M){var L=arguments.length<4?O:arguments[3],B=$.f(h(O),P),F,z,j;if(!B){if(v(z=A(O)))return R(z,P,M,L);B=I(0)}if(y(B)){if(B.writable===!1||!v(L))return!1;if(F=$.f(L,P)){if(F.get||F.set||F.writable===!1)return!1;F.value=M,S.f(L,P,F)}else S.f(L,P,I(0,M))}else{if(j=B.set,j===void 0)return!1;d(j,L,M)}return!0}var C=T(function(){var O=function(){},P=S.f(new O,"a",{configurable:!0});return Reflect.set(O.prototype,"a",1,P)!==!1});u({target:"Reflect",stat:!0,forced:C},{set:R})}),(function(x,b,n){var u=n(3),d=n(46),h=n(117),v=n(115);v&&u({target:"Reflect",stat:!0},{setPrototypeOf:function(T,S){d(T),h(S);try{return v(T,S),!0}catch($){return!1}}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(82);u({global:!0},{Reflect:{}}),h(d.Reflect,"Reflect",!0)}),(function(x,b,n){var u=n(6),d=n(4),h=n(14),v=n(67),y=n(120),T=n(43),S=n(71),$=n(57).f,A=n(24),I=n(426),R=n(68),C=n(427),O=n(430),P=n(119),M=n(47),L=n(7),B=n(38),F=n(51).enforce,z=n(198),j=n(33),G=n(431),V=n(432),X=j("match"),W=d.RegExp,H=W.prototype,Z=d.SyntaxError,_=h(H.exec),k=h("".charAt),q=h("".replace),et=h("".indexOf),rt=h("".slice),at=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,dt=/a/g,xt=/a/g,gt=new W(dt)!==dt,ht=O.MISSED_STICKY,Mt=O.UNSUPPORTED_Y,$t=u&&(!gt||ht||G||V||L(function(){return xt[X]=!1,W(dt)!==dt||W(xt)===xt||String(W(dt,"i"))!=="/a/i"})),zt=function(te){for(var Nt=te.length,Yt=0,ne="",fe=!1,ee;Yt<=Nt;Yt++){if(ee=k(te,Yt),ee==="\\"){ne+=ee+k(te,++Yt);continue}!fe&&ee==="."?ne+="[\\s\\S]":(ee==="["?fe=!0:ee==="]"&&(fe=!1),ne+=ee)}return ne},Ht=function(te){for(var Nt=te.length,Yt=0,ne="",fe=[],ee=S(null),le=!1,Me=!1,Ne=0,$e="",ae;Yt<=Nt;Yt++){if(ae=k(te,Yt),ae==="\\")ae+=k(te,++Yt);else if(ae==="]")le=!1;else if(!le)switch(!0){case ae==="[":le=!0;break;case ae==="(":if(ne+=ae,rt(te,Yt+1,Yt+3)==="?:")continue;_(at,rt(te,Yt+1))&&(Yt+=2,Me=!0),Ne++;continue;case(ae===">"&&Me):if($e===""||B(ee,$e))throw new Z("Invalid capture group name");ee[$e]=!0,fe[fe.length]=[$e,Ne],Me=!1,$e="";continue}Me?$e+=ae:ne+=ae}return[ne,fe]};if(v("RegExp",$t)){for(var _t=function(Nt,Yt){var ne=A(H,this),fe=I(Nt),ee=Yt===void 0,le=[],Me=Nt,Ne,$e,ae,Ae,xe,ge;if(!ne&&fe&&ee&&Nt.constructor===_t)return Nt;if((fe||A(H,Nt))&&(Nt=Nt.source,ee&&(Yt=C(Me))),Nt=Nt===void 0?"":R(Nt),Yt=Yt===void 0?"":R(Yt),Me=Nt,G&&"dotAll"in dt&&($e=!!Yt&&et(Yt,"s")>-1,$e&&(Yt=q(Yt,/s/g,""))),Ne=Yt,ht&&"sticky"in dt&&(ae=!!Yt&&et(Yt,"y")>-1,ae&&Mt&&(Yt=q(Yt,/y/g,""))),V&&(Ae=Ht(Nt),Nt=Ae[0],le=Ae[1]),xe=y(W(Nt,Yt),ne?this:H,_t),($e||ae||le.length)&&(ge=F(xe),$e&&(ge.dotAll=!0,ge.raw=_t(zt(Nt),Ne)),ae&&(ge.sticky=!0),le.length&&(ge.groups=le)),Nt!==Me)try{T(xe,"source",Me===""?"(?:)":Me)}catch(bt){}return xe},Ee=$(W),ue=0;Ee.length>ue;)P(_t,W,Ee[ue++]);H.constructor=_t,_t.prototype=H,M(d,"RegExp",_t,{constructor:!0})}z("RegExp")}),(function(x,b,n){var u=n(20),d=n(15),h=n(33),v=h("match");x.exports=function(y){var T;return u(y)&&((T=y[v])!==void 0?!!T:d(y)==="RegExp")}}),(function(x,b,n){var u=n(8),d=n(38),h=n(24),v=n(428),y=n(429),T=RegExp.prototype;x.exports=v.correct?function(S){return S.flags}:function(S){return!v.correct&&h(T,S)&&!d(S,"flags")?u(y,S):S.flags}}),(function(x,b,n){var u=n(4),d=n(7),h=u.RegExp,v=!d(function(){var y=!0;try{h(".","d")}catch(O){y=!1}var T={},S="",$=y?"dgimsy":"gimsy",A=function(O,P){Object.defineProperty(T,O,{get:function(){return S+=P,!0}})},I={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};y&&(I.hasIndices="d");for(var R in I)A(R,I[R]);var C=Object.getOwnPropertyDescriptor(h.prototype,"flags").get.call(T);return C!==$||S!==$});x.exports={correct:v}}),(function(x,b,n){var u=n(46);x.exports=function(){var d=u(this),h="";return d.hasIndices&&(h+="d"),d.global&&(h+="g"),d.ignoreCase&&(h+="i"),d.multiline&&(h+="m"),d.dotAll&&(h+="s"),d.unicode&&(h+="u"),d.unicodeSets&&(h+="v"),d.sticky&&(h+="y"),h}}),(function(x,b,n){var u=n(7),d=n(4),h=d.RegExp,v=u(function(){var S=h("a","y");return S.lastIndex=2,S.exec("abcd")!==null}),y=v||u(function(){return!h("a","y").sticky}),T=v||u(function(){var S=h("^r","gy");return S.lastIndex=2,S.exec("str")!==null});x.exports={BROKEN_CARET:T,MISSED_STICKY:y,UNSUPPORTED_Y:v}}),(function(x,b,n){var u=n(7),d=n(4),h=d.RegExp;x.exports=u(function(){var v=h(".","s");return!(v.dotAll&&v.test(`
|
|
28
28
|
`)&&v.flags==="s")})}),(function(x,b,n){var u=n(7),d=n(4),h=d.RegExp;x.exports=u(function(){var v=h("(?<a>b)","g");return v.exec("b").groups.a!=="b"||"b".replace(v,"$<a>c")!=="bc"})}),(function(x,b,n){var u=n(3),d=n(14),h=n(434),v=n(38),y=n(247).start,T=n(320),S=Array,$=RegExp.escape,A=d("".charAt),I=d("".charCodeAt),R=d(1.1.toString),C=d([].join),O=/^[0-9a-z]/i,P=/^[$()*+./?[\\\]^{|}]/,M=RegExp("^[!\"#%&',\\-:;<=>@`~"+T+"]"),L=d(O.exec),B={" ":"t","\n":"n","\v":"v","\f":"f","\r":"r"},F=function(j){var G=R(I(j,0),16);return G.length<3?"\\x"+y(G,2,"0"):"\\u"+y(G,4,"0")},z=!$||$("ab")!=="\\x61b";u({target:"RegExp",stat:!0,forced:z},{escape:function(G){h(G);for(var V=G.length,X=S(V),W=0;W<V;W++){var H=A(G,W);if(W===0&&L(O,H))X[W]=F(H);else if(v(B,H))X[W]="\\"+B[H];else if(L(P,H))X[W]="\\"+H;else if(L(M,H))X[W]=F(H);else{var Z=I(H,0);(Z&63488)!==55296?X[W]=H:Z>=56320||W+1>=V||(I(G,W+1)&64512)!==56320?X[W]=F(H):(X[W]=H,X[++W]=A(G,W))}}return C(X,"")}})}),(function(x){var b=TypeError;x.exports=function(n){if(typeof n=="string")return n;throw new b("Argument is not a string")}}),(function(x,b,n){var u=n(6),d=n(431),h=n(15),v=n(77),y=n(51).get,T=RegExp.prototype,S=TypeError;u&&d&&v(T,"dotAll",{configurable:!0,get:function(){if(this!==T){if(h(this)==="RegExp")return!!y(this).dotAll;throw new S("Incompatible receiver, RegExp required")}}})}),(function(x,b,n){var u=n(3),d=n(437);u({target:"RegExp",proto:!0,forced:/./.exec!==d},{exec:d})}),(function(x,b,n){var u=n(8),d=n(14),h=n(68),v=n(429),y=n(430),T=n(34),S=n(71),$=n(51).get,A=n(431),I=n(432),R=T("native-string-replace",String.prototype.replace),C=RegExp.prototype.exec,O=C,P=d("".charAt),M=d("".indexOf),L=d("".replace),B=d("".slice),F=(function(){var V=/a/,X=/b*/g;return u(C,V,"a"),u(C,X,"a"),V.lastIndex!==0||X.lastIndex!==0})(),z=y.BROKEN_CARET,j=/()??/.exec("")[1]!==void 0,G=F||j||z||A||I;G&&(O=function(X){var W=this,H=$(W),Z=h(X),_=H.raw,k,q,et,rt,at,dt,xt;if(_)return _.lastIndex=W.lastIndex,k=u(O,_,Z),W.lastIndex=_.lastIndex,k;var gt=H.groups,ht=z&&W.sticky,Mt=u(v,W),$t=W.source,zt=0,Ht=Z;if(ht&&(Mt=L(Mt,"y",""),M(Mt,"g")===-1&&(Mt+="g"),Ht=B(Z,W.lastIndex),W.lastIndex>0&&(!W.multiline||W.multiline&&P(Z,W.lastIndex-1)!==`
|
|
29
29
|
`)&&($t="(?: "+$t+")",Ht=" "+Ht,zt++),q=new RegExp("^(?:"+$t+")",Mt)),j&&(q=new RegExp("^"+$t+"$(?!\\s)",Mt)),F&&(et=W.lastIndex),rt=u(C,ht?q:W,Ht),ht?rt?(rt.input=B(rt.input,zt),rt[0]=B(rt[0],zt),rt.index=W.lastIndex,W.lastIndex+=rt[0].length):W.lastIndex=0:F&&rt&&(W.lastIndex=W.global?rt.index+rt[0].length:et),j&&rt&&rt.length>1&&u(R,rt[0],q,function(){for(at=1;at<arguments.length-2;at++)arguments[at]===void 0&&(rt[at]=void 0)}),rt&>)for(rt.groups=dt=S(null),at=0;at<gt.length;at++)xt=gt[at],dt[xt[0]]=rt[xt[1]];return rt}),x.exports=O}),(function(x,b,n){var u=n(6),d=n(77),h=n(428),v=n(429);u&&!h.correct&&(d(RegExp.prototype,"flags",{configurable:!0,get:v}),h.correct=!0)}),(function(x,b,n){var u=n(6),d=n(430).MISSED_STICKY,h=n(15),v=n(77),y=n(51).get,T=RegExp.prototype,S=TypeError;u&&d&&v(T,"sticky",{configurable:!0,get:function(){if(this!==T){if(h(this)==="RegExp")return!!y(this).sticky;throw new S("Incompatible receiver, RegExp required")}}})}),(function(x,b,n){n(436);var u=n(3),d=n(8),h=n(21),v=n(46),y=n(68),T=(function(){var $=!1,A=/[ac]/;return A.exec=function(){return $=!0,/./.exec.apply(this,arguments)},A.test("abc")===!0&&$})(),S=/./.test;u({target:"RegExp",proto:!0,forced:!T},{test:function($){var A=v(this),I=y($),R=A.exec;if(!h(R))return d(S,A,I);var C=d(R,A,I);return C===null?!1:(v(C),!0)}})}),(function(x,b,n){var u=n(49).PROPER,d=n(47),h=n(46),v=n(68),y=n(7),T=n(427),S="toString",$=RegExp.prototype,A=$[S],I=y(function(){return A.call({source:"a",flags:"b"})!=="/a/b"}),R=u&&A.name!==S;(I||R)&&d($,S,function(){var O=h(this),P=v(O.source),M=v(T(O));return"/"+P+"/"+M},{unsafe:!0})}),(function(x,b,n){n(443)}),(function(x,b,n){var u=n(286),d=n(291);u("Set",function(h){return function(){return h(this,arguments.length?arguments[0]:void 0)}},d)}),(function(x,b,n){var u=n(3),d=n(445),h=n(7),v=n(453),y=!v("difference",function(S){return S.size===0}),T=y||h(function(){var S={size:1,has:function(){return!0},keys:function(){var A=0;return{next:function(){var I=A++>1;return $.has(1)&&$.clear(),{done:I,value:2}}}}},$=new Set([1,2,3,4]);return $.difference(S).size!==3});u({target:"Set",proto:!0,real:!0,forced:T},{difference:d})}),(function(x,b,n){var u=n(446),d=n(447),h=n(448),v=n(451),y=n(452),T=n(449),S=n(450),$=d.has,A=d.remove;x.exports=function(R){var C=u(this),O=y(R),P=h(C);return v(C)<=O.size?T(C,function(M){O.includes(M)&&A(P,M)}):S(O.getIterator(),function(M){$(P,M)&&A(P,M)}),P}}),(function(x,b,n){var u=n(447).has;x.exports=function(d){return u(d),d}}),(function(x,b,n){var u=n(14),d=Set.prototype;x.exports={Set,add:u(d.add),has:u(d.has),remove:u(d.delete),proto:d}}),(function(x,b,n){var u=n(447),d=n(449),h=u.Set,v=u.add;x.exports=function(y){var T=new h;return d(y,function(S){v(T,S)}),T}}),(function(x,b,n){var u=n(14),d=n(450),h=n(447),v=h.Set,y=h.proto,T=u(y.forEach),S=u(y.keys),$=S(new v).next;x.exports=function(A,I,R){return R?d({iterator:S(A),next:$},I):T(A,I)}}),(function(x,b,n){var u=n(8);x.exports=function(d,h,v){for(var y=v?d:d.iterator,T=d.next,S,$;!(S=u(T,y)).done;)if($=h(S.value),$!==void 0)return $}}),(function(x,b,n){var u=n(116),d=n(447);x.exports=u(d.proto,"size","get")||function(h){return h.size}}),(function(x,b,n){var u=n(30),d=n(46),h=n(8),v=n(61),y=n(264),T="Invalid size",S=RangeError,$=TypeError,A=Math.max,I=function(R,C){this.set=R,this.size=A(C,0),this.has=u(R.has),this.keys=u(R.keys)};I.prototype={getIterator:function(){return y(d(h(this.keys,this.set)))},includes:function(R){return h(this.has,this.set,R)}},x.exports=function(R){d(R);var C=+R.size;if(C!==C)throw new $(T);var O=v(C);if(O<0)throw new S(T);return new I(R,O)}}),(function(x,b,n){var u=n(23),d=function(v){return{size:v,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},h=function(v){return{size:v,has:function(){return!0},keys:function(){throw new Error("e")}}};x.exports=function(v,y){var T=u("Set");try{new T()[v](d(0));try{return new T()[v](d(-1)),!1}catch($){if(!y)return!0;try{return new T()[v](h(-1/0)),!1}catch(A){var S=new T;return S.add(1),S.add(2),y(S[v](h(1/0)))}}}catch($){return!1}}}),(function(x,b,n){var u=n(3),d=n(7),h=n(455),v=n(453),y=!v("intersection",function(T){return T.size===2&&T.has(1)&&T.has(2)})||d(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});u({target:"Set",proto:!0,real:!0,forced:y},{intersection:h})}),(function(x,b,n){var u=n(446),d=n(447),h=n(451),v=n(452),y=n(449),T=n(450),S=d.Set,$=d.add,A=d.has;x.exports=function(R){var C=u(this),O=v(R),P=new S;return h(C)>O.size?T(O.getIterator(),function(M){A(C,M)&&$(P,M)}):y(C,function(M){O.includes(M)&&$(P,M)}),P}}),(function(x,b,n){var u=n(3),d=n(457),h=n(453),v=!h("isDisjointFrom",function(y){return!y});u({target:"Set",proto:!0,real:!0,forced:v},{isDisjointFrom:d})}),(function(x,b,n){var u=n(446),d=n(447).has,h=n(451),v=n(452),y=n(449),T=n(450),S=n(138);x.exports=function(A){var I=u(this),R=v(A);if(h(I)<=R.size)return y(I,function(O){if(R.includes(O))return!1},!0)!==!1;var C=R.getIterator();return T(C,function(O){if(d(I,O))return S(C,"normal",!1)})!==!1}}),(function(x,b,n){var u=n(3),d=n(459),h=n(453),v=!h("isSubsetOf",function(y){return y});u({target:"Set",proto:!0,real:!0,forced:v},{isSubsetOf:d})}),(function(x,b,n){var u=n(446),d=n(451),h=n(449),v=n(452);x.exports=function(T){var S=u(this),$=v(T);return d(S)>$.size?!1:h(S,function(A){if(!$.includes(A))return!1},!0)!==!1}}),(function(x,b,n){var u=n(3),d=n(461),h=n(453),v=!h("isSupersetOf",function(y){return!y});u({target:"Set",proto:!0,real:!0,forced:v},{isSupersetOf:d})}),(function(x,b,n){var u=n(446),d=n(447).has,h=n(451),v=n(452),y=n(450),T=n(138);x.exports=function($){var A=u(this),I=v($);if(h(A)<I.size)return!1;var R=I.getIterator();return y(R,function(C){if(!d(A,C))return T(R,"normal",!1)})!==!1}}),(function(x,b,n){var u=n(3),d=n(463),h=n(464),v=n(453),y=!v("symmetricDifference")||!h("symmetricDifference");u({target:"Set",proto:!0,real:!0,forced:y},{symmetricDifference:d})}),(function(x,b,n){var u=n(446),d=n(447),h=n(448),v=n(452),y=n(450),T=d.add,S=d.has,$=d.remove;x.exports=function(I){var R=u(this),C=v(I).getIterator(),O=h(R);return y(C,function(P){S(R,P)?$(O,P):T(O,P)}),O}}),(function(x){x.exports=function(b){try{var n=new Set,u={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return n.clear(),n.add(4),function(){return{done:!0}}}})}},d=n[b](u);return d.size===1&&d.values().next().value===4}catch(h){return!1}}}),(function(x,b,n){var u=n(3),d=n(466),h=n(464),v=n(453),y=!v("union")||!h("union");u({target:"Set",proto:!0,real:!0,forced:y},{union:d})}),(function(x,b,n){var u=n(446),d=n(447).add,h=n(448),v=n(452),y=n(450);x.exports=function(S){var $=u(this),A=v(S).getIterator(),I=h($);return y(A,function(R){d(I,R)}),I}}),(function(x,b,n){var u=n(3),d=n(14),h=n(16),v=n(61),y=n(68),T=n(7),S=d("".charAt),$=T(function(){return"\u{20BB7}".at(-2)!=="\uD842"});u({target:"String",proto:!0,forced:$},{at:function(I){var R=y(h(this)),C=R.length,O=v(I),P=O>=0?O:C+O;return P<0||P>=C?void 0:S(R,P)}})}),(function(x,b,n){var u=n(3),d=n(469).codeAt;u({target:"String",proto:!0},{codePointAt:function(v){return d(this,v)}})}),(function(x,b,n){var u=n(14),d=n(61),h=n(68),v=n(16),y=u("".charAt),T=u("".charCodeAt),S=u("".slice),$=function(A){return function(I,R){var C=h(v(I)),O=d(R),P=C.length,M,L;return O<0||O>=P?A?"":void 0:(M=T(C,O),M<55296||M>56319||O+1===P||(L=T(C,O+1))<56320||L>57343?A?y(C,O):M:A?S(C,O,O+2):(M-55296<<10)+(L-56320)+65536)}};x.exports={codeAt:$(!1),charAt:$(!0)}}),(function(x,b,n){var u=n(3),d=n(85),h=n(5).f,v=n(64),y=n(68),T=n(471),S=n(16),$=n(472),A=n(36),I=d("".slice),R=Math.min,C=$("endsWith"),O=!A&&!C&&!!(function(){var P=h(String.prototype,"endsWith");return P&&!P.writable})();u({target:"String",proto:!0,forced:!O&&!C},{endsWith:function(M){var L=y(S(this));T(M);var B=arguments.length>1?arguments[1]:void 0,F=L.length,z=B===void 0?F:R(v(B),F),j=y(M);return I(L,z-j.length,z)===j}})}),(function(x,b,n){var u=n(426),d=TypeError;x.exports=function(h){if(u(h))throw new d("The method doesn't accept regular expressions");return h}}),(function(x,b,n){var u=n(33),d=u("match");x.exports=function(h){var v=/./;try{"/./"[h](v)}catch(y){try{return v[d]=!1,"/./"[h](v)}catch(T){}}return!1}}),(function(x,b,n){var u=n(3),d=n(14),h=n(60),v=RangeError,y=String.fromCharCode,T=String.fromCodePoint,S=d([].join),$=!!T&&T.length!==1;u({target:"String",stat:!0,arity:1,forced:$},{fromCodePoint:function(I){for(var R=[],C=arguments.length,O=0,P;C>O;){if(P=+arguments[O++],h(P,1114111)!==P)throw new v(P+" is not a valid code point");R[O]=P<65536?y(P):y(((P-=65536)>>10)+55296,P%1024+56320)}return S(R,"")}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(471),v=n(16),y=n(68),T=n(472),S=d("".indexOf);u({target:"String",proto:!0,forced:!T("includes")},{includes:function(A){return!!~S(y(v(this)),y(h(A)),arguments.length>1?arguments[1]:void 0)}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(16),v=n(68),y=d("".charCodeAt);u({target:"String",proto:!0},{isWellFormed:function(){for(var S=v(h(this)),$=S.length,A=0;A<$;A++){var I=y(S,A);if((I&63488)===55296&&(I>=56320||++A>=$||(y(S,A)&64512)!==56320))return!1}return!0}})}),(function(x,b,n){var u=n(469).charAt,d=n(68),h=n(51),v=n(173),y=n(176),T="String Iterator",S=h.set,$=h.getterFor(T);v(String,"String",function(A){S(this,{type:T,string:d(A),index:0})},function(){var I=$(this),R=I.string,C=I.index,O;return C>=R.length?y(void 0,!0):(O=u(R,C),I.index+=O.length,y(O,!1))})}),(function(x,b,n){var u=n(8),d=n(14),h=n(478),v=n(46),y=n(20),T=n(64),S=n(68),$=n(16),A=n(29),I=n(479),R=n(427),C=n(480),O=d("".indexOf);h("match",function(P,M,L){return[function(F){var z=$(this),j=y(F)?A(F,P):void 0;return j?u(j,F,z):new RegExp(F)[P](S(z))},function(B){var F=v(this),z=S(B),j=L(M,F,z);if(j.done)return j.value;var G=S(R(F));if(O(G,"g")===-1)return C(F,z);var V=O(G,"u")!==-1;F.lastIndex=0;for(var X=[],W=0,H;(H=C(F,z))!==null;){var Z=S(H[0]);X[W]=Z,Z===""&&(F.lastIndex=I(z,T(F.lastIndex),V)),W++}return W===0?null:X}]})}),(function(x,b,n){n(436);var u=n(8),d=n(47),h=n(437),v=n(7),y=n(33),T=n(43),S=y("species"),$=RegExp.prototype;x.exports=function(A,I,R,C){var O=y(A),P=!v(function(){var F={};return F[O]=function(){return 7},""[A](F)!==7}),M=P&&!v(function(){var F=!1,z=/a/;return A==="split"&&(z={},z.constructor={},z.constructor[S]=function(){return z},z.flags="",z[O]=/./[O]),z.exec=function(){return F=!0,null},z[O](""),!F});if(!P||!M||R){var L=/./[O],B=I(O,""[A],function(F,z,j,G,V){var X=z.exec;return X===h||X===$.exec?P&&!V?{done:!0,value:u(L,z,j,G)}:{done:!0,value:u(F,j,z,G)}:{done:!1}});d(String.prototype,A,B[0]),d($,O,B[1])}C&&T($[O],"sham",!0)}}),(function(x,b,n){var u=n(469).charAt;x.exports=function(d,h,v){return h+(v?u(d,h).length:1)}}),(function(x,b,n){var u=n(8),d=n(46),h=n(21),v=n(15),y=n(437),T=TypeError;x.exports=function(S,$){var A=S.exec;if(h(A)){var I=u(A,S,$);return I!==null&&d(I),I}if(v(S)==="RegExp")return u(y,S,$);throw new T("RegExp#exec called on incompatible receiver")}}),(function(x,b,n){var u=n(3),d=n(8),h=n(85),v=n(174),y=n(176),T=n(16),S=n(64),$=n(68),A=n(46),I=n(20),R=n(15),C=n(426),O=n(427),P=n(29),M=n(47),L=n(7),B=n(33),F=n(374),z=n(479),j=n(480),G=n(51),V=n(36),X=B("matchAll"),W="RegExp String",H=W+" Iterator",Z=G.set,_=G.getterFor(H),k=RegExp.prototype,q=TypeError,et=h("".indexOf),rt=h("".matchAll),at=!!rt&&!L(function(){rt("a",/./)}),dt=v(function(ht,Mt,$t,zt){Z(this,{type:H,regexp:ht,string:Mt,global:$t,unicode:zt,done:!1})},W,function(){var ht=_(this);if(ht.done)return y(void 0,!0);var Mt=ht.regexp,$t=ht.string,zt=j(Mt,$t);return zt===null?(ht.done=!0,y(void 0,!0)):ht.global?($(zt[0])===""&&(Mt.lastIndex=z($t,S(Mt.lastIndex),ht.unicode)),y(zt,!1)):(ht.done=!0,y(zt,!1))}),xt=function(gt){var ht=A(this),Mt=$(gt),$t=F(ht,RegExp),zt=$(O(ht)),Ht,_t,Ee;return Ht=new $t($t===RegExp?ht.source:ht,zt),_t=!!~et(zt,"g"),Ee=!!~et(zt,"u"),Ht.lastIndex=S(ht.lastIndex),new dt(Ht,Mt,_t,Ee)};u({target:"String",proto:!0,forced:at},{matchAll:function(ht){var Mt=T(this),$t,zt,Ht,_t;if(I(ht)){if(C(ht)&&($t=$(T(O(ht))),!~et($t,"g")))throw new q("`.matchAll` does not allow non-global regexes");if(at)return rt(Mt,ht);if(Ht=P(ht,X),Ht===void 0&&V&&R(ht)==="RegExp"&&(Ht=xt),Ht)return d(Ht,ht,Mt)}else if(at)return rt(Mt,ht);return zt=$(Mt),_t=new RegExp(ht,"g"),V?d(xt,_t,zt):_t[X](zt)}}),V||X in k||M(k,X,xt)}),(function(x,b,n){var u=n(3),d=n(247).end,h=n(483);u({target:"String",proto:!0,forced:h},{padEnd:function(y){return d(this,y,arguments.length>1?arguments[1]:void 0)}})}),(function(x,b,n){var u=n(28);x.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(u)}),(function(x,b,n){var u=n(3),d=n(247).start,h=n(483);u({target:"String",proto:!0,forced:h},{padStart:function(y){return d(this,y,arguments.length>1?arguments[1]:void 0)}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(12),v=n(39),y=n(68),T=n(63),S=d([].push),$=d([].join);u({target:"String",stat:!0},{raw:function(I){var R=h(v(I).raw),C=T(R);if(!C)return"";for(var O=arguments.length,P=[],M=0;;){if(S(P,y(R[M++])),M===C)return $(P,"");M<O&&S(P,y(arguments[M]))}}})}),(function(x,b,n){var u=n(3),d=n(248);u({target:"String",proto:!0},{repeat:d})}),(function(x,b,n){var u=n(94),d=n(8),h=n(14),v=n(478),y=n(7),T=n(46),S=n(21),$=n(20),A=n(61),I=n(64),R=n(68),C=n(16),O=n(479),P=n(29),M=n(488),L=n(427),B=n(480),F=n(33),z=F("replace"),j=Math.max,G=Math.min,V=h([].concat),X=h([].push),W=h("".indexOf),H=h("".slice),Z=function(et){return et===void 0?et:String(et)},_=(function(){return"a".replace(/./,"$0")==="$0"})(),k=(function(){return/./[z]?/./[z]("a","$0")==="":!1})(),q=!y(function(){var et=/./;return et.exec=function(){var rt=[];return rt.groups={a:"7"},rt},"".replace(et,"$<a>")!=="7"});v("replace",function(et,rt,at){var dt=k?"$":"$0";return[function(gt,ht){var Mt=C(this),$t=$(gt)?P(gt,z):void 0;return $t?d($t,gt,Mt,ht):d(rt,R(Mt),gt,ht)},function(xt,gt){var ht=T(this),Mt=R(xt);if(typeof gt=="string"&&W(gt,dt)===-1&&W(gt,"$<")===-1){var $t=at(rt,ht,Mt,gt);if($t.done)return $t.value}var zt=S(gt);zt||(gt=R(gt));var Ht=R(L(ht)),_t=W(Ht,"g")!==-1,Ee;_t&&(Ee=W(Ht,"u")!==-1,ht.lastIndex=0);for(var ue=[],te;te=B(ht,Mt),!(te===null||(X(ue,te),!_t));){var Nt=R(te[0]);Nt===""&&(ht.lastIndex=O(Mt,I(ht.lastIndex),Ee))}for(var Yt="",ne=0,fe=0;fe<ue.length;fe++){te=ue[fe];for(var ee=R(te[0]),le=j(G(A(te.index),Mt.length),0),Me=[],Ne,$e=1;$e<te.length;$e++)X(Me,Z(te[$e]));var ae=te.groups;if(zt){var Ae=V([ee],Me,le,Mt);ae!==void 0&&X(Ae,ae),Ne=R(u(gt,void 0,Ae))}else Ne=M(ee,Mt,le,Me,ae,gt);le>=ne&&(Yt+=H(Mt,ne,le)+Ne,ne=le+ee.length)}return Yt+H(Mt,ne)}]},!q||!_||k)}),(function(x,b,n){var u=n(14),d=n(39),h=Math.floor,v=u("".charAt),y=u("".replace),T=u("".slice),S=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,$=/\$([$&'`]|\d{1,2})/g;x.exports=function(A,I,R,C,O,P){var M=R+A.length,L=C.length,B=$;return O!==void 0&&(O=d(O),B=S),y(P,B,function(F,z){var j;switch(v(z,0)){case"$":return"$";case"&":return A;case"`":return T(I,0,R);case"'":return T(I,M);case"<":j=O[T(z,1,-1)];break;default:var G=+z;if(G===0)return F;if(G>L){var V=h(G/10);return V===0?F:V<=L?C[V-1]===void 0?v(z,1):C[V-1]+v(z,1):F}j=C[G-1]}return j===void 0?"":j})}}),(function(x,b,n){var u=n(3),d=n(8),h=n(14),v=n(16),y=n(21),T=n(20),S=n(426),$=n(68),A=n(29),I=n(427),R=n(488),C=n(33),O=n(36),P=C("replace"),M=TypeError,L=h("".indexOf),B=h("".replace),F=h("".slice),z=Math.max;u({target:"String",proto:!0},{replaceAll:function(G,V){var X=v(this),W,H,Z,_,k,q,et,rt,at,dt,xt=0,gt="";if(T(G)){if(W=S(G),W&&(H=$(v(I(G))),!~L(H,"g")))throw new M("`.replaceAll` does not allow non-global regexes");if(Z=A(G,P),Z)return d(Z,G,X,V);if(O&&W)return B($(X),G,V)}for(_=$(X),k=$(G),q=y(V),q||(V=$(V)),et=k.length,rt=z(1,et),at=L(_,k);at!==-1;)dt=q?$(V(k,at,_)):R(k,_,at,[],void 0,V),gt+=F(_,xt,at)+dt,xt=at+et,at=at+rt>_.length?-1:L(_,k,at+rt);return xt<_.length&&(gt+=F(_,xt)),gt}})}),(function(x,b,n){var u=n(8),d=n(478),h=n(46),v=n(20),y=n(16),T=n(356),S=n(68),$=n(29),A=n(480);d("search",function(I,R,C){return[function(P){var M=y(this),L=v(P)?$(P,I):void 0;return L?u(L,P,M):new RegExp(P)[I](S(M))},function(O){var P=h(this),M=S(O),L=C(R,P,M);if(L.done)return L.value;var B=P.lastIndex;T(B,0)||(P.lastIndex=0);var F=A(P,M);return T(P.lastIndex,B)||(P.lastIndex=B),F===null?-1:F.index}]})}),(function(x,b,n){var u=n(8),d=n(14),h=n(478),v=n(46),y=n(20),T=n(16),S=n(374),$=n(479),A=n(64),I=n(68),R=n(29),C=n(480),O=n(430),P=n(7),M=O.UNSUPPORTED_Y,L=4294967295,B=Math.min,F=d([].push),z=d("".slice),j=!P(function(){var V=/(?:)/,X=V.exec;V.exec=function(){return X.apply(this,arguments)};var W="ab".split(V);return W.length!==2||W[0]!=="a"||W[1]!=="b"}),G="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;h("split",function(V,X,W){var H="0".split(void 0,0).length?function(Z,_){return Z===void 0&&_===0?[]:u(X,this,Z,_)}:X;return[function(_,k){var q=T(this),et=y(_)?R(_,V):void 0;return et?u(et,_,q,k):u(H,I(q),_,k)},function(Z,_){var k=v(this),q=I(Z);if(!G){var et=W(H,k,q,_,H!==X);if(et.done)return et.value}var rt=S(k,RegExp),at=k.unicode,dt=(k.ignoreCase?"i":"")+(k.multiline?"m":"")+(k.unicode?"u":"")+(M?"g":"y"),xt=new rt(M?"^(?:"+k.source+")":k,dt),gt=_===void 0?L:_>>>0;if(gt===0)return[];if(q.length===0)return C(xt,q)===null?[q]:[];for(var ht=0,Mt=0,$t=[];Mt<q.length;){xt.lastIndex=M?0:Mt;var zt=C(xt,M?z(q,Mt):q),Ht;if(zt===null||(Ht=B(A(xt.lastIndex+(M?Mt:0)),q.length))===ht)Mt=$(q,Mt,at);else{if(F($t,z(q,ht,Mt)),$t.length===gt)return $t;for(var _t=1;_t<=zt.length-1;_t++)if(F($t,zt[_t]),$t.length===gt)return $t;Mt=ht=Ht}}return F($t,z(q,ht)),$t}]},G||!j,M)}),(function(x,b,n){var u=n(3),d=n(85),h=n(5).f,v=n(64),y=n(68),T=n(471),S=n(16),$=n(472),A=n(36),I=d("".slice),R=Math.min,C=$("startsWith"),O=!A&&!C&&!!(function(){var P=h(String.prototype,"startsWith");return P&&!P.writable})();u({target:"String",proto:!0,forced:!O&&!C},{startsWith:function(M){var L=y(S(this));T(M);var B=v(R(arguments.length>1?arguments[1]:void 0,L.length)),F=y(M);return I(L,B,B+F.length)===F}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(16),v=n(61),y=n(68),T=d("".slice),S=Math.max,$=Math.min,A=!"".substr||"ab".substr(-1)!=="b";u({target:"String",proto:!0,forced:A},{substr:function(R,C){var O=y(h(this)),P=O.length,M=v(R),L,B;return M===1/0&&(M=0),M<0&&(M=S(P+M,0)),L=C===void 0?P:v(C),L<=0||L===1/0?"":(B=$(M+L,P),M>=B?"":T(O,M,B))}})}),(function(x,b,n){var u=n(3),d=n(8),h=n(14),v=n(16),y=n(68),T=n(7),S=Array,$=h("".charAt),A=h("".charCodeAt),I=h([].join),R="".toWellFormed,C="\uFFFD",O=R&&T(function(){return d(R,1)!=="1"});u({target:"String",proto:!0,forced:O},{toWellFormed:function(){var M=y(v(this));if(O)return d(R,M);for(var L=M.length,B=S(L),F=0;F<L;F++){var z=A(M,F);(z&63488)!==55296?B[F]=$(M,F):z>=56320||F+1>=L||(A(M,F+1)&64512)!==56320?B[F]=C:(B[F]=$(M,F),B[++F]=$(M,F))}return I(B,"")}})}),(function(x,b,n){var u=n(3),d=n(319).trim,h=n(496);u({target:"String",proto:!0,forced:h("trim")},{trim:function(){return d(this)}})}),(function(x,b,n){var u=n(49).PROPER,d=n(7),h=n(320),v="\u200B\x85\u180E";x.exports=function(y){return d(function(){return!!h[y]()||v[y]()!==v||u&&h[y].name!==y})}}),(function(x,b,n){n(498);var u=n(3),d=n(499);u({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==d},{trimEnd:d})}),(function(x,b,n){var u=n(3),d=n(499);u({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==d},{trimRight:d})}),(function(x,b,n){var u=n(319).end,d=n(496);x.exports=d("trimEnd")?function(){return u(this)}:"".trimEnd}),(function(x,b,n){n(501);var u=n(3),d=n(502);u({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==d},{trimStart:d})}),(function(x,b,n){var u=n(3),d=n(502);u({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==d},{trimLeft:d})}),(function(x,b,n){var u=n(319).start,d=n(496);x.exports=d("trimStart")?function(){return u(this)}:"".trimStart}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("anchor")},{anchor:function(y){return d(this,"a","name",y)}})}),(function(x,b,n){var u=n(14),d=n(16),h=n(68),v=/"/g,y=u("".replace);x.exports=function(T,S,$,A){var I=h(d(T)),R="<"+S;return $!==""&&(R+=" "+$+'="'+y(h(A),v,""")+'"'),R+">"+I+"</"+S+">"}}),(function(x,b,n){var u=n(7);x.exports=function(d){return u(function(){var h=""[d]('"');return h!==h.toLowerCase()||h.split('"').length>3})}}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("big")},{big:function(){return d(this,"big","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("blink")},{blink:function(){return d(this,"blink","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("bold")},{bold:function(){return d(this,"b","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("fixed")},{fixed:function(){return d(this,"tt","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("fontcolor")},{fontcolor:function(y){return d(this,"font","color",y)}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("fontsize")},{fontsize:function(y){return d(this,"font","size",y)}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("italics")},{italics:function(){return d(this,"i","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("link")},{link:function(y){return d(this,"a","href",y)}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("small")},{small:function(){return d(this,"small","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("strike")},{strike:function(){return d(this,"strike","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("sub")},{sub:function(){return d(this,"sub","","")}})}),(function(x,b,n){var u=n(3),d=n(504),h=n(505);u({target:"String",proto:!0,forced:h("sup")},{sup:function(){return d(this,"sup","","")}})}),(function(x,b,n){var u=n(519);u("Float32",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(8),v=n(6),y=n(520),T=n(223),S=n(212),$=n(215),A=n(11),I=n(43),R=n(325),C=n(64),O=n(216),P=n(521),M=n(522),L=n(18),B=n(38),F=n(69),z=n(20),j=n(22),G=n(71),V=n(24),X=n(115),W=n(57).f,H=n(523),Z=n(83).forEach,_=n(198),k=n(77),q=n(44),et=n(5),rt=n(203),at=n(51),dt=n(120),xt=at.get,gt=at.set,ht=at.enforce,Mt=q.f,$t=et.f,zt=d.RangeError,Ht=S.ArrayBuffer,_t=Ht.prototype,Ee=S.DataView,ue=T.NATIVE_ARRAY_BUFFER_VIEWS,te=T.TYPED_ARRAY_TAG,Nt=T.TypedArray,Yt=T.TypedArrayPrototype,ne=T.isTypedArray,fe="BYTES_PER_ELEMENT",ee="Wrong length",le=function(Ae,xe){k(Ae,xe,{configurable:!0,get:function(){return xt(this)[xe]}})},Me=function(Ae){var xe;return V(_t,Ae)||(xe=F(Ae))==="ArrayBuffer"||xe==="SharedArrayBuffer"},Ne=function(Ae,xe){return ne(Ae)&&!j(xe)&&xe in Ae&&R(+xe)&&xe>=0},$e=function(xe,ge){return ge=L(ge),Ne(xe,ge)?A(2,xe[ge]):$t(xe,ge)},ae=function(xe,ge,bt){return ge=L(ge),Ne(xe,ge)&&z(bt)&&B(bt,"value")&&!B(bt,"get")&&!B(bt,"set")&&!bt.configurable&&(!B(bt,"writable")||bt.writable)&&(!B(bt,"enumerable")||bt.enumerable)?(xe[ge]=bt.value,xe):Mt(xe,ge,bt)};v?(ue||(et.f=$e,q.f=ae,le(Yt,"buffer"),le(Yt,"byteOffset"),le(Yt,"byteLength"),le(Yt,"length")),u({target:"Object",stat:!0,forced:!ue},{getOwnPropertyDescriptor:$e,defineProperty:ae}),x.exports=function(Ae,xe,ge){var bt=Ae.match(/\d+/)[0]/8,Ut=Ae+(ge?"Clamped":"")+"Array",ie="get"+Ae,Lt="set"+Ae,Jt=d[Ut],Qt=Jt,Gt=Qt&&Qt.prototype,me={},He=function(Pt,Ft){var Et=xt(Pt);return Et.view[ie](Ft*bt+Et.byteOffset,!0)},ft=function(Pt,Ft,Et){var oe=xt(Pt);oe.view[Lt](Ft*bt+oe.byteOffset,ge?M(Et):Et,!0)},Rt=function(Pt,Ft){Mt(Pt,Ft,{get:function(){return He(this,Ft)},set:function(Et){return ft(this,Ft,Et)},enumerable:!0})};ue?y&&(Qt=xe(function(Pt,Ft,Et,oe){return $(Pt,Gt),dt((function(){return z(Ft)?Me(Ft)?oe!==void 0?new Jt(Ft,P(Et,bt),oe):Et!==void 0?new Jt(Ft,P(Et,bt)):new Jt(Ft):ne(Ft)?rt(Qt,Ft):h(H,Qt,Ft):new Jt(O(Ft))})(),Pt,Qt)}),X&&X(Qt,Nt),Z(W(Jt),function(Pt){Pt in Qt||I(Qt,Pt,Jt[Pt])}),Qt.prototype=Gt):(Qt=xe(function(Pt,Ft,Et,oe){$(Pt,Gt);var we=0,It=0,Vt,Xt,Kt;if(!z(Ft))Kt=O(Ft),Xt=Kt*bt,Vt=new Ht(Xt);else if(Me(Ft)){Vt=Ft,It=P(Et,bt);var de=Ft.byteLength;if(oe===void 0){if(de%bt)throw new zt(ee);if(Xt=de-It,Xt<0)throw new zt(ee)}else if(Xt=C(oe)*bt,Xt+It>de)throw new zt(ee);Kt=Xt/bt}else return ne(Ft)?rt(Qt,Ft):h(H,Qt,Ft);for(gt(Pt,{buffer:Vt,byteOffset:It,byteLength:Xt,length:Kt,view:new Ee(Vt)});we<Kt;)Rt(Pt,we++)}),X&&X(Qt,Nt),Gt=Qt.prototype=G(Yt)),Gt.constructor!==Qt&&I(Gt,"constructor",Qt),ht(Gt).TypedArrayConstructor=Qt,te&&I(Gt,te,Ut);var Ct=Qt!==Jt;me[Ut]=Qt,u({global:!0,constructor:!0,forced:Ct,sham:!ue},me),fe in Qt||I(Qt,fe,bt),fe in Gt||I(Gt,fe,bt),_(Ut)}):x.exports=function(){}}),(function(x,b,n){var u=n(4),d=n(7),h=n(168),v=n(223).NATIVE_ARRAY_BUFFER_VIEWS,y=u.ArrayBuffer,T=u.Int8Array;x.exports=!v||!d(function(){T(1)})||!d(function(){new T(-1)})||!h(function(S){new T,new T(null),new T(1.5),new T(S)},!0)||d(function(){return new T(new y(2),1,void 0).length!==1})}),(function(x,b,n){var u=n(266),d=RangeError;x.exports=function(h,v){var y=u(h);if(y%v)throw new d("Wrong offset");return y}}),(function(x){var b=Math.round;x.exports=function(n){var u=b(n);return u<0?0:u>255?255:u&255}}),(function(x,b,n){var u=n(84),d=n(8),h=n(375),v=n(39),y=n(63),T=n(136),S=n(137),$=n(134),A=n(524),I=n(223).aTypedArrayConstructor,R=n(525);x.exports=function(O){var P=h(this),M=v(O),L=arguments.length,B=L>1?arguments[1]:void 0,F=B!==void 0,z=S(M),j,G,V,X,W,H,Z,_;if(z&&!$(z))for(Z=T(M,z),_=Z.next,M=[];!(H=d(_,Z)).done;)M.push(H.value);for(F&&L>2&&(B=u(B,arguments[2])),G=y(M),V=new(I(P))(G),X=A(V),j=0;G>j;j++)W=F?B(M[j],j):M[j],V[j]=X?R(W):+W;return V}}),(function(x,b,n){var u=n(69);x.exports=function(d){var h=u(d);return h==="BigInt64Array"||h==="BigUint64Array"}}),(function(x,b,n){var u=n(19),d=TypeError;x.exports=function(h){var v=u(h,"number");if(typeof v=="number")throw new d("Can't convert number to bigint");return BigInt(v)}}),(function(x,b,n){var u=n(519);u("Float64",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(519);u("Int8",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(519);u("Int16",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(519);u("Int32",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(519);u("Uint8",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(519);u("Uint8",function(d){return function(v,y,T){return d(this,v,y,T)}},!0)}),(function(x,b,n){var u=n(519);u("Uint16",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(519);u("Uint32",function(d){return function(v,y,T){return d(this,v,y,T)}})}),(function(x,b,n){var u=n(223),d=n(63),h=n(61),v=u.aTypedArray,y=u.exportTypedArrayMethod;y("at",function(S){var $=v(this),A=d($),I=h(S),R=I>=0?I:A+I;return R<0||R>=A?void 0:$[R]})}),(function(x,b,n){var u=n(14),d=n(223),h=n(148),v=u(h),y=d.aTypedArray,T=d.exportTypedArrayMethod;T("copyWithin",function($,A){return v(y(this),$,A,arguments.length>2?arguments[2]:void 0)})}),(function(x,b,n){var u=n(223),d=n(83).every,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("every",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(153),h=n(525),v=n(69),y=n(8),T=n(14),S=n(7),$=u.aTypedArray,A=u.exportTypedArrayMethod,I=T("".slice),R=S(function(){var C=0;return new Int8Array(2).fill({valueOf:function(){return C++}}),C!==1});A("fill",function(O){var P=arguments.length;$(this);var M=I(v(this),0,3)==="Big"?h(O):+O;return y(d,this,M,P>1?arguments[1]:void 0,P>2?arguments[2]:void 0)},R)}),(function(x,b,n){var u=n(223),d=n(83).filter,h=n(539),v=u.aTypedArray,y=u.exportTypedArrayMethod;y("filter",function(S){var $=d(v(this),S,arguments.length>1?arguments[1]:void 0);return h(this,$)})}),(function(x,b,n){var u=n(203),d=n(223).getTypedArrayConstructor;x.exports=function(h,v){return u(d(h),v)}}),(function(x,b,n){var u=n(223),d=n(83).find,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("find",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(83).findIndex,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("findIndex",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(158).findLast,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("findLast",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(158).findLastIndex,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("findLastIndex",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(83).forEach,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("forEach",function(T){d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(520),d=n(223).exportTypedArrayStaticMethod,h=n(523);d("from",h,u)}),(function(x,b,n){var u=n(223),d=n(59).includes,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("includes",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(59).indexOf,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("indexOf",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(4),d=n(7),h=n(14),v=n(223),y=n(172),T=n(33),S=T("iterator"),$=u.Uint8Array,A=h(y.values),I=h(y.keys),R=h(y.entries),C=v.aTypedArray,O=v.exportTypedArrayMethod,P=$&&$.prototype,M=!d(function(){P[S].call([1])}),L=!!P&&P.values&&P[S]===P.values&&P.values.name==="values",B=function(){return A(C(this))};O("entries",function(){return R(C(this))},M),O("keys",function(){return I(C(this))},M),O("values",B,M||!L,{name:"values"}),O(S,B,M||!L,{name:"values"})}),(function(x,b,n){var u=n(223),d=n(14),h=u.aTypedArray,v=u.exportTypedArrayMethod,y=d([].join);v("join",function(S){return y(h(this),S)})}),(function(x,b,n){var u=n(223),d=n(94),h=n(179),v=u.aTypedArray,y=u.exportTypedArrayMethod;y("lastIndexOf",function(S){var $=arguments.length;return d(h,v(this),$>1?[S,arguments[1]]:[S])})}),(function(x,b,n){var u=n(223),d=n(83).map,h=u.aTypedArray,v=u.getTypedArrayConstructor,y=u.exportTypedArrayMethod;y("map",function(S){return d(h(this),S,arguments.length>1?arguments[1]:void 0,function($,A){return new(v($))(A)})})}),(function(x,b,n){var u=n(223),d=n(520),h=u.aTypedArrayConstructor,v=u.exportTypedArrayStaticMethod;v("of",function(){for(var T=0,S=arguments.length,$=new(h(this))(S);S>T;)$[T]=arguments[T++];return $},d)}),(function(x,b,n){var u=n(223),d=n(185).left,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("reduce",function(T){var S=arguments.length;return d(h(this),T,S,S>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=n(185).right,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("reduceRight",function(T){var S=arguments.length;return d(h(this),T,S,S>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(223),d=u.aTypedArray,h=u.exportTypedArrayMethod,v=Math.floor;h("reverse",function(){for(var T=this,S=d(T).length,$=v(S/2),A=0,I;A<$;)I=T[A],T[A++]=T[--S],T[S]=I;return T})}),(function(x,b,n){var u=n(4),d=n(8),h=n(223),v=n(63),y=n(521),T=n(39),S=n(7),$=u.RangeError,A=u.Int8Array,I=A&&A.prototype,R=I&&I.set,C=h.aTypedArray,O=h.exportTypedArrayMethod,P=!S(function(){var L=new Uint8ClampedArray(2);return d(R,L,{length:1,0:3},1),L[1]!==3}),M=P&&h.NATIVE_ARRAY_BUFFER_VIEWS&&S(function(){var L=new A(2);return L.set(1),L.set("2",1),L[0]!==0||L[1]!==2});O("set",function(B){C(this);var F=y(arguments.length>1?arguments[1]:void 0,1),z=T(B);if(P)return d(R,this,z,F);var j=this.length,G=v(z),V=0;if(G+F>j)throw new $("Wrong length");for(;V<G;)this[F+V]=z[V++]},!P||M)}),(function(x,b,n){var u=n(223),d=n(7),h=n(76),v=u.aTypedArray,y=u.getTypedArrayConstructor,T=u.exportTypedArrayMethod,S=d(function(){new Int8Array(1).slice()});T("slice",function(A,I){for(var R=h(v(this),A,I),C=y(this),O=0,P=R.length,M=new C(P);P>O;)M[O]=R[O++];return M},S)}),(function(x,b,n){var u=n(223),d=n(83).some,h=u.aTypedArray,v=u.exportTypedArrayMethod;v("some",function(T){return d(h(this),T,arguments.length>1?arguments[1]:void 0)})}),(function(x,b,n){var u=n(4),d=n(85),h=n(7),v=n(30),y=n(193),T=n(223),S=n(194),$=n(195),A=n(27),I=n(196),R=T.aTypedArray,C=T.exportTypedArrayMethod,O=u.Uint16Array,P=O&&d(O.prototype.sort),M=!!P&&!(h(function(){P(new O(2),null)})&&h(function(){P(new O(2),{})})),L=!!P&&!h(function(){if(A)return A<74;if(S)return S<67;if($)return!0;if(I)return I<602;var F=new O(516),z=Array(516),j,G;for(j=0;j<516;j++)G=j%4,F[j]=515-j,z[j]=j-2*G+3;for(P(F,function(V,X){return(V/4|0)-(X/4|0)}),j=0;j<516;j++)if(F[j]!==z[j])return!0}),B=function(F){return function(z,j){return F!==void 0?+F(z,j)||0:j!==j?-1:z!==z?1:z===0&&j===0?1/z>0&&1/j<0?1:-1:z>j}};C("sort",function(z){return z!==void 0&&v(z),L?P(this,z):y(R(this),B(z))},!L||M)}),(function(x,b,n){var u=n(223),d=n(64),h=n(60),v=u.aTypedArray,y=u.getTypedArrayConstructor,T=u.exportTypedArrayMethod;T("subarray",function($,A){var I=v(this),R=I.length,C=h($,R),O=y(I);return new O(I.buffer,I.byteOffset+C*I.BYTES_PER_ELEMENT,d((A===void 0?R:h(A,R))-C))})}),(function(x,b,n){var u=n(4),d=n(94),h=n(223),v=n(7),y=n(76),T=u.Int8Array,S=h.aTypedArray,$=h.exportTypedArrayMethod,A=[].toLocaleString,I=!!T&&v(function(){A.call(new T(1))}),R=v(function(){return[1,2].toLocaleString()!==new T([1,2]).toLocaleString()})||!v(function(){T.prototype.toLocaleString.call([1,2])});$("toLocaleString",function(){return d(A,I?y(S(this)):S(this),y(arguments))},R)}),(function(x,b,n){var u=n(201),d=n(223),h=d.aTypedArray,v=d.exportTypedArrayMethod,y=d.getTypedArrayConstructor;v("toReversed",function(){return u(h(this),y(this))})}),(function(x,b,n){var u=n(223),d=n(14),h=n(30),v=n(203),y=u.aTypedArray,T=u.getTypedArrayConstructor,S=u.exportTypedArrayMethod,$=d(u.TypedArrayPrototype.sort);S("toSorted",function(I){I!==void 0&&h(I);var R=y(this),C=v(T(R),R);return $(C,I)})}),(function(x,b,n){var u=n(223).exportTypedArrayMethod,d=n(7),h=n(4),v=n(14),y=h.Uint8Array,T=y&&y.prototype||{},S=[].toString,$=v([].join);d(function(){S.call({})})&&(S=function(){return $(this)});var A=T.toString!==S;u("toString",S,A)}),(function(x,b,n){var u=n(210),d=n(223),h=n(524),v=n(61),y=n(525),T=d.aTypedArray,S=d.getTypedArrayConstructor,$=d.exportTypedArrayMethod,A=(function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(R){return R===8}})(),I=A&&(function(){try{new Int8Array(1).with(-.5,1)}catch(R){return!0}})();$("with",function(R,C){var O=T(this),P=v(R),M=h(O)?y(C):+C;return u(O,S(O),P,M)},!A||I)}),(function(x,b,n){var u=n(3),d=n(4),h=n(203),v=n(567),y=d.Uint8Array,T=!y||!y.fromBase64||!(function(){try{y.fromBase64("a");return}catch(S){}try{y.fromBase64("",null)}catch(S){return!0}})();y&&u({target:"Uint8Array",stat:!0,forced:T},{fromBase64:function($){var A=v($,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return h(y,A.bytes)}})}),(function(x,b,n){var u=n(4),d=n(14),h=n(568),v=n(434),y=n(38),T=n(569),S=n(570),$=n(236),A=T.c2i,I=T.c2iUrl,R=u.SyntaxError,C=u.TypeError,O=d("".charAt),P=function(B,F){for(var z=B.length;F<z;F++){var j=O(B,F);if(j!==" "&&j!==" "&&j!==`
|
|
30
|
-
`&&j!=="\f"&&j!=="\r")break}return F},M=function(B,F,z){var j=B.length;j<4&&(B+=j===2?"AA":"A");var G=(F[O(B,0)]<<18)+(F[O(B,1)]<<12)+(F[O(B,2)]<<6)+F[O(B,3)],V=[G>>16&255,G>>8&255,G&255];if(j===2){if(z&&V[1]!==0)throw new R("Extra bits");return[V[0]]}if(j===3){if(z&&V[2]!==0)throw new R("Extra bits");return[V[0],V[1]]}return V},L=function(B,F,z){for(var j=F.length,G=0;G<j;G++)B[z+G]=F[G];return z+j};x.exports=function(B,F,z,j){v(B),h(F);var G=S(F)==="base64"?A:I,V=F?F.lastChunkHandling:void 0;if(V===void 0&&(V="loose"),V!=="loose"&&V!=="strict"&&V!=="stop-before-partial")throw new C("Incorrect `lastChunkHandling` option");z&&$(z.buffer);var X=B.length,W=z||[],H=0,Z=0,_="",k=0;if(j)for(;;){if(k=P(B,k),k===X){if(_.length>0){if(V==="stop-before-partial")break;if(V==="loose"){if(_.length===1)throw new R("Malformed padding: exactly one additional character");H=L(W,M(_,G,!1),H)}else throw new R("Missing padding")}Z=X;break}var q=O(B,k);if(++k,q==="="){if(_.length<2)throw new R("Padding is too early");if(k=P(B,k),_.length===2){if(k===X){if(V==="stop-before-partial")break;throw new R("Malformed padding: only one =")}O(B,k)==="="&&(++k,k=P(B,k))}if(k<X)throw new R("Unexpected character after padding");H=L(W,M(_,G,V==="strict"),H),Z=X;break}if(!y(G,q))throw new R("Unexpected character");var et=j-H;if(et===1&&_.length===2||et===2&&_.length===3||(_+=q,_.length===4&&(H=L(W,M(_,G,!1),H),_="",Z=k,H===j)))break}return{bytes:W,read:Z,written:H}}}),(function(x,b,n){var u=n(20),d=String,h=TypeError;x.exports=function(v){if(v===void 0||u(v))return v;throw new h(d(v)+" is not an object or undefined")}}),(function(x){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=b+"+/",u=b+"-_",d=function(h){for(var v={},y=0;y<64;y++)v[h.charAt(y)]=y;return v};x.exports={i2c:n,c2i:d(n),i2cUrl:u,c2iUrl:d(u)}}),(function(x){var b=TypeError;x.exports=function(n){var u=n&&n.alphabet;if(u===void 0||u==="base64"||u==="base64url")return u||"base64";throw new b("Incorrect `alphabet` option")}}),(function(x,b,n){var u=n(3),d=n(4),h=n(434),v=n(572);d.Uint8Array&&u({target:"Uint8Array",stat:!0},{fromHex:function(T){return v(h(T)).bytes}})}),(function(x,b,n){var u=n(4),d=n(14),h=u.Uint8Array,v=u.SyntaxError,y=u.parseInt,T=Math.min,S=/[^\da-f]/i,$=d(S.exec),A=d("".slice);x.exports=function(I,R){var C=I.length;if(C%2!==0)throw new v("String should be an even number of characters");for(var O=R?T(R.length,C/2):C/2,P=R||new h(O),M=0,L=0;L<O;){var B=A(I,M,M+=2);if($(S,B))throw new v("String should only contain hex characters");P[L++]=y(B,16)}return{bytes:P,read:M}}}),(function(x,b,n){var u=n(3),d=n(4),h=n(567),v=n(574),y=d.Uint8Array,T=!y||!y.prototype.setFromBase64||!(function(){var S=new y([255,255,255,255,255]);try{S.setFromBase64("",null);return}catch($){}try{S.setFromBase64("a");return}catch($){}try{S.setFromBase64("MjYyZg===")}catch($){return S[0]===50&&S[1]===54&&S[2]===50&&S[3]===255&&S[4]===255}})();y&&u({target:"Uint8Array",proto:!0,forced:T},{setFromBase64:function($){v(this);var A=h($,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:A.read,written:A.written}}})}),(function(x,b,n){var u=n(69),d=TypeError;x.exports=function(h){if(u(h)==="Uint8Array")return h;throw new d("Argument is not an Uint8Array")}}),(function(x,b,n){var u=n(3),d=n(4),h=n(434),v=n(574),y=n(236),T=n(572);d.Uint8Array&&u({target:"Uint8Array",proto:!0},{setFromHex:function($){v(this),h($),y(this.buffer);var A=T($,this).read;return{read:A,written:A/2}}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(14),v=n(568),y=n(574),T=n(236),S=n(569),$=n(570),A=S.i2c,I=S.i2cUrl,R=h("".charAt),C=d.Uint8Array,O=!C||!C.prototype.toBase64||!(function(){try{var P=new C;P.toBase64(null)}catch(M){return!0}})();C&&u({target:"Uint8Array",proto:!0,forced:O},{toBase64:function(){var M=y(this),L=arguments.length?v(arguments[0]):void 0,B=$(L)==="base64"?A:I,F=!!L&&!!L.omitPadding;T(this.buffer);for(var z="",j=0,G=M.length,V,X=function(W){return R(B,V>>6*W&63)};j+2<G;j+=3)V=(M[j]<<16)+(M[j+1]<<8)+M[j+2],z+=X(3)+X(2)+X(1)+X(0);return j+2===G?(V=(M[j]<<16)+(M[j+1]<<8),z+=X(3)+X(2)+X(1)+(F?"":"=")):j+1===G&&(V=M[j]<<16,z+=X(3)+X(2)+(F?"":"==")),z}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(14),v=n(574),y=n(236),T=h(1.1.toString),S=d.Uint8Array,$=!S||!S.prototype.toHex||!(function(){try{var A=new S([255,255,255,255,255,255,255,255]);return A.toHex()==="ffffffffffffffff"}catch(I){return!1}})();S&&u({target:"Uint8Array",proto:!0,forced:$},{toHex:function(){v(this),y(this.buffer);for(var I="",R=0,C=this.length;R<C;R++){var O=T(this[R],16);I+=O.length===1?"0"+O:O}return I}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(68),v=String.fromCharCode,y=d("".charAt),T=d(/./.exec),S=d("".slice),$=/^[\da-f]{2}$/i,A=/^[\da-f]{4}$/i;u({global:!0},{unescape:function(R){for(var C=h(R),O="",P=C.length,M=0,L,B;M<P;){if(L=y(C,M++),L==="%"){if(y(C,M)==="u"){if(B=S(C,M+1,M+5),T(A,B)){O+=v(parseInt(B,16)),M+=5;continue}}else if(B=S(C,M,M+2),T($,B)){O+=v(parseInt(B,16)),M+=2;continue}}O+=L}return O}})}),(function(x,b,n){n(580)}),(function(x,b,n){var u=n(290),d=n(4),h=n(14),v=n(214),y=n(287),T=n(286),S=n(581),$=n(20),A=n(51).enforce,I=n(7),R=n(52),C=Object,O=Array.isArray,P=C.isExtensible,M=C.isFrozen,L=C.isSealed,B=C.freeze,F=C.seal,z=!d.ActiveXObject&&"ActiveXObject"in d,j,G=function(q){return function(){return q(this,arguments.length?arguments[0]:void 0)}},V=T("WeakMap",G,S),X=V.prototype,W=h(X.set),H=function(){return u&&I(function(){var q=B([]);return W(new V,q,1),!M(q)})};if(R)if(z){j=S.getConstructor(G,"WeakMap",!0),y.enable();var Z=h(X.delete),_=h(X.has),k=h(X.get);v(X,{delete:function(q){if($(q)&&!P(q)){var et=A(this);return et.frozen||(et.frozen=new j),Z(this,q)||et.frozen.delete(q)}return Z(this,q)},has:function(et){if($(et)&&!P(et)){var rt=A(this);return rt.frozen||(rt.frozen=new j),_(this,et)||rt.frozen.has(et)}return _(this,et)},get:function(et){if($(et)&&!P(et)){var rt=A(this);return rt.frozen||(rt.frozen=new j),_(this,et)?k(this,et):rt.frozen.get(et)}return k(this,et)},set:function(et,rt){if($(et)&&!P(et)){var at=A(this);at.frozen||(at.frozen=new j),_(this,et)?W(this,et,rt):at.frozen.set(et,rt)}else W(this,et,rt);return this}})}else H()&&v(X,{set:function(et,rt){var at;return O(et)&&(M(et)?at=B:L(et)&&(at=F)),W(this,et,rt),at&&at(et),this}})}),(function(x,b,n){var u=n(14),d=n(214),h=n(287).getWeakData,v=n(215),y=n(46),T=n(17),S=n(20),$=n(133),A=n(83),I=n(38),R=n(51),C=R.set,O=R.getterFor,P=A.find,M=A.findIndex,L=u([].splice),B=0,F=function(G){return G.frozen||(G.frozen=new z)},z=function(){this.entries=[]},j=function(G,V){return P(G.entries,function(X){return X[0]===V})};z.prototype={get:function(G){var V=j(this,G);if(V)return V[1]},has:function(G){return!!j(this,G)},set:function(G,V){var X=j(this,G);X?X[1]=V:this.entries.push([G,V])},delete:function(G){var V=M(this.entries,function(X){return X[0]===G});return~V&&L(this.entries,V,1),!!~V}},x.exports={getConstructor:function(G,V,X,W){var H=G(function(q,et){v(q,Z),C(q,{type:V,id:B++,frozen:null}),T(et)||$(et,q[W],{that:q,AS_ENTRIES:X})}),Z=H.prototype,_=O(V),k=function(q,et,rt){var at=_(q),dt=h(y(et),!0);return dt===!0?F(at).set(et,rt):dt[at.id]=rt,q};return d(Z,{delete:function(q){var et=_(this);if(!S(q))return!1;var rt=h(q);return rt===!0?F(et).delete(q):rt&&I(rt,et.id)&&delete rt[et.id]},has:function(et){var rt=_(this);if(!S(et))return!1;var at=h(et);return at===!0?F(rt).has(et):at&&I(at,rt.id)}}),d(Z,X?{get:function(et){var rt=_(this);if(S(et)){var at=h(et);if(at===!0)return F(rt).get(et);if(at)return at[rt.id]}},set:function(et,rt){return k(this,et,rt)}}:{add:function(et){return k(this,et,!0)}}),H}}}),(function(x,b,n){n(583)}),(function(x,b,n){var u=n(286),d=n(581);u("WeakSet",function(h){return function(){return h(this,arguments.length?arguments[0]:void 0)}},d)}),(function(x,b,n){var u=n(3),d=n(4),h=n(23),v=n(14),y=n(8),T=n(7),S=n(68),$=n(377),A=n(569).c2i,I=/[^\d+/a-z]/i,R=/[\t\n\f\r ]+/g,C=/[=]{1,2}$/,O=h("atob"),P=String.fromCharCode,M=v("".charAt),L=v("".replace),B=v(I.exec),F=!!O&&!T(function(){return O("aGk=")!=="hi"}),z=F&&T(function(){return O(" ")!==""}),j=F&&!T(function(){O("a")}),G=F&&!T(function(){O()}),V=F&&O.length!==1,X=!F||z||j||G||V;u({global:!0,bind:!0,enumerable:!0,forced:X},{atob:function(H){if($(arguments.length,1),F&&!z&&!j)return y(O,d,H);var Z=L(S(H),R,""),_="",k=0,q=0,et,rt,at;if(Z.length%4===0&&(Z=L(Z,C,"")),et=Z.length,et%4===1||B(I,Z))throw new(h("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;k<et;)rt=M(Z,k++),at=q%4?at*64+A[rt]:A[rt],q++%4&&(_+=P(255&at>>(-2*q&6)));return _}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(23),v=n(14),y=n(8),T=n(7),S=n(68),$=n(377),A=n(569).i2c,I=h("btoa"),R=v("".charAt),C=v("".charCodeAt),O=!!I&&!T(function(){return I("hi")!=="aGk="}),P=O&&!T(function(){I()}),M=O&&T(function(){return I(null)!=="bnVsbA=="}),L=O&&I.length!==1;u({global:!0,bind:!0,enumerable:!0,forced:!O||P||M||L},{btoa:function(F){if($(arguments.length,1),O)return y(I,d,S(F));for(var z=S(F),j="",G=0,V=A,X,W;R(z,G)||(V="=",G%1);){if(W=C(z,G+=.75),W>255)throw new(h("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");X=X<<8|W,j+=R(V,63&X>>8-G%1*8)}return j}})}),(function(x,b,n){var u=n(4),d=n(587),h=n(588),v=n(164),y=n(43),T=function($){if($&&$.forEach!==v)try{y($,"forEach",v)}catch(A){$.forEach=v}};for(var S in d)d[S]&&T(u[S]&&u[S].prototype);T(h)}),(function(x){x.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),(function(x,b,n){var u=n(42),d=u("span").classList,h=d&&d.constructor&&d.constructor.prototype;x.exports=h===Object.prototype?void 0:h}),(function(x,b,n){var u=n(4),d=n(587),h=n(588),v=n(172),y=n(43),T=n(82),S=n(33),$=S("iterator"),A=v.values,I=function(C,O){if(C){if(C[$]!==A)try{y(C,$,A)}catch(M){C[$]=A}if(T(C,O,!0),d[O]){for(var P in v)if(C[P]!==v[P])try{y(C,P,v[P])}catch(M){C[P]=v[P]}}}};for(var R in d)I(u[R]&&u[R].prototype,R);I(h,"DOMTokenList")}),(function(x,b,n){var u=n(3),d=n(23),h=n(238),v=n(7),y=n(71),T=n(11),S=n(44).f,$=n(47),A=n(77),I=n(38),R=n(215),C=n(46),O=n(128),P=n(121),M=n(591),L=n(124),B=n(51),F=n(6),z=n(36),j="DOMException",G="DATA_CLONE_ERR",V=d("Error"),X=d(j)||(function(){try{var Nt=d("MessageChannel")||h("worker_threads").MessageChannel;new Nt().port1.postMessage(new WeakMap)}catch(Yt){if(Yt.name===G&&Yt.code===25)return Yt.constructor}})(),W=X&&X.prototype,H=V.prototype,Z=B.set,_=B.getterFor(j),k="stack"in new V(j),q=function(Nt){return I(M,Nt)&&M[Nt].m?M[Nt].c:0},et=function(){R(this,rt);var Yt=arguments.length,ne=P(Yt<1?void 0:arguments[0]),fe=P(Yt<2?void 0:arguments[1],"Error"),ee=q(fe);if(Z(this,{type:j,name:fe,message:ne,code:ee}),F||(this.name=fe,this.message=ne,this.code=ee),k){var le=new V(ne);le.name=j,S(this,"stack",T(1,L(le.stack,1)))}},rt=et.prototype=y(H),at=function(Nt){return{enumerable:!0,configurable:!0,get:Nt}},dt=function(Nt){return at(function(){return _(this)[Nt]})};F&&(A(rt,"code",dt("code")),A(rt,"message",dt("message")),A(rt,"name",dt("name"))),S(rt,"constructor",T(1,et));var xt=v(function(){return!(new X instanceof V)}),gt=xt||v(function(){return H.toString!==O||String(new X(1,2))!=="2: 1"}),ht=xt||v(function(){return new X(1,"DataCloneError").code!==25}),Mt=xt||X[G]!==25||W[G]!==25,$t=z?gt||ht||Mt:xt;u({global:!0,constructor:!0,forced:$t},{DOMException:$t?et:X});var zt=d(j),Ht=zt.prototype;gt&&(z||X===zt)&&$(Ht,"toString",O),ht&&F&&X===zt&&A(Ht,"code",at(function(){return q(C(this).name)}));for(var _t in M)if(I(M,_t)){var Ee=M[_t],ue=Ee.s,te=T(6,Ee.c);I(zt,ue)||S(zt,ue,te),I(Ht,ue)||S(Ht,ue,te)}}),(function(x){x.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}}),(function(x,b,n){var u=n(3),d=n(4),h=n(23),v=n(11),y=n(44).f,T=n(38),S=n(215),$=n(120),A=n(121),I=n(591),R=n(124),C=n(6),O=n(36),P="DOMException",M=h("Error"),L=h(P),B=function(){S(this,F);var et=arguments.length,rt=A(et<1?void 0:arguments[0]),at=A(et<2?void 0:arguments[1],"Error"),dt=new L(rt,at),xt=new M(rt);return xt.name=P,y(dt,"stack",v(1,R(xt.stack,1))),$(dt,this,B),dt},F=B.prototype=L.prototype,z="stack"in new M(P),j="stack"in new L(1,2),G=L&&C&&Object.getOwnPropertyDescriptor(d,P),V=!!G&&!(G.writable&&G.configurable),X=z&&!V&&!j;u({global:!0,constructor:!0,forced:O||X},{DOMException:X?B:L});var W=h(P),H=W.prototype;if(H.constructor!==W){O||y(H,"constructor",v(1,W));for(var Z in I)if(T(I,Z)){var _=I[Z],k=_.s;T(W,k)||y(W,k,v(6,_.c))}}}),(function(x,b,n){var u=n(23),d=n(82),h="DOMException";d(u(h),h)}),(function(x,b,n){n(595),n(596)}),(function(x,b,n){var u=n(3),d=n(4),h=n(376).clear;u({global:!0,bind:!0,enumerable:!0,forced:d.clearImmediate!==h},{clearImmediate:h})}),(function(x,b,n){var u=n(3),d=n(4),h=n(376).set,v=n(597),y=d.setImmediate?v(h,!1):h;u({global:!0,bind:!0,enumerable:!0,forced:d.setImmediate!==y},{setImmediate:y})}),(function(x,b,n){var u=n(4),d=n(94),h=n(21),v=n(187),y=n(28),T=n(76),S=n(377),$=u.Function,A=/MSIE .\./.test(y)||v==="BUN"&&(function(){var I=u.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")})();x.exports=function(I,R){var C=R?2:1;return A?function(O,P){var M=S(arguments.length,1)>C,L=h(O)?O:$(O),B=M?T(arguments,C):[],F=M?function(){d(L,this,B)}:L;return R?I(F,P):I(F)}:I}}),(function(x,b,n){var u=n(3),d=n(4),h=n(379),v=n(30),y=n(377),T=n(7),S=n(6),$=T(function(){return S&&Object.getOwnPropertyDescriptor(d,"queueMicrotask").value.length!==1});u({global:!0,enumerable:!0,dontCallGetSet:!0,forced:$},{queueMicrotask:function(I){y(arguments.length,1),h(v(I))}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(77),v=n(6),y=TypeError,T=Object.defineProperty,S=d.self!==d;try{if(v){var $=Object.getOwnPropertyDescriptor(d,"self");(S||!$||!$.get||!$.enumerable)&&h(d,"self",{get:function(){return d},set:function(I){if(this!==d)throw new y("Illegal invocation");T(d,"self",{value:I,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else u({global:!0,simple:!0,forced:S},{self:d})}catch(A){}}),(function(x,b,n){var u=n(36),d=n(3),h=n(4),v=n(23),y=n(14),T=n(7),S=n(40),$=n(21),A=n(89),I=n(17),R=n(20),C=n(22),O=n(133),P=n(46),M=n(69),L=n(38),B=n(145),F=n(43),z=n(63),j=n(377),G=n(427),V=n(293),X=n(447),W=n(449),H=n(237),Z=n(125),_=n(239),k=h.Object,q=h.Array,et=h.Date,rt=h.Error,at=h.TypeError,dt=h.PerformanceMark,xt=v("DOMException"),gt=V.Map,ht=V.has,Mt=V.get,$t=V.set,zt=X.Set,Ht=X.add,_t=X.has,Ee=v("Object","keys"),ue=y([].push),te=y((!0).valueOf),Nt=y(1.1.valueOf),Yt=y("".valueOf),ne=y(et.prototype.getTime),fe=S("structuredClone"),ee="DataCloneError",le="Transferring",Me=function(ft){return!T(function(){var Rt=new h.Set([7]),Ct=ft(Rt),Pt=ft(k(7));return Ct===Rt||!Ct.has(7)||!R(Pt)||+Pt!=7})&&ft},Ne=function(ft,Rt){return!T(function(){var Ct=new Rt,Pt=ft({a:Ct,b:Ct});return!(Pt&&Pt.a===Pt.b&&Pt.a instanceof Rt&&Pt.a.stack===Ct.stack)})},$e=function(ft){return!T(function(){var Rt=ft(new h.AggregateError([1],fe,{cause:3}));return Rt.name!=="AggregateError"||Rt.errors[0]!==1||Rt.message!==fe||Rt.cause!==3})},ae=h.structuredClone,Ae=u||!Ne(ae,rt)||!Ne(ae,xt)||!$e(ae),xe=!ae&&Me(function(ft){return new dt(fe,{detail:ft}).detail}),ge=Me(ae)||xe,bt=function(ft){throw new xt("Uncloneable type: "+ft,ee)},Ut=function(ft,Rt){throw new xt((Rt||"Cloning")+" of "+ft+" cannot be properly polyfilled in this engine",ee)},ie=function(ft,Rt){return ge||Ut(Rt),ge(ft)},Lt=function(){var ft;try{ft=new h.DataTransfer}catch(Rt){try{ft=new h.ClipboardEvent("").clipboardData}catch(Ct){}}return ft&&ft.items&&ft.files?ft:null},Jt=function(ft,Rt,Ct){if(ht(Rt,ft))return Mt(Rt,ft);var Pt=Ct||M(ft),Ft,Et,oe,we,It,Vt;if(Pt==="SharedArrayBuffer")ge?Ft=ge(ft):Ft=ft;else{var Xt=h.DataView;!Xt&&!$(ft.slice)&&Ut("ArrayBuffer");try{if($(ft.slice)&&!ft.resizable)Ft=ft.slice(0);else for(Et=ft.byteLength,oe=("maxByteLength"in ft)?{maxByteLength:ft.maxByteLength}:void 0,Ft=new ArrayBuffer(Et,oe),we=new Xt(ft),It=new Xt(Ft),Vt=0;Vt<Et;Vt++)It.setUint8(Vt,we.getUint8(Vt))}catch(Kt){throw new xt("ArrayBuffer is detached",ee)}}return $t(Rt,ft,Ft),Ft},Qt=function(ft,Rt,Ct,Pt,Ft){var Et=h[Rt];return R(Et)||Ut(Rt),new Et(Jt(ft.buffer,Ft),Ct,Pt)},Gt=function(ft,Rt){if(C(ft)&&bt("Symbol"),!R(ft))return ft;if(Rt){if(ht(Rt,ft))return Mt(Rt,ft)}else Rt=new gt;var Ct=M(ft),Pt,Ft,Et,oe,we,It,Vt,Xt;switch(Ct){case"Array":Et=q(z(ft));break;case"Object":Et={};break;case"Map":Et=new gt;break;case"Set":Et=new zt;break;case"RegExp":Et=new RegExp(ft.source,G(ft));break;case"Error":switch(Ft=ft.name,Ft){case"AggregateError":Et=new(v(Ft))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":Et=new(v(Ft));break;case"CompileError":case"LinkError":case"RuntimeError":Et=new(v("WebAssembly",Ft));break;default:Et=new rt}break;case"DOMException":Et=new xt(ft.message,ft.name);break;case"ArrayBuffer":case"SharedArrayBuffer":Et=Jt(ft,Rt,Ct);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":It=Ct==="DataView"?ft.byteLength:ft.length,Et=Qt(ft,Ct,ft.byteOffset,It,Rt);break;case"DOMQuad":try{Et=new DOMQuad(Gt(ft.p1,Rt),Gt(ft.p2,Rt),Gt(ft.p3,Rt),Gt(ft.p4,Rt))}catch(Kt){Et=ie(ft,Ct)}break;case"File":if(ge)try{Et=ge(ft),M(Et)!==Ct&&(Et=void 0)}catch(Kt){}if(!Et)try{Et=new File([ft],ft.name,ft)}catch(Kt){}Et||Ut(Ct);break;case"FileList":if(oe=Lt(),oe){for(we=0,It=z(ft);we<It;we++)oe.items.add(Gt(ft[we],Rt));Et=oe.files}else Et=ie(ft,Ct);break;case"ImageData":try{Et=new ImageData(Gt(ft.data,Rt),ft.width,ft.height,{colorSpace:ft.colorSpace})}catch(Kt){Et=ie(ft,Ct)}break;default:if(ge)Et=ge(ft);else switch(Ct){case"BigInt":Et=k(ft.valueOf());break;case"Boolean":Et=k(te(ft));break;case"Number":Et=k(Nt(ft));break;case"String":Et=k(Yt(ft));break;case"Date":Et=new et(ne(ft));break;case"Blob":try{Et=ft.slice(0,ft.size,ft.type)}catch(Kt){Ut(Ct)}break;case"DOMPoint":case"DOMPointReadOnly":Pt=h[Ct];try{Et=Pt.fromPoint?Pt.fromPoint(ft):new Pt(ft.x,ft.y,ft.z,ft.w)}catch(Kt){Ut(Ct)}break;case"DOMRect":case"DOMRectReadOnly":Pt=h[Ct];try{Et=Pt.fromRect?Pt.fromRect(ft):new Pt(ft.x,ft.y,ft.width,ft.height)}catch(Kt){Ut(Ct)}break;case"DOMMatrix":case"DOMMatrixReadOnly":Pt=h[Ct];try{Et=Pt.fromMatrix?Pt.fromMatrix(ft):new Pt(ft)}catch(Kt){Ut(Ct)}break;case"AudioData":case"VideoFrame":$(ft.clone)||Ut(Ct);try{Et=ft.clone()}catch(Kt){bt(Ct)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":Ut(Ct);default:bt(Ct)}}switch($t(Rt,ft,Et),Ct){case"Array":case"Object":for(Vt=Ee(ft),we=0,It=z(Vt);we<It;we++)Xt=Vt[we],B(Et,Xt,Gt(ft[Xt],Rt));break;case"Map":ft.forEach(function(Kt,de){$t(Et,Gt(de,Rt),Gt(Kt,Rt))});break;case"Set":ft.forEach(function(Kt){Ht(Et,Gt(Kt,Rt))});break;case"Error":F(Et,"message",Gt(ft.message,Rt)),L(ft,"cause")&&F(Et,"cause",Gt(ft.cause,Rt)),Ft==="AggregateError"?Et.errors=Gt(ft.errors,Rt):Ft==="SuppressedError"&&(Et.error=Gt(ft.error,Rt),Et.suppressed=Gt(ft.suppressed,Rt));case"DOMException":Z&&F(Et,"stack",Gt(ft.stack,Rt))}return Et},me=function(ft,Rt){if(!R(ft))throw new at("Transfer option cannot be converted to a sequence");var Ct=[];O(ft,function(de){ue(Ct,P(de))});for(var Pt=0,Ft=z(Ct),Et=new zt,oe,we,It,Vt,Xt,Kt;Pt<Ft;){if(oe=Ct[Pt++],we=M(oe),we==="ArrayBuffer"?_t(Et,oe):ht(Rt,oe))throw new xt("Duplicate transferable",ee);if(we==="ArrayBuffer"){Ht(Et,oe);continue}if(_)Vt=ae(oe,{transfer:[oe]});else switch(we){case"ImageBitmap":It=h.OffscreenCanvas,A(It)||Ut(we,le);try{Xt=new It(oe.width,oe.height),Kt=Xt.getContext("bitmaprenderer"),Kt.transferFromImageBitmap(oe),Vt=Xt.transferToImageBitmap()}catch(de){}break;case"AudioData":case"VideoFrame":(!$(oe.clone)||!$(oe.close))&&Ut(we,le);try{Vt=oe.clone(),oe.close()}catch(de){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":Ut(we,le)}if(Vt===void 0)throw new xt("This object cannot be transferred: "+we,ee);$t(Rt,oe,Vt)}return Et},He=function(ft){W(ft,function(Rt){_?ge(Rt,{transfer:[Rt]}):$(Rt.transfer)?Rt.transfer():H?H(Rt):Ut("ArrayBuffer",le)})};d({global:!0,enumerable:!0,sham:!_,forced:Ae},{structuredClone:function(Rt){var Ct=j(arguments.length,1)>1&&!I(arguments[1])?P(arguments[1]):void 0,Pt=Ct?Ct.transfer:void 0,Ft,Et;Pt!==void 0&&(Ft=new gt,Et=me(Pt,Ft));var oe=Gt(Rt,Ft);return Et&&He(Et),oe}})}),(function(x,b,n){n(602),n(603)}),(function(x,b,n){var u=n(3),d=n(4),h=n(597),v=h(d.setInterval,!0);u({global:!0,bind:!0,forced:d.setInterval!==v},{setInterval:v})}),(function(x,b,n){var u=n(3),d=n(4),h=n(597),v=h(d.setTimeout,!0);u({global:!0,bind:!0,forced:d.setTimeout!==v},{setTimeout:v})}),(function(x,b,n){n(605)}),(function(x,b,n){n(476);var u=n(3),d=n(6),h=n(606),v=n(4),y=n(84),T=n(14),S=n(47),$=n(77),A=n(215),I=n(38),R=n(338),C=n(166),O=n(76),P=n(469).codeAt,M=n(607),L=n(68),B=n(82),F=n(377),z=n(608),j=n(51),G=j.set,V=j.getterFor("URL"),X=z.URLSearchParams,W=z.getState,H=v.URL,Z=v.TypeError,_=v.parseInt,k=Math.floor,q=Math.pow,et=T("".charAt),rt=T(/./.exec),at=T([].join),dt=T(1.1.toString),xt=T([].pop),gt=T([].push),ht=T("".replace),Mt=T([].shift),$t=T("".split),zt=T("".slice),Ht=T("".toLowerCase),_t=T([].unshift),Ee="Invalid authority",ue="Invalid scheme",te="Invalid host",Nt="Invalid port",Yt=/[a-z]/i,ne=/[\d+-.a-z]/i,fe=/\d/,ee=/^0x/i,le=/^[0-7]+$/,Me=/^\d+$/,Ne=/^[\da-f]+$/i,$e=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ae=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ae=/^[\u0000-\u0020]+/,xe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ge=/[\t\n\r]/g,bt,Ut=function(ut){var wt=$t(ut,"."),mt,st,Ot,ye,qt,Oe,rn;if(wt.length&&wt[wt.length-1]===""&&wt.length--,mt=wt.length,mt>4)return ut;for(st=[],Ot=0;Ot<mt;Ot++){if(ye=wt[Ot],ye==="")return ut;if(qt=10,ye.length>1&&et(ye,0)==="0"&&(qt=rt(ee,ye)?16:8,ye=zt(ye,qt===8?1:2)),ye==="")Oe=0;else{if(!rt(qt===10?Me:qt===8?le:Ne,ye))return ut;Oe=_(ye,qt)}gt(st,Oe)}for(Ot=0;Ot<mt;Ot++)if(Oe=st[Ot],Ot===mt-1){if(Oe>=q(256,5-mt))return null}else if(Oe>255)return null;for(rn=xt(st),Ot=0;Ot<st.length;Ot++)rn+=st[Ot]*q(256,3-Ot);return rn},ie=function(ut){var wt=[0,0,0,0,0,0,0,0],mt=0,st=null,Ot=0,ye,qt,Oe,rn,hn,xn,it,an=function(){return et(ut,Ot)};if(an()===":"){if(et(ut,1)!==":")return;Ot+=2,mt++,st=mt}for(;an();){if(mt===8)return;if(an()===":"){if(st!==null)return;Ot++,mt++,st=mt;continue}for(ye=qt=0;qt<4&&rt(Ne,an());)ye=ye*16+_(an(),16),Ot++,qt++;if(an()==="."){if(qt===0||(Ot-=qt,mt>6))return;for(Oe=0;an();){if(rn=null,Oe>0)if(an()==="."&&Oe<4)Ot++;else return;if(!rt(fe,an()))return;for(;rt(fe,an());){if(hn=_(an(),10),rn===null)rn=hn;else{if(rn===0)return;rn=rn*10+hn}if(rn>255)return;Ot++}wt[mt]=wt[mt]*256+rn,Oe++,(Oe===2||Oe===4)&&mt++}if(Oe!==4)return;break}else if(an()===":"){if(Ot++,!an())return}else if(an())return;wt[mt++]=ye}if(st!==null)for(xn=mt-st,mt=7;mt!==0&&xn>0;)it=wt[mt],wt[mt--]=wt[st+xn-1],wt[st+--xn]=it;else if(mt!==8)return;return wt},Lt=function(ut){for(var wt=null,mt=1,st=null,Ot=0,ye=0;ye<8;ye++)ut[ye]!==0?(Ot>mt&&(wt=st,mt=Ot),st=null,Ot=0):(st===null&&(st=ye),++Ot);return Ot>mt?st:wt},Jt=function(ut){var wt,mt,st,Ot;if(typeof ut=="number"){for(wt=[],mt=0;mt<4;mt++)_t(wt,ut%256),ut=k(ut/256);return at(wt,".")}if(typeof ut=="object"){for(wt="",st=Lt(ut),mt=0;mt<8;mt++)Ot&&ut[mt]===0||(Ot&&(Ot=!1),st===mt?(wt+=mt?":":"::",Ot=!0):(wt+=dt(ut[mt],16),mt<7&&(wt+=":")));return"["+wt+"]"}return ut},Qt={},Gt=R({},Qt,{" ":1,'"':1,"<":1,">":1,"`":1}),me=R({},Gt,{"#":1,"?":1,"{":1,"}":1}),He=R({},me,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ft=function(ut,wt){var mt=P(ut,0);return mt>32&&mt<127&&!I(wt,ut)?ut:encodeURIComponent(ut)},Rt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ct=function(ut,wt){var mt;return ut.length===2&&rt(Yt,et(ut,0))&&((mt=et(ut,1))===":"||!wt&&mt==="|")},Pt=function(ut){var wt;return ut.length>1&&Ct(zt(ut,0,2))&&(ut.length===2||(wt=et(ut,2))==="/"||wt==="\\"||wt==="?"||wt==="#")},Ft=function(ut){return ut==="."||Ht(ut)==="%2e"},Et=function(ut){return ut=Ht(ut),ut===".."||ut==="%2e."||ut===".%2e"||ut==="%2e%2e"},oe={},we={},It={},Vt={},Xt={},Kt={},de={},be={},We={},Je={},nn={},yn={},Vn={},Wr={},Ka={},pa={},xr={},Xn={},Za={},sr={},Zn={},ma=function(ut,wt,mt){var st=L(ut),Ot,ye,qt;if(wt){if(ye=this.parse(st),ye)throw new Z(ye);this.searchParams=null}else{if(mt!==void 0&&(Ot=new ma(mt,!0)),ye=this.parse(st,null,Ot),ye)throw new Z(ye);qt=W(new X),qt.bindURL(this),this.searchParams=qt}};ma.prototype={type:"URL",parse:function(ut,wt,mt){var st=this,Ot=wt||oe,ye=0,qt="",Oe=!1,rn=!1,hn=!1,xn,it,an,Bn;for(ut=L(ut),wt||(st.scheme="",st.username="",st.password="",st.host=null,st.port=null,st.path=[],st.query=null,st.fragment=null,st.cannotBeABaseURL=!1,ut=ht(ut,Ae,""),ut=ht(ut,xe,"$1")),ut=ht(ut,ge,""),xn=C(ut);ye<=xn.length;){switch(it=xn[ye],Ot){case oe:if(it&&rt(Yt,it))qt+=Ht(it),Ot=we;else{if(wt)return ue;Ot=It;continue}break;case we:if(it&&(rt(ne,it)||it==="+"||it==="-"||it==="."))qt+=Ht(it);else if(it===":"){if(wt&&(st.isSpecial()!==I(Rt,qt)||qt==="file"&&(st.includesCredentials()||st.port!==null)||st.scheme==="file"&&!st.host))return;if(st.scheme=qt,wt){st.isSpecial()&&Rt[st.scheme]===st.port&&(st.port=null);return}qt="",st.scheme==="file"?Ot=Wr:st.isSpecial()&&mt&&mt.scheme===st.scheme?Ot=Vt:st.isSpecial()?Ot=be:xn[ye+1]==="/"?(Ot=Xt,ye++):(st.cannotBeABaseURL=!0,gt(st.path,""),Ot=Za)}else{if(wt)return ue;qt="",Ot=It,ye=0;continue}break;case It:if(!mt||mt.cannotBeABaseURL&&it!=="#")return ue;if(mt.cannotBeABaseURL&&it==="#"){st.scheme=mt.scheme,st.path=O(mt.path),st.query=mt.query,st.fragment="",st.cannotBeABaseURL=!0,Ot=Zn;break}Ot=mt.scheme==="file"?Wr:Kt;continue;case Vt:if(it==="/"&&xn[ye+1]==="/")Ot=We,ye++;else{Ot=Kt;continue}break;case Xt:if(it==="/"){Ot=Je;break}else{Ot=Xn;continue}case Kt:if(st.scheme=mt.scheme,it===bt)st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.query=mt.query;else if(it==="/"||it==="\\"&&st.isSpecial())Ot=de;else if(it==="?")st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.query="",Ot=sr;else if(it==="#")st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.query=mt.query,st.fragment="",Ot=Zn;else{st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.path.length--,Ot=Xn;continue}break;case de:if(st.isSpecial()&&(it==="/"||it==="\\"))Ot=We;else if(it==="/")Ot=Je;else{st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,Ot=Xn;continue}break;case be:if(Ot=We,it!=="/"||et(qt,ye+1)!=="/")continue;ye++;break;case We:if(it!=="/"&&it!=="\\"){Ot=Je;continue}break;case Je:if(it==="@"){Oe&&(qt="%40"+qt),Oe=!0,an=C(qt);for(var en=0;en<an.length;en++){var Hn=an[en];if(Hn===":"&&!hn){hn=!0;continue}var Pn=ft(Hn,He);hn?st.password+=Pn:st.username+=Pn}qt=""}else if(it===bt||it==="/"||it==="?"||it==="#"||it==="\\"&&st.isSpecial()){if(Oe&&qt==="")return Ee;ye-=C(qt).length+1,qt="",Ot=nn}else qt+=it;break;case nn:case yn:if(wt&&st.scheme==="file"){Ot=pa;continue}else if(it===":"&&!rn){if(qt==="")return te;if(Bn=st.parseHost(qt),Bn)return Bn;if(qt="",Ot=Vn,wt===yn)return}else if(it===bt||it==="/"||it==="?"||it==="#"||it==="\\"&&st.isSpecial()){if(st.isSpecial()&&qt==="")return te;if(wt&&qt===""&&(st.includesCredentials()||st.port!==null))return;if(Bn=st.parseHost(qt),Bn)return Bn;if(qt="",Ot=xr,wt)return;continue}else it==="["?rn=!0:it==="]"&&(rn=!1),qt+=it;break;case Vn:if(rt(fe,it))qt+=it;else if(it===bt||it==="/"||it==="?"||it==="#"||it==="\\"&&st.isSpecial()||wt){if(qt!==""){var Un=_(qt,10);if(Un>65535)return Nt;st.port=st.isSpecial()&&Un===Rt[st.scheme]?null:Un,qt=""}if(wt)return;Ot=xr;continue}else return Nt;break;case Wr:if(st.scheme="file",it==="/"||it==="\\")Ot=Ka;else if(mt&&mt.scheme==="file")switch(it){case bt:st.host=mt.host,st.path=O(mt.path),st.query=mt.query;break;case"?":st.host=mt.host,st.path=O(mt.path),st.query="",Ot=sr;break;case"#":st.host=mt.host,st.path=O(mt.path),st.query=mt.query,st.fragment="",Ot=Zn;break;default:Pt(at(O(xn,ye),""))||(st.host=mt.host,st.path=O(mt.path),st.shortenPath()),Ot=Xn;continue}else{Ot=Xn;continue}break;case Ka:if(it==="/"||it==="\\"){Ot=pa;break}mt&&mt.scheme==="file"&&!Pt(at(O(xn,ye),""))&&(Ct(mt.path[0],!0)?gt(st.path,mt.path[0]):st.host=mt.host),Ot=Xn;continue;case pa:if(it===bt||it==="/"||it==="\\"||it==="?"||it==="#"){if(!wt&&Ct(qt))Ot=Xn;else if(qt===""){if(st.host="",wt)return;Ot=xr}else{if(Bn=st.parseHost(qt),Bn)return Bn;if(st.host==="localhost"&&(st.host=""),wt)return;qt="",Ot=xr}continue}else qt+=it;break;case xr:if(st.isSpecial()){if(Ot=Xn,it!=="/"&&it!=="\\")continue}else if(!wt&&it==="?")st.query="",Ot=sr;else if(!wt&&it==="#")st.fragment="",Ot=Zn;else if(it!==bt&&(Ot=Xn,it!=="/"))continue;break;case Xn:if(it===bt||it==="/"||it==="\\"&&st.isSpecial()||!wt&&(it==="?"||it==="#")){if(Et(qt)?(st.shortenPath(),it!=="/"&&!(it==="\\"&&st.isSpecial())&>(st.path,"")):Ft(qt)?it!=="/"&&!(it==="\\"&&st.isSpecial())&>(st.path,""):(st.scheme==="file"&&!st.path.length&&Ct(qt)&&(st.host&&(st.host=""),qt=et(qt,0)+":"),gt(st.path,qt)),qt="",st.scheme==="file"&&(it===bt||it==="?"||it==="#"))for(;st.path.length>1&&st.path[0]==="";)Mt(st.path);it==="?"?(st.query="",Ot=sr):it==="#"&&(st.fragment="",Ot=Zn)}else qt+=ft(it,me);break;case Za:it==="?"?(st.query="",Ot=sr):it==="#"?(st.fragment="",Ot=Zn):it!==bt&&(st.path[0]+=ft(it,Qt));break;case sr:!wt&&it==="#"?(st.fragment="",Ot=Zn):it!==bt&&(it==="'"&&st.isSpecial()?st.query+="%27":it==="#"?st.query+="%23":st.query+=ft(it,Qt));break;case Zn:it!==bt&&(st.fragment+=ft(it,Gt));break}ye++}},parseHost:function(ut){var wt,mt,st;if(et(ut,0)==="["){if(et(ut,ut.length-1)!=="]"||(wt=ie(zt(ut,1,-1)),!wt))return te;this.host=wt}else if(this.isSpecial()){if(ut=M(ut),rt($e,ut)||(wt=Ut(ut),wt===null))return te;this.host=wt}else{if(rt(ae,ut))return te;for(wt="",mt=C(ut),st=0;st<mt.length;st++)wt+=ft(mt[st],Qt);this.host=wt}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return I(Rt,this.scheme)},shortenPath:function(){var ut=this.path,wt=ut.length;wt&&(this.scheme!=="file"||wt!==1||!Ct(ut[0],!0))&&ut.length--},serialize:function(){var ut=this,wt=ut.scheme,mt=ut.username,st=ut.password,Ot=ut.host,ye=ut.port,qt=ut.path,Oe=ut.query,rn=ut.fragment,hn=wt+":";return Ot!==null?(hn+="//",ut.includesCredentials()&&(hn+=mt+(st?":"+st:"")+"@"),hn+=Jt(Ot),ye!==null&&(hn+=":"+ye)):wt==="file"&&(hn+="//"),hn+=ut.cannotBeABaseURL?qt[0]:qt.length?"/"+at(qt,"/"):"",Oe!==null&&(hn+="?"+Oe),rn!==null&&(hn+="#"+rn),hn},setHref:function(ut){var wt=this.parse(ut);if(wt)throw new Z(wt);this.searchParams.update()},getOrigin:function(){var ut=this.scheme,wt=this.port;if(ut==="blob")try{return new Tr(ut.path[0]).origin}catch(mt){return"null"}return ut==="file"||!this.isSpecial()?"null":ut+"://"+Jt(this.host)+(wt!==null?":"+wt:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(ut){this.parse(L(ut)+":",oe)},getUsername:function(){return this.username},setUsername:function(ut){var wt=C(L(ut));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var mt=0;mt<wt.length;mt++)this.username+=ft(wt[mt],He)}},getPassword:function(){return this.password},setPassword:function(ut){var wt=C(L(ut));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var mt=0;mt<wt.length;mt++)this.password+=ft(wt[mt],He)}},getHost:function(){var ut=this.host,wt=this.port;return ut===null?"":wt===null?Jt(ut):Jt(ut)+":"+wt},setHost:function(ut){this.cannotBeABaseURL||this.parse(ut,nn)},getHostname:function(){var ut=this.host;return ut===null?"":Jt(ut)},setHostname:function(ut){this.cannotBeABaseURL||this.parse(ut,yn)},getPort:function(){var ut=this.port;return ut===null?"":L(ut)},setPort:function(ut){this.cannotHaveUsernamePasswordPort()||(ut=L(ut),ut===""?this.port=null:this.parse(ut,Vn))},getPathname:function(){var ut=this.path;return this.cannotBeABaseURL?ut[0]:ut.length?"/"+at(ut,"/"):""},setPathname:function(ut){this.cannotBeABaseURL||(this.path=[],this.parse(ut,xr))},getSearch:function(){var ut=this.query;return ut?"?"+ut:""},setSearch:function(ut){ut=L(ut),ut===""?this.query=null:(et(ut,0)==="?"&&(ut=zt(ut,1)),this.query="",this.parse(ut,sr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var ut=this.fragment;return ut?"#"+ut:""},setHash:function(ut){if(ut=L(ut),ut===""){this.fragment=null;return}et(ut,0)==="#"&&(ut=zt(ut,1)),this.fragment="",this.parse(ut,Zn)},update:function(){this.query=this.searchParams.serialize()||null}};var Tr=function(wt){var mt=A(this,$n),st=F(arguments.length,1)>1?arguments[1]:void 0,Ot=G(mt,new ma(wt,!1,st));d||(mt.href=Ot.serialize(),mt.origin=Ot.getOrigin(),mt.protocol=Ot.getProtocol(),mt.username=Ot.getUsername(),mt.password=Ot.getPassword(),mt.host=Ot.getHost(),mt.hostname=Ot.getHostname(),mt.port=Ot.getPort(),mt.pathname=Ot.getPathname(),mt.search=Ot.getSearch(),mt.searchParams=Ot.getSearchParams(),mt.hash=Ot.getHash())},$n=Tr.prototype,Nn=function(ut,wt){return{get:function(){return V(this)[ut]()},set:wt&&function(mt){return V(this)[wt](mt)},configurable:!0,enumerable:!0}};if(d&&($($n,"href",Nn("serialize","setHref")),$($n,"origin",Nn("getOrigin")),$($n,"protocol",Nn("getProtocol","setProtocol")),$($n,"username",Nn("getUsername","setUsername")),$($n,"password",Nn("getPassword","setPassword")),$($n,"host",Nn("getHost","setHost")),$($n,"hostname",Nn("getHostname","setHostname")),$($n,"port",Nn("getPort","setPort")),$($n,"pathname",Nn("getPathname","setPathname")),$($n,"search",Nn("getSearch","setSearch")),$($n,"searchParams",Nn("getSearchParams")),$($n,"hash",Nn("getHash","setHash"))),S($n,"toJSON",function(){return V(this).serialize()},{enumerable:!0}),S($n,"toString",function(){return V(this).serialize()},{enumerable:!0}),H){var Ja=H.createObjectURL,Qa=H.revokeObjectURL;Ja&&S(Tr,"createObjectURL",y(Ja,H)),Qa&&S(Tr,"revokeObjectURL",y(Qa,H))}B(Tr,"URL"),u({global:!0,constructor:!0,forced:!h,sham:!d},{URL:Tr})}),(function(x,b,n){var u=n(7),d=n(33),h=n(6),v=n(36),y=d("iterator");x.exports=!u(function(){var T=new URL("b?a=1&b=2&c=3","https://a"),S=T.searchParams,$=new URLSearchParams("a=1&a=2&b=3"),A="";return T.pathname="c%20d",S.forEach(function(I,R){S.delete("b"),A+=R+I}),$.delete("a",2),$.delete("b",void 0),v&&(!T.toJSON||!$.has("a",1)||$.has("a",2)||!$.has("a",void 0)||$.has("b"))||!S.size&&(v||!h)||!S.sort||T.href!=="https://a/c%20d?a=1&c=3"||S.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!S[y]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("https://a#\u0431").hash!=="#%D0%B1"||A!=="a1c3"||new URL("https://x",void 0).host!=="x"})}),(function(x,b,n){var u=n(14),d=2147483647,h=36,v=1,y=26,T=38,S=700,$=72,A=128,I="-",R=/[^\0-\u007E]/,C=/[.\u3002\uFF0E\uFF61]/g,O="Overflow: input needs wider integers to process",P=h-v,M=RangeError,L=u(C.exec),B=Math.floor,F=String.fromCharCode,z=u("".charCodeAt),j=u([].join),G=u([].push),V=u("".replace),X=u("".split),W=u("".toLowerCase),H=function(q){for(var et=[],rt=0,at=q.length;rt<at;){var dt=z(q,rt++);if(dt>=55296&&dt<=56319&&rt<at){var xt=z(q,rt++);(xt&64512)===56320?G(et,((dt&1023)<<10)+(xt&1023)+65536):(G(et,dt),rt--)}else G(et,dt)}return et},Z=function(q){return q+22+75*(q<26)},_=function(q,et,rt){var at=0;for(q=rt?B(q/S):q>>1,q+=B(q/et);q>P*y>>1;)q=B(q/P),at+=h;return B(at+(P+1)*q/(q+T))},k=function(q){var et=[];q=H(q);var rt=q.length,at=A,dt=0,xt=$,gt,ht;for(gt=0;gt<q.length;gt++)ht=q[gt],ht<128&&G(et,F(ht));var Mt=et.length,$t=Mt;for(Mt&&G(et,I);$t<rt;){var zt=d;for(gt=0;gt<q.length;gt++)ht=q[gt],ht>=at&&ht<zt&&(zt=ht);var Ht=$t+1;if(zt-at>B((d-dt)/Ht))throw new M(O);for(dt+=(zt-at)*Ht,at=zt,gt=0;gt<q.length;gt++){if(ht=q[gt],ht<at&&++dt>d)throw new M(O);if(ht===at){for(var _t=dt,Ee=h;;){var ue=Ee<=xt?v:Ee>=xt+y?y:Ee-xt;if(_t<ue)break;var te=_t-ue,Nt=h-ue;G(et,F(Z(ue+te%Nt))),_t=B(te/Nt),Ee+=h}G(et,F(Z(_t))),xt=_(dt,Ht,$t===Mt),dt=0,$t++}}dt++,at++}return j(et,"")};x.exports=function(q){var et=[],rt=X(V(W(q),C,"."),"."),at,dt;for(at=0;at<rt.length;at++)dt=rt[at],G(et,L(R,dt)?"xn--"+k(dt):dt);return j(et,".")}}),(function(x,b,n){n(172),n(473);var u=n(3),d=n(4),h=n(380),v=n(23),y=n(8),T=n(14),S=n(6),$=n(606),A=n(47),I=n(77),R=n(214),C=n(82),O=n(174),P=n(51),M=n(215),L=n(21),B=n(38),F=n(84),z=n(69),j=n(46),G=n(20),V=n(68),X=n(71),W=n(11),H=n(136),Z=n(137),_=n(176),k=n(377),q=n(33),et=n(193),rt=q("iterator"),at="URLSearchParams",dt=at+"Iterator",xt=P.set,gt=P.getterFor(at),ht=P.getterFor(dt),Mt=h("fetch"),$t=h("Request"),zt=h("Headers"),Ht=$t&&$t.prototype,_t=zt&&zt.prototype,Ee=d.TypeError,ue=d.encodeURIComponent,te=String.fromCharCode,Nt=v("String","fromCodePoint"),Yt=parseInt,ne=T("".charAt),fe=T([].join),ee=T([].push),le=T("".replace),Me=T([].shift),Ne=T([].splice),$e=T("".split),ae=T("".slice),Ae=T(/./.exec),xe=/\+/g,ge="\uFFFD",bt=/^[0-9a-f]+$/i,Ut=function(It,Vt){var Xt=ae(It,Vt,Vt+2);return Ae(bt,Xt)?Yt(Xt,16):NaN},ie=function(It){for(var Vt=0,Xt=128;Xt>0&&(It&Xt)!==0;Xt>>=1)Vt++;return Vt},Lt=function(It){var Vt=null;switch(It.length){case 1:Vt=It[0];break;case 2:Vt=(It[0]&31)<<6|It[1]&63;break;case 3:Vt=(It[0]&15)<<12|(It[1]&63)<<6|It[2]&63;break;case 4:Vt=(It[0]&7)<<18|(It[1]&63)<<12|(It[2]&63)<<6|It[3]&63;break}return Vt>1114111?null:Vt},Jt=function(It){It=le(It,xe," ");for(var Vt=It.length,Xt="",Kt=0;Kt<Vt;){var de=ne(It,Kt);if(de==="%"){if(ne(It,Kt+1)==="%"||Kt+3>Vt){Xt+="%",Kt++;continue}var be=Ut(It,Kt+1);if(be!==be){Xt+=de,Kt++;continue}Kt+=2;var We=ie(be);if(We===0)de=te(be);else{if(We===1||We>4){Xt+=ge,Kt++;continue}for(var Je=[be],nn=1;nn<We&&(Kt++,!(Kt+3>Vt||ne(It,Kt)!=="%"));){var yn=Ut(It,Kt+1);if(yn!==yn){Kt+=3;break}if(yn>191||yn<128)break;ee(Je,yn),Kt+=2,nn++}if(Je.length!==We){Xt+=ge;continue}var Vn=Lt(Je);Vn===null?Xt+=ge:de=Nt(Vn)}}Xt+=de,Kt++}return Xt},Qt=/[!'()~]|%20/g,Gt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},me=function(It){return Gt[It]},He=function(It){return le(ue(It),Qt,me)},ft=O(function(Vt,Xt){xt(this,{type:dt,target:gt(Vt).entries,index:0,kind:Xt})},at,function(){var Vt=ht(this),Xt=Vt.target,Kt=Vt.index++;if(!Xt||Kt>=Xt.length)return Vt.target=null,_(void 0,!0);var de=Xt[Kt];switch(Vt.kind){case"keys":return _(de.key,!1);case"values":return _(de.value,!1)}return _([de.key,de.value],!1)},!0),Rt=function(It){this.entries=[],this.url=null,It!==void 0&&(G(It)?this.parseObject(It):this.parseQuery(typeof It=="string"?ne(It,0)==="?"?ae(It,1):It:V(It)))};Rt.prototype={type:at,bindURL:function(It){this.url=It,this.update()},parseObject:function(It){var Vt=this.entries,Xt=Z(It),Kt,de,be,We,Je,nn,yn;if(Xt)for(Kt=H(It,Xt),de=Kt.next;!(be=y(de,Kt)).done;){if(We=H(j(be.value)),Je=We.next,(nn=y(Je,We)).done||(yn=y(Je,We)).done||!y(Je,We).done)throw new Ee("Expected sequence with length 2");ee(Vt,{key:V(nn.value),value:V(yn.value)})}else for(var Vn in It)B(It,Vn)&&ee(Vt,{key:Vn,value:V(It[Vn])})},parseQuery:function(It){if(It)for(var Vt=this.entries,Xt=$e(It,"&"),Kt=0,de,be;Kt<Xt.length;)de=Xt[Kt++],de.length&&(be=$e(de,"="),ee(Vt,{key:Jt(Me(be)),value:Jt(fe(be,"="))}))},serialize:function(){for(var It=this.entries,Vt=[],Xt=0,Kt;Xt<It.length;)Kt=It[Xt++],ee(Vt,He(Kt.key)+"="+He(Kt.value));return fe(Vt,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ct=function(){M(this,Pt);var Vt=arguments.length>0?arguments[0]:void 0,Xt=xt(this,new Rt(Vt));S||(this.size=Xt.entries.length)},Pt=Ct.prototype;if(R(Pt,{append:function(Vt,Xt){var Kt=gt(this);k(arguments.length,2),ee(Kt.entries,{key:V(Vt),value:V(Xt)}),S||this.length++,Kt.updateURL()},delete:function(It){for(var Vt=gt(this),Xt=k(arguments.length,1),Kt=Vt.entries,de=V(It),be=Xt<2?void 0:arguments[1],We=be===void 0?be:V(be),Je=0;Je<Kt.length;){var nn=Kt[Je];if(nn.key===de&&(We===void 0||nn.value===We)){if(Ne(Kt,Je,1),We!==void 0)break}else Je++}S||(this.size=Kt.length),Vt.updateURL()},get:function(Vt){var Xt=gt(this).entries;k(arguments.length,1);for(var Kt=V(Vt),de=0;de<Xt.length;de++)if(Xt[de].key===Kt)return Xt[de].value;return null},getAll:function(Vt){var Xt=gt(this).entries;k(arguments.length,1);for(var Kt=V(Vt),de=[],be=0;be<Xt.length;be++)Xt[be].key===Kt&&ee(de,Xt[be].value);return de},has:function(Vt){for(var Xt=gt(this).entries,Kt=k(arguments.length,1),de=V(Vt),be=Kt<2?void 0:arguments[1],We=be===void 0?be:V(be),Je=0;Je<Xt.length;){var nn=Xt[Je++];if(nn.key===de&&(We===void 0||nn.value===We))return!0}return!1},set:function(Vt,Xt){var Kt=gt(this);k(arguments.length,1);for(var de=Kt.entries,be=!1,We=V(Vt),Je=V(Xt),nn=0,yn;nn<de.length;nn++)yn=de[nn],yn.key===We&&(be?Ne(de,nn--,1):(be=!0,yn.value=Je));be||ee(de,{key:We,value:Je}),S||(this.size=de.length),Kt.updateURL()},sort:function(){var Vt=gt(this);et(Vt.entries,function(Xt,Kt){return Xt.key>Kt.key?1:-1}),Vt.updateURL()},forEach:function(Vt){for(var Xt=gt(this).entries,Kt=F(Vt,arguments.length>1?arguments[1]:void 0),de=0,be;de<Xt.length;)be=Xt[de++],Kt(be.value,be.key,this)},keys:function(){return new ft(this,"keys")},values:function(){return new ft(this,"values")},entries:function(){return new ft(this,"entries")}},{enumerable:!0}),A(Pt,rt,Pt.entries,{name:"entries"}),A(Pt,"toString",function(){return gt(this).serialize()},{enumerable:!0}),S&&I(Pt,"size",{get:function(){return gt(this).entries.length},configurable:!0,enumerable:!0}),C(Ct,at),u({global:!0,constructor:!0,forced:!$},{URLSearchParams:Ct}),!$&&L(zt)){var Ft=T(_t.has),Et=T(_t.set),oe=function(It){if(G(It)){var Vt=It.body,Xt;if(z(Vt)===at)return Xt=It.headers?new zt(It.headers):new zt,Ft(Xt,"content-type")||Et(Xt,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),X(It,{body:W(0,V(Vt)),headers:W(0,Xt)})}return It};if(L(Mt)&&u({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(Vt){return Mt(Vt,arguments.length>1?oe(arguments[1]):{})}}),L($t)){var we=function(Vt){return M(this,Ht),new $t(Vt,arguments.length>1?oe(arguments[1]):{})};Ht.constructor=we,we.prototype=Ht,u({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:we})}}x.exports={URLSearchParams:Ct,getState:gt}}),(function(x,b,n){var u=n(3),d=n(23),h=n(7),v=n(377),y=n(68),T=n(606),S=d("URL"),$=T&&h(function(){S.canParse()}),A=h(function(){return S.canParse.length!==1});u({target:"URL",stat:!0,forced:!$||A},{canParse:function(R){var C=v(arguments.length,1),O=y(R),P=C<2||arguments[1]===void 0?void 0:y(arguments[1]);try{return!!new S(O,P)}catch(M){return!1}}})}),(function(x,b,n){var u=n(3),d=n(23),h=n(377),v=n(68),y=n(606),T=d("URL");u({target:"URL",stat:!0,forced:!y},{parse:function($){var A=h(arguments.length,1),I=v($),R=A<2||arguments[1]===void 0?void 0:v(arguments[1]);try{return new T(I,R)}catch(C){return null}}})}),(function(x,b,n){var u=n(3),d=n(8);u({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return d(URL.prototype.toString,this)}})}),(function(x,b,n){n(608)}),(function(x,b,n){var u=n(47),d=n(14),h=n(68),v=n(377),y=URLSearchParams,T=y.prototype,S=d(T.append),$=d(T.delete),A=d(T.forEach),I=d([].push),R=new y("a=1&a=2&b=3");R.delete("a",1),R.delete("b",void 0),R+""!="a=2"&&u(T,"delete",function(C){var O=arguments.length,P=O<2?void 0:arguments[1];if(O&&P===void 0)return $(this,C);var M=[];A(this,function(X,W){I(M,{key:W,value:X})}),v(O,1);for(var L=h(C),B=h(P),F=0,z=0,j=!1,G=M.length,V;F<G;)V=M[F++],j||V.key===L?(j=!0,$(this,V.key)):z++;for(;z<G;)V=M[z++],V.key===L&&V.value===B||S(this,V.key,V.value)},{enumerable:!0,unsafe:!0})}),(function(x,b,n){var u=n(47),d=n(14),h=n(68),v=n(377),y=URLSearchParams,T=y.prototype,S=d(T.getAll),$=d(T.has),A=new y("a=1");(A.has("a",2)||!A.has("a",void 0))&&u(T,"has",function(R){var C=arguments.length,O=C<2?void 0:arguments[1];if(C&&O===void 0)return $(this,R);var P=S(this,R);v(C,1);for(var M=h(O),L=0;L<P.length;)if(P[L++]===M)return!0;return!1},{enumerable:!0,unsafe:!0})}),(function(x,b,n){var u=n(6),d=n(14),h=n(77),v=URLSearchParams.prototype,y=d(v.forEach);u&&!("size"in v)&&h(v,"size",{get:function(){var S=0;return y(this,function(){S++}),S},configurable:!0,enumerable:!0})}),(function(x,b,n){n.r(b),n.d(b,{bb:function(){return Mf},default:function(){return Mf}});var u={};n.r(u),n.d(u,{selection:function(){return Tu},subchart:function(){return Su},zoom:function(){return $u}});var d={};n.r(d),n.d(d,{area:function(){return ff},areaLineRange:function(){return df},areaSpline:function(){return vf},areaSplineRange:function(){return gf},areaStep:function(){return pf},areaStepRange:function(){return hf},bar:function(){return bf},bubble:function(){return If},candlestick:function(){return Rf},donut:function(){return Tf},funnel:function(){return Cf},gauge:function(){return Sf},line:function(){return mf},pie:function(){return $f},polar:function(){return Af},radar:function(){return Ef},scatter:function(){return Of},spline:function(){return yf},step:function(){return xf},treemap:function(){return Pf}});function h(){}function v(t){return t==null?h:function(){return this.querySelector(t)}}function y(t){typeof t!="function"&&(t=v(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var i=e[o],s=i.length,l=a[o]=new Array(s),c,f,g=0;g<s;++g)(c=i[g])&&(f=t.call(c,c.__data__,g,i))&&("__data__"in c&&(f.__data__=c.__data__),l[g]=f);return new Oe(a,this._parents)}function T(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function S(){return[]}function $(t){return t==null?S:function(){return this.querySelectorAll(t)}}function A(t){return function(){return T(t.apply(this,arguments))}}function I(t){typeof t=="function"?t=A(t):t=$(t);for(var e=this._groups,r=e.length,a=[],o=[],i=0;i<r;++i)for(var s=e[i],l=s.length,c,f=0;f<l;++f)(c=s[f])&&(a.push(t.call(c,c.__data__,f,s)),o.push(c));return new Oe(a,o)}function R(t){return function(){return this.matches(t)}}function C(t){return function(e){return e.matches(t)}}var O=Array.prototype.find;function P(t){return function(){return O.call(this.children,t)}}function M(){return this.firstElementChild}function L(t){return this.select(t==null?M:P(typeof t=="function"?t:C(t)))}var B=Array.prototype.filter;function F(){return Array.from(this.children)}function z(t){return function(){return B.call(this.children,t)}}function j(t){return this.selectAll(t==null?F:z(typeof t=="function"?t:C(t)))}function G(t){typeof t!="function"&&(t=R(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var i=e[o],s=i.length,l=a[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&l.push(c);return new Oe(a,this._parents)}function V(t){return new Array(t.length)}function X(){return new Oe(this._enter||this._groups.map(V),this._parents)}function W(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}W.prototype={constructor:W,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function H(t){return function(){return t}}function Z(t,e,r,a,o,i){for(var s=0,l,c=e.length,f=i.length;s<f;++s)(l=e[s])?(l.__data__=i[s],a[s]=l):r[s]=new W(t,i[s]);for(;s<c;++s)(l=e[s])&&(o[s]=l)}function _(t,e,r,a,o,i,s){var l,c,f=new Map,g=e.length,p=i.length,m=new Array(g),E;for(l=0;l<g;++l)(c=e[l])&&(m[l]=E=s.call(c,c.__data__,l,e)+"",f.has(E)?o[l]=c:f.set(E,c));for(l=0;l<p;++l)E=s.call(t,i[l],l,i)+"",(c=f.get(E))?(a[l]=c,c.__data__=i[l],f.delete(E)):r[l]=new W(t,i[l]);for(l=0;l<g;++l)(c=e[l])&&f.get(m[l])===c&&(o[l]=c)}function k(t){return t.__data__}function q(t,e){if(!arguments.length)return Array.from(this,k);var r=e?_:Z,a=this._parents,o=this._groups;typeof t!="function"&&(t=H(t));for(var i=o.length,s=new Array(i),l=new Array(i),c=new Array(i),f=0;f<i;++f){var g=a[f],p=o[f],m=p.length,E=et(t.call(g,g&&g.__data__,f,a)),w=E.length,U=l[f]=new Array(w),N=s[f]=new Array(w),D=c[f]=new Array(m);r(g,p,U,N,D,E,e);for(var Y=0,J=0,K,nt;Y<w;++Y)if(K=U[Y]){for(Y>=J&&(J=Y+1);!(nt=N[J])&&++J<w;);K._next=nt||null}}return s=new Oe(s,a),s._enter=l,s._exit=c,s}function et(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function rt(){return new Oe(this._exit||this._groups.map(V),this._parents)}function at(t,e,r){var a=this.enter(),o=this,i=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?i.remove():r(i),a&&o?a.merge(o).order():o}function dt(t){for(var e=t.selection?t.selection():t,r=this._groups,a=e._groups,o=r.length,i=a.length,s=Math.min(o,i),l=new Array(o),c=0;c<s;++c)for(var f=r[c],g=a[c],p=f.length,m=l[c]=new Array(p),E,w=0;w<p;++w)(E=f[w]||g[w])&&(m[w]=E);for(;c<o;++c)l[c]=r[c];return new Oe(l,this._parents)}function xt(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var a=t[e],o=a.length-1,i=a[o],s;--o>=0;)(s=a[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function gt(t){t||(t=ht);function e(p,m){return p&&m?t(p.__data__,m.__data__):!p-!m}for(var r=this._groups,a=r.length,o=new Array(a),i=0;i<a;++i){for(var s=r[i],l=s.length,c=o[i]=new Array(l),f,g=0;g<l;++g)(f=s[g])&&(c[g]=f);c.sort(e)}return new Oe(o,this._parents).order()}function ht(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Mt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function $t(){return Array.from(this)}function zt(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,i=a.length;o<i;++o){var s=a[o];if(s)return s}return null}function Ht(){let t=0;for(const e of this)++t;return t}function _t(){return!this.node()}function Ee(t){for(var e=this._groups,r=0,a=e.length;r<a;++r)for(var o=e[r],i=0,s=o.length,l;i<s;++i)(l=o[i])&&t.call(l,l.__data__,i,o);return this}var ue="http://www.w3.org/1999/xhtml",te={svg:"http://www.w3.org/2000/svg",xhtml:ue,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nt(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),te.hasOwnProperty(e)?{space:te[e],local:t}:t}function Yt(t){return function(){this.removeAttribute(t)}}function ne(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fe(t,e){return function(){this.setAttribute(t,e)}}function ee(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function le(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Me(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Ne(t,e){var r=Nt(t);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((e==null?r.local?ne:Yt:typeof e=="function"?r.local?Me:le:r.local?ee:fe)(r,e))}function $e(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ae(t){return function(){this.style.removeProperty(t)}}function Ae(t,e,r){return function(){this.style.setProperty(t,e,r)}}function xe(t,e,r){return function(){var a=e.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,r)}}function ge(t,e,r){return arguments.length>1?this.each((e==null?ae:typeof e=="function"?xe:Ae)(t,e,r==null?"":r)):bt(this.node(),t)}function bt(t,e){return t.style.getPropertyValue(e)||$e(t).getComputedStyle(t,null).getPropertyValue(e)}function Ut(t){return function(){delete this[t]}}function ie(t,e){return function(){this[t]=e}}function Lt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Jt(t,e){return arguments.length>1?this.each((e==null?Ut:typeof e=="function"?Lt:ie)(t,e)):this.node()[t]}function Qt(t){return t.trim().split(/^|\s+/)}function Gt(t){return t.classList||new me(t)}function me(t){this._node=t,this._names=Qt(t.getAttribute("class")||"")}me.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function He(t,e){for(var r=Gt(t),a=-1,o=e.length;++a<o;)r.add(e[a])}function ft(t,e){for(var r=Gt(t),a=-1,o=e.length;++a<o;)r.remove(e[a])}function Rt(t){return function(){He(this,t)}}function Ct(t){return function(){ft(this,t)}}function Pt(t,e){return function(){(e.apply(this,arguments)?He:ft)(this,t)}}function Ft(t,e){var r=Qt(t+"");if(arguments.length<2){for(var a=Gt(this.node()),o=-1,i=r.length;++o<i;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?Pt:e?Rt:Ct)(r,e))}function Et(){this.textContent=""}function oe(t){return function(){this.textContent=t}}function we(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function It(t){return arguments.length?this.each(t==null?Et:(typeof t=="function"?we:oe)(t)):this.node().textContent}function Vt(){this.innerHTML=""}function Xt(t){return function(){this.innerHTML=t}}function Kt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function de(t){return arguments.length?this.each(t==null?Vt:(typeof t=="function"?Kt:Xt)(t)):this.node().innerHTML}function be(){this.nextSibling&&this.parentNode.appendChild(this)}function We(){return this.each(be)}function Je(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nn(){return this.each(Je)}function yn(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===ue&&e.documentElement.namespaceURI===ue?e.createElement(t):e.createElementNS(r,t)}}function Vn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wr(t){var e=Nt(t);return(e.local?Vn:yn)(e)}function Ka(t){var e=typeof t=="function"?t:Wr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function pa(){return null}function xr(t,e){var r=typeof t=="function"?t:Wr(t),a=e==null?pa:typeof e=="function"?e:v(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function Xn(){var t=this.parentNode;t&&t.removeChild(this)}function Za(){return this.each(Xn)}function sr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Zn(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ma(t){return this.select(t?Zn:sr)}function Tr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function $n(t){return function(e){t.call(this,e,this.__data__)}}function Nn(t){return t.trim().split(/^|\s+/).map(function(e){var r="",a=e.indexOf(".");return a>=0&&(r=e.slice(a+1),e=e.slice(0,a)),{type:e,name:r}})}function Ja(t){return function(){var e=this.__on;if(e){for(var r=0,a=-1,o=e.length,i;r<o;++r)i=e[r],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++a]=i;++a?e.length=a:delete this.__on}}}function Qa(t,e,r){return function(){var a=this.__on,o,i=$n(e);if(a){for(var s=0,l=a.length;s<l;++s)if((o=a[s]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=r),o.value=e;return}}this.addEventListener(t.type,i,r),o={type:t.type,name:t.name,value:e,listener:i,options:r},a?a.push(o):this.__on=[o]}}function ut(t,e,r){var a=Nn(t+""),o,i=a.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,g;c<f;++c)for(o=0,g=l[c];o<i;++o)if((s=a[o]).type===g.type&&s.name===g.name)return g.value}return}for(l=e?Qa:Ja,o=0;o<i;++o)this.each(l(a[o],e,r));return this}function wt(t,e,r){var a=$e(t),o=a.CustomEvent;typeof o=="function"?o=new o(e,r):(o=a.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function mt(t,e){return function(){return wt(this,t,e)}}function st(t,e){return function(){return wt(this,t,e.apply(this,arguments))}}function Ot(t,e){return this.each((typeof e=="function"?st:mt)(t,e))}function*ye(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,i=a.length,s;o<i;++o)(s=a[o])&&(yield s)}var qt=[null];function Oe(t,e){this._groups=t,this._parents=e}function rn(){return new Oe([[document.documentElement]],qt)}function hn(){return this}Oe.prototype=rn.prototype={constructor:Oe,select:y,selectAll:I,selectChild:L,selectChildren:j,filter:G,data:q,enter:X,exit:rt,join:at,merge:dt,selection:hn,order:xt,sort:gt,call:Mt,nodes:$t,node:zt,size:Ht,empty:_t,each:Ee,attr:Ne,style:ge,property:Jt,classed:Ft,text:It,html:de,raise:We,lower:nn,append:Ka,insert:xr,remove:Za,clone:ma,datum:Tr,on:ut,dispatch:Ot,[Symbol.iterator]:ye};var xn=rn;function it(t){return typeof t=="string"?new Oe([[document.querySelector(t)]],[document.documentElement]):new Oe([[t]],qt)}const an=new Date,Bn=new Date;function en(t,e,r,a){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{const s=o(i),l=o.ceil(i);return i-s<l-i?s:l},o.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,l)=>{const c=[];if(i=o.ceil(i),l=l==null?1:Math.floor(l),!(i<s)||!(l>0))return c;let f;do c.push(f=new Date(+i)),e(i,l),t(i);while(f<i&&i<s);return c},o.filter=i=>en(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!i(s););else for(;--l>=0;)for(;e(s,1),!i(s););}),r&&(o.count=(i,s)=>(an.setTime(+i),Bn.setTime(+s),t(an),t(Bn),Math.floor(r(an,Bn))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(a?s=>a(s)%i===0:s=>o.count(0,s)%i===0):o)),o}const Hn=1e3,Pn=Hn*60,Un=Pn*60,lr=Un*24,ri=lr*7,ws=lr*30,ai=lr*365;function Rr(t){return en(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Pn)/ri)}const ka=Rr(0),qa=Rr(1),Df=Rr(2),Nf=Rr(3),Yr=Rr(4),Lf=Rr(5),Ff=Rr(6),Y0=ka.range,K0=qa.range,Z0=Df.range,J0=Nf.range,Q0=Yr.range,k0=Lf.range,q0=Ff.range;function Or(t){return en(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/ri)}const _a=Or(0),to=Or(1),Bf=Or(2),Uf=Or(3),Kr=Or(4),zf=Or(5),jf=Or(6),_0=_a.range,t1=to.range,e1=Bf.range,n1=Uf.range,r1=Kr.range,a1=zf.range,o1=jf.range,ya=en(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Pn)/lr,t=>t.getDate()-1),i1=ya.range,eo=en(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lr,t=>t.getUTCDate()-1),s1=eo.range,Ds=en(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lr,t=>Math.floor(t/lr)),l1=Ds.range,cr=en(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());cr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:en(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});const c1=cr.range,ur=en(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());ur.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:en(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});const u1=ur.range;function oi(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ii(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function xa(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function Gf(t){var e=t.dateTime,r=t.date,a=t.time,o=t.periods,i=t.days,s=t.shortDays,l=t.months,c=t.shortMonths,f=Ta(o),g=Sa(o),p=Ta(i),m=Sa(i),E=Ta(s),w=Sa(s),U=Ta(l),N=Sa(l),D=Ta(c),Y=Sa(c),J={a:At,A:Wt,b:Dt,B:Zt,c:null,d:zs,e:zs,f:ud,g:Td,G:$d,H:sd,I:ld,j:cd,L:js,m:fd,M:dd,p:re,q:ce,Q:Ys,s:Ks,S:hd,u:vd,U:gd,V:pd,w:md,W:yd,x:null,X:null,y:xd,Y:Sd,Z:Ad,"%":Ws},K={a:Ie,A:Ce,b:Pe,B:Ye,c:null,d:Vs,e:Vs,f:Rd,g:Bd,G:zd,H:Ed,I:bd,j:Id,L:Xs,m:Od,M:Cd,p:Be,q:dn,Q:Ys,s:Ks,S:Pd,u:Md,U:wd,V:Dd,w:Nd,W:Ld,x:null,X:null,y:Fd,Y:Ud,Z:jd,"%":Ws},nt={a:yt,A:lt,b:jt,B:vt,c:tt,d:Bs,e:Bs,f:rd,g:Fs,G:Ls,H:Us,I:Us,j:_f,L:nd,m:qf,M:td,p:Tt,q:kf,Q:od,s:id,S:ed,u:Yf,U:Kf,V:Zf,w:Wf,W:Jf,x:St,X:ct,y:Fs,Y:Ls,Z:Qf,"%":ad};J.x=Q(r,J),J.X=Q(a,J),J.c=Q(e,J),K.x=Q(r,K),K.X=Q(a,K),K.c=Q(e,K);function Q(kt,Te){return function(Re){var Bt=[],un=-1,Xe=0,wn=kt.length,Dn,ve,fn;for(Re instanceof Date||(Re=new Date(+Re));++un<wn;)kt.charCodeAt(un)===37&&(Bt.push(kt.slice(Xe,un)),(ve=Ns[Dn=kt.charAt(++un)])!=null?Dn=kt.charAt(++un):ve=Dn==="e"?" ":"0",(fn=Te[Dn])&&(Dn=fn(Re,ve)),Bt.push(Dn),Xe=un+1);return Bt.push(kt.slice(Xe,un)),Bt.join("")}}function ot(kt,Te){return function(Re){var Bt=xa(1900,void 0,1),un=pt(Bt,kt,Re+="",0),Xe,wn;if(un!=Re.length)return null;if("Q"in Bt)return new Date(Bt.Q);if("s"in Bt)return new Date(Bt.s*1e3+("L"in Bt?Bt.L:0));if(Te&&!("Z"in Bt)&&(Bt.Z=0),"p"in Bt&&(Bt.H=Bt.H%12+Bt.p*12),Bt.m===void 0&&(Bt.m="q"in Bt?Bt.q:0),"V"in Bt){if(Bt.V<1||Bt.V>53)return null;"w"in Bt||(Bt.w=1),"Z"in Bt?(Xe=ii(xa(Bt.y,0,1)),wn=Xe.getUTCDay(),Xe=wn>4||wn===0?to.ceil(Xe):to(Xe),Xe=eo.offset(Xe,(Bt.V-1)*7),Bt.y=Xe.getUTCFullYear(),Bt.m=Xe.getUTCMonth(),Bt.d=Xe.getUTCDate()+(Bt.w+6)%7):(Xe=oi(xa(Bt.y,0,1)),wn=Xe.getDay(),Xe=wn>4||wn===0?qa.ceil(Xe):qa(Xe),Xe=ya.offset(Xe,(Bt.V-1)*7),Bt.y=Xe.getFullYear(),Bt.m=Xe.getMonth(),Bt.d=Xe.getDate()+(Bt.w+6)%7)}else("W"in Bt||"U"in Bt)&&("w"in Bt||(Bt.w="u"in Bt?Bt.u%7:"W"in Bt?1:0),wn="Z"in Bt?ii(xa(Bt.y,0,1)).getUTCDay():oi(xa(Bt.y,0,1)).getDay(),Bt.m=0,Bt.d="W"in Bt?(Bt.w+6)%7+Bt.W*7-(wn+5)%7:Bt.w+Bt.U*7-(wn+6)%7);return"Z"in Bt?(Bt.H+=Bt.Z/100|0,Bt.M+=Bt.Z%100,ii(Bt)):oi(Bt)}}function pt(kt,Te,Re,Bt){for(var un=0,Xe=Te.length,wn=Re.length,Dn,ve;un<Xe;){if(Bt>=wn)return-1;if(Dn=Te.charCodeAt(un++),Dn===37){if(Dn=Te.charAt(un++),ve=nt[Dn in Ns?Te.charAt(un++):Dn],!ve||(Bt=ve(kt,Re,Bt))<0)return-1}else if(Dn!=Re.charCodeAt(Bt++))return-1}return Bt}function Tt(kt,Te,Re){var Bt=f.exec(Te.slice(Re));return Bt?(kt.p=g.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function yt(kt,Te,Re){var Bt=E.exec(Te.slice(Re));return Bt?(kt.w=w.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function lt(kt,Te,Re){var Bt=p.exec(Te.slice(Re));return Bt?(kt.w=m.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function jt(kt,Te,Re){var Bt=D.exec(Te.slice(Re));return Bt?(kt.m=Y.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function vt(kt,Te,Re){var Bt=U.exec(Te.slice(Re));return Bt?(kt.m=N.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function tt(kt,Te,Re){return pt(kt,e,Te,Re)}function St(kt,Te,Re){return pt(kt,r,Te,Re)}function ct(kt,Te,Re){return pt(kt,a,Te,Re)}function At(kt){return s[kt.getDay()]}function Wt(kt){return i[kt.getDay()]}function Dt(kt){return c[kt.getMonth()]}function Zt(kt){return l[kt.getMonth()]}function re(kt){return o[+(kt.getHours()>=12)]}function ce(kt){return 1+~~(kt.getMonth()/3)}function Ie(kt){return s[kt.getUTCDay()]}function Ce(kt){return i[kt.getUTCDay()]}function Pe(kt){return c[kt.getUTCMonth()]}function Ye(kt){return l[kt.getUTCMonth()]}function Be(kt){return o[+(kt.getUTCHours()>=12)]}function dn(kt){return 1+~~(kt.getUTCMonth()/3)}return{format:function(kt){var Te=Q(kt+="",J);return Te.toString=function(){return kt},Te},parse:function(kt){var Te=ot(kt+="",!1);return Te.toString=function(){return kt},Te},utcFormat:function(kt){var Te=Q(kt+="",K);return Te.toString=function(){return kt},Te},utcParse:function(kt){var Te=ot(kt+="",!0);return Te.toString=function(){return kt},Te}}}var Ns={"-":"",_:" ",0:"0"},Tn=/^\s*\d+/,Vf=/^%/,Xf=/[\\^$*+?|[\]().{}]/g;function Fe(t,e,r){var a=t<0?"-":"",o=(a?-t:t)+"",i=o.length;return a+(i<r?new Array(r-i+1).join(e)+o:o)}function Hf(t){return t.replace(Xf,"\\$&")}function Ta(t){return new RegExp("^(?:"+t.map(Hf).join("|")+")","i")}function Sa(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function Wf(t,e,r){var a=Tn.exec(e.slice(r,r+1));return a?(t.w=+a[0],r+a[0].length):-1}function Yf(t,e,r){var a=Tn.exec(e.slice(r,r+1));return a?(t.u=+a[0],r+a[0].length):-1}function Kf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.U=+a[0],r+a[0].length):-1}function Zf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.V=+a[0],r+a[0].length):-1}function Jf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.W=+a[0],r+a[0].length):-1}function Ls(t,e,r){var a=Tn.exec(e.slice(r,r+4));return a?(t.y=+a[0],r+a[0].length):-1}function Fs(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.y=+a[0]+(+a[0]>68?1900:2e3),r+a[0].length):-1}function Qf(t,e,r){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return a?(t.Z=a[1]?0:-(a[2]+(a[3]||"00")),r+a[0].length):-1}function kf(t,e,r){var a=Tn.exec(e.slice(r,r+1));return a?(t.q=a[0]*3-3,r+a[0].length):-1}function qf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.m=a[0]-1,r+a[0].length):-1}function Bs(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.d=+a[0],r+a[0].length):-1}function _f(t,e,r){var a=Tn.exec(e.slice(r,r+3));return a?(t.m=0,t.d=+a[0],r+a[0].length):-1}function Us(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.H=+a[0],r+a[0].length):-1}function td(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.M=+a[0],r+a[0].length):-1}function ed(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.S=+a[0],r+a[0].length):-1}function nd(t,e,r){var a=Tn.exec(e.slice(r,r+3));return a?(t.L=+a[0],r+a[0].length):-1}function rd(t,e,r){var a=Tn.exec(e.slice(r,r+6));return a?(t.L=Math.floor(a[0]/1e3),r+a[0].length):-1}function ad(t,e,r){var a=Vf.exec(e.slice(r,r+1));return a?r+a[0].length:-1}function od(t,e,r){var a=Tn.exec(e.slice(r));return a?(t.Q=+a[0],r+a[0].length):-1}function id(t,e,r){var a=Tn.exec(e.slice(r));return a?(t.s=+a[0],r+a[0].length):-1}function zs(t,e){return Fe(t.getDate(),e,2)}function sd(t,e){return Fe(t.getHours(),e,2)}function ld(t,e){return Fe(t.getHours()%12||12,e,2)}function cd(t,e){return Fe(1+ya.count(cr(t),t),e,3)}function js(t,e){return Fe(t.getMilliseconds(),e,3)}function ud(t,e){return js(t,e)+"000"}function fd(t,e){return Fe(t.getMonth()+1,e,2)}function dd(t,e){return Fe(t.getMinutes(),e,2)}function hd(t,e){return Fe(t.getSeconds(),e,2)}function vd(t){var e=t.getDay();return e===0?7:e}function gd(t,e){return Fe(ka.count(cr(t)-1,t),e,2)}function Gs(t){var e=t.getDay();return e>=4||e===0?Yr(t):Yr.ceil(t)}function pd(t,e){return t=Gs(t),Fe(Yr.count(cr(t),t)+(cr(t).getDay()===4),e,2)}function md(t){return t.getDay()}function yd(t,e){return Fe(qa.count(cr(t)-1,t),e,2)}function xd(t,e){return Fe(t.getFullYear()%100,e,2)}function Td(t,e){return t=Gs(t),Fe(t.getFullYear()%100,e,2)}function Sd(t,e){return Fe(t.getFullYear()%1e4,e,4)}function $d(t,e){var r=t.getDay();return t=r>=4||r===0?Yr(t):Yr.ceil(t),Fe(t.getFullYear()%1e4,e,4)}function Ad(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Fe(e/60|0,"0",2)+Fe(e%60,"0",2)}function Vs(t,e){return Fe(t.getUTCDate(),e,2)}function Ed(t,e){return Fe(t.getUTCHours(),e,2)}function bd(t,e){return Fe(t.getUTCHours()%12||12,e,2)}function Id(t,e){return Fe(1+eo.count(ur(t),t),e,3)}function Xs(t,e){return Fe(t.getUTCMilliseconds(),e,3)}function Rd(t,e){return Xs(t,e)+"000"}function Od(t,e){return Fe(t.getUTCMonth()+1,e,2)}function Cd(t,e){return Fe(t.getUTCMinutes(),e,2)}function Pd(t,e){return Fe(t.getUTCSeconds(),e,2)}function Md(t){var e=t.getUTCDay();return e===0?7:e}function wd(t,e){return Fe(_a.count(ur(t)-1,t),e,2)}function Hs(t){var e=t.getUTCDay();return e>=4||e===0?Kr(t):Kr.ceil(t)}function Dd(t,e){return t=Hs(t),Fe(Kr.count(ur(t),t)+(ur(t).getUTCDay()===4),e,2)}function Nd(t){return t.getUTCDay()}function Ld(t,e){return Fe(to.count(ur(t)-1,t),e,2)}function Fd(t,e){return Fe(t.getUTCFullYear()%100,e,2)}function Bd(t,e){return t=Hs(t),Fe(t.getUTCFullYear()%100,e,2)}function Ud(t,e){return Fe(t.getUTCFullYear()%1e4,e,4)}function zd(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Kr(t):Kr.ceil(t),Fe(t.getUTCFullYear()%1e4,e,4)}function jd(){return"+0000"}function Ws(){return"%"}function Ys(t){return+t}function Ks(t){return Math.floor(+t/1e3)}var Zr,si,Zs,li,Js;Gd({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Gd(t){return Zr=Gf(t),si=Zr.format,Zs=Zr.parse,li=Zr.utcFormat,Js=Zr.utcParse,Zr}var Vd=Object.defineProperty,Qs=Object.getOwnPropertySymbols,Xd=Object.prototype.hasOwnProperty,Hd=Object.prototype.propertyIsEnumerable,ks=(t,e,r)=>e in t?Vd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ke=(t,e)=>{for(var r in e||(e={}))Xd.call(e,r)&&ks(t,r,e[r]);if(Qs)for(var r of Qs(e))Hd.call(e,r)&&ks(t,r,e[r]);return t};const Se={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},Ve={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},no={area:"bb-area",areas:"bb-areas"},vn={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},zn={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},fr={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},An={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},ci={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},Cr={dragarea:"bb-dragarea",INCLUDED:"_included_"},$a={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},jn={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Ke={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},dr={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},Jn={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},qe={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},on={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Sr={level:"bb-level",levels:"bb-levels"},qs={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},Aa={region:"bb-region",regions:"bb-regions"},tn={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},sn={shape:"bb-shape",shapes:"bb-shapes"},_s={brush:"bb-brush",subchart:"bb-subchart"},gn={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},ro={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},tl={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},ui={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var je=ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke({},Se),Ve),no),vn),zn),fr),An),ci),Cr),jn),Ke),dr),Jn),qe),$a),on),qs),Aa),tn),sn),_s),gn),ro),tl),ui),Wd={boost_useCssRule:!1,boost_useWorker:!1},Yd={color_pattern:[],color_tiles:void 0,color_threshold:{},color_onover:void 0},Kd={legend_contents_bindto:void 0,legend_contents_template:"<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",legend_equally:!1,legend_hide:!1,legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_interaction:!0,legend_item_dblclick:!1,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_item_tile_width:10,legend_item_tile_height:10,legend_item_tile_r:5,legend_item_tile_type:"rectangle",legend_format:void 0,legend_padding:0,legend_position:"bottom",legend_show:!0,legend_tooltip:!1,legend_usePoint:!1},Zd={bindto:"#chart",background:{},clipPath:!0,svg_classname:void 0,size_width:void 0,size_height:void 0,padding:!0,padding_mode:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,resize_timer:!0,onclick:void 0,onover:void 0,onout:void 0,onresize:void 0,onresized:void 0,onbeforeinit:void 0,oninit:void 0,onafterinit:void 0,onrendered:void 0,transition_duration:250,plugins:[],render:{},regions:[]},Jd={title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"center"},Qd={tooltip_show:!0,tooltip_doNotHide:!1,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:{},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:void 0,tooltip_linked:!1,tooltip_linked_name:"",tooltip_onshow:()=>{},tooltip_onhide:()=>{},tooltip_onshown:()=>{},tooltip_onhidden:()=>{},tooltip_order:null},kd={data_x:void 0,data_idConverter:t=>t,data_names:{},data_classes:{},data_type:void 0,data_types:{},data_order:"desc",data_groups:[],data_groupsZeroAs:"positive",data_color:void 0,data_colors:{},data_labels:{},data_labels_backgroundColors:void 0,data_labels_colors:void 0,data_labels_position:{},data_labels_imgUrl:void 0,data_hide:!1,data_filter:void 0,data_onclick:()=>{},data_onover:()=>{},data_onout:()=>{},data_onshown:void 0,data_onhidden:void 0,data_onmin:void 0,data_onmax:void 0,data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:"csv",data_keys:void 0,data_empty_label_text:""},qd={interaction_enabled:!0,interaction_brighten:!0,interaction_inputType_mouse:!0,interaction_inputType_touch:{},interaction_onout:!0},_d={value:()=>{}};function el(){for(var t=0,e=arguments.length,r={},a;t<e;++t){if(!(a=arguments[t]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new ao(r)}function ao(t){this._=t}function th(t,e){return t.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}ao.prototype=el.prototype={constructor:ao,on:function(t,e){var r=this._,a=th(t+"",r),o,i=-1,s=a.length;if(arguments.length<2){for(;++i<s;)if((o=(t=a[i]).type)&&(o=eh(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(o=(t=a[i]).type)r[o]=nl(r[o],t.name,e);else if(e==null)for(o in r)r[o]=nl(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new ao(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,i;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],a=0,o=i.length;a<o;++a)i[a].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],o=0,i=a.length;o<i;++o)a[o].value.apply(e,r)}};function eh(t,e){for(var r=0,a=t.length,o;r<a;++r)if((o=t[r]).name===e)return o.value}function nl(t,e,r){for(var a=0,o=t.length;a<o;++a)if(t[a].name===e){t[a]=_d,t=t.slice(0,a).concat(t.slice(a+1));break}return r!=null&&t.push({name:e,value:r}),t}var oo=el;const nh={passive:!1},Ea={capture:!0,passive:!1};function fi(t){t.stopImmediatePropagation()}function Jr(t){t.preventDefault(),t.stopImmediatePropagation()}function di(t){var e=t.document.documentElement,r=it(t).on("dragstart.drag",Jr,Ea);"onselectstart"in e?r.on("selectstart.drag",Jr,Ea):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function hi(t,e){var r=t.document.documentElement,a=it(t).on("dragstart.drag",null);e&&(a.on("click.drag",Jr,Ea),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function vi(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function rl(t,e){var r=Object.create(t.prototype);for(var a in e)r[a]=e[a];return r}function ba(){}var Ia=.7,io=1/Ia,Qr="\\s*([+-]?\\d+)\\s*",Ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,ah=new RegExp(`^rgb\\(${Qr},${Qr},${Qr}\\)$`),oh=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),ih=new RegExp(`^rgba\\(${Qr},${Qr},${Qr},${Ra}\\)$`),sh=new RegExp(`^rgba\\(${er},${er},${er},${Ra}\\)$`),lh=new RegExp(`^hsl\\(${Ra},${er},${er}\\)$`),ch=new RegExp(`^hsla\\(${Ra},${er},${er},${Ra}\\)$`),al={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vi(ba,Pr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ol,formatHex:ol,formatHex8:uh,formatHsl:fh,formatRgb:il,toString:il});function ol(){return this.rgb().formatHex()}function uh(){return this.rgb().formatHex8()}function fh(){return fl(this).formatHsl()}function il(){return this.rgb().formatRgb()}function Pr(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=rh.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?sl(e):r===3?new Ln(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?so(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?so(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ah.exec(t))?new Ln(e[1],e[2],e[3],1):(e=oh.exec(t))?new Ln(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ih.exec(t))?so(e[1],e[2],e[3],e[4]):(e=sh.exec(t))?so(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=lh.exec(t))?ul(e[1],e[2]/100,e[3]/100,1):(e=ch.exec(t))?ul(e[1],e[2]/100,e[3]/100,e[4]):al.hasOwnProperty(t)?sl(al[t]):t==="transparent"?new Ln(NaN,NaN,NaN,0):null}function sl(t){return new Ln(t>>16&255,t>>8&255,t&255,1)}function so(t,e,r,a){return a<=0&&(t=e=r=NaN),new Ln(t,e,r,a)}function dh(t){return t instanceof ba||(t=Pr(t)),t?(t=t.rgb(),new Ln(t.r,t.g,t.b,t.opacity)):new Ln}function lo(t,e,r,a){return arguments.length===1?dh(t):new Ln(t,e,r,a==null?1:a)}function Ln(t,e,r,a){this.r=+t,this.g=+e,this.b=+r,this.opacity=+a}vi(Ln,lo,rl(ba,{brighter(t){return t=t==null?io:Math.pow(io,t),new Ln(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ia:Math.pow(Ia,t),new Ln(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ln(Mr(this.r),Mr(this.g),Mr(this.b),co(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ll,formatHex:ll,formatHex8:hh,formatRgb:cl,toString:cl}));function ll(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}`}function hh(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}${wr((isNaN(this.opacity)?1:this.opacity)*255)}`}function cl(){const t=co(this.opacity);return`${t===1?"rgb(":"rgba("}${Mr(this.r)}, ${Mr(this.g)}, ${Mr(this.b)}${t===1?")":`, ${t})`}`}function co(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Mr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function wr(t){return t=Mr(t),(t<16?"0":"")+t.toString(16)}function ul(t,e,r,a){return a<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Qn(t,e,r,a)}function fl(t){if(t instanceof Qn)return new Qn(t.h,t.s,t.l,t.opacity);if(t instanceof ba||(t=Pr(t)),!t)return new Qn;if(t instanceof Qn)return t;t=t.rgb();var e=t.r/255,r=t.g/255,a=t.b/255,o=Math.min(e,r,a),i=Math.max(e,r,a),s=NaN,l=i-o,c=(i+o)/2;return l?(e===i?s=(r-a)/l+(r<a)*6:r===i?s=(a-e)/l+2:s=(e-r)/l+4,l/=c<.5?i+o:2-i-o,s*=60):l=c>0&&c<1?0:s,new Qn(s,l,c,t.opacity)}function vh(t,e,r,a){return arguments.length===1?fl(t):new Qn(t,e,r,a==null?1:a)}function Qn(t,e,r,a){this.h=+t,this.s=+e,this.l=+r,this.opacity=+a}vi(Qn,vh,rl(ba,{brighter(t){return t=t==null?io:Math.pow(io,t),new Qn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ia:Math.pow(Ia,t),new Qn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*e,o=2*r-a;return new Ln(gi(t>=240?t-240:t+120,o,a),gi(t,o,a),gi(t<120?t+240:t-120,o,a),this.opacity)},clamp(){return new Qn(dl(this.h),uo(this.s),uo(this.l),co(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=co(this.opacity);return`${t===1?"hsl(":"hsla("}${dl(this.h)}, ${uo(this.s)*100}%, ${uo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dl(t){return t=(t||0)%360,t<0?t+360:t}function uo(t){return Math.max(0,Math.min(1,t||0))}function gi(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function hl(t,e,r,a,o){var i=t*t,s=i*t;return((1-3*t+3*i-s)*e+(4-6*i+3*s)*r+(1+3*t+3*i-3*s)*a+s*o)/6}function gh(t){var e=t.length-1;return function(r){var a=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[a],i=t[a+1],s=a>0?t[a-1]:2*o-i,l=a<e-1?t[a+2]:2*i-o;return hl((r-a/e)*e,s,o,i,l)}}function ph(t){var e=t.length;return function(r){var a=Math.floor(((r%=1)<0?++r:r)*e),o=t[(a+e-1)%e],i=t[a%e],s=t[(a+1)%e],l=t[(a+2)%e];return hl((r-a/e)*e,o,i,s,l)}}var fo=(t=>()=>t);function vl(t,e){return function(r){return t+r*e}}function mh(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(a){return Math.pow(t+a*e,r)}}function f1(t,e){var r=e-t;return r?vl(t,r>180||r<-180?r-360*Math.round(r/360):r):fo(isNaN(t)?e:t)}function yh(t){return(t=+t)==1?gl:function(e,r){return r-e?mh(e,r,t):fo(isNaN(e)?r:e)}}function gl(t,e){var r=e-t;return r?vl(t,r):fo(isNaN(t)?e:t)}var ho=(function t(e){var r=yh(e);function a(o,i){var s=r((o=lo(o)).r,(i=lo(i)).r),l=r(o.g,i.g),c=r(o.b,i.b),f=gl(o.opacity,i.opacity);return function(g){return o.r=s(g),o.g=l(g),o.b=c(g),o.opacity=f(g),o+""}}return a.gamma=t,a})(1);function pl(t){return function(e){var r=e.length,a=new Array(r),o=new Array(r),i=new Array(r),s,l;for(s=0;s<r;++s)l=lo(e[s]),a[s]=l.r||0,o[s]=l.g||0,i[s]=l.b||0;return a=t(a),o=t(o),i=t(i),l.opacity=1,function(c){return l.r=a(c),l.g=o(c),l.b=i(c),l+""}}}var d1=pl(gh),h1=pl(ph);function ml(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,a=e.slice(),o;return function(i){for(o=0;o<r;++o)a[o]=t[o]*(1-i)+e[o]*i;return a}}function yl(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function v1(t,e){return(yl(e)?ml:xl)(t,e)}function xl(t,e){var r=e?e.length:0,a=t?Math.min(r,t.length):0,o=new Array(a),i=new Array(r),s;for(s=0;s<a;++s)o[s]=kr(t[s],e[s]);for(;s<r;++s)i[s]=e[s];return function(l){for(s=0;s<a;++s)i[s]=o[s](l);return i}}function xh(t,e){var r=new Date;return t=+t,e=+e,function(a){return r.setTime(t*(1-a)+e*a),r}}function kn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Th(t,e){var r={},a={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?r[o]=kr(t[o],e[o]):a[o]=e[o];return function(i){for(o in r)a[o]=r[o](i);return a}}var pi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mi=new RegExp(pi.source,"g");function Sh(t){return function(){return t}}function $h(t){return function(e){return t(e)+""}}function Tl(t,e){var r=pi.lastIndex=mi.lastIndex=0,a,o,i,s=-1,l=[],c=[];for(t=t+"",e=e+"";(a=pi.exec(t))&&(o=mi.exec(e));)(i=o.index)>r&&(i=e.slice(r,i),l[s]?l[s]+=i:l[++s]=i),(a=a[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,c.push({i:s,x:kn(a,o)})),r=mi.lastIndex;return r<e.length&&(i=e.slice(r),l[s]?l[s]+=i:l[++s]=i),l.length<2?c[0]?$h(c[0].x):Sh(e):(e=c.length,function(f){for(var g=0,p;g<e;++g)l[(p=c[g]).i]=p.x(f);return l.join("")})}function kr(t,e){var r=typeof e,a;return e==null||r==="boolean"?fo(e):(r==="number"?kn:r==="string"?(a=Pr(e))?(e=a,ho):Tl:e instanceof Pr?ho:e instanceof Date?xh:yl(e)?ml:Array.isArray(e)?xl:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Th:kn)(t,e)}function Ah(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Wn(t,e){if(t=Ah(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var qr=0,Oa=0,Ca=0,Sl=1e3,vo,Pa,go=0,Dr=0,po=0,Ma=typeof performance=="object"&&performance.now?performance:Date,$l=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function yi(){return Dr||($l(Eh),Dr=Ma.now()+po)}function Eh(){Dr=0}function mo(){this._call=this._time=this._next=null}mo.prototype=Al.prototype={constructor:mo,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?yi():+r)+(e==null?0:+e),!this._next&&Pa!==this&&(Pa?Pa._next=this:vo=this,Pa=this),this._call=t,this._time=r,xi()},stop:function(){this._call&&(this._call=null,this._time=1/0,xi())}};function Al(t,e,r){var a=new mo;return a.restart(t,e,r),a}function bh(){yi(),++qr;for(var t=vo,e;t;)(e=Dr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--qr}function El(){Dr=(go=Ma.now())+po,qr=Oa=0;try{bh()}finally{qr=0,Rh(),Dr=0}}function Ih(){var t=Ma.now(),e=t-go;e>Sl&&(po-=e,go=t)}function Rh(){for(var t,e=vo,r,a=1/0;e;)e._call?(a>e._time&&(a=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:vo=r);Pa=t,xi(a)}function xi(t){if(!qr){Oa&&(Oa=clearTimeout(Oa));var e=t-Dr;e>24?(t<1/0&&(Oa=setTimeout(El,t-Ma.now()-po)),Ca&&(Ca=clearInterval(Ca))):(Ca||(go=Ma.now(),Ca=setInterval(Ih,Sl)),qr=1,$l(El))}}function bl(t,e,r){var a=new mo;return e=e==null?0:+e,a.restart(o=>{a.stop(),t(o+e)},e,r),a}var Oh=oo("start","end","cancel","interrupt"),Ch=[],Il=0,Rl=1,Ti=2,yo=3,Ol=4,Si=5,xo=6;function To(t,e,r,a,o,i){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Ph(t,r,{name:e,index:a,group:o,on:Oh,tween:Ch,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Il})}function $i(t,e){var r=qn(t,e);if(r.state>Il)throw new Error("too late; already scheduled");return r}function nr(t,e){var r=qn(t,e);if(r.state>yo)throw new Error("too late; already running");return r}function qn(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Ph(t,e,r){var a=t.__transition,o;a[e]=r,r.timer=Al(i,0,r.time);function i(f){r.state=Rl,r.timer.restart(s,r.delay,r.time),r.delay<=f&&s(f-r.delay)}function s(f){var g,p,m,E;if(r.state!==Rl)return c();for(g in a)if(E=a[g],E.name===r.name){if(E.state===yo)return bl(s);E.state===Ol?(E.state=xo,E.timer.stop(),E.on.call("interrupt",t,t.__data__,E.index,E.group),delete a[g]):+g<e&&(E.state=xo,E.timer.stop(),E.on.call("cancel",t,t.__data__,E.index,E.group),delete a[g])}if(bl(function(){r.state===yo&&(r.state=Ol,r.timer.restart(l,r.delay,r.time),l(f))}),r.state=Ti,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Ti){for(r.state=yo,o=new Array(m=r.tween.length),g=0,p=-1;g<m;++g)(E=r.tween[g].value.call(t,t.__data__,r.index,r.group))&&(o[++p]=E);o.length=p+1}}function l(f){for(var g=f<r.duration?r.ease.call(null,f/r.duration):(r.timer.restart(c),r.state=Si,1),p=-1,m=o.length;++p<m;)o[p].call(t,g);r.state===Si&&(r.on.call("end",t,t.__data__,r.index,r.group),c())}function c(){r.state=xo,r.timer.stop(),delete a[e];for(var f in a)return;delete t.__transition}}function _r(t,e){var r=t.__transition,a,o,i=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((a=r[s]).name!==e){i=!1;continue}o=a.state>Ti&&a.state<Si,a.state=xo,a.timer.stop(),a.on.call(o?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete r[s]}i&&delete t.__transition}}function Mh(t){return this.each(function(){_r(this,t)})}var Cl=180/Math.PI,Ai={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pl(t,e,r,a,o,i){var s,l,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*r+e*a)&&(r-=t*c,a-=e*c),(l=Math.sqrt(r*r+a*a))&&(r/=l,a/=l,c/=l),t*a<e*r&&(t=-t,e=-e,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Cl,skewX:Math.atan(c)*Cl,scaleX:s,scaleY:l}}var So;function wh(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ai:Pl(e.a,e.b,e.c,e.d,e.e,e.f)}function Dh(t){return t==null||(So||(So=document.createElementNS("http://www.w3.org/2000/svg","g")),So.setAttribute("transform",t),!(t=So.transform.baseVal.consolidate()))?Ai:(t=t.matrix,Pl(t.a,t.b,t.c,t.d,t.e,t.f))}function Ml(t,e,r,a){function o(f){return f.length?f.pop()+" ":""}function i(f,g,p,m,E,w){if(f!==p||g!==m){var U=E.push("translate(",null,e,null,r);w.push({i:U-4,x:kn(f,p)},{i:U-2,x:kn(g,m)})}else(p||m)&&E.push("translate("+p+e+m+r)}function s(f,g,p,m){f!==g?(f-g>180?g+=360:g-f>180&&(f+=360),m.push({i:p.push(o(p)+"rotate(",null,a)-2,x:kn(f,g)})):g&&p.push(o(p)+"rotate("+g+a)}function l(f,g,p,m){f!==g?m.push({i:p.push(o(p)+"skewX(",null,a)-2,x:kn(f,g)}):g&&p.push(o(p)+"skewX("+g+a)}function c(f,g,p,m,E,w){if(f!==p||g!==m){var U=E.push(o(E)+"scale(",null,",",null,")");w.push({i:U-4,x:kn(f,p)},{i:U-2,x:kn(g,m)})}else(p!==1||m!==1)&&E.push(o(E)+"scale("+p+","+m+")")}return function(f,g){var p=[],m=[];return f=t(f),g=t(g),i(f.translateX,f.translateY,g.translateX,g.translateY,p,m),s(f.rotate,g.rotate,p,m),l(f.skewX,g.skewX,p,m),c(f.scaleX,f.scaleY,g.scaleX,g.scaleY,p,m),f=g=null,function(E){for(var w=-1,U=m.length,N;++w<U;)p[(N=m[w]).i]=N.x(E);return p.join("")}}}var Nh=Ml(wh,"px, ","px)","deg)"),Lh=Ml(Dh,", ",")",")");function Fh(t,e){var r,a;return function(){var o=nr(this,t),i=o.tween;if(i!==r){a=r=i;for(var s=0,l=a.length;s<l;++s)if(a[s].name===e){a=a.slice(),a.splice(s,1);break}}o.tween=a}}function Bh(t,e,r){var a,o;if(typeof r!="function")throw new Error;return function(){var i=nr(this,t),s=i.tween;if(s!==a){o=(a=s).slice();for(var l={name:e,value:r},c=0,f=o.length;c<f;++c)if(o[c].name===e){o[c]=l;break}c===f&&o.push(l)}i.tween=o}}function Uh(t,e){var r=this._id;if(t+="",arguments.length<2){for(var a=qn(this.node(),r).tween,o=0,i=a.length,s;o<i;++o)if((s=a[o]).name===t)return s.value;return null}return this.each((e==null?Fh:Bh)(r,t,e))}function Ei(t,e,r){var a=t._id;return t.each(function(){var o=nr(this,a);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return qn(o,a).value[e]}}function wl(t,e){var r;return(typeof e=="number"?kn:e instanceof Pr?ho:(r=Pr(e))?(e=r,ho):Tl)(t,e)}function zh(t){return function(){this.removeAttribute(t)}}function jh(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gh(t,e,r){var a,o=r+"",i;return function(){var s=this.getAttribute(t);return s===o?null:s===a?i:i=e(a=s,r)}}function Vh(t,e,r){var a,o=r+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===a?i:i=e(a=s,r)}}function Xh(t,e,r){var a,o,i;return function(){var s,l=r(this),c;return l==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=l+"",s===c?null:s===a&&c===o?i:(o=c,i=e(a=s,l)))}}function Hh(t,e,r){var a,o,i;return function(){var s,l=r(this),c;return l==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=l+"",s===c?null:s===a&&c===o?i:(o=c,i=e(a=s,l)))}}function Wh(t,e){var r=Nt(t),a=r==="transform"?Lh:wl;return this.attrTween(t,typeof e=="function"?(r.local?Hh:Xh)(r,a,Ei(this,"attr."+t,e)):e==null?(r.local?jh:zh)(r):(r.local?Vh:Gh)(r,a,e))}function Yh(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Kh(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Zh(t,e){var r,a;function o(){var i=e.apply(this,arguments);return i!==a&&(r=(a=i)&&Kh(t,i)),r}return o._value=e,o}function Jh(t,e){var r,a;function o(){var i=e.apply(this,arguments);return i!==a&&(r=(a=i)&&Yh(t,i)),r}return o._value=e,o}function Qh(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var a=Nt(t);return this.tween(r,(a.local?Zh:Jh)(a,e))}function kh(t,e){return function(){$i(this,t).delay=+e.apply(this,arguments)}}function qh(t,e){return e=+e,function(){$i(this,t).delay=e}}function _h(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?kh:qh)(e,t)):qn(this.node(),e).delay}function tv(t,e){return function(){nr(this,t).duration=+e.apply(this,arguments)}}function ev(t,e){return e=+e,function(){nr(this,t).duration=e}}function nv(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?tv:ev)(e,t)):qn(this.node(),e).duration}function rv(t,e){if(typeof e!="function")throw new Error;return function(){nr(this,t).ease=e}}function av(t){var e=this._id;return arguments.length?this.each(rv(e,t)):qn(this.node(),e).ease}function ov(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;nr(this,t).ease=r}}function iv(t){if(typeof t!="function")throw new Error;return this.each(ov(this._id,t))}function sv(t){typeof t!="function"&&(t=R(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var i=e[o],s=i.length,l=a[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&l.push(c);return new hr(a,this._parents,this._name,this._id)}function lv(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,a=e.length,o=r.length,i=Math.min(a,o),s=new Array(a),l=0;l<i;++l)for(var c=e[l],f=r[l],g=c.length,p=s[l]=new Array(g),m,E=0;E<g;++E)(m=c[E]||f[E])&&(p[E]=m);for(;l<a;++l)s[l]=e[l];return new hr(s,this._parents,this._name,this._id)}function cv(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function uv(t,e,r){var a,o,i=cv(e)?$i:nr;return function(){var s=i(this,t),l=s.on;l!==a&&(o=(a=l).copy()).on(e,r),s.on=o}}function fv(t,e){var r=this._id;return arguments.length<2?qn(this.node(),r).on.on(t):this.each(uv(r,t,e))}function dv(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function hv(){return this.on("end.remove",dv(this._id))}function vv(t){var e=this._name,r=this._id;typeof t!="function"&&(t=v(t));for(var a=this._groups,o=a.length,i=new Array(o),s=0;s<o;++s)for(var l=a[s],c=l.length,f=i[s]=new Array(c),g,p,m=0;m<c;++m)(g=l[m])&&(p=t.call(g,g.__data__,m,l))&&("__data__"in g&&(p.__data__=g.__data__),f[m]=p,To(f[m],e,r,m,f,qn(g,r)));return new hr(i,this._parents,e,r)}function gv(t){var e=this._name,r=this._id;typeof t!="function"&&(t=$(t));for(var a=this._groups,o=a.length,i=[],s=[],l=0;l<o;++l)for(var c=a[l],f=c.length,g,p=0;p<f;++p)if(g=c[p]){for(var m=t.call(g,g.__data__,p,c),E,w=qn(g,r),U=0,N=m.length;U<N;++U)(E=m[U])&&To(E,e,r,U,m,w);i.push(m),s.push(g)}return new hr(i,s,e,r)}var pv=xn.prototype.constructor;function mv(){return new pv(this._groups,this._parents)}function yv(t,e){var r,a,o;return function(){var i=bt(this,t),s=(this.style.removeProperty(t),bt(this,t));return i===s?null:i===r&&s===a?o:o=e(r=i,a=s)}}function Dl(t){return function(){this.style.removeProperty(t)}}function xv(t,e,r){var a,o=r+"",i;return function(){var s=bt(this,t);return s===o?null:s===a?i:i=e(a=s,r)}}function Tv(t,e,r){var a,o,i;return function(){var s=bt(this,t),l=r(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(t),bt(this,t))),s===c?null:s===a&&c===o?i:(o=c,i=e(a=s,l))}}function Sv(t,e){var r,a,o,i="style."+e,s="end."+i,l;return function(){var c=nr(this,t),f=c.on,g=c.value[i]==null?l||(l=Dl(e)):void 0;(f!==r||o!==g)&&(a=(r=f).copy()).on(s,o=g),c.on=a}}function $v(t,e,r){var a=(t+="")=="transform"?Nh:wl;return e==null?this.styleTween(t,yv(t,a)).on("end.style."+t,Dl(t)):typeof e=="function"?this.styleTween(t,Tv(t,a,Ei(this,"style."+t,e))).each(Sv(this._id,t)):this.styleTween(t,xv(t,a,e),r).on("end.style."+t,null)}function Av(t,e,r){return function(a){this.style.setProperty(t,e.call(this,a),r)}}function Ev(t,e,r){var a,o;function i(){var s=e.apply(this,arguments);return s!==o&&(a=(o=s)&&Av(t,s,r)),a}return i._value=e,i}function bv(t,e,r){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(e==null)return this.tween(a,null);if(typeof e!="function")throw new Error;return this.tween(a,Ev(t,e,r==null?"":r))}function Iv(t){return function(){this.textContent=t}}function Rv(t){return function(){var e=t(this);this.textContent=e==null?"":e}}function Ov(t){return this.tween("text",typeof t=="function"?Rv(Ei(this,"text",t)):Iv(t==null?"":t+""))}function Cv(t){return function(e){this.textContent=t.call(this,e)}}function Pv(t){var e,r;function a(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&Cv(o)),e}return a._value=t,a}function Mv(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Pv(t))}function wv(){for(var t=this._name,e=this._id,r=Ll(),a=this._groups,o=a.length,i=0;i<o;++i)for(var s=a[i],l=s.length,c,f=0;f<l;++f)if(c=s[f]){var g=qn(c,e);To(c,t,r,f,s,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new hr(a,this._parents,t,r)}function Dv(){var t,e,r=this,a=r._id,o=r.size();return new Promise(function(i,s){var l={value:s},c={value:function(){--o===0&&i()}};r.each(function(){var f=nr(this,a),g=f.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),f.on=e}),o===0&&i()})}var Nv=0;function hr(t,e,r,a){this._groups=t,this._parents=e,this._name=r,this._id=a}function Nl(t){return xn().transition(t)}function Ll(){return++Nv}var vr=xn.prototype;hr.prototype=Nl.prototype={constructor:hr,select:vv,selectAll:gv,selectChild:vr.selectChild,selectChildren:vr.selectChildren,filter:sv,merge:lv,selection:mv,transition:wv,call:vr.call,nodes:vr.nodes,node:vr.node,size:vr.size,empty:vr.empty,each:vr.each,on:fv,attr:Wh,attrTween:Qh,style:$v,styleTween:bv,text:Ov,textTween:Mv,remove:hv,tween:Uh,delay:_h,duration:nv,ease:av,easeVarying:iv,end:Dv,[Symbol.iterator]:vr[Symbol.iterator]};function g1(t){return t*t*t}function p1(t){return--t*t*t+1}function Lv(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Fv={time:null,delay:0,duration:250,ease:Lv};function Bv(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function Uv(t){var e,r;t instanceof hr?(e=t._id,t=t._name):(e=Ll(),(r=Fv).time=yi(),t=t==null?null:t+"");for(var a=this._groups,o=a.length,i=0;i<o;++i)for(var s=a[i],l=s.length,c,f=0;f<l;++f)(c=s[f])&&To(c,t,e,f,s,r||Bv(c,e));return new hr(a,this._parents,t,e)}xn.prototype.interrupt=Mh,xn.prototype.transition=Uv;var bi=(t=>()=>t);function zv(t,{sourceEvent:e,target:r,selection:a,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:a,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function jv(t){t.stopImmediatePropagation()}function Ii(t){t.preventDefault(),t.stopImmediatePropagation()}var Fl={name:"drag"},Ri={name:"space"},ta={name:"handle"},ea={name:"center"};const{abs:Bl,max:En,min:bn}=Math;function Ul(t){return[+t[0],+t[1]]}function Oi(t){return[Ul(t[0]),Ul(t[1])]}var $o={name:"x",handles:["w","e"].map(wa),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Ao={name:"y",handles:["n","s"].map(wa),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Gv={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(wa),input:function(t){return t==null?null:Oi(t)},output:function(t){return t}},gr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zl={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},jl={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Vv={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Xv={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wa(t){return{type:t}}function Hv(t){return!t.ctrlKey&&!t.button}function Wv(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Yv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ci(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Kv(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Gl(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Zv(){return Pi($o)}function Jv(){return Pi(Ao)}function m1(){return Pi(Gv)}function Pi(t){var e=Wv,r=Hv,a=Yv,o=!0,i=oo("start","brush","end"),s=6,l;function c(N){var D=N.property("__brush",U).selectAll(".overlay").data([wa("overlay")]);D.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gr.overlay).merge(D).each(function(){var J=Ci(this).extent;it(this).attr("x",J[0][0]).attr("y",J[0][1]).attr("width",J[1][0]-J[0][0]).attr("height",J[1][1]-J[0][1])}),N.selectAll(".selection").data([wa("selection")]).enter().append("rect").attr("class","selection").attr("cursor",gr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var Y=N.selectAll(".handle").data(t.handles,function(J){return J.type});Y.exit().remove(),Y.enter().append("rect").attr("class",function(J){return"handle handle--"+J.type}).attr("cursor",function(J){return gr[J.type]}),N.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",m).filter(a).on("touchstart.brush",m).on("touchmove.brush",E).on("touchend.brush touchcancel.brush",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(N,D,Y){N.tween?N.on("start.brush",function(J){g(this,arguments).beforestart().start(J)}).on("interrupt.brush end.brush",function(J){g(this,arguments).end(J)}).tween("brush",function(){var J=this,K=J.__brush,nt=g(J,arguments),Q=K.selection,ot=t.input(typeof D=="function"?D.apply(this,arguments):D,K.extent),pt=kr(Q,ot);function Tt(yt){K.selection=yt===1&&ot===null?null:pt(yt),f.call(J),nt.brush()}return Q!==null&&ot!==null?Tt:Tt(1)}):N.each(function(){var J=this,K=arguments,nt=J.__brush,Q=t.input(typeof D=="function"?D.apply(J,K):D,nt.extent),ot=g(J,K).beforestart();_r(J),nt.selection=Q===null?null:Q,f.call(J),ot.start(Y).brush(Y).end(Y)})},c.clear=function(N,D){c.move(N,null,D)};function f(){var N=it(this),D=Ci(this).selection;D?(N.selectAll(".selection").style("display",null).attr("x",D[0][0]).attr("y",D[0][1]).attr("width",D[1][0]-D[0][0]).attr("height",D[1][1]-D[0][1]),N.selectAll(".handle").style("display",null).attr("x",function(Y){return Y.type[Y.type.length-1]==="e"?D[1][0]-s/2:D[0][0]-s/2}).attr("y",function(Y){return Y.type[0]==="s"?D[1][1]-s/2:D[0][1]-s/2}).attr("width",function(Y){return Y.type==="n"||Y.type==="s"?D[1][0]-D[0][0]+s:s}).attr("height",function(Y){return Y.type==="e"||Y.type==="w"?D[1][1]-D[0][1]+s:s})):N.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function g(N,D,Y){var J=N.__brush.emitter;return J&&(!Y||!J.clean)?J:new p(N,D,Y)}function p(N,D,Y){this.that=N,this.args=D,this.state=N.__brush,this.active=0,this.clean=Y}p.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(N,D){return this.starting?(this.starting=!1,this.emit("start",N,D)):this.emit("brush",N),this},brush:function(N,D){return this.emit("brush",N,D),this},end:function(N,D){return--this.active===0&&(delete this.state.emitter,this.emit("end",N,D)),this},emit:function(N,D,Y){var J=it(this.that).datum();i.call(N,this.that,new zv(N,{sourceEvent:D,target:c,selection:t.output(this.state.selection),mode:Y,dispatch:i}),J)}};function m(N){if(l&&!N.touches||!r.apply(this,arguments))return;var D=this,Y=N.target.__data__.type,J=(o&&N.metaKey?Y="overlay":Y)==="selection"?Fl:o&&N.altKey?ea:ta,K=t===Ao?null:Vv[Y],nt=t===$o?null:Xv[Y],Q=Ci(D),ot=Q.extent,pt=Q.selection,Tt=ot[0][0],yt,lt,jt=ot[0][1],vt,tt,St=ot[1][0],ct,At,Wt=ot[1][1],Dt,Zt,re=0,ce=0,Ie,Ce=K&&nt&&o&&N.shiftKey,Pe,Ye,Be=Array.from(N.touches||[N],ve=>{const fn=ve.identifier;return ve=Wn(ve,D),ve.point0=ve.slice(),ve.identifier=fn,ve});_r(D);var dn=g(D,arguments,!0).beforestart();if(Y==="overlay"){pt&&(Ie=!0);const ve=[Be[0],Be[1]||Be[0]];Q.selection=pt=[[yt=t===Ao?Tt:bn(ve[0][0],ve[1][0]),vt=t===$o?jt:bn(ve[0][1],ve[1][1])],[ct=t===Ao?St:En(ve[0][0],ve[1][0]),Dt=t===$o?Wt:En(ve[0][1],ve[1][1])]],Be.length>1&&un(N)}else yt=pt[0][0],vt=pt[0][1],ct=pt[1][0],Dt=pt[1][1];lt=yt,tt=vt,At=ct,Zt=Dt;var kt=it(D).attr("pointer-events","none"),Te=kt.selectAll(".overlay").attr("cursor",gr[Y]);if(N.touches)dn.moved=Bt,dn.ended=Xe;else{var Re=it(N.view).on("mousemove.brush",Bt,!0).on("mouseup.brush",Xe,!0);o&&Re.on("keydown.brush",wn,!0).on("keyup.brush",Dn,!0),di(N.view)}f.call(D),dn.start(N,J.name);function Bt(ve){for(const fn of ve.changedTouches||[ve])for(const Ha of Be)Ha.identifier===fn.identifier&&(Ha.cur=Wn(fn,D));if(Ce&&!Pe&&!Ye&&Be.length===1){const fn=Be[0];Bl(fn.cur[0]-fn[0])>Bl(fn.cur[1]-fn[1])?Ye=!0:Pe=!0}for(const fn of Be)fn.cur&&(fn[0]=fn.cur[0],fn[1]=fn.cur[1]);Ie=!0,Ii(ve),un(ve)}function un(ve){const fn=Be[0],Ha=fn.point0;var Ir;switch(re=fn[0]-Ha[0],ce=fn[1]-Ha[1],J){case Ri:case Fl:{K&&(re=En(Tt-yt,bn(St-ct,re)),lt=yt+re,At=ct+re),nt&&(ce=En(jt-vt,bn(Wt-Dt,ce)),tt=vt+ce,Zt=Dt+ce);break}case ta:{Be[1]?(K&&(lt=En(Tt,bn(St,Be[0][0])),At=En(Tt,bn(St,Be[1][0])),K=1),nt&&(tt=En(jt,bn(Wt,Be[0][1])),Zt=En(jt,bn(Wt,Be[1][1])),nt=1)):(K<0?(re=En(Tt-yt,bn(St-yt,re)),lt=yt+re,At=ct):K>0&&(re=En(Tt-ct,bn(St-ct,re)),lt=yt,At=ct+re),nt<0?(ce=En(jt-vt,bn(Wt-vt,ce)),tt=vt+ce,Zt=Dt):nt>0&&(ce=En(jt-Dt,bn(Wt-Dt,ce)),tt=vt,Zt=Dt+ce));break}case ea:{K&&(lt=En(Tt,bn(St,yt-re*K)),At=En(Tt,bn(St,ct+re*K))),nt&&(tt=En(jt,bn(Wt,vt-ce*nt)),Zt=En(jt,bn(Wt,Dt+ce*nt)));break}}At<lt&&(K*=-1,Ir=yt,yt=ct,ct=Ir,Ir=lt,lt=At,At=Ir,Y in zl&&Te.attr("cursor",gr[Y=zl[Y]])),Zt<tt&&(nt*=-1,Ir=vt,vt=Dt,Dt=Ir,Ir=tt,tt=Zt,Zt=Ir,Y in jl&&Te.attr("cursor",gr[Y=jl[Y]])),Q.selection&&(pt=Q.selection),Pe&&(lt=pt[0][0],At=pt[1][0]),Ye&&(tt=pt[0][1],Zt=pt[1][1]),(pt[0][0]!==lt||pt[0][1]!==tt||pt[1][0]!==At||pt[1][1]!==Zt)&&(Q.selection=[[lt,tt],[At,Zt]],f.call(D),dn.brush(ve,J.name))}function Xe(ve){if(jv(ve),ve.touches){if(ve.touches.length)return;l&&clearTimeout(l),l=setTimeout(function(){l=null},500)}else hi(ve.view,Ie),Re.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);kt.attr("pointer-events","all"),Te.attr("cursor",gr.overlay),Q.selection&&(pt=Q.selection),Kv(pt)&&(Q.selection=null,f.call(D)),dn.end(ve,J.name)}function wn(ve){switch(ve.keyCode){case 16:{Ce=K&&nt;break}case 18:{J===ta&&(K&&(ct=At-re*K,yt=lt+re*K),nt&&(Dt=Zt-ce*nt,vt=tt+ce*nt),J=ea,un(ve));break}case 32:{(J===ta||J===ea)&&(K<0?ct=At-re:K>0&&(yt=lt-re),nt<0?Dt=Zt-ce:nt>0&&(vt=tt-ce),J=Ri,Te.attr("cursor",gr.selection),un(ve));break}default:return}Ii(ve)}function Dn(ve){switch(ve.keyCode){case 16:{Ce&&(Pe=Ye=Ce=!1,un(ve));break}case 18:{J===ea&&(K<0?ct=At:K>0&&(yt=lt),nt<0?Dt=Zt:nt>0&&(vt=tt),J=ta,un(ve));break}case 32:{J===Ri&&(ve.altKey?(K&&(ct=At-re*K,yt=lt+re*K),nt&&(Dt=Zt-ce*nt,vt=tt+ce*nt),J=ea):(K<0?ct=At:K>0&&(yt=lt),nt<0?Dt=Zt:nt>0&&(vt=tt),J=ta),Te.attr("cursor",gr[Y]),un(ve));break}default:return}Ii(ve)}}function E(N){g(this,arguments).moved(N)}function w(N){g(this,arguments).ended(N)}function U(){var N=this.__brush||{selection:null};return N.extent=Oi(e.apply(this,arguments)),N.dim=t,N}return c.extent=function(N){return arguments.length?(e=typeof N=="function"?N:bi(Oi(N)),c):e},c.filter=function(N){return arguments.length?(r=typeof N=="function"?N:bi(!!N),c):r},c.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:bi(!!N),c):a},c.handleSize=function(N){return arguments.length?(s=+N,c):s},c.keyModifiers=function(N){return arguments.length?(o=!!N,c):o},c.on=function(){var N=i.on.apply(i,arguments);return N===i?c:N},c}function Qv(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function kv(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",r=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",a=i=>setTimeout(i,1),o=i=>clearTimeout(i);return[e?t.requestAnimationFrame:a,e?t.cancelAnimationFrame:o,r?t.requestIdleCallback:a,r?t.cancelIdleCallback:o]}const Ze=Qv(),pn=Ze==null?void 0:Ze.document,[qv,y1,Vl,x1]=kv(Ze);var _v=Object.defineProperty,Xl=Object.getOwnPropertySymbols,tg=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable,Hl=(t,e,r)=>e in t?_v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wl=(t,e)=>{for(var r in e||(e={}))tg.call(e,r)&&Hl(t,r,e[r]);if(Xl)for(var r of Xl(e))eg.call(e,r)&&Hl(t,r,e[r]);return t};const De=t=>t||t===0,he=t=>typeof t=="function",Ue=t=>typeof t=="string",pe=t=>typeof t=="number",ln=t=>typeof t=="undefined",Qe=t=>typeof t!="undefined",Mi=t=>typeof t=="boolean",ng=t=>Math.ceil(t/10)*10,Eo=t=>Math.ceil(t)+.5,Nr=t=>t[1]-t[0],rr=t=>typeof t=="object",_n=t=>ln(t)||t===null||Ue(t)&&t.length===0||rr(t)&&!(t instanceof Date)&&Object.keys(t).length===0||pe(t)&&isNaN(t),cn=t=>!_n(t),Ge=t=>Array.isArray(t),ze=t=>t&&!(t!=null&&t.nodeType)&&rr(t)&&!Ge(t);function $r(t,e,r){return Qe(t[e])?t[e]:r}function rg(t,e){let r=!1;return Object.keys(t).forEach(a=>t[a]===e&&(r=!0)),r}function _e(t,e,...r){const a=he(t);return a&&t.call(e,...r),a}function bo(t,e){let r=0;const a=function(...o){!--r&&e.apply(this,...o)};"duration"in t?t.each(()=>++r).on("end",a):(++r,t.call(a))}function wi(t){return Ue(t)?t.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):t}function Da(t,e,r=[-1,1],a=!1){if(!(!t||!Ue(e)))if(e.indexOf(`
|
|
30
|
+
`&&j!=="\f"&&j!=="\r")break}return F},M=function(B,F,z){var j=B.length;j<4&&(B+=j===2?"AA":"A");var G=(F[O(B,0)]<<18)+(F[O(B,1)]<<12)+(F[O(B,2)]<<6)+F[O(B,3)],V=[G>>16&255,G>>8&255,G&255];if(j===2){if(z&&V[1]!==0)throw new R("Extra bits");return[V[0]]}if(j===3){if(z&&V[2]!==0)throw new R("Extra bits");return[V[0],V[1]]}return V},L=function(B,F,z){for(var j=F.length,G=0;G<j;G++)B[z+G]=F[G];return z+j};x.exports=function(B,F,z,j){v(B),h(F);var G=S(F)==="base64"?A:I,V=F?F.lastChunkHandling:void 0;if(V===void 0&&(V="loose"),V!=="loose"&&V!=="strict"&&V!=="stop-before-partial")throw new C("Incorrect `lastChunkHandling` option");z&&$(z.buffer);var X=B.length,W=z||[],H=0,Z=0,_="",k=0;if(j)for(;;){if(k=P(B,k),k===X){if(_.length>0){if(V==="stop-before-partial")break;if(V==="loose"){if(_.length===1)throw new R("Malformed padding: exactly one additional character");H=L(W,M(_,G,!1),H)}else throw new R("Missing padding")}Z=X;break}var q=O(B,k);if(++k,q==="="){if(_.length<2)throw new R("Padding is too early");if(k=P(B,k),_.length===2){if(k===X){if(V==="stop-before-partial")break;throw new R("Malformed padding: only one =")}O(B,k)==="="&&(++k,k=P(B,k))}if(k<X)throw new R("Unexpected character after padding");H=L(W,M(_,G,V==="strict"),H),Z=X;break}if(!y(G,q))throw new R("Unexpected character");var et=j-H;if(et===1&&_.length===2||et===2&&_.length===3||(_+=q,_.length===4&&(H=L(W,M(_,G,!1),H),_="",Z=k,H===j)))break}return{bytes:W,read:Z,written:H}}}),(function(x,b,n){var u=n(20),d=String,h=TypeError;x.exports=function(v){if(v===void 0||u(v))return v;throw new h(d(v)+" is not an object or undefined")}}),(function(x){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=b+"+/",u=b+"-_",d=function(h){for(var v={},y=0;y<64;y++)v[h.charAt(y)]=y;return v};x.exports={i2c:n,c2i:d(n),i2cUrl:u,c2iUrl:d(u)}}),(function(x){var b=TypeError;x.exports=function(n){var u=n&&n.alphabet;if(u===void 0||u==="base64"||u==="base64url")return u||"base64";throw new b("Incorrect `alphabet` option")}}),(function(x,b,n){var u=n(3),d=n(4),h=n(434),v=n(572);d.Uint8Array&&u({target:"Uint8Array",stat:!0},{fromHex:function(T){return v(h(T)).bytes}})}),(function(x,b,n){var u=n(4),d=n(14),h=u.Uint8Array,v=u.SyntaxError,y=u.parseInt,T=Math.min,S=/[^\da-f]/i,$=d(S.exec),A=d("".slice);x.exports=function(I,R){var C=I.length;if(C%2!==0)throw new v("String should be an even number of characters");for(var O=R?T(R.length,C/2):C/2,P=R||new h(O),M=0,L=0;L<O;){var B=A(I,M,M+=2);if($(S,B))throw new v("String should only contain hex characters");P[L++]=y(B,16)}return{bytes:P,read:M}}}),(function(x,b,n){var u=n(3),d=n(4),h=n(567),v=n(574),y=d.Uint8Array,T=!y||!y.prototype.setFromBase64||!(function(){var S=new y([255,255,255,255,255]);try{S.setFromBase64("",null);return}catch($){}try{S.setFromBase64("a");return}catch($){}try{S.setFromBase64("MjYyZg===")}catch($){return S[0]===50&&S[1]===54&&S[2]===50&&S[3]===255&&S[4]===255}})();y&&u({target:"Uint8Array",proto:!0,forced:T},{setFromBase64:function($){v(this);var A=h($,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:A.read,written:A.written}}})}),(function(x,b,n){var u=n(69),d=TypeError;x.exports=function(h){if(u(h)==="Uint8Array")return h;throw new d("Argument is not an Uint8Array")}}),(function(x,b,n){var u=n(3),d=n(4),h=n(434),v=n(574),y=n(236),T=n(572);d.Uint8Array&&u({target:"Uint8Array",proto:!0},{setFromHex:function($){v(this),h($),y(this.buffer);var A=T($,this).read;return{read:A,written:A/2}}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(14),v=n(568),y=n(574),T=n(236),S=n(569),$=n(570),A=S.i2c,I=S.i2cUrl,R=h("".charAt),C=d.Uint8Array,O=!C||!C.prototype.toBase64||!(function(){try{var P=new C;P.toBase64(null)}catch(M){return!0}})();C&&u({target:"Uint8Array",proto:!0,forced:O},{toBase64:function(){var M=y(this),L=arguments.length?v(arguments[0]):void 0,B=$(L)==="base64"?A:I,F=!!L&&!!L.omitPadding;T(this.buffer);for(var z="",j=0,G=M.length,V,X=function(W){return R(B,V>>6*W&63)};j+2<G;j+=3)V=(M[j]<<16)+(M[j+1]<<8)+M[j+2],z+=X(3)+X(2)+X(1)+X(0);return j+2===G?(V=(M[j]<<16)+(M[j+1]<<8),z+=X(3)+X(2)+X(1)+(F?"":"=")):j+1===G&&(V=M[j]<<16,z+=X(3)+X(2)+(F?"":"==")),z}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(14),v=n(574),y=n(236),T=h(1.1.toString),S=d.Uint8Array,$=!S||!S.prototype.toHex||!(function(){try{var A=new S([255,255,255,255,255,255,255,255]);return A.toHex()==="ffffffffffffffff"}catch(I){return!1}})();S&&u({target:"Uint8Array",proto:!0,forced:$},{toHex:function(){v(this),y(this.buffer);for(var I="",R=0,C=this.length;R<C;R++){var O=T(this[R],16);I+=O.length===1?"0"+O:O}return I}})}),(function(x,b,n){var u=n(3),d=n(14),h=n(68),v=String.fromCharCode,y=d("".charAt),T=d(/./.exec),S=d("".slice),$=/^[\da-f]{2}$/i,A=/^[\da-f]{4}$/i;u({global:!0},{unescape:function(R){for(var C=h(R),O="",P=C.length,M=0,L,B;M<P;){if(L=y(C,M++),L==="%"){if(y(C,M)==="u"){if(B=S(C,M+1,M+5),T(A,B)){O+=v(parseInt(B,16)),M+=5;continue}}else if(B=S(C,M,M+2),T($,B)){O+=v(parseInt(B,16)),M+=2;continue}}O+=L}return O}})}),(function(x,b,n){n(580)}),(function(x,b,n){var u=n(290),d=n(4),h=n(14),v=n(214),y=n(287),T=n(286),S=n(581),$=n(20),A=n(51).enforce,I=n(7),R=n(52),C=Object,O=Array.isArray,P=C.isExtensible,M=C.isFrozen,L=C.isSealed,B=C.freeze,F=C.seal,z=!d.ActiveXObject&&"ActiveXObject"in d,j,G=function(q){return function(){return q(this,arguments.length?arguments[0]:void 0)}},V=T("WeakMap",G,S),X=V.prototype,W=h(X.set),H=function(){return u&&I(function(){var q=B([]);return W(new V,q,1),!M(q)})};if(R)if(z){j=S.getConstructor(G,"WeakMap",!0),y.enable();var Z=h(X.delete),_=h(X.has),k=h(X.get);v(X,{delete:function(q){if($(q)&&!P(q)){var et=A(this);return et.frozen||(et.frozen=new j),Z(this,q)||et.frozen.delete(q)}return Z(this,q)},has:function(et){if($(et)&&!P(et)){var rt=A(this);return rt.frozen||(rt.frozen=new j),_(this,et)||rt.frozen.has(et)}return _(this,et)},get:function(et){if($(et)&&!P(et)){var rt=A(this);return rt.frozen||(rt.frozen=new j),_(this,et)?k(this,et):rt.frozen.get(et)}return k(this,et)},set:function(et,rt){if($(et)&&!P(et)){var at=A(this);at.frozen||(at.frozen=new j),_(this,et)?W(this,et,rt):at.frozen.set(et,rt)}else W(this,et,rt);return this}})}else H()&&v(X,{set:function(et,rt){var at;return O(et)&&(M(et)?at=B:L(et)&&(at=F)),W(this,et,rt),at&&at(et),this}})}),(function(x,b,n){var u=n(14),d=n(214),h=n(287).getWeakData,v=n(215),y=n(46),T=n(17),S=n(20),$=n(133),A=n(83),I=n(38),R=n(51),C=R.set,O=R.getterFor,P=A.find,M=A.findIndex,L=u([].splice),B=0,F=function(G){return G.frozen||(G.frozen=new z)},z=function(){this.entries=[]},j=function(G,V){return P(G.entries,function(X){return X[0]===V})};z.prototype={get:function(G){var V=j(this,G);if(V)return V[1]},has:function(G){return!!j(this,G)},set:function(G,V){var X=j(this,G);X?X[1]=V:this.entries.push([G,V])},delete:function(G){var V=M(this.entries,function(X){return X[0]===G});return~V&&L(this.entries,V,1),!!~V}},x.exports={getConstructor:function(G,V,X,W){var H=G(function(q,et){v(q,Z),C(q,{type:V,id:B++,frozen:null}),T(et)||$(et,q[W],{that:q,AS_ENTRIES:X})}),Z=H.prototype,_=O(V),k=function(q,et,rt){var at=_(q),dt=h(y(et),!0);return dt===!0?F(at).set(et,rt):dt[at.id]=rt,q};return d(Z,{delete:function(q){var et=_(this);if(!S(q))return!1;var rt=h(q);return rt===!0?F(et).delete(q):rt&&I(rt,et.id)&&delete rt[et.id]},has:function(et){var rt=_(this);if(!S(et))return!1;var at=h(et);return at===!0?F(rt).has(et):at&&I(at,rt.id)}}),d(Z,X?{get:function(et){var rt=_(this);if(S(et)){var at=h(et);if(at===!0)return F(rt).get(et);if(at)return at[rt.id]}},set:function(et,rt){return k(this,et,rt)}}:{add:function(et){return k(this,et,!0)}}),H}}}),(function(x,b,n){n(583)}),(function(x,b,n){var u=n(286),d=n(581);u("WeakSet",function(h){return function(){return h(this,arguments.length?arguments[0]:void 0)}},d)}),(function(x,b,n){var u=n(3),d=n(4),h=n(23),v=n(14),y=n(8),T=n(7),S=n(68),$=n(377),A=n(569).c2i,I=/[^\d+/a-z]/i,R=/[\t\n\f\r ]+/g,C=/[=]{1,2}$/,O=h("atob"),P=String.fromCharCode,M=v("".charAt),L=v("".replace),B=v(I.exec),F=!!O&&!T(function(){return O("aGk=")!=="hi"}),z=F&&T(function(){return O(" ")!==""}),j=F&&!T(function(){O("a")}),G=F&&!T(function(){O()}),V=F&&O.length!==1,X=!F||z||j||G||V;u({global:!0,bind:!0,enumerable:!0,forced:X},{atob:function(H){if($(arguments.length,1),F&&!z&&!j)return y(O,d,H);var Z=L(S(H),R,""),_="",k=0,q=0,et,rt,at;if(Z.length%4===0&&(Z=L(Z,C,"")),et=Z.length,et%4===1||B(I,Z))throw new(h("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;k<et;)rt=M(Z,k++),at=q%4?at*64+A[rt]:A[rt],q++%4&&(_+=P(255&at>>(-2*q&6)));return _}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(23),v=n(14),y=n(8),T=n(7),S=n(68),$=n(377),A=n(569).i2c,I=h("btoa"),R=v("".charAt),C=v("".charCodeAt),O=!!I&&!T(function(){return I("hi")!=="aGk="}),P=O&&!T(function(){I()}),M=O&&T(function(){return I(null)!=="bnVsbA=="}),L=O&&I.length!==1;u({global:!0,bind:!0,enumerable:!0,forced:!O||P||M||L},{btoa:function(F){if($(arguments.length,1),O)return y(I,d,S(F));for(var z=S(F),j="",G=0,V=A,X,W;R(z,G)||(V="=",G%1);){if(W=C(z,G+=.75),W>255)throw new(h("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");X=X<<8|W,j+=R(V,63&X>>8-G%1*8)}return j}})}),(function(x,b,n){var u=n(4),d=n(587),h=n(588),v=n(164),y=n(43),T=function($){if($&&$.forEach!==v)try{y($,"forEach",v)}catch(A){$.forEach=v}};for(var S in d)d[S]&&T(u[S]&&u[S].prototype);T(h)}),(function(x){x.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),(function(x,b,n){var u=n(42),d=u("span").classList,h=d&&d.constructor&&d.constructor.prototype;x.exports=h===Object.prototype?void 0:h}),(function(x,b,n){var u=n(4),d=n(587),h=n(588),v=n(172),y=n(43),T=n(82),S=n(33),$=S("iterator"),A=v.values,I=function(C,O){if(C){if(C[$]!==A)try{y(C,$,A)}catch(M){C[$]=A}if(T(C,O,!0),d[O]){for(var P in v)if(C[P]!==v[P])try{y(C,P,v[P])}catch(M){C[P]=v[P]}}}};for(var R in d)I(u[R]&&u[R].prototype,R);I(h,"DOMTokenList")}),(function(x,b,n){var u=n(3),d=n(23),h=n(238),v=n(7),y=n(71),T=n(11),S=n(44).f,$=n(47),A=n(77),I=n(38),R=n(215),C=n(46),O=n(128),P=n(121),M=n(591),L=n(124),B=n(51),F=n(6),z=n(36),j="DOMException",G="DATA_CLONE_ERR",V=d("Error"),X=d(j)||(function(){try{var Nt=d("MessageChannel")||h("worker_threads").MessageChannel;new Nt().port1.postMessage(new WeakMap)}catch(Yt){if(Yt.name===G&&Yt.code===25)return Yt.constructor}})(),W=X&&X.prototype,H=V.prototype,Z=B.set,_=B.getterFor(j),k="stack"in new V(j),q=function(Nt){return I(M,Nt)&&M[Nt].m?M[Nt].c:0},et=function(){R(this,rt);var Yt=arguments.length,ne=P(Yt<1?void 0:arguments[0]),fe=P(Yt<2?void 0:arguments[1],"Error"),ee=q(fe);if(Z(this,{type:j,name:fe,message:ne,code:ee}),F||(this.name=fe,this.message=ne,this.code=ee),k){var le=new V(ne);le.name=j,S(this,"stack",T(1,L(le.stack,1)))}},rt=et.prototype=y(H),at=function(Nt){return{enumerable:!0,configurable:!0,get:Nt}},dt=function(Nt){return at(function(){return _(this)[Nt]})};F&&(A(rt,"code",dt("code")),A(rt,"message",dt("message")),A(rt,"name",dt("name"))),S(rt,"constructor",T(1,et));var xt=v(function(){return!(new X instanceof V)}),gt=xt||v(function(){return H.toString!==O||String(new X(1,2))!=="2: 1"}),ht=xt||v(function(){return new X(1,"DataCloneError").code!==25}),Mt=xt||X[G]!==25||W[G]!==25,$t=z?gt||ht||Mt:xt;u({global:!0,constructor:!0,forced:$t},{DOMException:$t?et:X});var zt=d(j),Ht=zt.prototype;gt&&(z||X===zt)&&$(Ht,"toString",O),ht&&F&&X===zt&&A(Ht,"code",at(function(){return q(C(this).name)}));for(var _t in M)if(I(M,_t)){var Ee=M[_t],ue=Ee.s,te=T(6,Ee.c);I(zt,ue)||S(zt,ue,te),I(Ht,ue)||S(Ht,ue,te)}}),(function(x){x.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}}),(function(x,b,n){var u=n(3),d=n(4),h=n(23),v=n(11),y=n(44).f,T=n(38),S=n(215),$=n(120),A=n(121),I=n(591),R=n(124),C=n(6),O=n(36),P="DOMException",M=h("Error"),L=h(P),B=function(){S(this,F);var et=arguments.length,rt=A(et<1?void 0:arguments[0]),at=A(et<2?void 0:arguments[1],"Error"),dt=new L(rt,at),xt=new M(rt);return xt.name=P,y(dt,"stack",v(1,R(xt.stack,1))),$(dt,this,B),dt},F=B.prototype=L.prototype,z="stack"in new M(P),j="stack"in new L(1,2),G=L&&C&&Object.getOwnPropertyDescriptor(d,P),V=!!G&&!(G.writable&&G.configurable),X=z&&!V&&!j;u({global:!0,constructor:!0,forced:O||X},{DOMException:X?B:L});var W=h(P),H=W.prototype;if(H.constructor!==W){O||y(H,"constructor",v(1,W));for(var Z in I)if(T(I,Z)){var _=I[Z],k=_.s;T(W,k)||y(W,k,v(6,_.c))}}}),(function(x,b,n){var u=n(23),d=n(82),h="DOMException";d(u(h),h)}),(function(x,b,n){n(595),n(596)}),(function(x,b,n){var u=n(3),d=n(4),h=n(376).clear;u({global:!0,bind:!0,enumerable:!0,forced:d.clearImmediate!==h},{clearImmediate:h})}),(function(x,b,n){var u=n(3),d=n(4),h=n(376).set,v=n(597),y=d.setImmediate?v(h,!1):h;u({global:!0,bind:!0,enumerable:!0,forced:d.setImmediate!==y},{setImmediate:y})}),(function(x,b,n){var u=n(4),d=n(94),h=n(21),v=n(187),y=n(28),T=n(76),S=n(377),$=u.Function,A=/MSIE .\./.test(y)||v==="BUN"&&(function(){var I=u.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")})();x.exports=function(I,R){var C=R?2:1;return A?function(O,P){var M=S(arguments.length,1)>C,L=h(O)?O:$(O),B=M?T(arguments,C):[],F=M?function(){d(L,this,B)}:L;return R?I(F,P):I(F)}:I}}),(function(x,b,n){var u=n(3),d=n(4),h=n(379),v=n(30),y=n(377),T=n(7),S=n(6),$=T(function(){return S&&Object.getOwnPropertyDescriptor(d,"queueMicrotask").value.length!==1});u({global:!0,enumerable:!0,dontCallGetSet:!0,forced:$},{queueMicrotask:function(I){y(arguments.length,1),h(v(I))}})}),(function(x,b,n){var u=n(3),d=n(4),h=n(77),v=n(6),y=TypeError,T=Object.defineProperty,S=d.self!==d;try{if(v){var $=Object.getOwnPropertyDescriptor(d,"self");(S||!$||!$.get||!$.enumerable)&&h(d,"self",{get:function(){return d},set:function(I){if(this!==d)throw new y("Illegal invocation");T(d,"self",{value:I,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else u({global:!0,simple:!0,forced:S},{self:d})}catch(A){}}),(function(x,b,n){var u=n(36),d=n(3),h=n(4),v=n(23),y=n(14),T=n(7),S=n(40),$=n(21),A=n(89),I=n(17),R=n(20),C=n(22),O=n(133),P=n(46),M=n(69),L=n(38),B=n(145),F=n(43),z=n(63),j=n(377),G=n(427),V=n(293),X=n(447),W=n(449),H=n(237),Z=n(125),_=n(239),k=h.Object,q=h.Array,et=h.Date,rt=h.Error,at=h.TypeError,dt=h.PerformanceMark,xt=v("DOMException"),gt=V.Map,ht=V.has,Mt=V.get,$t=V.set,zt=X.Set,Ht=X.add,_t=X.has,Ee=v("Object","keys"),ue=y([].push),te=y((!0).valueOf),Nt=y(1.1.valueOf),Yt=y("".valueOf),ne=y(et.prototype.getTime),fe=S("structuredClone"),ee="DataCloneError",le="Transferring",Me=function(ft){return!T(function(){var Rt=new h.Set([7]),Ct=ft(Rt),Pt=ft(k(7));return Ct===Rt||!Ct.has(7)||!R(Pt)||+Pt!=7})&&ft},Ne=function(ft,Rt){return!T(function(){var Ct=new Rt,Pt=ft({a:Ct,b:Ct});return!(Pt&&Pt.a===Pt.b&&Pt.a instanceof Rt&&Pt.a.stack===Ct.stack)})},$e=function(ft){return!T(function(){var Rt=ft(new h.AggregateError([1],fe,{cause:3}));return Rt.name!=="AggregateError"||Rt.errors[0]!==1||Rt.message!==fe||Rt.cause!==3})},ae=h.structuredClone,Ae=u||!Ne(ae,rt)||!Ne(ae,xt)||!$e(ae),xe=!ae&&Me(function(ft){return new dt(fe,{detail:ft}).detail}),ge=Me(ae)||xe,bt=function(ft){throw new xt("Uncloneable type: "+ft,ee)},Ut=function(ft,Rt){throw new xt((Rt||"Cloning")+" of "+ft+" cannot be properly polyfilled in this engine",ee)},ie=function(ft,Rt){return ge||Ut(Rt),ge(ft)},Lt=function(){var ft;try{ft=new h.DataTransfer}catch(Rt){try{ft=new h.ClipboardEvent("").clipboardData}catch(Ct){}}return ft&&ft.items&&ft.files?ft:null},Jt=function(ft,Rt,Ct){if(ht(Rt,ft))return Mt(Rt,ft);var Pt=Ct||M(ft),Ft,Et,oe,we,It,Vt;if(Pt==="SharedArrayBuffer")ge?Ft=ge(ft):Ft=ft;else{var Xt=h.DataView;!Xt&&!$(ft.slice)&&Ut("ArrayBuffer");try{if($(ft.slice)&&!ft.resizable)Ft=ft.slice(0);else for(Et=ft.byteLength,oe=("maxByteLength"in ft)?{maxByteLength:ft.maxByteLength}:void 0,Ft=new ArrayBuffer(Et,oe),we=new Xt(ft),It=new Xt(Ft),Vt=0;Vt<Et;Vt++)It.setUint8(Vt,we.getUint8(Vt))}catch(Kt){throw new xt("ArrayBuffer is detached",ee)}}return $t(Rt,ft,Ft),Ft},Qt=function(ft,Rt,Ct,Pt,Ft){var Et=h[Rt];return R(Et)||Ut(Rt),new Et(Jt(ft.buffer,Ft),Ct,Pt)},Gt=function(ft,Rt){if(C(ft)&&bt("Symbol"),!R(ft))return ft;if(Rt){if(ht(Rt,ft))return Mt(Rt,ft)}else Rt=new gt;var Ct=M(ft),Pt,Ft,Et,oe,we,It,Vt,Xt;switch(Ct){case"Array":Et=q(z(ft));break;case"Object":Et={};break;case"Map":Et=new gt;break;case"Set":Et=new zt;break;case"RegExp":Et=new RegExp(ft.source,G(ft));break;case"Error":switch(Ft=ft.name,Ft){case"AggregateError":Et=new(v(Ft))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":Et=new(v(Ft));break;case"CompileError":case"LinkError":case"RuntimeError":Et=new(v("WebAssembly",Ft));break;default:Et=new rt}break;case"DOMException":Et=new xt(ft.message,ft.name);break;case"ArrayBuffer":case"SharedArrayBuffer":Et=Jt(ft,Rt,Ct);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":It=Ct==="DataView"?ft.byteLength:ft.length,Et=Qt(ft,Ct,ft.byteOffset,It,Rt);break;case"DOMQuad":try{Et=new DOMQuad(Gt(ft.p1,Rt),Gt(ft.p2,Rt),Gt(ft.p3,Rt),Gt(ft.p4,Rt))}catch(Kt){Et=ie(ft,Ct)}break;case"File":if(ge)try{Et=ge(ft),M(Et)!==Ct&&(Et=void 0)}catch(Kt){}if(!Et)try{Et=new File([ft],ft.name,ft)}catch(Kt){}Et||Ut(Ct);break;case"FileList":if(oe=Lt(),oe){for(we=0,It=z(ft);we<It;we++)oe.items.add(Gt(ft[we],Rt));Et=oe.files}else Et=ie(ft,Ct);break;case"ImageData":try{Et=new ImageData(Gt(ft.data,Rt),ft.width,ft.height,{colorSpace:ft.colorSpace})}catch(Kt){Et=ie(ft,Ct)}break;default:if(ge)Et=ge(ft);else switch(Ct){case"BigInt":Et=k(ft.valueOf());break;case"Boolean":Et=k(te(ft));break;case"Number":Et=k(Nt(ft));break;case"String":Et=k(Yt(ft));break;case"Date":Et=new et(ne(ft));break;case"Blob":try{Et=ft.slice(0,ft.size,ft.type)}catch(Kt){Ut(Ct)}break;case"DOMPoint":case"DOMPointReadOnly":Pt=h[Ct];try{Et=Pt.fromPoint?Pt.fromPoint(ft):new Pt(ft.x,ft.y,ft.z,ft.w)}catch(Kt){Ut(Ct)}break;case"DOMRect":case"DOMRectReadOnly":Pt=h[Ct];try{Et=Pt.fromRect?Pt.fromRect(ft):new Pt(ft.x,ft.y,ft.width,ft.height)}catch(Kt){Ut(Ct)}break;case"DOMMatrix":case"DOMMatrixReadOnly":Pt=h[Ct];try{Et=Pt.fromMatrix?Pt.fromMatrix(ft):new Pt(ft)}catch(Kt){Ut(Ct)}break;case"AudioData":case"VideoFrame":$(ft.clone)||Ut(Ct);try{Et=ft.clone()}catch(Kt){bt(Ct)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":Ut(Ct);default:bt(Ct)}}switch($t(Rt,ft,Et),Ct){case"Array":case"Object":for(Vt=Ee(ft),we=0,It=z(Vt);we<It;we++)Xt=Vt[we],B(Et,Xt,Gt(ft[Xt],Rt));break;case"Map":ft.forEach(function(Kt,de){$t(Et,Gt(de,Rt),Gt(Kt,Rt))});break;case"Set":ft.forEach(function(Kt){Ht(Et,Gt(Kt,Rt))});break;case"Error":F(Et,"message",Gt(ft.message,Rt)),L(ft,"cause")&&F(Et,"cause",Gt(ft.cause,Rt)),Ft==="AggregateError"?Et.errors=Gt(ft.errors,Rt):Ft==="SuppressedError"&&(Et.error=Gt(ft.error,Rt),Et.suppressed=Gt(ft.suppressed,Rt));case"DOMException":Z&&F(Et,"stack",Gt(ft.stack,Rt))}return Et},me=function(ft,Rt){if(!R(ft))throw new at("Transfer option cannot be converted to a sequence");var Ct=[];O(ft,function(de){ue(Ct,P(de))});for(var Pt=0,Ft=z(Ct),Et=new zt,oe,we,It,Vt,Xt,Kt;Pt<Ft;){if(oe=Ct[Pt++],we=M(oe),we==="ArrayBuffer"?_t(Et,oe):ht(Rt,oe))throw new xt("Duplicate transferable",ee);if(we==="ArrayBuffer"){Ht(Et,oe);continue}if(_)Vt=ae(oe,{transfer:[oe]});else switch(we){case"ImageBitmap":It=h.OffscreenCanvas,A(It)||Ut(we,le);try{Xt=new It(oe.width,oe.height),Kt=Xt.getContext("bitmaprenderer"),Kt.transferFromImageBitmap(oe),Vt=Xt.transferToImageBitmap()}catch(de){}break;case"AudioData":case"VideoFrame":(!$(oe.clone)||!$(oe.close))&&Ut(we,le);try{Vt=oe.clone(),oe.close()}catch(de){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":Ut(we,le)}if(Vt===void 0)throw new xt("This object cannot be transferred: "+we,ee);$t(Rt,oe,Vt)}return Et},He=function(ft){W(ft,function(Rt){_?ge(Rt,{transfer:[Rt]}):$(Rt.transfer)?Rt.transfer():H?H(Rt):Ut("ArrayBuffer",le)})};d({global:!0,enumerable:!0,sham:!_,forced:Ae},{structuredClone:function(Rt){var Ct=j(arguments.length,1)>1&&!I(arguments[1])?P(arguments[1]):void 0,Pt=Ct?Ct.transfer:void 0,Ft,Et;Pt!==void 0&&(Ft=new gt,Et=me(Pt,Ft));var oe=Gt(Rt,Ft);return Et&&He(Et),oe}})}),(function(x,b,n){n(602),n(603)}),(function(x,b,n){var u=n(3),d=n(4),h=n(597),v=h(d.setInterval,!0);u({global:!0,bind:!0,forced:d.setInterval!==v},{setInterval:v})}),(function(x,b,n){var u=n(3),d=n(4),h=n(597),v=h(d.setTimeout,!0);u({global:!0,bind:!0,forced:d.setTimeout!==v},{setTimeout:v})}),(function(x,b,n){n(605)}),(function(x,b,n){n(476);var u=n(3),d=n(6),h=n(606),v=n(4),y=n(84),T=n(14),S=n(47),$=n(77),A=n(215),I=n(38),R=n(338),C=n(166),O=n(76),P=n(469).codeAt,M=n(607),L=n(68),B=n(82),F=n(377),z=n(608),j=n(51),G=j.set,V=j.getterFor("URL"),X=z.URLSearchParams,W=z.getState,H=v.URL,Z=v.TypeError,_=v.parseInt,k=Math.floor,q=Math.pow,et=T("".charAt),rt=T(/./.exec),at=T([].join),dt=T(1.1.toString),xt=T([].pop),gt=T([].push),ht=T("".replace),Mt=T([].shift),$t=T("".split),zt=T("".slice),Ht=T("".toLowerCase),_t=T([].unshift),Ee="Invalid authority",ue="Invalid scheme",te="Invalid host",Nt="Invalid port",Yt=/[a-z]/i,ne=/[\d+-.a-z]/i,fe=/\d/,ee=/^0x/i,le=/^[0-7]+$/,Me=/^\d+$/,Ne=/^[\da-f]+$/i,$e=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ae=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ae=/^[\u0000-\u0020]+/,xe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ge=/[\t\n\r]/g,bt,Ut=function(ut){var wt=$t(ut,"."),mt,st,Ot,ye,qt,Oe,rn;if(wt.length&&wt[wt.length-1]===""&&wt.length--,mt=wt.length,mt>4)return ut;for(st=[],Ot=0;Ot<mt;Ot++){if(ye=wt[Ot],ye==="")return ut;if(qt=10,ye.length>1&&et(ye,0)==="0"&&(qt=rt(ee,ye)?16:8,ye=zt(ye,qt===8?1:2)),ye==="")Oe=0;else{if(!rt(qt===10?Me:qt===8?le:Ne,ye))return ut;Oe=_(ye,qt)}gt(st,Oe)}for(Ot=0;Ot<mt;Ot++)if(Oe=st[Ot],Ot===mt-1){if(Oe>=q(256,5-mt))return null}else if(Oe>255)return null;for(rn=xt(st),Ot=0;Ot<st.length;Ot++)rn+=st[Ot]*q(256,3-Ot);return rn},ie=function(ut){var wt=[0,0,0,0,0,0,0,0],mt=0,st=null,Ot=0,ye,qt,Oe,rn,hn,xn,it,an=function(){return et(ut,Ot)};if(an()===":"){if(et(ut,1)!==":")return;Ot+=2,mt++,st=mt}for(;an();){if(mt===8)return;if(an()===":"){if(st!==null)return;Ot++,mt++,st=mt;continue}for(ye=qt=0;qt<4&&rt(Ne,an());)ye=ye*16+_(an(),16),Ot++,qt++;if(an()==="."){if(qt===0||(Ot-=qt,mt>6))return;for(Oe=0;an();){if(rn=null,Oe>0)if(an()==="."&&Oe<4)Ot++;else return;if(!rt(fe,an()))return;for(;rt(fe,an());){if(hn=_(an(),10),rn===null)rn=hn;else{if(rn===0)return;rn=rn*10+hn}if(rn>255)return;Ot++}wt[mt]=wt[mt]*256+rn,Oe++,(Oe===2||Oe===4)&&mt++}if(Oe!==4)return;break}else if(an()===":"){if(Ot++,!an())return}else if(an())return;wt[mt++]=ye}if(st!==null)for(xn=mt-st,mt=7;mt!==0&&xn>0;)it=wt[mt],wt[mt--]=wt[st+xn-1],wt[st+--xn]=it;else if(mt!==8)return;return wt},Lt=function(ut){for(var wt=null,mt=1,st=null,Ot=0,ye=0;ye<8;ye++)ut[ye]!==0?(Ot>mt&&(wt=st,mt=Ot),st=null,Ot=0):(st===null&&(st=ye),++Ot);return Ot>mt?st:wt},Jt=function(ut){var wt,mt,st,Ot;if(typeof ut=="number"){for(wt=[],mt=0;mt<4;mt++)_t(wt,ut%256),ut=k(ut/256);return at(wt,".")}if(typeof ut=="object"){for(wt="",st=Lt(ut),mt=0;mt<8;mt++)Ot&&ut[mt]===0||(Ot&&(Ot=!1),st===mt?(wt+=mt?":":"::",Ot=!0):(wt+=dt(ut[mt],16),mt<7&&(wt+=":")));return"["+wt+"]"}return ut},Qt={},Gt=R({},Qt,{" ":1,'"':1,"<":1,">":1,"`":1}),me=R({},Gt,{"#":1,"?":1,"{":1,"}":1}),He=R({},me,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ft=function(ut,wt){var mt=P(ut,0);return mt>32&&mt<127&&!I(wt,ut)?ut:encodeURIComponent(ut)},Rt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ct=function(ut,wt){var mt;return ut.length===2&&rt(Yt,et(ut,0))&&((mt=et(ut,1))===":"||!wt&&mt==="|")},Pt=function(ut){var wt;return ut.length>1&&Ct(zt(ut,0,2))&&(ut.length===2||(wt=et(ut,2))==="/"||wt==="\\"||wt==="?"||wt==="#")},Ft=function(ut){return ut==="."||Ht(ut)==="%2e"},Et=function(ut){return ut=Ht(ut),ut===".."||ut==="%2e."||ut===".%2e"||ut==="%2e%2e"},oe={},we={},It={},Vt={},Xt={},Kt={},de={},be={},We={},Je={},nn={},yn={},Vn={},Wr={},Ka={},pa={},xr={},Xn={},Za={},sr={},Jn={},ma=function(ut,wt,mt){var st=L(ut),Ot,ye,qt;if(wt){if(ye=this.parse(st),ye)throw new Z(ye);this.searchParams=null}else{if(mt!==void 0&&(Ot=new ma(mt,!0)),ye=this.parse(st,null,Ot),ye)throw new Z(ye);qt=W(new X),qt.bindURL(this),this.searchParams=qt}};ma.prototype={type:"URL",parse:function(ut,wt,mt){var st=this,Ot=wt||oe,ye=0,qt="",Oe=!1,rn=!1,hn=!1,xn,it,an,Bn;for(ut=L(ut),wt||(st.scheme="",st.username="",st.password="",st.host=null,st.port=null,st.path=[],st.query=null,st.fragment=null,st.cannotBeABaseURL=!1,ut=ht(ut,Ae,""),ut=ht(ut,xe,"$1")),ut=ht(ut,ge,""),xn=C(ut);ye<=xn.length;){switch(it=xn[ye],Ot){case oe:if(it&&rt(Yt,it))qt+=Ht(it),Ot=we;else{if(wt)return ue;Ot=It;continue}break;case we:if(it&&(rt(ne,it)||it==="+"||it==="-"||it==="."))qt+=Ht(it);else if(it===":"){if(wt&&(st.isSpecial()!==I(Rt,qt)||qt==="file"&&(st.includesCredentials()||st.port!==null)||st.scheme==="file"&&!st.host))return;if(st.scheme=qt,wt){st.isSpecial()&&Rt[st.scheme]===st.port&&(st.port=null);return}qt="",st.scheme==="file"?Ot=Wr:st.isSpecial()&&mt&&mt.scheme===st.scheme?Ot=Vt:st.isSpecial()?Ot=be:xn[ye+1]==="/"?(Ot=Xt,ye++):(st.cannotBeABaseURL=!0,gt(st.path,""),Ot=Za)}else{if(wt)return ue;qt="",Ot=It,ye=0;continue}break;case It:if(!mt||mt.cannotBeABaseURL&&it!=="#")return ue;if(mt.cannotBeABaseURL&&it==="#"){st.scheme=mt.scheme,st.path=O(mt.path),st.query=mt.query,st.fragment="",st.cannotBeABaseURL=!0,Ot=Jn;break}Ot=mt.scheme==="file"?Wr:Kt;continue;case Vt:if(it==="/"&&xn[ye+1]==="/")Ot=We,ye++;else{Ot=Kt;continue}break;case Xt:if(it==="/"){Ot=Je;break}else{Ot=Xn;continue}case Kt:if(st.scheme=mt.scheme,it===bt)st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.query=mt.query;else if(it==="/"||it==="\\"&&st.isSpecial())Ot=de;else if(it==="?")st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.query="",Ot=sr;else if(it==="#")st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.query=mt.query,st.fragment="",Ot=Jn;else{st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,st.path=O(mt.path),st.path.length--,Ot=Xn;continue}break;case de:if(st.isSpecial()&&(it==="/"||it==="\\"))Ot=We;else if(it==="/")Ot=Je;else{st.username=mt.username,st.password=mt.password,st.host=mt.host,st.port=mt.port,Ot=Xn;continue}break;case be:if(Ot=We,it!=="/"||et(qt,ye+1)!=="/")continue;ye++;break;case We:if(it!=="/"&&it!=="\\"){Ot=Je;continue}break;case Je:if(it==="@"){Oe&&(qt="%40"+qt),Oe=!0,an=C(qt);for(var en=0;en<an.length;en++){var Hn=an[en];if(Hn===":"&&!hn){hn=!0;continue}var Pn=ft(Hn,He);hn?st.password+=Pn:st.username+=Pn}qt=""}else if(it===bt||it==="/"||it==="?"||it==="#"||it==="\\"&&st.isSpecial()){if(Oe&&qt==="")return Ee;ye-=C(qt).length+1,qt="",Ot=nn}else qt+=it;break;case nn:case yn:if(wt&&st.scheme==="file"){Ot=pa;continue}else if(it===":"&&!rn){if(qt==="")return te;if(Bn=st.parseHost(qt),Bn)return Bn;if(qt="",Ot=Vn,wt===yn)return}else if(it===bt||it==="/"||it==="?"||it==="#"||it==="\\"&&st.isSpecial()){if(st.isSpecial()&&qt==="")return te;if(wt&&qt===""&&(st.includesCredentials()||st.port!==null))return;if(Bn=st.parseHost(qt),Bn)return Bn;if(qt="",Ot=xr,wt)return;continue}else it==="["?rn=!0:it==="]"&&(rn=!1),qt+=it;break;case Vn:if(rt(fe,it))qt+=it;else if(it===bt||it==="/"||it==="?"||it==="#"||it==="\\"&&st.isSpecial()||wt){if(qt!==""){var Un=_(qt,10);if(Un>65535)return Nt;st.port=st.isSpecial()&&Un===Rt[st.scheme]?null:Un,qt=""}if(wt)return;Ot=xr;continue}else return Nt;break;case Wr:if(st.scheme="file",it==="/"||it==="\\")Ot=Ka;else if(mt&&mt.scheme==="file")switch(it){case bt:st.host=mt.host,st.path=O(mt.path),st.query=mt.query;break;case"?":st.host=mt.host,st.path=O(mt.path),st.query="",Ot=sr;break;case"#":st.host=mt.host,st.path=O(mt.path),st.query=mt.query,st.fragment="",Ot=Jn;break;default:Pt(at(O(xn,ye),""))||(st.host=mt.host,st.path=O(mt.path),st.shortenPath()),Ot=Xn;continue}else{Ot=Xn;continue}break;case Ka:if(it==="/"||it==="\\"){Ot=pa;break}mt&&mt.scheme==="file"&&!Pt(at(O(xn,ye),""))&&(Ct(mt.path[0],!0)?gt(st.path,mt.path[0]):st.host=mt.host),Ot=Xn;continue;case pa:if(it===bt||it==="/"||it==="\\"||it==="?"||it==="#"){if(!wt&&Ct(qt))Ot=Xn;else if(qt===""){if(st.host="",wt)return;Ot=xr}else{if(Bn=st.parseHost(qt),Bn)return Bn;if(st.host==="localhost"&&(st.host=""),wt)return;qt="",Ot=xr}continue}else qt+=it;break;case xr:if(st.isSpecial()){if(Ot=Xn,it!=="/"&&it!=="\\")continue}else if(!wt&&it==="?")st.query="",Ot=sr;else if(!wt&&it==="#")st.fragment="",Ot=Jn;else if(it!==bt&&(Ot=Xn,it!=="/"))continue;break;case Xn:if(it===bt||it==="/"||it==="\\"&&st.isSpecial()||!wt&&(it==="?"||it==="#")){if(Et(qt)?(st.shortenPath(),it!=="/"&&!(it==="\\"&&st.isSpecial())&>(st.path,"")):Ft(qt)?it!=="/"&&!(it==="\\"&&st.isSpecial())&>(st.path,""):(st.scheme==="file"&&!st.path.length&&Ct(qt)&&(st.host&&(st.host=""),qt=et(qt,0)+":"),gt(st.path,qt)),qt="",st.scheme==="file"&&(it===bt||it==="?"||it==="#"))for(;st.path.length>1&&st.path[0]==="";)Mt(st.path);it==="?"?(st.query="",Ot=sr):it==="#"&&(st.fragment="",Ot=Jn)}else qt+=ft(it,me);break;case Za:it==="?"?(st.query="",Ot=sr):it==="#"?(st.fragment="",Ot=Jn):it!==bt&&(st.path[0]+=ft(it,Qt));break;case sr:!wt&&it==="#"?(st.fragment="",Ot=Jn):it!==bt&&(it==="'"&&st.isSpecial()?st.query+="%27":it==="#"?st.query+="%23":st.query+=ft(it,Qt));break;case Jn:it!==bt&&(st.fragment+=ft(it,Gt));break}ye++}},parseHost:function(ut){var wt,mt,st;if(et(ut,0)==="["){if(et(ut,ut.length-1)!=="]"||(wt=ie(zt(ut,1,-1)),!wt))return te;this.host=wt}else if(this.isSpecial()){if(ut=M(ut),rt($e,ut)||(wt=Ut(ut),wt===null))return te;this.host=wt}else{if(rt(ae,ut))return te;for(wt="",mt=C(ut),st=0;st<mt.length;st++)wt+=ft(mt[st],Qt);this.host=wt}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return I(Rt,this.scheme)},shortenPath:function(){var ut=this.path,wt=ut.length;wt&&(this.scheme!=="file"||wt!==1||!Ct(ut[0],!0))&&ut.length--},serialize:function(){var ut=this,wt=ut.scheme,mt=ut.username,st=ut.password,Ot=ut.host,ye=ut.port,qt=ut.path,Oe=ut.query,rn=ut.fragment,hn=wt+":";return Ot!==null?(hn+="//",ut.includesCredentials()&&(hn+=mt+(st?":"+st:"")+"@"),hn+=Jt(Ot),ye!==null&&(hn+=":"+ye)):wt==="file"&&(hn+="//"),hn+=ut.cannotBeABaseURL?qt[0]:qt.length?"/"+at(qt,"/"):"",Oe!==null&&(hn+="?"+Oe),rn!==null&&(hn+="#"+rn),hn},setHref:function(ut){var wt=this.parse(ut);if(wt)throw new Z(wt);this.searchParams.update()},getOrigin:function(){var ut=this.scheme,wt=this.port;if(ut==="blob")try{return new Tr(ut.path[0]).origin}catch(mt){return"null"}return ut==="file"||!this.isSpecial()?"null":ut+"://"+Jt(this.host)+(wt!==null?":"+wt:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(ut){this.parse(L(ut)+":",oe)},getUsername:function(){return this.username},setUsername:function(ut){var wt=C(L(ut));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var mt=0;mt<wt.length;mt++)this.username+=ft(wt[mt],He)}},getPassword:function(){return this.password},setPassword:function(ut){var wt=C(L(ut));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var mt=0;mt<wt.length;mt++)this.password+=ft(wt[mt],He)}},getHost:function(){var ut=this.host,wt=this.port;return ut===null?"":wt===null?Jt(ut):Jt(ut)+":"+wt},setHost:function(ut){this.cannotBeABaseURL||this.parse(ut,nn)},getHostname:function(){var ut=this.host;return ut===null?"":Jt(ut)},setHostname:function(ut){this.cannotBeABaseURL||this.parse(ut,yn)},getPort:function(){var ut=this.port;return ut===null?"":L(ut)},setPort:function(ut){this.cannotHaveUsernamePasswordPort()||(ut=L(ut),ut===""?this.port=null:this.parse(ut,Vn))},getPathname:function(){var ut=this.path;return this.cannotBeABaseURL?ut[0]:ut.length?"/"+at(ut,"/"):""},setPathname:function(ut){this.cannotBeABaseURL||(this.path=[],this.parse(ut,xr))},getSearch:function(){var ut=this.query;return ut?"?"+ut:""},setSearch:function(ut){ut=L(ut),ut===""?this.query=null:(et(ut,0)==="?"&&(ut=zt(ut,1)),this.query="",this.parse(ut,sr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var ut=this.fragment;return ut?"#"+ut:""},setHash:function(ut){if(ut=L(ut),ut===""){this.fragment=null;return}et(ut,0)==="#"&&(ut=zt(ut,1)),this.fragment="",this.parse(ut,Jn)},update:function(){this.query=this.searchParams.serialize()||null}};var Tr=function(wt){var mt=A(this,$n),st=F(arguments.length,1)>1?arguments[1]:void 0,Ot=G(mt,new ma(wt,!1,st));d||(mt.href=Ot.serialize(),mt.origin=Ot.getOrigin(),mt.protocol=Ot.getProtocol(),mt.username=Ot.getUsername(),mt.password=Ot.getPassword(),mt.host=Ot.getHost(),mt.hostname=Ot.getHostname(),mt.port=Ot.getPort(),mt.pathname=Ot.getPathname(),mt.search=Ot.getSearch(),mt.searchParams=Ot.getSearchParams(),mt.hash=Ot.getHash())},$n=Tr.prototype,Nn=function(ut,wt){return{get:function(){return V(this)[ut]()},set:wt&&function(mt){return V(this)[wt](mt)},configurable:!0,enumerable:!0}};if(d&&($($n,"href",Nn("serialize","setHref")),$($n,"origin",Nn("getOrigin")),$($n,"protocol",Nn("getProtocol","setProtocol")),$($n,"username",Nn("getUsername","setUsername")),$($n,"password",Nn("getPassword","setPassword")),$($n,"host",Nn("getHost","setHost")),$($n,"hostname",Nn("getHostname","setHostname")),$($n,"port",Nn("getPort","setPort")),$($n,"pathname",Nn("getPathname","setPathname")),$($n,"search",Nn("getSearch","setSearch")),$($n,"searchParams",Nn("getSearchParams")),$($n,"hash",Nn("getHash","setHash"))),S($n,"toJSON",function(){return V(this).serialize()},{enumerable:!0}),S($n,"toString",function(){return V(this).serialize()},{enumerable:!0}),H){var Ja=H.createObjectURL,Qa=H.revokeObjectURL;Ja&&S(Tr,"createObjectURL",y(Ja,H)),Qa&&S(Tr,"revokeObjectURL",y(Qa,H))}B(Tr,"URL"),u({global:!0,constructor:!0,forced:!h,sham:!d},{URL:Tr})}),(function(x,b,n){var u=n(7),d=n(33),h=n(6),v=n(36),y=d("iterator");x.exports=!u(function(){var T=new URL("b?a=1&b=2&c=3","https://a"),S=T.searchParams,$=new URLSearchParams("a=1&a=2&b=3"),A="";return T.pathname="c%20d",S.forEach(function(I,R){S.delete("b"),A+=R+I}),$.delete("a",2),$.delete("b",void 0),v&&(!T.toJSON||!$.has("a",1)||$.has("a",2)||!$.has("a",void 0)||$.has("b"))||!S.size&&(v||!h)||!S.sort||T.href!=="https://a/c%20d?a=1&c=3"||S.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!S[y]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("https://a#\u0431").hash!=="#%D0%B1"||A!=="a1c3"||new URL("https://x",void 0).host!=="x"})}),(function(x,b,n){var u=n(14),d=2147483647,h=36,v=1,y=26,T=38,S=700,$=72,A=128,I="-",R=/[^\0-\u007E]/,C=/[.\u3002\uFF0E\uFF61]/g,O="Overflow: input needs wider integers to process",P=h-v,M=RangeError,L=u(C.exec),B=Math.floor,F=String.fromCharCode,z=u("".charCodeAt),j=u([].join),G=u([].push),V=u("".replace),X=u("".split),W=u("".toLowerCase),H=function(q){for(var et=[],rt=0,at=q.length;rt<at;){var dt=z(q,rt++);if(dt>=55296&&dt<=56319&&rt<at){var xt=z(q,rt++);(xt&64512)===56320?G(et,((dt&1023)<<10)+(xt&1023)+65536):(G(et,dt),rt--)}else G(et,dt)}return et},Z=function(q){return q+22+75*(q<26)},_=function(q,et,rt){var at=0;for(q=rt?B(q/S):q>>1,q+=B(q/et);q>P*y>>1;)q=B(q/P),at+=h;return B(at+(P+1)*q/(q+T))},k=function(q){var et=[];q=H(q);var rt=q.length,at=A,dt=0,xt=$,gt,ht;for(gt=0;gt<q.length;gt++)ht=q[gt],ht<128&&G(et,F(ht));var Mt=et.length,$t=Mt;for(Mt&&G(et,I);$t<rt;){var zt=d;for(gt=0;gt<q.length;gt++)ht=q[gt],ht>=at&&ht<zt&&(zt=ht);var Ht=$t+1;if(zt-at>B((d-dt)/Ht))throw new M(O);for(dt+=(zt-at)*Ht,at=zt,gt=0;gt<q.length;gt++){if(ht=q[gt],ht<at&&++dt>d)throw new M(O);if(ht===at){for(var _t=dt,Ee=h;;){var ue=Ee<=xt?v:Ee>=xt+y?y:Ee-xt;if(_t<ue)break;var te=_t-ue,Nt=h-ue;G(et,F(Z(ue+te%Nt))),_t=B(te/Nt),Ee+=h}G(et,F(Z(_t))),xt=_(dt,Ht,$t===Mt),dt=0,$t++}}dt++,at++}return j(et,"")};x.exports=function(q){var et=[],rt=X(V(W(q),C,"."),"."),at,dt;for(at=0;at<rt.length;at++)dt=rt[at],G(et,L(R,dt)?"xn--"+k(dt):dt);return j(et,".")}}),(function(x,b,n){n(172),n(473);var u=n(3),d=n(4),h=n(380),v=n(23),y=n(8),T=n(14),S=n(6),$=n(606),A=n(47),I=n(77),R=n(214),C=n(82),O=n(174),P=n(51),M=n(215),L=n(21),B=n(38),F=n(84),z=n(69),j=n(46),G=n(20),V=n(68),X=n(71),W=n(11),H=n(136),Z=n(137),_=n(176),k=n(377),q=n(33),et=n(193),rt=q("iterator"),at="URLSearchParams",dt=at+"Iterator",xt=P.set,gt=P.getterFor(at),ht=P.getterFor(dt),Mt=h("fetch"),$t=h("Request"),zt=h("Headers"),Ht=$t&&$t.prototype,_t=zt&&zt.prototype,Ee=d.TypeError,ue=d.encodeURIComponent,te=String.fromCharCode,Nt=v("String","fromCodePoint"),Yt=parseInt,ne=T("".charAt),fe=T([].join),ee=T([].push),le=T("".replace),Me=T([].shift),Ne=T([].splice),$e=T("".split),ae=T("".slice),Ae=T(/./.exec),xe=/\+/g,ge="\uFFFD",bt=/^[0-9a-f]+$/i,Ut=function(It,Vt){var Xt=ae(It,Vt,Vt+2);return Ae(bt,Xt)?Yt(Xt,16):NaN},ie=function(It){for(var Vt=0,Xt=128;Xt>0&&(It&Xt)!==0;Xt>>=1)Vt++;return Vt},Lt=function(It){var Vt=null;switch(It.length){case 1:Vt=It[0];break;case 2:Vt=(It[0]&31)<<6|It[1]&63;break;case 3:Vt=(It[0]&15)<<12|(It[1]&63)<<6|It[2]&63;break;case 4:Vt=(It[0]&7)<<18|(It[1]&63)<<12|(It[2]&63)<<6|It[3]&63;break}return Vt>1114111?null:Vt},Jt=function(It){It=le(It,xe," ");for(var Vt=It.length,Xt="",Kt=0;Kt<Vt;){var de=ne(It,Kt);if(de==="%"){if(ne(It,Kt+1)==="%"||Kt+3>Vt){Xt+="%",Kt++;continue}var be=Ut(It,Kt+1);if(be!==be){Xt+=de,Kt++;continue}Kt+=2;var We=ie(be);if(We===0)de=te(be);else{if(We===1||We>4){Xt+=ge,Kt++;continue}for(var Je=[be],nn=1;nn<We&&(Kt++,!(Kt+3>Vt||ne(It,Kt)!=="%"));){var yn=Ut(It,Kt+1);if(yn!==yn){Kt+=3;break}if(yn>191||yn<128)break;ee(Je,yn),Kt+=2,nn++}if(Je.length!==We){Xt+=ge;continue}var Vn=Lt(Je);Vn===null?Xt+=ge:de=Nt(Vn)}}Xt+=de,Kt++}return Xt},Qt=/[!'()~]|%20/g,Gt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},me=function(It){return Gt[It]},He=function(It){return le(ue(It),Qt,me)},ft=O(function(Vt,Xt){xt(this,{type:dt,target:gt(Vt).entries,index:0,kind:Xt})},at,function(){var Vt=ht(this),Xt=Vt.target,Kt=Vt.index++;if(!Xt||Kt>=Xt.length)return Vt.target=null,_(void 0,!0);var de=Xt[Kt];switch(Vt.kind){case"keys":return _(de.key,!1);case"values":return _(de.value,!1)}return _([de.key,de.value],!1)},!0),Rt=function(It){this.entries=[],this.url=null,It!==void 0&&(G(It)?this.parseObject(It):this.parseQuery(typeof It=="string"?ne(It,0)==="?"?ae(It,1):It:V(It)))};Rt.prototype={type:at,bindURL:function(It){this.url=It,this.update()},parseObject:function(It){var Vt=this.entries,Xt=Z(It),Kt,de,be,We,Je,nn,yn;if(Xt)for(Kt=H(It,Xt),de=Kt.next;!(be=y(de,Kt)).done;){if(We=H(j(be.value)),Je=We.next,(nn=y(Je,We)).done||(yn=y(Je,We)).done||!y(Je,We).done)throw new Ee("Expected sequence with length 2");ee(Vt,{key:V(nn.value),value:V(yn.value)})}else for(var Vn in It)B(It,Vn)&&ee(Vt,{key:Vn,value:V(It[Vn])})},parseQuery:function(It){if(It)for(var Vt=this.entries,Xt=$e(It,"&"),Kt=0,de,be;Kt<Xt.length;)de=Xt[Kt++],de.length&&(be=$e(de,"="),ee(Vt,{key:Jt(Me(be)),value:Jt(fe(be,"="))}))},serialize:function(){for(var It=this.entries,Vt=[],Xt=0,Kt;Xt<It.length;)Kt=It[Xt++],ee(Vt,He(Kt.key)+"="+He(Kt.value));return fe(Vt,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ct=function(){M(this,Pt);var Vt=arguments.length>0?arguments[0]:void 0,Xt=xt(this,new Rt(Vt));S||(this.size=Xt.entries.length)},Pt=Ct.prototype;if(R(Pt,{append:function(Vt,Xt){var Kt=gt(this);k(arguments.length,2),ee(Kt.entries,{key:V(Vt),value:V(Xt)}),S||this.length++,Kt.updateURL()},delete:function(It){for(var Vt=gt(this),Xt=k(arguments.length,1),Kt=Vt.entries,de=V(It),be=Xt<2?void 0:arguments[1],We=be===void 0?be:V(be),Je=0;Je<Kt.length;){var nn=Kt[Je];if(nn.key===de&&(We===void 0||nn.value===We)){if(Ne(Kt,Je,1),We!==void 0)break}else Je++}S||(this.size=Kt.length),Vt.updateURL()},get:function(Vt){var Xt=gt(this).entries;k(arguments.length,1);for(var Kt=V(Vt),de=0;de<Xt.length;de++)if(Xt[de].key===Kt)return Xt[de].value;return null},getAll:function(Vt){var Xt=gt(this).entries;k(arguments.length,1);for(var Kt=V(Vt),de=[],be=0;be<Xt.length;be++)Xt[be].key===Kt&&ee(de,Xt[be].value);return de},has:function(Vt){for(var Xt=gt(this).entries,Kt=k(arguments.length,1),de=V(Vt),be=Kt<2?void 0:arguments[1],We=be===void 0?be:V(be),Je=0;Je<Xt.length;){var nn=Xt[Je++];if(nn.key===de&&(We===void 0||nn.value===We))return!0}return!1},set:function(Vt,Xt){var Kt=gt(this);k(arguments.length,1);for(var de=Kt.entries,be=!1,We=V(Vt),Je=V(Xt),nn=0,yn;nn<de.length;nn++)yn=de[nn],yn.key===We&&(be?Ne(de,nn--,1):(be=!0,yn.value=Je));be||ee(de,{key:We,value:Je}),S||(this.size=de.length),Kt.updateURL()},sort:function(){var Vt=gt(this);et(Vt.entries,function(Xt,Kt){return Xt.key>Kt.key?1:-1}),Vt.updateURL()},forEach:function(Vt){for(var Xt=gt(this).entries,Kt=F(Vt,arguments.length>1?arguments[1]:void 0),de=0,be;de<Xt.length;)be=Xt[de++],Kt(be.value,be.key,this)},keys:function(){return new ft(this,"keys")},values:function(){return new ft(this,"values")},entries:function(){return new ft(this,"entries")}},{enumerable:!0}),A(Pt,rt,Pt.entries,{name:"entries"}),A(Pt,"toString",function(){return gt(this).serialize()},{enumerable:!0}),S&&I(Pt,"size",{get:function(){return gt(this).entries.length},configurable:!0,enumerable:!0}),C(Ct,at),u({global:!0,constructor:!0,forced:!$},{URLSearchParams:Ct}),!$&&L(zt)){var Ft=T(_t.has),Et=T(_t.set),oe=function(It){if(G(It)){var Vt=It.body,Xt;if(z(Vt)===at)return Xt=It.headers?new zt(It.headers):new zt,Ft(Xt,"content-type")||Et(Xt,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),X(It,{body:W(0,V(Vt)),headers:W(0,Xt)})}return It};if(L(Mt)&&u({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(Vt){return Mt(Vt,arguments.length>1?oe(arguments[1]):{})}}),L($t)){var we=function(Vt){return M(this,Ht),new $t(Vt,arguments.length>1?oe(arguments[1]):{})};Ht.constructor=we,we.prototype=Ht,u({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:we})}}x.exports={URLSearchParams:Ct,getState:gt}}),(function(x,b,n){var u=n(3),d=n(23),h=n(7),v=n(377),y=n(68),T=n(606),S=d("URL"),$=T&&h(function(){S.canParse()}),A=h(function(){return S.canParse.length!==1});u({target:"URL",stat:!0,forced:!$||A},{canParse:function(R){var C=v(arguments.length,1),O=y(R),P=C<2||arguments[1]===void 0?void 0:y(arguments[1]);try{return!!new S(O,P)}catch(M){return!1}}})}),(function(x,b,n){var u=n(3),d=n(23),h=n(377),v=n(68),y=n(606),T=d("URL");u({target:"URL",stat:!0,forced:!y},{parse:function($){var A=h(arguments.length,1),I=v($),R=A<2||arguments[1]===void 0?void 0:v(arguments[1]);try{return new T(I,R)}catch(C){return null}}})}),(function(x,b,n){var u=n(3),d=n(8);u({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return d(URL.prototype.toString,this)}})}),(function(x,b,n){n(608)}),(function(x,b,n){var u=n(47),d=n(14),h=n(68),v=n(377),y=URLSearchParams,T=y.prototype,S=d(T.append),$=d(T.delete),A=d(T.forEach),I=d([].push),R=new y("a=1&a=2&b=3");R.delete("a",1),R.delete("b",void 0),R+""!="a=2"&&u(T,"delete",function(C){var O=arguments.length,P=O<2?void 0:arguments[1];if(O&&P===void 0)return $(this,C);var M=[];A(this,function(X,W){I(M,{key:W,value:X})}),v(O,1);for(var L=h(C),B=h(P),F=0,z=0,j=!1,G=M.length,V;F<G;)V=M[F++],j||V.key===L?(j=!0,$(this,V.key)):z++;for(;z<G;)V=M[z++],V.key===L&&V.value===B||S(this,V.key,V.value)},{enumerable:!0,unsafe:!0})}),(function(x,b,n){var u=n(47),d=n(14),h=n(68),v=n(377),y=URLSearchParams,T=y.prototype,S=d(T.getAll),$=d(T.has),A=new y("a=1");(A.has("a",2)||!A.has("a",void 0))&&u(T,"has",function(R){var C=arguments.length,O=C<2?void 0:arguments[1];if(C&&O===void 0)return $(this,R);var P=S(this,R);v(C,1);for(var M=h(O),L=0;L<P.length;)if(P[L++]===M)return!0;return!1},{enumerable:!0,unsafe:!0})}),(function(x,b,n){var u=n(6),d=n(14),h=n(77),v=URLSearchParams.prototype,y=d(v.forEach);u&&!("size"in v)&&h(v,"size",{get:function(){var S=0;return y(this,function(){S++}),S},configurable:!0,enumerable:!0})}),(function(x,b,n){n.r(b),n.d(b,{bb:function(){return Mf},default:function(){return Mf}});var u={};n.r(u),n.d(u,{selection:function(){return Tu},subchart:function(){return Su},zoom:function(){return $u}});var d={};n.r(d),n.d(d,{area:function(){return ff},areaLineRange:function(){return df},areaSpline:function(){return vf},areaSplineRange:function(){return gf},areaStep:function(){return pf},areaStepRange:function(){return hf},bar:function(){return bf},bubble:function(){return If},candlestick:function(){return Rf},donut:function(){return Tf},funnel:function(){return Cf},gauge:function(){return Sf},line:function(){return mf},pie:function(){return $f},polar:function(){return Af},radar:function(){return Ef},scatter:function(){return Of},spline:function(){return yf},step:function(){return xf},treemap:function(){return Pf}});function h(){}function v(t){return t==null?h:function(){return this.querySelector(t)}}function y(t){typeof t!="function"&&(t=v(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var i=e[o],s=i.length,l=a[o]=new Array(s),c,f,g=0;g<s;++g)(c=i[g])&&(f=t.call(c,c.__data__,g,i))&&("__data__"in c&&(f.__data__=c.__data__),l[g]=f);return new Oe(a,this._parents)}function T(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function S(){return[]}function $(t){return t==null?S:function(){return this.querySelectorAll(t)}}function A(t){return function(){return T(t.apply(this,arguments))}}function I(t){typeof t=="function"?t=A(t):t=$(t);for(var e=this._groups,r=e.length,a=[],o=[],i=0;i<r;++i)for(var s=e[i],l=s.length,c,f=0;f<l;++f)(c=s[f])&&(a.push(t.call(c,c.__data__,f,s)),o.push(c));return new Oe(a,o)}function R(t){return function(){return this.matches(t)}}function C(t){return function(e){return e.matches(t)}}var O=Array.prototype.find;function P(t){return function(){return O.call(this.children,t)}}function M(){return this.firstElementChild}function L(t){return this.select(t==null?M:P(typeof t=="function"?t:C(t)))}var B=Array.prototype.filter;function F(){return Array.from(this.children)}function z(t){return function(){return B.call(this.children,t)}}function j(t){return this.selectAll(t==null?F:z(typeof t=="function"?t:C(t)))}function G(t){typeof t!="function"&&(t=R(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var i=e[o],s=i.length,l=a[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&l.push(c);return new Oe(a,this._parents)}function V(t){return new Array(t.length)}function X(){return new Oe(this._enter||this._groups.map(V),this._parents)}function W(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}W.prototype={constructor:W,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function H(t){return function(){return t}}function Z(t,e,r,a,o,i){for(var s=0,l,c=e.length,f=i.length;s<f;++s)(l=e[s])?(l.__data__=i[s],a[s]=l):r[s]=new W(t,i[s]);for(;s<c;++s)(l=e[s])&&(o[s]=l)}function _(t,e,r,a,o,i,s){var l,c,f=new Map,g=e.length,p=i.length,m=new Array(g),E;for(l=0;l<g;++l)(c=e[l])&&(m[l]=E=s.call(c,c.__data__,l,e)+"",f.has(E)?o[l]=c:f.set(E,c));for(l=0;l<p;++l)E=s.call(t,i[l],l,i)+"",(c=f.get(E))?(a[l]=c,c.__data__=i[l],f.delete(E)):r[l]=new W(t,i[l]);for(l=0;l<g;++l)(c=e[l])&&f.get(m[l])===c&&(o[l]=c)}function k(t){return t.__data__}function q(t,e){if(!arguments.length)return Array.from(this,k);var r=e?_:Z,a=this._parents,o=this._groups;typeof t!="function"&&(t=H(t));for(var i=o.length,s=new Array(i),l=new Array(i),c=new Array(i),f=0;f<i;++f){var g=a[f],p=o[f],m=p.length,E=et(t.call(g,g&&g.__data__,f,a)),w=E.length,U=l[f]=new Array(w),N=s[f]=new Array(w),D=c[f]=new Array(m);r(g,p,U,N,D,E,e);for(var Y=0,J=0,K,nt;Y<w;++Y)if(K=U[Y]){for(Y>=J&&(J=Y+1);!(nt=N[J])&&++J<w;);K._next=nt||null}}return s=new Oe(s,a),s._enter=l,s._exit=c,s}function et(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function rt(){return new Oe(this._exit||this._groups.map(V),this._parents)}function at(t,e,r){var a=this.enter(),o=this,i=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?i.remove():r(i),a&&o?a.merge(o).order():o}function dt(t){for(var e=t.selection?t.selection():t,r=this._groups,a=e._groups,o=r.length,i=a.length,s=Math.min(o,i),l=new Array(o),c=0;c<s;++c)for(var f=r[c],g=a[c],p=f.length,m=l[c]=new Array(p),E,w=0;w<p;++w)(E=f[w]||g[w])&&(m[w]=E);for(;c<o;++c)l[c]=r[c];return new Oe(l,this._parents)}function xt(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var a=t[e],o=a.length-1,i=a[o],s;--o>=0;)(s=a[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function gt(t){t||(t=ht);function e(p,m){return p&&m?t(p.__data__,m.__data__):!p-!m}for(var r=this._groups,a=r.length,o=new Array(a),i=0;i<a;++i){for(var s=r[i],l=s.length,c=o[i]=new Array(l),f,g=0;g<l;++g)(f=s[g])&&(c[g]=f);c.sort(e)}return new Oe(o,this._parents).order()}function ht(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Mt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function $t(){return Array.from(this)}function zt(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,i=a.length;o<i;++o){var s=a[o];if(s)return s}return null}function Ht(){let t=0;for(const e of this)++t;return t}function _t(){return!this.node()}function Ee(t){for(var e=this._groups,r=0,a=e.length;r<a;++r)for(var o=e[r],i=0,s=o.length,l;i<s;++i)(l=o[i])&&t.call(l,l.__data__,i,o);return this}var ue="http://www.w3.org/1999/xhtml",te={svg:"http://www.w3.org/2000/svg",xhtml:ue,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nt(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),te.hasOwnProperty(e)?{space:te[e],local:t}:t}function Yt(t){return function(){this.removeAttribute(t)}}function ne(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fe(t,e){return function(){this.setAttribute(t,e)}}function ee(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function le(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Me(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Ne(t,e){var r=Nt(t);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((e==null?r.local?ne:Yt:typeof e=="function"?r.local?Me:le:r.local?ee:fe)(r,e))}function $e(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ae(t){return function(){this.style.removeProperty(t)}}function Ae(t,e,r){return function(){this.style.setProperty(t,e,r)}}function xe(t,e,r){return function(){var a=e.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,r)}}function ge(t,e,r){return arguments.length>1?this.each((e==null?ae:typeof e=="function"?xe:Ae)(t,e,r==null?"":r)):bt(this.node(),t)}function bt(t,e){return t.style.getPropertyValue(e)||$e(t).getComputedStyle(t,null).getPropertyValue(e)}function Ut(t){return function(){delete this[t]}}function ie(t,e){return function(){this[t]=e}}function Lt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Jt(t,e){return arguments.length>1?this.each((e==null?Ut:typeof e=="function"?Lt:ie)(t,e)):this.node()[t]}function Qt(t){return t.trim().split(/^|\s+/)}function Gt(t){return t.classList||new me(t)}function me(t){this._node=t,this._names=Qt(t.getAttribute("class")||"")}me.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function He(t,e){for(var r=Gt(t),a=-1,o=e.length;++a<o;)r.add(e[a])}function ft(t,e){for(var r=Gt(t),a=-1,o=e.length;++a<o;)r.remove(e[a])}function Rt(t){return function(){He(this,t)}}function Ct(t){return function(){ft(this,t)}}function Pt(t,e){return function(){(e.apply(this,arguments)?He:ft)(this,t)}}function Ft(t,e){var r=Qt(t+"");if(arguments.length<2){for(var a=Gt(this.node()),o=-1,i=r.length;++o<i;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?Pt:e?Rt:Ct)(r,e))}function Et(){this.textContent=""}function oe(t){return function(){this.textContent=t}}function we(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function It(t){return arguments.length?this.each(t==null?Et:(typeof t=="function"?we:oe)(t)):this.node().textContent}function Vt(){this.innerHTML=""}function Xt(t){return function(){this.innerHTML=t}}function Kt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function de(t){return arguments.length?this.each(t==null?Vt:(typeof t=="function"?Kt:Xt)(t)):this.node().innerHTML}function be(){this.nextSibling&&this.parentNode.appendChild(this)}function We(){return this.each(be)}function Je(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nn(){return this.each(Je)}function yn(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===ue&&e.documentElement.namespaceURI===ue?e.createElement(t):e.createElementNS(r,t)}}function Vn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wr(t){var e=Nt(t);return(e.local?Vn:yn)(e)}function Ka(t){var e=typeof t=="function"?t:Wr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function pa(){return null}function xr(t,e){var r=typeof t=="function"?t:Wr(t),a=e==null?pa:typeof e=="function"?e:v(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function Xn(){var t=this.parentNode;t&&t.removeChild(this)}function Za(){return this.each(Xn)}function sr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Jn(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ma(t){return this.select(t?Jn:sr)}function Tr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function $n(t){return function(e){t.call(this,e,this.__data__)}}function Nn(t){return t.trim().split(/^|\s+/).map(function(e){var r="",a=e.indexOf(".");return a>=0&&(r=e.slice(a+1),e=e.slice(0,a)),{type:e,name:r}})}function Ja(t){return function(){var e=this.__on;if(e){for(var r=0,a=-1,o=e.length,i;r<o;++r)i=e[r],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++a]=i;++a?e.length=a:delete this.__on}}}function Qa(t,e,r){return function(){var a=this.__on,o,i=$n(e);if(a){for(var s=0,l=a.length;s<l;++s)if((o=a[s]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=r),o.value=e;return}}this.addEventListener(t.type,i,r),o={type:t.type,name:t.name,value:e,listener:i,options:r},a?a.push(o):this.__on=[o]}}function ut(t,e,r){var a=Nn(t+""),o,i=a.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,g;c<f;++c)for(o=0,g=l[c];o<i;++o)if((s=a[o]).type===g.type&&s.name===g.name)return g.value}return}for(l=e?Qa:Ja,o=0;o<i;++o)this.each(l(a[o],e,r));return this}function wt(t,e,r){var a=$e(t),o=a.CustomEvent;typeof o=="function"?o=new o(e,r):(o=a.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function mt(t,e){return function(){return wt(this,t,e)}}function st(t,e){return function(){return wt(this,t,e.apply(this,arguments))}}function Ot(t,e){return this.each((typeof e=="function"?st:mt)(t,e))}function*ye(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,i=a.length,s;o<i;++o)(s=a[o])&&(yield s)}var qt=[null];function Oe(t,e){this._groups=t,this._parents=e}function rn(){return new Oe([[document.documentElement]],qt)}function hn(){return this}Oe.prototype=rn.prototype={constructor:Oe,select:y,selectAll:I,selectChild:L,selectChildren:j,filter:G,data:q,enter:X,exit:rt,join:at,merge:dt,selection:hn,order:xt,sort:gt,call:Mt,nodes:$t,node:zt,size:Ht,empty:_t,each:Ee,attr:Ne,style:ge,property:Jt,classed:Ft,text:It,html:de,raise:We,lower:nn,append:Ka,insert:xr,remove:Za,clone:ma,datum:Tr,on:ut,dispatch:Ot,[Symbol.iterator]:ye};var xn=rn;function it(t){return typeof t=="string"?new Oe([[document.querySelector(t)]],[document.documentElement]):new Oe([[t]],qt)}const an=new Date,Bn=new Date;function en(t,e,r,a){function o(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(t(i=new Date(+i)),i),o.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),o.round=i=>{const s=o(i),l=o.ceil(i);return i-s<l-i?s:l},o.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,l)=>{const c=[];if(i=o.ceil(i),l=l==null?1:Math.floor(l),!(i<s)||!(l>0))return c;let f;do c.push(f=new Date(+i)),e(i,l),t(i);while(f<i&&i<s);return c},o.filter=i=>en(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!i(s););else for(;--l>=0;)for(;e(s,1),!i(s););}),r&&(o.count=(i,s)=>(an.setTime(+i),Bn.setTime(+s),t(an),t(Bn),Math.floor(r(an,Bn))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(a?s=>a(s)%i===0:s=>o.count(0,s)%i===0):o)),o}const Hn=1e3,Pn=Hn*60,Un=Pn*60,lr=Un*24,ri=lr*7,ws=lr*30,ai=lr*365;function Rr(t){return en(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Pn)/ri)}const ka=Rr(0),qa=Rr(1),Df=Rr(2),Nf=Rr(3),Yr=Rr(4),Lf=Rr(5),Ff=Rr(6),K0=ka.range,Z0=qa.range,J0=Df.range,Q0=Nf.range,k0=Yr.range,q0=Lf.range,_0=Ff.range;function Or(t){return en(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/ri)}const _a=Or(0),to=Or(1),Bf=Or(2),Uf=Or(3),Kr=Or(4),zf=Or(5),jf=Or(6),t1=_a.range,e1=to.range,n1=Bf.range,r1=Uf.range,a1=Kr.range,o1=zf.range,i1=jf.range,ya=en(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Pn)/lr,t=>t.getDate()-1),s1=ya.range,eo=en(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lr,t=>t.getUTCDate()-1),l1=eo.range,Ds=en(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/lr,t=>Math.floor(t/lr)),c1=Ds.range,cr=en(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());cr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:en(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});const u1=cr.range,ur=en(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());ur.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:en(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});const f1=ur.range;function oi(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ii(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function xa(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function Gf(t){var e=t.dateTime,r=t.date,a=t.time,o=t.periods,i=t.days,s=t.shortDays,l=t.months,c=t.shortMonths,f=Ta(o),g=Sa(o),p=Ta(i),m=Sa(i),E=Ta(s),w=Sa(s),U=Ta(l),N=Sa(l),D=Ta(c),Y=Sa(c),J={a:At,A:Wt,b:Dt,B:Zt,c:null,d:zs,e:zs,f:ud,g:Td,G:$d,H:sd,I:ld,j:cd,L:js,m:fd,M:dd,p:re,q:ce,Q:Ys,s:Ks,S:hd,u:vd,U:gd,V:pd,w:md,W:yd,x:null,X:null,y:xd,Y:Sd,Z:Ad,"%":Ws},K={a:Ie,A:Ce,b:Pe,B:Ye,c:null,d:Vs,e:Vs,f:Rd,g:Bd,G:zd,H:Ed,I:bd,j:Id,L:Xs,m:Od,M:Cd,p:Be,q:dn,Q:Ys,s:Ks,S:Pd,u:Md,U:wd,V:Dd,w:Nd,W:Ld,x:null,X:null,y:Fd,Y:Ud,Z:jd,"%":Ws},nt={a:yt,A:lt,b:jt,B:vt,c:tt,d:Bs,e:Bs,f:rd,g:Fs,G:Ls,H:Us,I:Us,j:_f,L:nd,m:qf,M:td,p:Tt,q:kf,Q:od,s:id,S:ed,u:Yf,U:Kf,V:Zf,w:Wf,W:Jf,x:St,X:ct,y:Fs,Y:Ls,Z:Qf,"%":ad};J.x=Q(r,J),J.X=Q(a,J),J.c=Q(e,J),K.x=Q(r,K),K.X=Q(a,K),K.c=Q(e,K);function Q(kt,Te){return function(Re){var Bt=[],un=-1,Xe=0,wn=kt.length,Dn,ve,fn;for(Re instanceof Date||(Re=new Date(+Re));++un<wn;)kt.charCodeAt(un)===37&&(Bt.push(kt.slice(Xe,un)),(ve=Ns[Dn=kt.charAt(++un)])!=null?Dn=kt.charAt(++un):ve=Dn==="e"?" ":"0",(fn=Te[Dn])&&(Dn=fn(Re,ve)),Bt.push(Dn),Xe=un+1);return Bt.push(kt.slice(Xe,un)),Bt.join("")}}function ot(kt,Te){return function(Re){var Bt=xa(1900,void 0,1),un=pt(Bt,kt,Re+="",0),Xe,wn;if(un!=Re.length)return null;if("Q"in Bt)return new Date(Bt.Q);if("s"in Bt)return new Date(Bt.s*1e3+("L"in Bt?Bt.L:0));if(Te&&!("Z"in Bt)&&(Bt.Z=0),"p"in Bt&&(Bt.H=Bt.H%12+Bt.p*12),Bt.m===void 0&&(Bt.m="q"in Bt?Bt.q:0),"V"in Bt){if(Bt.V<1||Bt.V>53)return null;"w"in Bt||(Bt.w=1),"Z"in Bt?(Xe=ii(xa(Bt.y,0,1)),wn=Xe.getUTCDay(),Xe=wn>4||wn===0?to.ceil(Xe):to(Xe),Xe=eo.offset(Xe,(Bt.V-1)*7),Bt.y=Xe.getUTCFullYear(),Bt.m=Xe.getUTCMonth(),Bt.d=Xe.getUTCDate()+(Bt.w+6)%7):(Xe=oi(xa(Bt.y,0,1)),wn=Xe.getDay(),Xe=wn>4||wn===0?qa.ceil(Xe):qa(Xe),Xe=ya.offset(Xe,(Bt.V-1)*7),Bt.y=Xe.getFullYear(),Bt.m=Xe.getMonth(),Bt.d=Xe.getDate()+(Bt.w+6)%7)}else("W"in Bt||"U"in Bt)&&("w"in Bt||(Bt.w="u"in Bt?Bt.u%7:"W"in Bt?1:0),wn="Z"in Bt?ii(xa(Bt.y,0,1)).getUTCDay():oi(xa(Bt.y,0,1)).getDay(),Bt.m=0,Bt.d="W"in Bt?(Bt.w+6)%7+Bt.W*7-(wn+5)%7:Bt.w+Bt.U*7-(wn+6)%7);return"Z"in Bt?(Bt.H+=Bt.Z/100|0,Bt.M+=Bt.Z%100,ii(Bt)):oi(Bt)}}function pt(kt,Te,Re,Bt){for(var un=0,Xe=Te.length,wn=Re.length,Dn,ve;un<Xe;){if(Bt>=wn)return-1;if(Dn=Te.charCodeAt(un++),Dn===37){if(Dn=Te.charAt(un++),ve=nt[Dn in Ns?Te.charAt(un++):Dn],!ve||(Bt=ve(kt,Re,Bt))<0)return-1}else if(Dn!=Re.charCodeAt(Bt++))return-1}return Bt}function Tt(kt,Te,Re){var Bt=f.exec(Te.slice(Re));return Bt?(kt.p=g.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function yt(kt,Te,Re){var Bt=E.exec(Te.slice(Re));return Bt?(kt.w=w.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function lt(kt,Te,Re){var Bt=p.exec(Te.slice(Re));return Bt?(kt.w=m.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function jt(kt,Te,Re){var Bt=D.exec(Te.slice(Re));return Bt?(kt.m=Y.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function vt(kt,Te,Re){var Bt=U.exec(Te.slice(Re));return Bt?(kt.m=N.get(Bt[0].toLowerCase()),Re+Bt[0].length):-1}function tt(kt,Te,Re){return pt(kt,e,Te,Re)}function St(kt,Te,Re){return pt(kt,r,Te,Re)}function ct(kt,Te,Re){return pt(kt,a,Te,Re)}function At(kt){return s[kt.getDay()]}function Wt(kt){return i[kt.getDay()]}function Dt(kt){return c[kt.getMonth()]}function Zt(kt){return l[kt.getMonth()]}function re(kt){return o[+(kt.getHours()>=12)]}function ce(kt){return 1+~~(kt.getMonth()/3)}function Ie(kt){return s[kt.getUTCDay()]}function Ce(kt){return i[kt.getUTCDay()]}function Pe(kt){return c[kt.getUTCMonth()]}function Ye(kt){return l[kt.getUTCMonth()]}function Be(kt){return o[+(kt.getUTCHours()>=12)]}function dn(kt){return 1+~~(kt.getUTCMonth()/3)}return{format:function(kt){var Te=Q(kt+="",J);return Te.toString=function(){return kt},Te},parse:function(kt){var Te=ot(kt+="",!1);return Te.toString=function(){return kt},Te},utcFormat:function(kt){var Te=Q(kt+="",K);return Te.toString=function(){return kt},Te},utcParse:function(kt){var Te=ot(kt+="",!0);return Te.toString=function(){return kt},Te}}}var Ns={"-":"",_:" ",0:"0"},Tn=/^\s*\d+/,Vf=/^%/,Xf=/[\\^$*+?|[\]().{}]/g;function Fe(t,e,r){var a=t<0?"-":"",o=(a?-t:t)+"",i=o.length;return a+(i<r?new Array(r-i+1).join(e)+o:o)}function Hf(t){return t.replace(Xf,"\\$&")}function Ta(t){return new RegExp("^(?:"+t.map(Hf).join("|")+")","i")}function Sa(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function Wf(t,e,r){var a=Tn.exec(e.slice(r,r+1));return a?(t.w=+a[0],r+a[0].length):-1}function Yf(t,e,r){var a=Tn.exec(e.slice(r,r+1));return a?(t.u=+a[0],r+a[0].length):-1}function Kf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.U=+a[0],r+a[0].length):-1}function Zf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.V=+a[0],r+a[0].length):-1}function Jf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.W=+a[0],r+a[0].length):-1}function Ls(t,e,r){var a=Tn.exec(e.slice(r,r+4));return a?(t.y=+a[0],r+a[0].length):-1}function Fs(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.y=+a[0]+(+a[0]>68?1900:2e3),r+a[0].length):-1}function Qf(t,e,r){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return a?(t.Z=a[1]?0:-(a[2]+(a[3]||"00")),r+a[0].length):-1}function kf(t,e,r){var a=Tn.exec(e.slice(r,r+1));return a?(t.q=a[0]*3-3,r+a[0].length):-1}function qf(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.m=a[0]-1,r+a[0].length):-1}function Bs(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.d=+a[0],r+a[0].length):-1}function _f(t,e,r){var a=Tn.exec(e.slice(r,r+3));return a?(t.m=0,t.d=+a[0],r+a[0].length):-1}function Us(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.H=+a[0],r+a[0].length):-1}function td(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.M=+a[0],r+a[0].length):-1}function ed(t,e,r){var a=Tn.exec(e.slice(r,r+2));return a?(t.S=+a[0],r+a[0].length):-1}function nd(t,e,r){var a=Tn.exec(e.slice(r,r+3));return a?(t.L=+a[0],r+a[0].length):-1}function rd(t,e,r){var a=Tn.exec(e.slice(r,r+6));return a?(t.L=Math.floor(a[0]/1e3),r+a[0].length):-1}function ad(t,e,r){var a=Vf.exec(e.slice(r,r+1));return a?r+a[0].length:-1}function od(t,e,r){var a=Tn.exec(e.slice(r));return a?(t.Q=+a[0],r+a[0].length):-1}function id(t,e,r){var a=Tn.exec(e.slice(r));return a?(t.s=+a[0],r+a[0].length):-1}function zs(t,e){return Fe(t.getDate(),e,2)}function sd(t,e){return Fe(t.getHours(),e,2)}function ld(t,e){return Fe(t.getHours()%12||12,e,2)}function cd(t,e){return Fe(1+ya.count(cr(t),t),e,3)}function js(t,e){return Fe(t.getMilliseconds(),e,3)}function ud(t,e){return js(t,e)+"000"}function fd(t,e){return Fe(t.getMonth()+1,e,2)}function dd(t,e){return Fe(t.getMinutes(),e,2)}function hd(t,e){return Fe(t.getSeconds(),e,2)}function vd(t){var e=t.getDay();return e===0?7:e}function gd(t,e){return Fe(ka.count(cr(t)-1,t),e,2)}function Gs(t){var e=t.getDay();return e>=4||e===0?Yr(t):Yr.ceil(t)}function pd(t,e){return t=Gs(t),Fe(Yr.count(cr(t),t)+(cr(t).getDay()===4),e,2)}function md(t){return t.getDay()}function yd(t,e){return Fe(qa.count(cr(t)-1,t),e,2)}function xd(t,e){return Fe(t.getFullYear()%100,e,2)}function Td(t,e){return t=Gs(t),Fe(t.getFullYear()%100,e,2)}function Sd(t,e){return Fe(t.getFullYear()%1e4,e,4)}function $d(t,e){var r=t.getDay();return t=r>=4||r===0?Yr(t):Yr.ceil(t),Fe(t.getFullYear()%1e4,e,4)}function Ad(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Fe(e/60|0,"0",2)+Fe(e%60,"0",2)}function Vs(t,e){return Fe(t.getUTCDate(),e,2)}function Ed(t,e){return Fe(t.getUTCHours(),e,2)}function bd(t,e){return Fe(t.getUTCHours()%12||12,e,2)}function Id(t,e){return Fe(1+eo.count(ur(t),t),e,3)}function Xs(t,e){return Fe(t.getUTCMilliseconds(),e,3)}function Rd(t,e){return Xs(t,e)+"000"}function Od(t,e){return Fe(t.getUTCMonth()+1,e,2)}function Cd(t,e){return Fe(t.getUTCMinutes(),e,2)}function Pd(t,e){return Fe(t.getUTCSeconds(),e,2)}function Md(t){var e=t.getUTCDay();return e===0?7:e}function wd(t,e){return Fe(_a.count(ur(t)-1,t),e,2)}function Hs(t){var e=t.getUTCDay();return e>=4||e===0?Kr(t):Kr.ceil(t)}function Dd(t,e){return t=Hs(t),Fe(Kr.count(ur(t),t)+(ur(t).getUTCDay()===4),e,2)}function Nd(t){return t.getUTCDay()}function Ld(t,e){return Fe(to.count(ur(t)-1,t),e,2)}function Fd(t,e){return Fe(t.getUTCFullYear()%100,e,2)}function Bd(t,e){return t=Hs(t),Fe(t.getUTCFullYear()%100,e,2)}function Ud(t,e){return Fe(t.getUTCFullYear()%1e4,e,4)}function zd(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Kr(t):Kr.ceil(t),Fe(t.getUTCFullYear()%1e4,e,4)}function jd(){return"+0000"}function Ws(){return"%"}function Ys(t){return+t}function Ks(t){return Math.floor(+t/1e3)}var Zr,si,Zs,li,Js;Gd({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Gd(t){return Zr=Gf(t),si=Zr.format,Zs=Zr.parse,li=Zr.utcFormat,Js=Zr.utcParse,Zr}var Vd=Object.defineProperty,Qs=Object.getOwnPropertySymbols,Xd=Object.prototype.hasOwnProperty,Hd=Object.prototype.propertyIsEnumerable,ks=(t,e,r)=>e in t?Vd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ke=(t,e)=>{for(var r in e||(e={}))Xd.call(e,r)&&ks(t,r,e[r]);if(Qs)for(var r of Qs(e))Hd.call(e,r)&&ks(t,r,e[r]);return t};const Se={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},Ve={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},no={area:"bb-area",areas:"bb-areas"},vn={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},zn={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},fr={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},An={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},ci={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},Cr={dragarea:"bb-dragarea",INCLUDED:"_included_"},$a={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},jn={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Ke={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},dr={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},Qn={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},qe={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},on={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Sr={level:"bb-level",levels:"bb-levels"},qs={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},Aa={region:"bb-region",regions:"bb-regions"},tn={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},sn={shape:"bb-shape",shapes:"bb-shapes"},_s={brush:"bb-brush",subchart:"bb-subchart"},gn={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},ro={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},tl={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},ui={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var je=ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke(ke({},Se),Ve),no),vn),zn),fr),An),ci),Cr),jn),Ke),dr),Qn),qe),$a),on),qs),Aa),tn),sn),_s),gn),ro),tl),ui),Wd={boost_useCssRule:!1,boost_useWorker:!1},Yd={color_pattern:[],color_tiles:void 0,color_threshold:{},color_onover:void 0},Kd={legend_contents_bindto:void 0,legend_contents_template:"<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",legend_equally:!1,legend_hide:!1,legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_interaction:!0,legend_item_dblclick:!1,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_item_tile_width:10,legend_item_tile_height:10,legend_item_tile_r:5,legend_item_tile_type:"rectangle",legend_format:void 0,legend_padding:0,legend_position:"bottom",legend_show:!0,legend_tooltip:!1,legend_usePoint:!1},Zd={bindto:"#chart",background:{},clipPath:!0,svg_classname:void 0,size_width:void 0,size_height:void 0,padding:!0,padding_mode:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,resize_timer:!0,onclick:void 0,onover:void 0,onout:void 0,onresize:void 0,onresized:void 0,onbeforeinit:void 0,oninit:void 0,onafterinit:void 0,onrendered:void 0,transition_duration:250,plugins:[],render:{},regions:[]},Jd={title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"center"},Qd={tooltip_show:!0,tooltip_doNotHide:!1,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:{},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:void 0,tooltip_linked:!1,tooltip_linked_name:"",tooltip_onshow:()=>{},tooltip_onhide:()=>{},tooltip_onshown:()=>{},tooltip_onhidden:()=>{},tooltip_order:null},kd={data_x:void 0,data_idConverter:t=>t,data_names:{},data_classes:{},data_type:void 0,data_types:{},data_order:"desc",data_groups:[],data_groupsZeroAs:"positive",data_color:void 0,data_colors:{},data_labels:{},data_labels_backgroundColors:void 0,data_labels_colors:void 0,data_labels_position:{},data_labels_imgUrl:void 0,data_hide:!1,data_filter:void 0,data_onclick:()=>{},data_onover:()=>{},data_onout:()=>{},data_onshown:void 0,data_onhidden:void 0,data_onmin:void 0,data_onmax:void 0,data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:"csv",data_keys:void 0,data_empty_label_text:""},qd={interaction_enabled:!0,interaction_brighten:!0,interaction_inputType_mouse:!0,interaction_inputType_touch:{},interaction_onout:!0},_d={value:()=>{}};function el(){for(var t=0,e=arguments.length,r={},a;t<e;++t){if(!(a=arguments[t]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new ao(r)}function ao(t){this._=t}function th(t,e){return t.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}ao.prototype=el.prototype={constructor:ao,on:function(t,e){var r=this._,a=th(t+"",r),o,i=-1,s=a.length;if(arguments.length<2){for(;++i<s;)if((o=(t=a[i]).type)&&(o=eh(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(o=(t=a[i]).type)r[o]=nl(r[o],t.name,e);else if(e==null)for(o in r)r[o]=nl(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new ao(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,i;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],a=0,o=i.length;a<o;++a)i[a].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],o=0,i=a.length;o<i;++o)a[o].value.apply(e,r)}};function eh(t,e){for(var r=0,a=t.length,o;r<a;++r)if((o=t[r]).name===e)return o.value}function nl(t,e,r){for(var a=0,o=t.length;a<o;++a)if(t[a].name===e){t[a]=_d,t=t.slice(0,a).concat(t.slice(a+1));break}return r!=null&&t.push({name:e,value:r}),t}var oo=el;const nh={passive:!1},Ea={capture:!0,passive:!1};function fi(t){t.stopImmediatePropagation()}function Jr(t){t.preventDefault(),t.stopImmediatePropagation()}function di(t){var e=t.document.documentElement,r=it(t).on("dragstart.drag",Jr,Ea);"onselectstart"in e?r.on("selectstart.drag",Jr,Ea):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function hi(t,e){var r=t.document.documentElement,a=it(t).on("dragstart.drag",null);e&&(a.on("click.drag",Jr,Ea),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function vi(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function rl(t,e){var r=Object.create(t.prototype);for(var a in e)r[a]=e[a];return r}function ba(){}var Ia=.7,io=1/Ia,Qr="\\s*([+-]?\\d+)\\s*",Ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,ah=new RegExp(`^rgb\\(${Qr},${Qr},${Qr}\\)$`),oh=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),ih=new RegExp(`^rgba\\(${Qr},${Qr},${Qr},${Ra}\\)$`),sh=new RegExp(`^rgba\\(${er},${er},${er},${Ra}\\)$`),lh=new RegExp(`^hsl\\(${Ra},${er},${er}\\)$`),ch=new RegExp(`^hsla\\(${Ra},${er},${er},${Ra}\\)$`),al={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vi(ba,Pr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ol,formatHex:ol,formatHex8:uh,formatHsl:fh,formatRgb:il,toString:il});function ol(){return this.rgb().formatHex()}function uh(){return this.rgb().formatHex8()}function fh(){return fl(this).formatHsl()}function il(){return this.rgb().formatRgb()}function Pr(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=rh.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?sl(e):r===3?new Ln(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?so(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?so(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ah.exec(t))?new Ln(e[1],e[2],e[3],1):(e=oh.exec(t))?new Ln(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ih.exec(t))?so(e[1],e[2],e[3],e[4]):(e=sh.exec(t))?so(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=lh.exec(t))?ul(e[1],e[2]/100,e[3]/100,1):(e=ch.exec(t))?ul(e[1],e[2]/100,e[3]/100,e[4]):al.hasOwnProperty(t)?sl(al[t]):t==="transparent"?new Ln(NaN,NaN,NaN,0):null}function sl(t){return new Ln(t>>16&255,t>>8&255,t&255,1)}function so(t,e,r,a){return a<=0&&(t=e=r=NaN),new Ln(t,e,r,a)}function dh(t){return t instanceof ba||(t=Pr(t)),t?(t=t.rgb(),new Ln(t.r,t.g,t.b,t.opacity)):new Ln}function lo(t,e,r,a){return arguments.length===1?dh(t):new Ln(t,e,r,a==null?1:a)}function Ln(t,e,r,a){this.r=+t,this.g=+e,this.b=+r,this.opacity=+a}vi(Ln,lo,rl(ba,{brighter(t){return t=t==null?io:Math.pow(io,t),new Ln(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ia:Math.pow(Ia,t),new Ln(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ln(Mr(this.r),Mr(this.g),Mr(this.b),co(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ll,formatHex:ll,formatHex8:hh,formatRgb:cl,toString:cl}));function ll(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}`}function hh(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}${wr((isNaN(this.opacity)?1:this.opacity)*255)}`}function cl(){const t=co(this.opacity);return`${t===1?"rgb(":"rgba("}${Mr(this.r)}, ${Mr(this.g)}, ${Mr(this.b)}${t===1?")":`, ${t})`}`}function co(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Mr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function wr(t){return t=Mr(t),(t<16?"0":"")+t.toString(16)}function ul(t,e,r,a){return a<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new kn(t,e,r,a)}function fl(t){if(t instanceof kn)return new kn(t.h,t.s,t.l,t.opacity);if(t instanceof ba||(t=Pr(t)),!t)return new kn;if(t instanceof kn)return t;t=t.rgb();var e=t.r/255,r=t.g/255,a=t.b/255,o=Math.min(e,r,a),i=Math.max(e,r,a),s=NaN,l=i-o,c=(i+o)/2;return l?(e===i?s=(r-a)/l+(r<a)*6:r===i?s=(a-e)/l+2:s=(e-r)/l+4,l/=c<.5?i+o:2-i-o,s*=60):l=c>0&&c<1?0:s,new kn(s,l,c,t.opacity)}function vh(t,e,r,a){return arguments.length===1?fl(t):new kn(t,e,r,a==null?1:a)}function kn(t,e,r,a){this.h=+t,this.s=+e,this.l=+r,this.opacity=+a}vi(kn,vh,rl(ba,{brighter(t){return t=t==null?io:Math.pow(io,t),new kn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ia:Math.pow(Ia,t),new kn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*e,o=2*r-a;return new Ln(gi(t>=240?t-240:t+120,o,a),gi(t,o,a),gi(t<120?t+240:t-120,o,a),this.opacity)},clamp(){return new kn(dl(this.h),uo(this.s),uo(this.l),co(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=co(this.opacity);return`${t===1?"hsl(":"hsla("}${dl(this.h)}, ${uo(this.s)*100}%, ${uo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dl(t){return t=(t||0)%360,t<0?t+360:t}function uo(t){return Math.max(0,Math.min(1,t||0))}function gi(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function hl(t,e,r,a,o){var i=t*t,s=i*t;return((1-3*t+3*i-s)*e+(4-6*i+3*s)*r+(1+3*t+3*i-3*s)*a+s*o)/6}function gh(t){var e=t.length-1;return function(r){var a=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[a],i=t[a+1],s=a>0?t[a-1]:2*o-i,l=a<e-1?t[a+2]:2*i-o;return hl((r-a/e)*e,s,o,i,l)}}function ph(t){var e=t.length;return function(r){var a=Math.floor(((r%=1)<0?++r:r)*e),o=t[(a+e-1)%e],i=t[a%e],s=t[(a+1)%e],l=t[(a+2)%e];return hl((r-a/e)*e,o,i,s,l)}}var fo=(t=>()=>t);function vl(t,e){return function(r){return t+r*e}}function mh(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(a){return Math.pow(t+a*e,r)}}function d1(t,e){var r=e-t;return r?vl(t,r>180||r<-180?r-360*Math.round(r/360):r):fo(isNaN(t)?e:t)}function yh(t){return(t=+t)==1?gl:function(e,r){return r-e?mh(e,r,t):fo(isNaN(e)?r:e)}}function gl(t,e){var r=e-t;return r?vl(t,r):fo(isNaN(t)?e:t)}var ho=(function t(e){var r=yh(e);function a(o,i){var s=r((o=lo(o)).r,(i=lo(i)).r),l=r(o.g,i.g),c=r(o.b,i.b),f=gl(o.opacity,i.opacity);return function(g){return o.r=s(g),o.g=l(g),o.b=c(g),o.opacity=f(g),o+""}}return a.gamma=t,a})(1);function pl(t){return function(e){var r=e.length,a=new Array(r),o=new Array(r),i=new Array(r),s,l;for(s=0;s<r;++s)l=lo(e[s]),a[s]=l.r||0,o[s]=l.g||0,i[s]=l.b||0;return a=t(a),o=t(o),i=t(i),l.opacity=1,function(c){return l.r=a(c),l.g=o(c),l.b=i(c),l+""}}}var h1=pl(gh),v1=pl(ph);function ml(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,a=e.slice(),o;return function(i){for(o=0;o<r;++o)a[o]=t[o]*(1-i)+e[o]*i;return a}}function yl(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function g1(t,e){return(yl(e)?ml:xl)(t,e)}function xl(t,e){var r=e?e.length:0,a=t?Math.min(r,t.length):0,o=new Array(a),i=new Array(r),s;for(s=0;s<a;++s)o[s]=kr(t[s],e[s]);for(;s<r;++s)i[s]=e[s];return function(l){for(s=0;s<a;++s)i[s]=o[s](l);return i}}function xh(t,e){var r=new Date;return t=+t,e=+e,function(a){return r.setTime(t*(1-a)+e*a),r}}function qn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Th(t,e){var r={},a={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?r[o]=kr(t[o],e[o]):a[o]=e[o];return function(i){for(o in r)a[o]=r[o](i);return a}}var pi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mi=new RegExp(pi.source,"g");function Sh(t){return function(){return t}}function $h(t){return function(e){return t(e)+""}}function Tl(t,e){var r=pi.lastIndex=mi.lastIndex=0,a,o,i,s=-1,l=[],c=[];for(t=t+"",e=e+"";(a=pi.exec(t))&&(o=mi.exec(e));)(i=o.index)>r&&(i=e.slice(r,i),l[s]?l[s]+=i:l[++s]=i),(a=a[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,c.push({i:s,x:qn(a,o)})),r=mi.lastIndex;return r<e.length&&(i=e.slice(r),l[s]?l[s]+=i:l[++s]=i),l.length<2?c[0]?$h(c[0].x):Sh(e):(e=c.length,function(f){for(var g=0,p;g<e;++g)l[(p=c[g]).i]=p.x(f);return l.join("")})}function kr(t,e){var r=typeof e,a;return e==null||r==="boolean"?fo(e):(r==="number"?qn:r==="string"?(a=Pr(e))?(e=a,ho):Tl:e instanceof Pr?ho:e instanceof Date?xh:yl(e)?ml:Array.isArray(e)?xl:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Th:qn)(t,e)}function Ah(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Wn(t,e){if(t=Ah(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var qr=0,Oa=0,Ca=0,Sl=1e3,vo,Pa,go=0,Dr=0,po=0,Ma=typeof performance=="object"&&performance.now?performance:Date,$l=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function yi(){return Dr||($l(Eh),Dr=Ma.now()+po)}function Eh(){Dr=0}function mo(){this._call=this._time=this._next=null}mo.prototype=Al.prototype={constructor:mo,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?yi():+r)+(e==null?0:+e),!this._next&&Pa!==this&&(Pa?Pa._next=this:vo=this,Pa=this),this._call=t,this._time=r,xi()},stop:function(){this._call&&(this._call=null,this._time=1/0,xi())}};function Al(t,e,r){var a=new mo;return a.restart(t,e,r),a}function bh(){yi(),++qr;for(var t=vo,e;t;)(e=Dr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--qr}function El(){Dr=(go=Ma.now())+po,qr=Oa=0;try{bh()}finally{qr=0,Rh(),Dr=0}}function Ih(){var t=Ma.now(),e=t-go;e>Sl&&(po-=e,go=t)}function Rh(){for(var t,e=vo,r,a=1/0;e;)e._call?(a>e._time&&(a=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:vo=r);Pa=t,xi(a)}function xi(t){if(!qr){Oa&&(Oa=clearTimeout(Oa));var e=t-Dr;e>24?(t<1/0&&(Oa=setTimeout(El,t-Ma.now()-po)),Ca&&(Ca=clearInterval(Ca))):(Ca||(go=Ma.now(),Ca=setInterval(Ih,Sl)),qr=1,$l(El))}}function bl(t,e,r){var a=new mo;return e=e==null?0:+e,a.restart(o=>{a.stop(),t(o+e)},e,r),a}var Oh=oo("start","end","cancel","interrupt"),Ch=[],Il=0,Rl=1,Ti=2,yo=3,Ol=4,Si=5,xo=6;function To(t,e,r,a,o,i){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Ph(t,r,{name:e,index:a,group:o,on:Oh,tween:Ch,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Il})}function $i(t,e){var r=_n(t,e);if(r.state>Il)throw new Error("too late; already scheduled");return r}function nr(t,e){var r=_n(t,e);if(r.state>yo)throw new Error("too late; already running");return r}function _n(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Ph(t,e,r){var a=t.__transition,o;a[e]=r,r.timer=Al(i,0,r.time);function i(f){r.state=Rl,r.timer.restart(s,r.delay,r.time),r.delay<=f&&s(f-r.delay)}function s(f){var g,p,m,E;if(r.state!==Rl)return c();for(g in a)if(E=a[g],E.name===r.name){if(E.state===yo)return bl(s);E.state===Ol?(E.state=xo,E.timer.stop(),E.on.call("interrupt",t,t.__data__,E.index,E.group),delete a[g]):+g<e&&(E.state=xo,E.timer.stop(),E.on.call("cancel",t,t.__data__,E.index,E.group),delete a[g])}if(bl(function(){r.state===yo&&(r.state=Ol,r.timer.restart(l,r.delay,r.time),l(f))}),r.state=Ti,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Ti){for(r.state=yo,o=new Array(m=r.tween.length),g=0,p=-1;g<m;++g)(E=r.tween[g].value.call(t,t.__data__,r.index,r.group))&&(o[++p]=E);o.length=p+1}}function l(f){for(var g=f<r.duration?r.ease.call(null,f/r.duration):(r.timer.restart(c),r.state=Si,1),p=-1,m=o.length;++p<m;)o[p].call(t,g);r.state===Si&&(r.on.call("end",t,t.__data__,r.index,r.group),c())}function c(){r.state=xo,r.timer.stop(),delete a[e];for(var f in a)return;delete t.__transition}}function _r(t,e){var r=t.__transition,a,o,i=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((a=r[s]).name!==e){i=!1;continue}o=a.state>Ti&&a.state<Si,a.state=xo,a.timer.stop(),a.on.call(o?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete r[s]}i&&delete t.__transition}}function Mh(t){return this.each(function(){_r(this,t)})}var Cl=180/Math.PI,Ai={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pl(t,e,r,a,o,i){var s,l,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*r+e*a)&&(r-=t*c,a-=e*c),(l=Math.sqrt(r*r+a*a))&&(r/=l,a/=l,c/=l),t*a<e*r&&(t=-t,e=-e,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Cl,skewX:Math.atan(c)*Cl,scaleX:s,scaleY:l}}var So;function wh(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ai:Pl(e.a,e.b,e.c,e.d,e.e,e.f)}function Dh(t){return t==null||(So||(So=document.createElementNS("http://www.w3.org/2000/svg","g")),So.setAttribute("transform",t),!(t=So.transform.baseVal.consolidate()))?Ai:(t=t.matrix,Pl(t.a,t.b,t.c,t.d,t.e,t.f))}function Ml(t,e,r,a){function o(f){return f.length?f.pop()+" ":""}function i(f,g,p,m,E,w){if(f!==p||g!==m){var U=E.push("translate(",null,e,null,r);w.push({i:U-4,x:qn(f,p)},{i:U-2,x:qn(g,m)})}else(p||m)&&E.push("translate("+p+e+m+r)}function s(f,g,p,m){f!==g?(f-g>180?g+=360:g-f>180&&(f+=360),m.push({i:p.push(o(p)+"rotate(",null,a)-2,x:qn(f,g)})):g&&p.push(o(p)+"rotate("+g+a)}function l(f,g,p,m){f!==g?m.push({i:p.push(o(p)+"skewX(",null,a)-2,x:qn(f,g)}):g&&p.push(o(p)+"skewX("+g+a)}function c(f,g,p,m,E,w){if(f!==p||g!==m){var U=E.push(o(E)+"scale(",null,",",null,")");w.push({i:U-4,x:qn(f,p)},{i:U-2,x:qn(g,m)})}else(p!==1||m!==1)&&E.push(o(E)+"scale("+p+","+m+")")}return function(f,g){var p=[],m=[];return f=t(f),g=t(g),i(f.translateX,f.translateY,g.translateX,g.translateY,p,m),s(f.rotate,g.rotate,p,m),l(f.skewX,g.skewX,p,m),c(f.scaleX,f.scaleY,g.scaleX,g.scaleY,p,m),f=g=null,function(E){for(var w=-1,U=m.length,N;++w<U;)p[(N=m[w]).i]=N.x(E);return p.join("")}}}var Nh=Ml(wh,"px, ","px)","deg)"),Lh=Ml(Dh,", ",")",")");function Fh(t,e){var r,a;return function(){var o=nr(this,t),i=o.tween;if(i!==r){a=r=i;for(var s=0,l=a.length;s<l;++s)if(a[s].name===e){a=a.slice(),a.splice(s,1);break}}o.tween=a}}function Bh(t,e,r){var a,o;if(typeof r!="function")throw new Error;return function(){var i=nr(this,t),s=i.tween;if(s!==a){o=(a=s).slice();for(var l={name:e,value:r},c=0,f=o.length;c<f;++c)if(o[c].name===e){o[c]=l;break}c===f&&o.push(l)}i.tween=o}}function Uh(t,e){var r=this._id;if(t+="",arguments.length<2){for(var a=_n(this.node(),r).tween,o=0,i=a.length,s;o<i;++o)if((s=a[o]).name===t)return s.value;return null}return this.each((e==null?Fh:Bh)(r,t,e))}function Ei(t,e,r){var a=t._id;return t.each(function(){var o=nr(this,a);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return _n(o,a).value[e]}}function wl(t,e){var r;return(typeof e=="number"?qn:e instanceof Pr?ho:(r=Pr(e))?(e=r,ho):Tl)(t,e)}function zh(t){return function(){this.removeAttribute(t)}}function jh(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gh(t,e,r){var a,o=r+"",i;return function(){var s=this.getAttribute(t);return s===o?null:s===a?i:i=e(a=s,r)}}function Vh(t,e,r){var a,o=r+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===a?i:i=e(a=s,r)}}function Xh(t,e,r){var a,o,i;return function(){var s,l=r(this),c;return l==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=l+"",s===c?null:s===a&&c===o?i:(o=c,i=e(a=s,l)))}}function Hh(t,e,r){var a,o,i;return function(){var s,l=r(this),c;return l==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=l+"",s===c?null:s===a&&c===o?i:(o=c,i=e(a=s,l)))}}function Wh(t,e){var r=Nt(t),a=r==="transform"?Lh:wl;return this.attrTween(t,typeof e=="function"?(r.local?Hh:Xh)(r,a,Ei(this,"attr."+t,e)):e==null?(r.local?jh:zh)(r):(r.local?Vh:Gh)(r,a,e))}function Yh(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Kh(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Zh(t,e){var r,a;function o(){var i=e.apply(this,arguments);return i!==a&&(r=(a=i)&&Kh(t,i)),r}return o._value=e,o}function Jh(t,e){var r,a;function o(){var i=e.apply(this,arguments);return i!==a&&(r=(a=i)&&Yh(t,i)),r}return o._value=e,o}function Qh(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var a=Nt(t);return this.tween(r,(a.local?Zh:Jh)(a,e))}function kh(t,e){return function(){$i(this,t).delay=+e.apply(this,arguments)}}function qh(t,e){return e=+e,function(){$i(this,t).delay=e}}function _h(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?kh:qh)(e,t)):_n(this.node(),e).delay}function tv(t,e){return function(){nr(this,t).duration=+e.apply(this,arguments)}}function ev(t,e){return e=+e,function(){nr(this,t).duration=e}}function nv(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?tv:ev)(e,t)):_n(this.node(),e).duration}function rv(t,e){if(typeof e!="function")throw new Error;return function(){nr(this,t).ease=e}}function av(t){var e=this._id;return arguments.length?this.each(rv(e,t)):_n(this.node(),e).ease}function ov(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;nr(this,t).ease=r}}function iv(t){if(typeof t!="function")throw new Error;return this.each(ov(this._id,t))}function sv(t){typeof t!="function"&&(t=R(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var i=e[o],s=i.length,l=a[o]=[],c,f=0;f<s;++f)(c=i[f])&&t.call(c,c.__data__,f,i)&&l.push(c);return new hr(a,this._parents,this._name,this._id)}function lv(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,a=e.length,o=r.length,i=Math.min(a,o),s=new Array(a),l=0;l<i;++l)for(var c=e[l],f=r[l],g=c.length,p=s[l]=new Array(g),m,E=0;E<g;++E)(m=c[E]||f[E])&&(p[E]=m);for(;l<a;++l)s[l]=e[l];return new hr(s,this._parents,this._name,this._id)}function cv(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function uv(t,e,r){var a,o,i=cv(e)?$i:nr;return function(){var s=i(this,t),l=s.on;l!==a&&(o=(a=l).copy()).on(e,r),s.on=o}}function fv(t,e){var r=this._id;return arguments.length<2?_n(this.node(),r).on.on(t):this.each(uv(r,t,e))}function dv(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function hv(){return this.on("end.remove",dv(this._id))}function vv(t){var e=this._name,r=this._id;typeof t!="function"&&(t=v(t));for(var a=this._groups,o=a.length,i=new Array(o),s=0;s<o;++s)for(var l=a[s],c=l.length,f=i[s]=new Array(c),g,p,m=0;m<c;++m)(g=l[m])&&(p=t.call(g,g.__data__,m,l))&&("__data__"in g&&(p.__data__=g.__data__),f[m]=p,To(f[m],e,r,m,f,_n(g,r)));return new hr(i,this._parents,e,r)}function gv(t){var e=this._name,r=this._id;typeof t!="function"&&(t=$(t));for(var a=this._groups,o=a.length,i=[],s=[],l=0;l<o;++l)for(var c=a[l],f=c.length,g,p=0;p<f;++p)if(g=c[p]){for(var m=t.call(g,g.__data__,p,c),E,w=_n(g,r),U=0,N=m.length;U<N;++U)(E=m[U])&&To(E,e,r,U,m,w);i.push(m),s.push(g)}return new hr(i,s,e,r)}var pv=xn.prototype.constructor;function mv(){return new pv(this._groups,this._parents)}function yv(t,e){var r,a,o;return function(){var i=bt(this,t),s=(this.style.removeProperty(t),bt(this,t));return i===s?null:i===r&&s===a?o:o=e(r=i,a=s)}}function Dl(t){return function(){this.style.removeProperty(t)}}function xv(t,e,r){var a,o=r+"",i;return function(){var s=bt(this,t);return s===o?null:s===a?i:i=e(a=s,r)}}function Tv(t,e,r){var a,o,i;return function(){var s=bt(this,t),l=r(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(t),bt(this,t))),s===c?null:s===a&&c===o?i:(o=c,i=e(a=s,l))}}function Sv(t,e){var r,a,o,i="style."+e,s="end."+i,l;return function(){var c=nr(this,t),f=c.on,g=c.value[i]==null?l||(l=Dl(e)):void 0;(f!==r||o!==g)&&(a=(r=f).copy()).on(s,o=g),c.on=a}}function $v(t,e,r){var a=(t+="")=="transform"?Nh:wl;return e==null?this.styleTween(t,yv(t,a)).on("end.style."+t,Dl(t)):typeof e=="function"?this.styleTween(t,Tv(t,a,Ei(this,"style."+t,e))).each(Sv(this._id,t)):this.styleTween(t,xv(t,a,e),r).on("end.style."+t,null)}function Av(t,e,r){return function(a){this.style.setProperty(t,e.call(this,a),r)}}function Ev(t,e,r){var a,o;function i(){var s=e.apply(this,arguments);return s!==o&&(a=(o=s)&&Av(t,s,r)),a}return i._value=e,i}function bv(t,e,r){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(e==null)return this.tween(a,null);if(typeof e!="function")throw new Error;return this.tween(a,Ev(t,e,r==null?"":r))}function Iv(t){return function(){this.textContent=t}}function Rv(t){return function(){var e=t(this);this.textContent=e==null?"":e}}function Ov(t){return this.tween("text",typeof t=="function"?Rv(Ei(this,"text",t)):Iv(t==null?"":t+""))}function Cv(t){return function(e){this.textContent=t.call(this,e)}}function Pv(t){var e,r;function a(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&Cv(o)),e}return a._value=t,a}function Mv(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Pv(t))}function wv(){for(var t=this._name,e=this._id,r=Ll(),a=this._groups,o=a.length,i=0;i<o;++i)for(var s=a[i],l=s.length,c,f=0;f<l;++f)if(c=s[f]){var g=_n(c,e);To(c,t,r,f,s,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new hr(a,this._parents,t,r)}function Dv(){var t,e,r=this,a=r._id,o=r.size();return new Promise(function(i,s){var l={value:s},c={value:function(){--o===0&&i()}};r.each(function(){var f=nr(this,a),g=f.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),f.on=e}),o===0&&i()})}var Nv=0;function hr(t,e,r,a){this._groups=t,this._parents=e,this._name=r,this._id=a}function Nl(t){return xn().transition(t)}function Ll(){return++Nv}var vr=xn.prototype;hr.prototype=Nl.prototype={constructor:hr,select:vv,selectAll:gv,selectChild:vr.selectChild,selectChildren:vr.selectChildren,filter:sv,merge:lv,selection:mv,transition:wv,call:vr.call,nodes:vr.nodes,node:vr.node,size:vr.size,empty:vr.empty,each:vr.each,on:fv,attr:Wh,attrTween:Qh,style:$v,styleTween:bv,text:Ov,textTween:Mv,remove:hv,tween:Uh,delay:_h,duration:nv,ease:av,easeVarying:iv,end:Dv,[Symbol.iterator]:vr[Symbol.iterator]};function p1(t){return t*t*t}function m1(t){return--t*t*t+1}function Lv(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Fv={time:null,delay:0,duration:250,ease:Lv};function Bv(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function Uv(t){var e,r;t instanceof hr?(e=t._id,t=t._name):(e=Ll(),(r=Fv).time=yi(),t=t==null?null:t+"");for(var a=this._groups,o=a.length,i=0;i<o;++i)for(var s=a[i],l=s.length,c,f=0;f<l;++f)(c=s[f])&&To(c,t,e,f,s,r||Bv(c,e));return new hr(a,this._parents,t,e)}xn.prototype.interrupt=Mh,xn.prototype.transition=Uv;var bi=(t=>()=>t);function zv(t,{sourceEvent:e,target:r,selection:a,mode:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:a,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function jv(t){t.stopImmediatePropagation()}function Ii(t){t.preventDefault(),t.stopImmediatePropagation()}var Fl={name:"drag"},Ri={name:"space"},ta={name:"handle"},ea={name:"center"};const{abs:Bl,max:En,min:bn}=Math;function Ul(t){return[+t[0],+t[1]]}function Oi(t){return[Ul(t[0]),Ul(t[1])]}var $o={name:"x",handles:["w","e"].map(wa),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Ao={name:"y",handles:["n","s"].map(wa),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Gv={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(wa),input:function(t){return t==null?null:Oi(t)},output:function(t){return t}},gr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zl={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},jl={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Vv={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Xv={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wa(t){return{type:t}}function Hv(t){return!t.ctrlKey&&!t.button}function Wv(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Yv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ci(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Kv(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Gl(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Zv(){return Pi($o)}function Jv(){return Pi(Ao)}function y1(){return Pi(Gv)}function Pi(t){var e=Wv,r=Hv,a=Yv,o=!0,i=oo("start","brush","end"),s=6,l;function c(N){var D=N.property("__brush",U).selectAll(".overlay").data([wa("overlay")]);D.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gr.overlay).merge(D).each(function(){var J=Ci(this).extent;it(this).attr("x",J[0][0]).attr("y",J[0][1]).attr("width",J[1][0]-J[0][0]).attr("height",J[1][1]-J[0][1])}),N.selectAll(".selection").data([wa("selection")]).enter().append("rect").attr("class","selection").attr("cursor",gr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var Y=N.selectAll(".handle").data(t.handles,function(J){return J.type});Y.exit().remove(),Y.enter().append("rect").attr("class",function(J){return"handle handle--"+J.type}).attr("cursor",function(J){return gr[J.type]}),N.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",m).filter(a).on("touchstart.brush",m).on("touchmove.brush",E).on("touchend.brush touchcancel.brush",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(N,D,Y){N.tween?N.on("start.brush",function(J){g(this,arguments).beforestart().start(J)}).on("interrupt.brush end.brush",function(J){g(this,arguments).end(J)}).tween("brush",function(){var J=this,K=J.__brush,nt=g(J,arguments),Q=K.selection,ot=t.input(typeof D=="function"?D.apply(this,arguments):D,K.extent),pt=kr(Q,ot);function Tt(yt){K.selection=yt===1&&ot===null?null:pt(yt),f.call(J),nt.brush()}return Q!==null&&ot!==null?Tt:Tt(1)}):N.each(function(){var J=this,K=arguments,nt=J.__brush,Q=t.input(typeof D=="function"?D.apply(J,K):D,nt.extent),ot=g(J,K).beforestart();_r(J),nt.selection=Q===null?null:Q,f.call(J),ot.start(Y).brush(Y).end(Y)})},c.clear=function(N,D){c.move(N,null,D)};function f(){var N=it(this),D=Ci(this).selection;D?(N.selectAll(".selection").style("display",null).attr("x",D[0][0]).attr("y",D[0][1]).attr("width",D[1][0]-D[0][0]).attr("height",D[1][1]-D[0][1]),N.selectAll(".handle").style("display",null).attr("x",function(Y){return Y.type[Y.type.length-1]==="e"?D[1][0]-s/2:D[0][0]-s/2}).attr("y",function(Y){return Y.type[0]==="s"?D[1][1]-s/2:D[0][1]-s/2}).attr("width",function(Y){return Y.type==="n"||Y.type==="s"?D[1][0]-D[0][0]+s:s}).attr("height",function(Y){return Y.type==="e"||Y.type==="w"?D[1][1]-D[0][1]+s:s})):N.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function g(N,D,Y){var J=N.__brush.emitter;return J&&(!Y||!J.clean)?J:new p(N,D,Y)}function p(N,D,Y){this.that=N,this.args=D,this.state=N.__brush,this.active=0,this.clean=Y}p.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(N,D){return this.starting?(this.starting=!1,this.emit("start",N,D)):this.emit("brush",N),this},brush:function(N,D){return this.emit("brush",N,D),this},end:function(N,D){return--this.active===0&&(delete this.state.emitter,this.emit("end",N,D)),this},emit:function(N,D,Y){var J=it(this.that).datum();i.call(N,this.that,new zv(N,{sourceEvent:D,target:c,selection:t.output(this.state.selection),mode:Y,dispatch:i}),J)}};function m(N){if(l&&!N.touches||!r.apply(this,arguments))return;var D=this,Y=N.target.__data__.type,J=(o&&N.metaKey?Y="overlay":Y)==="selection"?Fl:o&&N.altKey?ea:ta,K=t===Ao?null:Vv[Y],nt=t===$o?null:Xv[Y],Q=Ci(D),ot=Q.extent,pt=Q.selection,Tt=ot[0][0],yt,lt,jt=ot[0][1],vt,tt,St=ot[1][0],ct,At,Wt=ot[1][1],Dt,Zt,re=0,ce=0,Ie,Ce=K&&nt&&o&&N.shiftKey,Pe,Ye,Be=Array.from(N.touches||[N],ve=>{const fn=ve.identifier;return ve=Wn(ve,D),ve.point0=ve.slice(),ve.identifier=fn,ve});_r(D);var dn=g(D,arguments,!0).beforestart();if(Y==="overlay"){pt&&(Ie=!0);const ve=[Be[0],Be[1]||Be[0]];Q.selection=pt=[[yt=t===Ao?Tt:bn(ve[0][0],ve[1][0]),vt=t===$o?jt:bn(ve[0][1],ve[1][1])],[ct=t===Ao?St:En(ve[0][0],ve[1][0]),Dt=t===$o?Wt:En(ve[0][1],ve[1][1])]],Be.length>1&&un(N)}else yt=pt[0][0],vt=pt[0][1],ct=pt[1][0],Dt=pt[1][1];lt=yt,tt=vt,At=ct,Zt=Dt;var kt=it(D).attr("pointer-events","none"),Te=kt.selectAll(".overlay").attr("cursor",gr[Y]);if(N.touches)dn.moved=Bt,dn.ended=Xe;else{var Re=it(N.view).on("mousemove.brush",Bt,!0).on("mouseup.brush",Xe,!0);o&&Re.on("keydown.brush",wn,!0).on("keyup.brush",Dn,!0),di(N.view)}f.call(D),dn.start(N,J.name);function Bt(ve){for(const fn of ve.changedTouches||[ve])for(const Ha of Be)Ha.identifier===fn.identifier&&(Ha.cur=Wn(fn,D));if(Ce&&!Pe&&!Ye&&Be.length===1){const fn=Be[0];Bl(fn.cur[0]-fn[0])>Bl(fn.cur[1]-fn[1])?Ye=!0:Pe=!0}for(const fn of Be)fn.cur&&(fn[0]=fn.cur[0],fn[1]=fn.cur[1]);Ie=!0,Ii(ve),un(ve)}function un(ve){const fn=Be[0],Ha=fn.point0;var Ir;switch(re=fn[0]-Ha[0],ce=fn[1]-Ha[1],J){case Ri:case Fl:{K&&(re=En(Tt-yt,bn(St-ct,re)),lt=yt+re,At=ct+re),nt&&(ce=En(jt-vt,bn(Wt-Dt,ce)),tt=vt+ce,Zt=Dt+ce);break}case ta:{Be[1]?(K&&(lt=En(Tt,bn(St,Be[0][0])),At=En(Tt,bn(St,Be[1][0])),K=1),nt&&(tt=En(jt,bn(Wt,Be[0][1])),Zt=En(jt,bn(Wt,Be[1][1])),nt=1)):(K<0?(re=En(Tt-yt,bn(St-yt,re)),lt=yt+re,At=ct):K>0&&(re=En(Tt-ct,bn(St-ct,re)),lt=yt,At=ct+re),nt<0?(ce=En(jt-vt,bn(Wt-vt,ce)),tt=vt+ce,Zt=Dt):nt>0&&(ce=En(jt-Dt,bn(Wt-Dt,ce)),tt=vt,Zt=Dt+ce));break}case ea:{K&&(lt=En(Tt,bn(St,yt-re*K)),At=En(Tt,bn(St,ct+re*K))),nt&&(tt=En(jt,bn(Wt,vt-ce*nt)),Zt=En(jt,bn(Wt,Dt+ce*nt)));break}}At<lt&&(K*=-1,Ir=yt,yt=ct,ct=Ir,Ir=lt,lt=At,At=Ir,Y in zl&&Te.attr("cursor",gr[Y=zl[Y]])),Zt<tt&&(nt*=-1,Ir=vt,vt=Dt,Dt=Ir,Ir=tt,tt=Zt,Zt=Ir,Y in jl&&Te.attr("cursor",gr[Y=jl[Y]])),Q.selection&&(pt=Q.selection),Pe&&(lt=pt[0][0],At=pt[1][0]),Ye&&(tt=pt[0][1],Zt=pt[1][1]),(pt[0][0]!==lt||pt[0][1]!==tt||pt[1][0]!==At||pt[1][1]!==Zt)&&(Q.selection=[[lt,tt],[At,Zt]],f.call(D),dn.brush(ve,J.name))}function Xe(ve){if(jv(ve),ve.touches){if(ve.touches.length)return;l&&clearTimeout(l),l=setTimeout(function(){l=null},500)}else hi(ve.view,Ie),Re.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);kt.attr("pointer-events","all"),Te.attr("cursor",gr.overlay),Q.selection&&(pt=Q.selection),Kv(pt)&&(Q.selection=null,f.call(D)),dn.end(ve,J.name)}function wn(ve){switch(ve.keyCode){case 16:{Ce=K&&nt;break}case 18:{J===ta&&(K&&(ct=At-re*K,yt=lt+re*K),nt&&(Dt=Zt-ce*nt,vt=tt+ce*nt),J=ea,un(ve));break}case 32:{(J===ta||J===ea)&&(K<0?ct=At-re:K>0&&(yt=lt-re),nt<0?Dt=Zt-ce:nt>0&&(vt=tt-ce),J=Ri,Te.attr("cursor",gr.selection),un(ve));break}default:return}Ii(ve)}function Dn(ve){switch(ve.keyCode){case 16:{Ce&&(Pe=Ye=Ce=!1,un(ve));break}case 18:{J===ea&&(K<0?ct=At:K>0&&(yt=lt),nt<0?Dt=Zt:nt>0&&(vt=tt),J=ta,un(ve));break}case 32:{J===Ri&&(ve.altKey?(K&&(ct=At-re*K,yt=lt+re*K),nt&&(Dt=Zt-ce*nt,vt=tt+ce*nt),J=ea):(K<0?ct=At:K>0&&(yt=lt),nt<0?Dt=Zt:nt>0&&(vt=tt),J=ta),Te.attr("cursor",gr[Y]),un(ve));break}default:return}Ii(ve)}}function E(N){g(this,arguments).moved(N)}function w(N){g(this,arguments).ended(N)}function U(){var N=this.__brush||{selection:null};return N.extent=Oi(e.apply(this,arguments)),N.dim=t,N}return c.extent=function(N){return arguments.length?(e=typeof N=="function"?N:bi(Oi(N)),c):e},c.filter=function(N){return arguments.length?(r=typeof N=="function"?N:bi(!!N),c):r},c.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:bi(!!N),c):a},c.handleSize=function(N){return arguments.length?(s=+N,c):s},c.keyModifiers=function(N){return arguments.length?(o=!!N,c):o},c.on=function(){var N=i.on.apply(i,arguments);return N===i?c:N},c}function Qv(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function kv(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",r=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",a=i=>setTimeout(i,1),o=i=>clearTimeout(i);return[e?t.requestAnimationFrame:a,e?t.cancelAnimationFrame:o,r?t.requestIdleCallback:a,r?t.cancelIdleCallback:o]}const Ze=Qv(),pn=Ze==null?void 0:Ze.document,[qv,x1,Vl,T1]=kv(Ze);var _v=Object.defineProperty,Xl=Object.getOwnPropertySymbols,tg=Object.prototype.hasOwnProperty,eg=Object.prototype.propertyIsEnumerable,Hl=(t,e,r)=>e in t?_v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wl=(t,e)=>{for(var r in e||(e={}))tg.call(e,r)&&Hl(t,r,e[r]);if(Xl)for(var r of Xl(e))eg.call(e,r)&&Hl(t,r,e[r]);return t};const De=t=>t||t===0,he=t=>typeof t=="function",Ue=t=>typeof t=="string",pe=t=>typeof t=="number",ln=t=>typeof t=="undefined",Qe=t=>typeof t!="undefined",Mi=t=>typeof t=="boolean",ng=t=>Math.ceil(t/10)*10,Eo=t=>Math.ceil(t)+.5,Nr=t=>t[1]-t[0],rr=t=>typeof t=="object",rg=t=>{for(const e in t)return!1;return!0},Yn=t=>ln(t)||t===null||Ue(t)&&t.length===0||rr(t)&&!(t instanceof Date)&&rg(t)||pe(t)&&isNaN(t),cn=t=>!Yn(t),Ge=t=>Array.isArray(t),ze=t=>t&&!(t!=null&&t.nodeType)&&rr(t)&&!Ge(t);function $r(t,e,r){return Qe(t[e])?t[e]:r}function ag(t,e){let r=!1;return Object.keys(t).forEach(a=>t[a]===e&&(r=!0)),r}function _e(t,e,...r){const a=he(t);return a&&t.call(e,...r),a}function bo(t,e){let r=0;const a=function(...o){!--r&&e.apply(this,...o)};"duration"in t?t.each(()=>++r).on("end",a):(++r,t.call(a))}function wi(t){return Ue(t)?t.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):t}function Da(t,e,r=[-1,1],a=!1){if(!(!t||!Ue(e)))if(e.indexOf(`
|
|
31
31
|
`)===-1)t.text(e);else{const o=[t.text(),e].map(i=>i.replace(/[\s\n]/g,""));if(o[0]!==o[1]){const i=e.split(`
|
|
32
|
-
`),s=a?i.length-1:1;t.html(""),i.forEach((l,c)=>{t.append("tspan").attr("x",0).attr("dy",`${c===0?r[0]*s:r[1]}em`).text(l)})}}}function Yl(t){const{x:e,y:r,width:a,height:o}=t.getBBox();return[{x:e,y:r+o},{x:e,y:r},{x:e+a,y:r},{x:e+a,y:r+o}]}function Kl(t){const{width:e,height:r}=mn(t),a=Yl(t),o=a[0].x,i=Math.min(a[0].y,a[1].y);return{x:o,y:i,width:e,height:r}}function Yn(t,e){var r;const a=t&&((r=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:r[0]);let o=[0,0];try{o=Wn(a||t,e)}catch(i){}return o.map(i=>isNaN(i)?0:i)}function Zl(t){const{event:e,$el:r}=t,a=r.subchart.main||r.main;let o;return e&&e.type==="brush"?o=e.selection:a&&(o=a.select(".bb-brush").node())&&(o=Gl(o)),o}function Jl(t,e,r=!1){const a=o=>o[t?"getBoundingClientRect":"getBBox"]();return r?a(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=a(e):e.rect}function mn(t,e=!1){return Jl(!0,t,e)}function na(t,e=!1){return Jl(!1,t,e)}function ar(t=!0,e=0,r=1e4){const a=Ze.crypto||Ze.msCrypto,o=a?e+a.getRandomValues(new Uint32Array(1))[0]%(r-e+1):Math.floor(Math.random()*(r-e)+e);return t?String(o):o}function Di(t,e,r,a,o){if(r>a)return-1;const i=Math.floor((r+a)/2);let{x:s,w:l=0}=t[i];return o&&(s=t[i].y,l=t[i].h),e>=s&&e<=s+l?i:e<s?Di(t,e,r,i-1,o):Di(t,e,i+1,a,o)}function Ql(t){const e=Zl(t);return e?e[0]===e[1]:!0}function ag(...t){const e=r=>{if(ze(r)&&r.constructor){const a=new r.constructor;for(const o in r)a[o]=e(r[o]);return a}return r};return t.map(r=>e(r)).reduce((r,a)=>Wl(Wl({},r),a))}function Sn(t={},e){Ge(e)&&e.forEach(r=>Sn(t,r));for(const r in e)/^\d+$/.test(r)||r in t||(t[r]=e[r]);return t}const In=t=>t.charAt(0).toUpperCase()+t.slice(1);function og(t,e="-"){return t.split(e).map((r,a)=>a?r.charAt(0).toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()).join("")}const Lr=t=>[].slice.call(t);function ig(t,e,r){const{rootSelector:a="",sheet:o}=t,s=`${a} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${r.join(";")}}`;return o[o.insertRule?"insertRule":"addRule"](s,o.cssRules.length)}function sg(t){let e=[];return t.forEach(r=>{var a;try{r.cssRules&&r.cssRules.length&&(e=e.concat(Lr(r.cssRules)))}catch(o){(a=Ze.console)==null||a.warn(`Error while reading rules from ${r.href}: ${o.toString()}`)}}),e}function kl(t){var e,r,a,o,i,s;return{x:((r=(e=Ze.pageXOffset)!=null?e:Ze.scrollX)!=null?r:0)+((a=t.scrollLeft)!=null?a:0),y:((i=(o=Ze.pageYOffset)!=null?o:Ze.scrollY)!=null?i:0)+((s=t.scrollTop)!=null?s:0)}}function Io(t,e=0,r=0,a=!0){const o=new DOMPoint(e,r),i=t.getScreenCTM(),s=o.matrixTransform(a?i==null?void 0:i.inverse():i);if(a===!1){const l=mn(t);s.x-=l.x,s.y-=l.y}return s}function ql(t){const e=t?t.transform:null,r=e&&e.baseVal;return r&&r.numberOfItems?r.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ni(t){const e=t[0]instanceof Date,r=(e?t.map(Number):t).filter((a,o,i)=>i.indexOf(a)===o);return e?r.map(a=>new Date(a)):r}function _l(t){return t&&t.length?t.reduce((e,r)=>e.concat(r)):[]}function ra(t,...e){if(!e.length||e.length===1&&!e[0])return t;const r=e.shift();return ze(t)&&ze(r)&&Object.keys(r).forEach(a=>{if(!/^(__proto__|constructor|prototype)$/i.test(a)){const o=r[a];ze(o)?(!t[a]&&(t[a]={}),t[a]=ra(t[a],o)):t[a]=Ge(o)?o.concat():o}}),ra(t,...e)}function aa(t,e=!0){let r;return t[0]instanceof Date?r=e?(a,o)=>a-o:(a,o)=>o-a:e&&!t.every(isNaN)?r=(a,o)=>a-o:e||(r=(a,o)=>a>o&&-1||a<o&&1||a===o&&0),t.concat().sort(r)}function tr(t,e){let r=e.filter(a=>cn(a));return r.length?pe(r[0])?r=Math[t](...r):r[0]instanceof Date&&(r=aa(r,t==="min")[0]):r=void 0,r}const Ro=(t,e,r=1)=>{const a=[],o=Math.max(0,Math.ceil((e-t)/r))|0;for(let i=t;i<o;i++)a.push(t+i*r);return a},lg={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,r,a=t())=>{e.dispatchEvent(new MouseEvent(r,a))}}catch(e){return(r,a,o=t())=>{const i=pn.createEvent("MouseEvent");i.initMouseEvent(a,o.bubbles,o.cancelable,Ze,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),r.dispatchEvent(i)}}})(),touch:(t,e,r)=>{const a=new Touch(ra({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},r));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[a],targetTouches:[],changedTouches:[a]}))}};function Na(t,e){let r=t;for(const a in e)r=r.replace(new RegExp(`{=${a}}`,"g"),e[a]);return r}function Kn(t){var e;let r;if(t instanceof Date)r=t;else if(Ue(t)){const{config:a,format:o}=this;r=(e=o.dataTime(a.data_xFormat)(t))!=null?e:new Date(t)}else pe(t)&&!isNaN(t)&&(r=new Date(+t));return(!r||isNaN(+r))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),r}function Li(t){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function cg(t,e,r=!1){const a=!!t.node;let o=!1;for(const[i,s]of Object.entries(e))if(o=a?t.style(i)===s:t.style[i]===s,r===!1&&o)break;return o}function La(){var t,e;return((t=pn)==null?void 0:t.hidden)===!1||((e=pn)==null?void 0:e.visibilityState)==="visible"}function ug(t,e){const{DocumentTouch:r,matchMedia:a,navigator:o}=Ze,i=a==null?void 0:a("(pointer:coarse)").matches;let s=!1;if(e)if(o&&"maxTouchPoints"in o)s=o.maxTouchPoints>0;else if("ontouchmove"in Ze||r&&pn instanceof r)s=!0;else if(i)s=!0;else{const c=o.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(c)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(c)}return t&&!i&&(a==null?void 0:a("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function tc(t,e){e()===!1?qv(()=>tc(t,e)):t()}function fg(t){if(ze(t)&&!Ue(t)){const s=t;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const e=(Ue(t)?t.trim().split(/\s+/):[t]).map(s=>+s||0),[r,a=r,o=r,i=a]=e;return{top:r,right:a,bottom:o,left:i}}var dg=Object.defineProperty,ec=Object.getOwnPropertySymbols,hg=Object.prototype.hasOwnProperty,vg=Object.prototype.propertyIsEnumerable,Fi=(t,e,r)=>e in t?dg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nc=(t,e)=>{for(var r in e||(e={}))hg.call(e,r)&&Fi(t,r,e[r]);if(ec)for(var r of ec(e))vg.call(e,r)&&Fi(t,r,e[r]);return t},gg=(t,e,r)=>Fi(t,typeof e!="symbol"?e+"":e,r);const rc=class wf{static setOptions(e){this.data=e.reduce((r,a)=>nc(nc({},r),a),this.data)}constructor(){return ag(Zd,Wd,kd,Yd,qd,Kd,Jd,Qd,wf.data)}};gg(rc,"data",{});let Fr=rc;class pg{constructor(){return{chart:null,main:null,svg:null,axis:{x:null,y:null,y2:null,subX:null},axisTooltip:{x:null,y:null,y2:null},defs:null,tooltip:null,legend:null,title:null,subchart:{main:null,bar:null,line:null,area:null},arcs:null,bar:null,candlestick:null,line:null,area:null,circle:null,radar:null,text:null,grid:{main:null,x:null,y:null},gridLines:{main:null,x:null,y:null},region:{main:null,list:null},eventRect:null,zoomResetBtn:null}}}class mg{constructor(){return{width:0,width2:0,height:0,height2:0,margin:{top:0,bottom:0,left:0,right:0},margin2:{top:0,bottom:0,left:0,right:0},margin3:{top:0,bottom:0,left:0,right:0},arcWidth:0,arcHeight:0,xAxisHeight:0,hasAxis:!1,hasFunnel:!1,hasRadar:!1,hasTreemap:!1,cssRule:{},current:{domain:void 0,width:0,height:0,dataMax:0,maxTickSize:{x:{width:0,height:0,ticks:[],clipPath:0,domain:""},y:{width:0,height:0,domain:""},y2:{width:0,height:0,domain:""}},types:[],needle:void 0,zoomDomain:null},isLegendRight:!1,isLegendInset:!1,isLegendTop:!1,isLegendLeft:!1,legendStep:0,legendItemWidth:0,legendItemHeight:0,legendHasRendered:!1,eventReceiver:{currentIdx:-1,rect:{},data:[],coords:[]},axis:{x:{padding:{left:0,right:0},tickCount:0}},rotatedPadding:{left:30,right:0,top:5},withoutFadeIn:{},inputType:"",datetimeId:"",clip:{id:"",idXAxis:"",idYAxis:"",idXAxisTickTexts:"",idGrid:"",idSubchart:"",path:"",pathXAxis:"",pathYAxis:"",pathXAxisTickTexts:"",pathGrid:""},event:null,dragStart:null,dragging:!1,flowing:!1,cancelClick:!1,mouseover:!1,rendered:!1,transiting:!1,redrawing:!1,resizing:!1,toggling:!1,zooming:!1,hasNegativeValue:!1,hasPositiveValue:!0,orgAreaOpacity:"0.2",orgConfig:{},hiddenTargetIds:[],hiddenLegendIds:[],focusedTargetIds:[],defocusedTargetIds:[],radius:0,innerRadius:0,outerRadius:void 0,innerRadiusRatio:0,gaugeArcWidth:0,radiusExpanded:0,xgridAttr:{x1:null,x2:null,y1:null,y2:null}}}}const ac={element:pg,state:mg};class yg{constructor(){Object.keys(ac).forEach(e=>{this[e]=new ac[e]})}getStore(e){return this[e]}}var xg=Object.defineProperty,Tg=(t,e,r)=>e in t?xg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sg=(t,e,r)=>Tg(t,typeof e!="symbol"?e+"":e,r);const Mn={bubbleBaseLength:"$baseLength",colorPattern:"__colorPattern__",dataMinMax:"$dataMinMax",dataTotalSum:"$dataTotalSum",dataTotalPerIndex:"$totalPerIndex",legendItemTextBox:"legendItemTextBox",radarPoints:"$radarPoints",radarTextWidth:"$radarTextWidth",setOverOut:"setOverOut",callOverOutForTouch:"callOverOutForTouch",textRect:"textRect"};class $g{constructor(){Sg(this,"cache",{})}add(e,r,a=!1){return this.cache[e]=a?this.cloneTarget(r):r,this.cache[e]}remove(e){(Ue(e)?[e]:e).forEach(r=>delete this.cache[r])}get(e,r=!1){if(r&&Array.isArray(e)){const a=[];for(let o=0,i;i=e[o];o++)i in this.cache&&a.push(this.cloneTarget(this.cache[i]));return a}else{const a=this.cache[e];return De(a)?a:null}}reset(e){const r=this;for(const a in r.cache)(e||/^\$/.test(a))&&(r.cache[a]=null)}cloneTarget(e){return{id:e.id,id_org:e.id_org,values:e.values.map(r=>({x:r.x,value:r.value,id:r.id}))}}}const se={AREA:"area",AREA_LINE_RANGE:"area-line-range",AREA_SPLINE:"area-spline",AREA_SPLINE_RANGE:"area-spline-range",AREA_STEP:"area-step",AREA_STEP_RANGE:"area-step-range",BAR:"bar",BUBBLE:"bubble",CANDLESTICK:"candlestick",DONUT:"donut",FUNNEL:"funnel",GAUGE:"gauge",LINE:"line",PIE:"pie",POLAR:"polar",RADAR:"radar",SCATTER:"scatter",SPLINE:"spline",STEP:"step",TREEMAP:"treemap"},Bi={AREA:"initArea",AREA_LINE_RANGE:"initArea",AREA_SPLINE:"initArea",AREA_SPLINE_RANGE:"initArea",AREA_STEP:"initArea",AREA_STEP_RANGE:"initArea",BAR:"initBar",BUBBLE:"initCircle",CANDLESTICK:"initCandlestick",DONUT:"initArc",FUNNEL:"initFunnel",GAUGE:"initArc",LINE:"initLine",PIE:"initArc",POLAR:"initPolar",RADAR:"initCircle",SCATTER:"initCircle",SPLINE:"initLine",STEP:"initLine",TREEMAP:"initTreemap"},Ar={Area:[se.AREA,se.AREA_SPLINE,se.AREA_SPLINE_RANGE,se.AREA_LINE_RANGE,se.AREA_STEP,se.AREA_STEP_RANGE],AreaRange:[se.AREA_SPLINE_RANGE,se.AREA_LINE_RANGE,se.AREA_STEP_RANGE],Arc:[se.PIE,se.DONUT,se.GAUGE,se.POLAR,se.RADAR],Line:[se.LINE,se.SPLINE,se.AREA,se.AREA_SPLINE,se.AREA_SPLINE_RANGE,se.AREA_LINE_RANGE,se.STEP,se.AREA_STEP,se.AREA_STEP_RANGE],Step:[se.STEP,se.AREA_STEP,se.AREA_STEP_RANGE],Spline:[se.SPLINE,se.AREA_SPLINE,se.AREA_SPLINE_RANGE]};function Ag(t){const e=t,{config:r}=e;let a="";if(_n(r.data_type||r.data_types)&&!e[Bi.LINE])a="line";else for(const o in Bi){const i=se[o];if(e.hasType(i)&&!e[Bi[o]]){a=i;break}}a&&Eg(`Please, make sure if %c${og(a)}`,"module has been imported and specified correctly.","https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality")}function Eg(t,e,r){var a;const o="[billboard.js]";if((a=Ze.console)==null?void 0:a.error){const s=e?["background:red;color:white;display:block;font-size:15px",e]:[];console.error(`\u274C ${o} ${t}`,"background:red;color:white;display:block;font-size:15px",...s),r&&console.info("%c\u2139\uFE0F","font-size:15px",r)}throw Error(`${o} ${t.replace(/\%c([a-z-]+)/i,"'$1' ")} ${e!=null?e:""}`)}const{setTimeout:bg,clearTimeout:Ig}=Ze;function Rg(t){const e=[];let r;const a=function(){a.clear(),t===!1?Vl(()=>{e.forEach(o=>o())},{timeout:200}):r=bg(()=>{e.forEach(o=>o())},pe(t)?t:200)};return a.clear=()=>{r&&(Ig(r),r=null)},a.add=o=>e.push(o),a.remove=o=>e.splice(e.indexOf(o),1),a}function oc(){let t=[];const e=function(r,a){function o(){var i;let s=0;for(let l=0,c;c=t[l];l++){if(c===!0||(i=c.empty)!=null&&i.call(c)){s++;continue}if(La()===!1){s=t.length;break}try{c.transition()}catch(f){s++}}return s===t.length}tc(()=>{a==null||a()},o)};return e.add=function(r){Ge(r)?t=t.concat(r):t.push(r)},e}const Ui={};function Og(t,e){var r;const a=t.toString(),o=a.replace(/(function|[\s\W\n])/g,"").substring(0,15);return o in Ui||(Ui[o]=new Ze.Blob([`${(r=e==null?void 0:e.map(String).join(";"))!=null?r:""}
|
|
32
|
+
`),s=a?i.length-1:1;t.html(""),i.forEach((l,c)=>{t.append("tspan").attr("x",0).attr("dy",`${c===0?r[0]*s:r[1]}em`).text(l)})}}}function Yl(t){const{x:e,y:r,width:a,height:o}=t.getBBox();return[{x:e,y:r+o},{x:e,y:r},{x:e+a,y:r},{x:e+a,y:r+o}]}function Kl(t){const{width:e,height:r}=mn(t),a=Yl(t),o=a[0].x,i=Math.min(a[0].y,a[1].y);return{x:o,y:i,width:e,height:r}}function Kn(t,e){var r;const a=t&&((r=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:r[0]);let o=[0,0];try{o=Wn(a||t,e)}catch(i){}return o.map(i=>isNaN(i)?0:i)}function Zl(t){const{event:e,$el:r}=t,a=r.subchart.main||r.main;let o;return e&&e.type==="brush"?o=e.selection:a&&(o=a.select(".bb-brush").node())&&(o=Gl(o)),o}function Jl(t,e,r=!1){const a=o=>o[t?"getBoundingClientRect":"getBBox"]();return r?a(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=a(e):e.rect}function mn(t,e=!1){return Jl(!0,t,e)}function na(t,e=!1){return Jl(!1,t,e)}function ar(t=!0,e=0,r=1e4){const a=Ze.crypto||Ze.msCrypto,o=a?e+a.getRandomValues(new Uint32Array(1))[0]%(r-e+1):Math.floor(Math.random()*(r-e)+e);return t?String(o):o}function Di(t,e,r,a,o){if(r>a)return-1;const i=Math.floor((r+a)/2);let{x:s,w:l=0}=t[i];return o&&(s=t[i].y,l=t[i].h),e>=s&&e<=s+l?i:e<s?Di(t,e,r,i-1,o):Di(t,e,i+1,a,o)}function Ql(t){const e=Zl(t);return e?e[0]===e[1]:!0}function og(...t){const e=r=>{if(ze(r)&&r.constructor){const a=new r.constructor;for(const o in r)a[o]=e(r[o]);return a}return r};return t.map(r=>e(r)).reduce((r,a)=>Wl(Wl({},r),a))}function Sn(t={},e){Ge(e)&&e.forEach(r=>Sn(t,r));for(const r in e)/^\d+$/.test(r)||r in t||(t[r]=e[r]);return t}const In=t=>t.charAt(0).toUpperCase()+t.slice(1);function ig(t,e="-"){return t.split(e).map((r,a)=>a?r.charAt(0).toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()).join("")}const Lr=t=>[].slice.call(t);function sg(t,e,r){const{rootSelector:a="",sheet:o}=t,s=`${a} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${r.join(";")}}`;return o[o.insertRule?"insertRule":"addRule"](s,o.cssRules.length)}function lg(t){let e=[];return t.forEach(r=>{var a;try{r.cssRules&&r.cssRules.length&&(e=e.concat(Lr(r.cssRules)))}catch(o){(a=Ze.console)==null||a.warn(`Error while reading rules from ${r.href}: ${o.toString()}`)}}),e}function kl(t){var e,r,a,o,i,s;return{x:((r=(e=Ze.pageXOffset)!=null?e:Ze.scrollX)!=null?r:0)+((a=t.scrollLeft)!=null?a:0),y:((i=(o=Ze.pageYOffset)!=null?o:Ze.scrollY)!=null?i:0)+((s=t.scrollTop)!=null?s:0)}}function Io(t,e=0,r=0,a=!0){const o=new DOMPoint(e,r),i=t.getScreenCTM(),s=o.matrixTransform(a?i==null?void 0:i.inverse():i);if(a===!1){const l=mn(t);s.x-=l.x,s.y-=l.y}return s}function ql(t){const e=t?t.transform:null,r=e&&e.baseVal;return r&&r.numberOfItems?r.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ni(t){const e=t[0]instanceof Date,r=(e?t.map(Number):t).filter((a,o,i)=>i.indexOf(a)===o);return e?r.map(a=>new Date(a)):r}function _l(t){return t&&t.length?t.reduce((e,r)=>e.concat(r)):[]}function ra(t,...e){if(!e.length||e.length===1&&!e[0])return t;const r=e.shift();return ze(t)&&ze(r)&&Object.keys(r).forEach(a=>{if(!/^(__proto__|constructor|prototype)$/i.test(a)){const o=r[a];ze(o)?(!t[a]&&(t[a]={}),t[a]=ra(t[a],o)):t[a]=Ge(o)?o.concat():o}}),ra(t,...e)}function aa(t,e=!0){let r;return t[0]instanceof Date?r=e?(a,o)=>a-o:(a,o)=>o-a:e&&!t.every(isNaN)?r=(a,o)=>a-o:e||(r=(a,o)=>a>o&&-1||a<o&&1||a===o&&0),t.concat().sort(r)}function tr(t,e){let r=e.filter(a=>cn(a));return r.length?pe(r[0])?r=Math[t](...r):r[0]instanceof Date&&(r=aa(r,t==="min")[0]):r=void 0,r}const Ro=(t,e,r=1)=>{const a=[],o=Math.max(0,Math.ceil((e-t)/r))|0;for(let i=t;i<o;i++)a.push(t+i*r);return a},cg={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,r,a=t())=>{e.dispatchEvent(new MouseEvent(r,a))}}catch(e){return(r,a,o=t())=>{const i=pn.createEvent("MouseEvent");i.initMouseEvent(a,o.bubbles,o.cancelable,Ze,0,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),r.dispatchEvent(i)}}})(),touch:(t,e,r)=>{const a=new Touch(ra({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},r));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[a],targetTouches:[],changedTouches:[a]}))}};function Na(t,e){let r=t;for(const a in e)r=r.replace(new RegExp(`{=${a}}`,"g"),e[a]);return r}function Zn(t){var e;let r;if(t instanceof Date)r=t;else if(Ue(t)){const{config:a,format:o}=this;r=(e=o.dataTime(a.data_xFormat)(t))!=null?e:new Date(t)}else pe(t)&&!isNaN(t)&&(r=new Date(+t));return(!r||isNaN(+r))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),r}function Li(t){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function ug(t,e,r=!1){const a=!!t.node;let o=!1;for(const[i,s]of Object.entries(e))if(o=a?t.style(i)===s:t.style[i]===s,r===!1&&o)break;return o}function La(){var t,e;return((t=pn)==null?void 0:t.hidden)===!1||((e=pn)==null?void 0:e.visibilityState)==="visible"}function fg(t,e){const{DocumentTouch:r,matchMedia:a,navigator:o}=Ze,i=a==null?void 0:a("(pointer:coarse)").matches;let s=!1;if(e)if(o&&"maxTouchPoints"in o)s=o.maxTouchPoints>0;else if("ontouchmove"in Ze||r&&pn instanceof r)s=!0;else if(i)s=!0;else{const c=o.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(c)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(c)}return t&&!i&&(a==null?void 0:a("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function tc(t,e){e()===!1?qv(()=>tc(t,e)):t()}function dg(t){if(ze(t)&&!Ue(t)){const s=t;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const e=(Ue(t)?t.trim().split(/\s+/):[t]).map(s=>+s||0),[r,a=r,o=r,i=a]=e;return{top:r,right:a,bottom:o,left:i}}var hg=Object.defineProperty,ec=Object.getOwnPropertySymbols,vg=Object.prototype.hasOwnProperty,gg=Object.prototype.propertyIsEnumerable,Fi=(t,e,r)=>e in t?hg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nc=(t,e)=>{for(var r in e||(e={}))vg.call(e,r)&&Fi(t,r,e[r]);if(ec)for(var r of ec(e))gg.call(e,r)&&Fi(t,r,e[r]);return t},pg=(t,e,r)=>Fi(t,typeof e!="symbol"?e+"":e,r);const rc=class wf{static setOptions(e){this.data=e.reduce((r,a)=>nc(nc({},r),a),this.data)}constructor(){return og(Zd,Wd,kd,Yd,qd,Kd,Jd,Qd,wf.data)}};pg(rc,"data",{});let Fr=rc;class mg{constructor(){return{chart:null,main:null,svg:null,axis:{x:null,y:null,y2:null,subX:null},axisTooltip:{x:null,y:null,y2:null},defs:null,tooltip:null,legend:null,title:null,subchart:{main:null,bar:null,line:null,area:null},arcs:null,bar:null,candlestick:null,line:null,area:null,circle:null,radar:null,text:null,grid:{main:null,x:null,y:null},gridLines:{main:null,x:null,y:null},region:{main:null,list:null},eventRect:null,zoomResetBtn:null}}}class yg{constructor(){return{width:0,width2:0,height:0,height2:0,margin:{top:0,bottom:0,left:0,right:0},margin2:{top:0,bottom:0,left:0,right:0},margin3:{top:0,bottom:0,left:0,right:0},arcWidth:0,arcHeight:0,xAxisHeight:0,hasAxis:!1,hasFunnel:!1,hasRadar:!1,hasTreemap:!1,cssRule:{},current:{domain:void 0,width:0,height:0,dataMax:0,maxTickSize:{x:{width:0,height:0,ticks:[],clipPath:0,domain:""},y:{width:0,height:0,domain:""},y2:{width:0,height:0,domain:""}},types:[],needle:void 0,zoomDomain:null},isLegendRight:!1,isLegendInset:!1,isLegendTop:!1,isLegendLeft:!1,legendStep:0,legendItemWidth:0,legendItemHeight:0,legendHasRendered:!1,eventReceiver:{currentIdx:-1,rect:{},data:[],coords:[]},axis:{x:{padding:{left:0,right:0},tickCount:0}},rotatedPadding:{left:30,right:0,top:5},withoutFadeIn:{},inputType:"",datetimeId:"",clip:{id:"",idXAxis:"",idYAxis:"",idXAxisTickTexts:"",idGrid:"",idSubchart:"",path:"",pathXAxis:"",pathYAxis:"",pathXAxisTickTexts:"",pathGrid:""},event:null,dragStart:null,dragging:!1,flowing:!1,cancelClick:!1,mouseover:!1,rendered:!1,transiting:!1,redrawing:!1,resizing:!1,toggling:!1,zooming:!1,hasNegativeValue:!1,hasPositiveValue:!0,orgAreaOpacity:"0.2",orgConfig:{},hiddenTargetIds:[],hiddenLegendIds:[],focusedTargetIds:[],defocusedTargetIds:[],radius:0,innerRadius:0,outerRadius:void 0,innerRadiusRatio:0,gaugeArcWidth:0,radiusExpanded:0,xgridAttr:{x1:null,x2:null,y1:null,y2:null}}}}const ac={element:mg,state:yg};class xg{constructor(){Object.keys(ac).forEach(e=>{this[e]=new ac[e]})}getStore(e){return this[e]}}var Tg=Object.defineProperty,Sg=(t,e,r)=>e in t?Tg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$g=(t,e,r)=>Sg(t,typeof e!="symbol"?e+"":e,r);const Mn={bubbleBaseLength:"$baseLength",colorPattern:"__colorPattern__",dataMinMax:"$dataMinMax",dataTotalSum:"$dataTotalSum",dataTotalPerIndex:"$totalPerIndex",legendItemTextBox:"legendItemTextBox",radarPoints:"$radarPoints",radarTextWidth:"$radarTextWidth",setOverOut:"setOverOut",callOverOutForTouch:"callOverOutForTouch",textRect:"textRect"};class Ag{constructor(){$g(this,"cache",{})}add(e,r,a=!1){return this.cache[e]=a?this.cloneTarget(r):r,this.cache[e]}remove(e){(Ue(e)?[e]:e).forEach(r=>delete this.cache[r])}get(e,r=!1){if(r&&Array.isArray(e)){const a=[];for(let o=0,i;i=e[o];o++)i in this.cache&&a.push(this.cloneTarget(this.cache[i]));return a}else{const a=this.cache[e];return De(a)?a:null}}reset(e){const r=this;for(const a in r.cache)(e||/^\$/.test(a))&&(r.cache[a]=null)}cloneTarget(e){return{id:e.id,id_org:e.id_org,values:e.values.map(r=>({x:r.x,value:r.value,id:r.id}))}}}const se={AREA:"area",AREA_LINE_RANGE:"area-line-range",AREA_SPLINE:"area-spline",AREA_SPLINE_RANGE:"area-spline-range",AREA_STEP:"area-step",AREA_STEP_RANGE:"area-step-range",BAR:"bar",BUBBLE:"bubble",CANDLESTICK:"candlestick",DONUT:"donut",FUNNEL:"funnel",GAUGE:"gauge",LINE:"line",PIE:"pie",POLAR:"polar",RADAR:"radar",SCATTER:"scatter",SPLINE:"spline",STEP:"step",TREEMAP:"treemap"},Bi={AREA:"initArea",AREA_LINE_RANGE:"initArea",AREA_SPLINE:"initArea",AREA_SPLINE_RANGE:"initArea",AREA_STEP:"initArea",AREA_STEP_RANGE:"initArea",BAR:"initBar",BUBBLE:"initCircle",CANDLESTICK:"initCandlestick",DONUT:"initArc",FUNNEL:"initFunnel",GAUGE:"initArc",LINE:"initLine",PIE:"initArc",POLAR:"initPolar",RADAR:"initCircle",SCATTER:"initCircle",SPLINE:"initLine",STEP:"initLine",TREEMAP:"initTreemap"},Ar={Area:[se.AREA,se.AREA_SPLINE,se.AREA_SPLINE_RANGE,se.AREA_LINE_RANGE,se.AREA_STEP,se.AREA_STEP_RANGE],AreaRange:[se.AREA_SPLINE_RANGE,se.AREA_LINE_RANGE,se.AREA_STEP_RANGE],Arc:[se.PIE,se.DONUT,se.GAUGE,se.POLAR,se.RADAR],Line:[se.LINE,se.SPLINE,se.AREA,se.AREA_SPLINE,se.AREA_SPLINE_RANGE,se.AREA_LINE_RANGE,se.STEP,se.AREA_STEP,se.AREA_STEP_RANGE],Step:[se.STEP,se.AREA_STEP,se.AREA_STEP_RANGE],Spline:[se.SPLINE,se.AREA_SPLINE,se.AREA_SPLINE_RANGE]};function Eg(t){const e=t,{config:r}=e;let a="";if(Yn(r.data_type||r.data_types)&&!e[Bi.LINE])a="line";else for(const o in Bi){const i=se[o];if(e.hasType(i)&&!e[Bi[o]]){a=i;break}}a&&bg(`Please, make sure if %c${ig(a)}`,"module has been imported and specified correctly.","https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality")}function bg(t,e,r){var a;const o="[billboard.js]";if((a=Ze.console)==null?void 0:a.error){const s=e?["background:red;color:white;display:block;font-size:15px",e]:[];console.error(`\u274C ${o} ${t}`,"background:red;color:white;display:block;font-size:15px",...s),r&&console.info("%c\u2139\uFE0F","font-size:15px",r)}throw Error(`${o} ${t.replace(/\%c([a-z-]+)/i,"'$1' ")} ${e!=null?e:""}`)}const{setTimeout:Ig,clearTimeout:Rg}=Ze;function Og(t){const e=[];let r;const a=function(){a.clear(),t===!1?Vl(()=>{e.forEach(o=>o())},{timeout:200}):r=Ig(()=>{e.forEach(o=>o())},pe(t)?t:200)};return a.clear=()=>{r&&(Rg(r),r=null)},a.add=o=>e.push(o),a.remove=o=>e.splice(e.indexOf(o),1),a}function oc(){let t=[];const e=function(r,a){function o(){var i;let s=0;for(let l=0,c;c=t[l];l++){if(c===!0||(i=c.empty)!=null&&i.call(c)){s++;continue}if(La()===!1){s=t.length;break}try{c.transition()}catch(f){s++}}return s===t.length}tc(()=>{a==null||a()},o)};return e.add=function(r){Ge(r)?t=t.concat(r):t.push(r)},e}const Ui={};function Cg(t,e){var r;const a=t.toString(),o=a.replace(/(function|[\s\W\n])/g,"").substring(0,15);return o in Ui||(Ui[o]=new Ze.Blob([`${(r=e==null?void 0:e.map(String).join(";"))!=null?r:""}
|
|
33
33
|
|
|
34
34
|
self.onmessage=function({data}) {
|
|
35
35
|
const result = (${a}).apply(null, data);
|
|
36
36
|
self.postMessage(result);
|
|
37
|
-
};`],{type:"text/javascript"})),Ze.URL.createObjectURL(Ui[o])}function
|
|
38
|
-
\r]`),r=t.charCodeAt(0);function a(p,m){var E,w,U=o(p,function(N,D){if(E)return E(N,D-1);w=N,E=m?
|
|
37
|
+
};`],{type:"text/javascript"})),Ze.URL.createObjectURL(Ui[o])}function Pg(t){const e=new Ze.Worker(t);return e.onerror=function(r){console.error?console.error(r):console.log(r)},e}function zi(t=!0,e,r,a){let o=function(...i){const s=e(...i);r(s)};if(Ze.Worker&&t){const i=Cg(e,a),s=Pg(i);o=function(...l){s.postMessage(l),s.onmessage=function(c){return Ze.URL.revokeObjectURL(i),r(c.data)}}}return o}var ic={},ji={},Gi=34,Fa=10,Vi=13;function sc(t){return new Function("d","return {"+t.map(function(e,r){return JSON.stringify(e)+": d["+r+'] || ""'}).join(",")+"}")}function Mg(t,e){var r=sc(t);return function(a,o){return e(r(a),o,t)}}function lc(t){var e=Object.create(null),r=[];return t.forEach(function(a){for(var o in a)o in e||r.push(e[o]=o)}),r}function Fn(t,e){var r=t+"",a=r.length;return a<e?new Array(e-a+1).join(0)+r:r}function wg(t){return t<0?"-"+Fn(-t,6):t>9999?"+"+Fn(t,6):Fn(t,4)}function Dg(t){var e=t.getUTCHours(),r=t.getUTCMinutes(),a=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":wg(t.getUTCFullYear(),4)+"-"+Fn(t.getUTCMonth()+1,2)+"-"+Fn(t.getUTCDate(),2)+(o?"T"+Fn(e,2)+":"+Fn(r,2)+":"+Fn(a,2)+"."+Fn(o,3)+"Z":a?"T"+Fn(e,2)+":"+Fn(r,2)+":"+Fn(a,2)+"Z":r||e?"T"+Fn(e,2)+":"+Fn(r,2)+"Z":"")}function cc(t){var e=new RegExp('["'+t+`
|
|
38
|
+
\r]`),r=t.charCodeAt(0);function a(p,m){var E,w,U=o(p,function(N,D){if(E)return E(N,D-1);w=N,E=m?Mg(N,m):sc(N)});return U.columns=w||[],U}function o(p,m){var E=[],w=p.length,U=0,N=0,D,Y=w<=0,J=!1;p.charCodeAt(w-1)===Fa&&--w,p.charCodeAt(w-1)===Vi&&--w;function K(){if(Y)return ji;if(J)return J=!1,ic;var Q,ot=U,pt;if(p.charCodeAt(ot)===Gi){for(;U++<w&&p.charCodeAt(U)!==Gi||p.charCodeAt(++U)===Gi;);return(Q=U)>=w?Y=!0:(pt=p.charCodeAt(U++))===Fa?J=!0:pt===Vi&&(J=!0,p.charCodeAt(U)===Fa&&++U),p.slice(ot+1,Q-1).replace(/""/g,'"')}for(;U<w;){if((pt=p.charCodeAt(Q=U++))===Fa)J=!0;else if(pt===Vi)J=!0,p.charCodeAt(U)===Fa&&++U;else if(pt!==r)continue;return p.slice(ot,Q)}return Y=!0,p.slice(ot,w)}for(;(D=K())!==ji;){for(var nt=[];D!==ic&&D!==ji;)nt.push(D),D=K();m&&(nt=m(nt,N++))==null||E.push(nt)}return E}function i(p,m){return p.map(function(E){return m.map(function(w){return g(E[w])}).join(t)})}function s(p,m){return m==null&&(m=lc(p)),[m.map(g).join(t)].concat(i(p,m)).join(`
|
|
39
39
|
`)}function l(p,m){return m==null&&(m=lc(p)),i(p,m).join(`
|
|
40
40
|
`)}function c(p){return p.map(f).join(`
|
|
41
|
-
`)}function f(p){return p.map(g).join(t)}function g(p){return p==null?"":p instanceof Date?wg(p):e.test(p+="")?'"'+p.replace(/"/g,'""')+'"':p}return{parse:a,parseRows:o,format:s,formatBody:l,formatRows:c,formatRow:f,formatValue:g}}var Br=cc(","),Dg=Br.parse,Ng=Br.parseRows,T1=Br.format,S1=Br.formatBody,$1=Br.formatRows,A1=Br.formatRow,E1=Br.formatValue,Ur=cc(" "),Lg=Ur.parse,Fg=Ur.parseRows,b1=Ur.format,I1=Ur.formatBody,R1=Ur.formatRows,O1=Ur.formatRow,C1=Ur.formatValue;function Xi(t){const e=[];return t.forEach(function(r,a){const o=r[0];r.forEach(function(i,s){if(s>0){if(typeof e[s-1]=="undefined"&&(e[s-1]={}),typeof i=="undefined")throw new Error(`Source data is missing a component at (${a}, ${s})!`);e[s-1][o]=i}})}),e}function Hi(t){const e=t[0],r=[];return t.forEach(function(a,o){if(o>0){const i={};a.forEach(function(s,l){if(typeof s=="undefined")throw new Error(`Source data is missing a component at (${o}, ${l})!`);i[e[l]]=s}),r.push(i)}}),r}function uc(t,e){const r=[];let a,o;if(Array.isArray(t)){const i=function(s,l){if(s[l]!==void 0)return s[l];const f=l.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");let g=s;return f.some(function(p){return!(g=g&&p in g?g[p]:void 0)}),g};e.x?a=e.value.concat(e.x):a=e.value,r.push(a),t.forEach(function(s){const l=a.map(function(c){let f=i(s,c);return typeof f=="undefined"&&(f=null),f});r.push(l)}),o=Hi(r)}else Object.keys(t).forEach(function(i){var s;const l=t[i].concat();(s=l.unshift)==null||s.call(l,i),r.push(l)}),o=Xi(r);return o}function Bg(t,e="csv",r,a,o){const i=new XMLHttpRequest,s={csv:Ug,tsv:zg,json:uc};i.open("GET",t),r&&Object.keys(r).forEach(function(l){i.setRequestHeader(l,r[l])}),i.onreadystatechange=function(){if(i.readyState===4)if(i.status===200){const l=i.responseText;l&&o.call(this,s[e](e==="json"?JSON.parse(l):l,a))}else throw new Error(`${t}: Something went wrong loading!`)},i.send()}function fc(t,e){const r=t.rows(e);let a;return r.length===1?(a=[{}],r[0].forEach(o=>{a[0][o]=null})):a=t.parse(e),a}function Ug(t){return fc({rows:Ng,parse:Dg},t)}function zg(t){return fc({rows:Fg,parse:Lg},t)}function dc(t,e){const r=t||(e==null?void 0:e.data_keys);return r!=null&&r.x&&(e.data_x=r.x),r}function jg(t,e,r){const a=this,{config:o}=a;let i;t.forEach(s=>{const l=a.getXKey(s);if(r.customX||r.timeSeries?r.xs.indexOf(l)>=0?i=(r.appendXs&&a.data.xs[s]||[]).concat(e.map((c,f)=>{const g=De(c[l]);return g?a.generateTargetX(g,s,f):!1}).filter(c=>c!==!1)):o.data_x?i=this.getOtherTargetXs():cn(o.data_xs)&&(i=a.getXValuesOfXKey(l,a.data.targets)):i=e.map((c,f)=>f),i)a.data.xs[s]=i;else throw new Error(`x is not defined for id = "${s}".`)})}var Gg={convertData(t,e){const{config:r}=this,a=i=>{var s;return i!=null&&i.length&&((s=i[0])!=null&&s.length)?r.boost_useWorker:!1};let o=t;if(t.bindto&&(o={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(i=>{const s=`data_${i}`;s in t&&(o[i]=t[s])})),o.url&&e)Bg(o.url,o.mimeType,o.headers,dc(o.keys,r),e);else if(o.json)zi(a(o.json),uc,e,[Xi,Hi])(o.json,dc(o.keys,r));else if(o.rows)zi(a(o.rows),Hi,e)(o.rows);else if(o.columns)zi(a(o.columns),Xi,e)(o.columns);else if(t.bindto)throw Error("url or json or rows or columns is required.")},convertDataToTargets(t,e){const r=this,{axis:a,config:o,state:i}=r,s=o.data_type,l=Object.keys(t[0]||{}),{ids:c,xs:f}=l.length?l.reduce((m,E)=>(r.isX.call(r,E)?m.xs.push(E):r.isNotX.call(r,E)&&m.ids.push(E),m),{ids:[],xs:[]}):{ids:[],xs:[]},g={appendXs:e,xs:f,idConverter:o.data_idConverter.bind(r.api),categorized:a==null?void 0:a.isCategorized(),timeSeries:a==null?void 0:a.isTimeSeries(),customX:a==null?void 0:a.isCustomX()};jg.bind(r)(c,t,g);const p=c.map((m,E)=>{const w=o.data_idConverter.bind(r.api)(m),U=r.getXKey(m),N=g.customX&&g.categorized,D=N&&(()=>{const K=new Set(o.axis_x_categories);return t.every(nt=>K.has(nt.x))})(),Y=t.__append__,J=U===null&&Y?r.api.data.values(m).length:0;return{id:w,id_org:m,values:t.map((K,nt)=>{const Q=K[U];let ot=K[m],pt;return ot=ot!==null&&!isNaN(ot)&&!ze(ot)?+ot:Ge(ot)||ze(ot)?ot:null,(N||i.hasRadar)&&E===0&&!ln(Q)?(!D&&E===0&&nt===0&&!Y&&(o.axis_x_categories=[]),pt=o.axis_x_categories.indexOf(Q),pt===-1&&(pt=o.axis_x_categories.length,o.axis_x_categories.push(Q))):pt=r.generateTargetX(Q,m,J+nt),(ln(ot)||r.data.xs[m].length<=nt)&&(pt=void 0),{x:pt,value:ot,id:w,index:-1}}).filter(K=>Qe(K.x))}});if(p.forEach(m=>{var E;o.data_xSort&&(m.values=m.values.sort((w,U)=>{const N=w.x||w.x===0?w.x:1/0,D=U.x||U.x===0?U.x:1/0;return N-D})),m.values.forEach((w,U)=>w.index=U),(E=r.data.xs[m.id])==null||E.sort((w,U)=>w-U)}),i.hasNegativeValue=r.hasNegativeValueInTargets(p),i.hasPositiveValue=r.hasPositiveValueInTargets(p),s&&r.isValidChartType(s)){const m=r.mapToIds(p).filter(E=>!(E in o.data_types)||!r.isValidChartType(o.data_types[E]));r.setTargetType(m,s)}return p.forEach(m=>r.cache.add(m.id_org,m,!0)),p}},Vg={isX(t){const e=this,{config:r}=e,a=r.data_x&&t===r.data_x,o=cn(r.data_xs)&&rg(r.data_xs,t);return a||o},isNotX(t){return!this.isX(t)},isStackNormalized(){const{config:t}=this;return!!(t.data_stack_normalize&&t.data_groups.length)},isGrouped(t){const e=this.config.data_groups;return t?e.some(r=>r.indexOf(t)>=0&&r.length>1):e.length>0},getXKey(t){const e=this,{config:r}=e;return r.data_x?r.data_x:cn(r.data_xs)?r.data_xs[t]:null},getXValuesOfXKey(t,e){const r=this,a=e&&cn(e)?r.mapToIds(e):[];let o;return a.forEach(i=>{r.getXKey(i)===t&&(o=r.data.xs[i])}),o},getIndexByX(t,e){const r=this;return e?e.indexOf(Ue(t)?t:+t):(r.filterByX(r.data.targets,t)[0]||{index:null}).index},getXValue(t,e){const r=this;return t in r.data.xs&&r.data.xs[t]&&De(r.data.xs[t][e])?r.data.xs[t][e]:e},getOtherTargetXs(){const t=this,e=Object.keys(t.data.xs);return e.length?t.data.xs[e[0]]:null},getOtherTargetX(t){const e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},addXs(t){const e=this,{config:r}=e;Object.keys(t).forEach(a=>{r.data_xs[a]=t[a]})},isMultipleX(){return!this.config.axis_x_forceAsSingle&&(cn(this.config.data_xs)||this.hasType("bubble")||this.hasType("scatter"))},addName(t){const e=this,{config:r}=e;let a;return t&&(a=r.data_names[t.id],t.name=a!==void 0?a:t.id),t},getAllValuesOnIndex(t,e=!1){const r=this;let a=r.filterTargetsToShow(r.data.targets).map(o=>r.addName(r.getValueOnIndex(o.values,t)));return e&&(a=a.filter(o=>o&&"value"in o&&De(o.value))),a},getValueOnIndex(t,e){const r=t.filter(a=>a.index===e);return r.length?r[0]:null},updateTargetX(t,e){const r=this;t.forEach(a=>{a.values.forEach((o,i)=>{o.x=r.generateTargetX(e[i],a.id,i)}),r.data.xs[a.id]=e})},updateTargetXs(t,e){const r=this;t.forEach(a=>{e[a.id]&&r.updateTargetX([a],e[a.id])})},generateTargetX(t,e,r){const a=this,{axis:o}=a;let i=o!=null&&o.isCategorized()?r:t||r;if(o!=null&&o.isTimeSeries()){const s=Kn.bind(a);i=s(t||a.getXValue(e,r))}else o!=null&&o.isCustomX()&&!(o!=null&&o.isCategorized())&&(i=De(t)?+t:a.getXValue(e,r));return i},updateXs(t){t.length&&(this.axis.xs=t.map(e=>e.x))},getPrevX(t){const e=this.axis.xs[t-1];return Qe(e)?e:null},getNextX(t){const e=this.axis.xs[t+1];return Qe(e)?e:null},getBaseValue(t){const e=this,{hasAxis:r}=e.state;let{value:a}=t;return a&&r&&(e.isAreaRangeType(t)?a=e.getRangedData(t,"mid"):e.isBubbleZType(t)&&(a=e.getBubbleZData(a,"y"))),a},getMinMaxValue(t){const e=this.getBaseValue.bind(this);let r,a;return(t||this.data.targets.map(o=>o.values)).forEach((o,i)=>{const s=o.map(e).filter(pe);r=Math.min(i?r:1/0,...s),a=Math.max(i?a:-1/0,...s)}),{min:r,max:a}},getMinMaxData(){const t=this,e=Mn.dataMinMax;let r=t.cache.get(e);if(!r){const a=t.data.targets.map(f=>f.values),o=t.getMinMaxValue(a);let i=[],s=[];const{min:l,max:c}=o;a.forEach(f=>{const g=t.getFilteredDataByValue(f,l),p=t.getFilteredDataByValue(f,c);g.length&&(i=i.concat(g)),p.length&&(s=s.concat(p))}),t.cache.add(e,r={min:i,max:s})}return r},getTotalPerIndex(){const t=this,e=Mn.dataTotalPerIndex;let r=t.cache.get(e);return(t.config.data_groups.length||t.isStackNormalized())&&!r&&(r=[],t.data.targets.forEach(a=>{a.values.forEach((o,i)=>{r[i]||(r[i]=0),r[i]+=~~o.value})})),r},getTotalDataSum(t){const e=this,r=Mn.dataTotalSum;let a=e.cache.get(r);return pe(a)||(a=e.data.targets.reduce((o,i)=>o+i.values.reduce((s,l)=>s+~~l.value,0),0),e.cache.add(r,a)),t&&(a-=e.getHiddenTotalDataSum()),a},getHiddenTotalDataSum(){const t=this,{api:e,state:{hiddenTargetIds:r}}=t;let a=0;return r.length&&(a=e.data.values.bind(e)(r).reduce((o,i)=>o+i)),a},getFilteredDataByValue(t,e){return t.filter(r=>this.getBaseValue(r)===e)},getMaxDataCount(){return Math.max(...this.data.targets.map(t=>t.values.length),0)},getMaxDataCountTarget(){let t=this.filterTargetsToShow()||[];const e=t.length,r=this.config.axis_x_inverted;return e>1?(t=t.map(a=>a.values).reduce((a,o)=>a.concat(o)).map(a=>a.x),t=aa(Ni(t)).map((a,o,i)=>({x:a,index:r?i.length-o-1:o}))):e&&(t=t[0].values.concat()),t},mapToIds(t){return t.map(e=>e.id)},mapToTargetIds(t){const e=this;return t?Ge(t)?t.concat():[t]:e.mapToIds(e.data.targets)},hasTarget(t,e){const r=this.mapToIds(t);for(let a=0,o;o=r[a];a++)if(o===e)return!0;return!1},isTargetToShow(t){return this.state.hiddenTargetIds.indexOf(t)<0},isLegendToShow(t){return this.state.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow(t){const e=this;return(t||e.data.targets).filter(r=>e.isTargetToShow(r.id))},mapTargetsToUniqueXs(t){const e=this,{axis:r}=e;let a=[];return t!=null&&t.length&&(a=Ni(_l(t.map(o=>o.values.map(i=>+i.x)))),a=r!=null&&r.isTimeSeries()?a.map(o=>new Date(+o)):a.map(Number)),aa(a)},addTargetIds(t,e){const{state:r}=this;(Ge(e)?e:[e]).forEach(o=>{r[t].indexOf(o)<0&&r[t].push(o)})},removeTargetIds(t,e){const{state:r}=this;(Ge(e)?e:[e]).forEach(o=>{const i=r[t].indexOf(o);i>=0&&r[t].splice(i,1)})},addHiddenTargetIds(t){this.addTargetIds("hiddenTargetIds",t)},removeHiddenTargetIds(t){this.removeTargetIds("hiddenTargetIds",t)},addHiddenLegendIds(t){this.addTargetIds("hiddenLegendIds",t)},removeHiddenLegendIds(t){this.removeTargetIds("hiddenLegendIds",t)},getValuesAsIdKeyed(t){const e=this,{hasAxis:r}=e.state,a={},o=e.isMultipleX(),i=o?e.mapTargetsToUniqueXs(t).map(s=>Ue(s)?s:+s):null;return t.forEach(s=>{const l=[];s.values.filter(({value:c})=>De(c)||c===null).forEach(c=>{let{value:f}=c;f!==null&&e.isCandlestickType(c)&&(f=Ge(f)?f.slice(0,4):[f.open,f.high,f.low,f.close]),Ge(f)?l.push(...f):ze(f)&&"high"in f?l.push(...Object.values(f)):e.isBubbleZType(c)?l.push(r&&e.getBubbleZData(f,"y")):o?l[e.getIndexByX(c.x,i)]=f:l.push(f)}),a[s.id]=l}),a},checkValueInTargets(t,e){return Object.keys(t).some(r=>t[r].values.some(a=>e(a.value)))},hasMultiTargets(){return this.filterTargetsToShow().length>1},hasNegativeValueInTargets(t){return this.checkValueInTargets(t,e=>e<0)},hasPositiveValueInTargets(t){return this.checkValueInTargets(t,e=>e>0)},orderTargets(t){const e=this,r=[...t],a=e.getSortCompareFn();return a&&r.sort(a),r},getSortCompareFn(t=!1){const e=this,{config:r}=e,a=r.data_order,o=/asc/i.test(a),i=/desc/i.test(a);let s;if(o||i){const l=(f,g)=>f+Math.abs(g.value),c=f=>pe(f)?f:"values"in f?f.values.reduce(l,0):f.value;s=(f,g)=>{const p=c(f),m=c(g);return t?o?p-m:m-p:o?m-p:p-m}}else he(a)&&(s=a.bind(e.api));return s||null},filterByX(t,e){return _l(t.map(r=>r.values)).filter(r=>r.x-e===0)},filterNullish(t){const e=r=>De(r.value);return t&&t.filter(r=>"value"in r?e(r):r.values.some(e))},filterRemoveNull(t){return t.filter(e=>De(this.getBaseValue(e)))},filterByXDomain(t,e){return t.map(r=>({id:r.id,id_org:r.id_org,values:r.values.filter(a=>e[0]<=a.x&&a.x<=e[1])}))},hasDataLabel(){const t=this.config.data_labels;return Mi(t)&&t||rr(t)&&cn(t)},hasNullDataValue(t){return t.some(({value:e})=>e===null)},getDataIndexFromEvent(t){const e=this,{$el:r,config:a,state:{hasRadar:o,inputType:i,eventReceiver:{coords:s,rect:l}}}=e;let c;if(o){let f=t.target;/tspan/i.test(f.tagName)&&(f=f.parentNode);const g=it(f).datum();c=g&&Object.keys(g).length===1?g.index:void 0}else{const f=a.axis_rotated,g=kl(r.chart.node()),p=i==="touch"&&t.changedTouches?t.changedTouches[0]:t;let m=f?p.clientY+g.y:p.clientX+g.x;if(Li(r.svg)){const E=[m,0];f&&E.reverse(),m=Io(r.eventRect.node(),...E)[f?"y":"x"]}else m-=f?l.top:l.left;c=Di(s,m,0,s.length-1,f)}return c},getDataLabelLength(t,e,r){var a;const o=this,i=1.3;return((a=o.getTextRect([t,e].map(s=>o.dataLabelFormat()(s))))==null?void 0:a.map(s=>s[r]*i))||[0,0]},isNoneArc(t){return this.hasTarget(this.data.targets,t.id)},isArc(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},findSameXOfValues(t,e){const r=t[e].x,a=[];let o;for(o=e-1;o>=0&&r===t[o].x;o--)a.push(t[o]);for(o=e;o<t.length&&r===t[o].x;o++)a.push(t[o]);return a},findClosestFromTargets(t,e){const r=this,a=t.map(o=>r.findClosest(o.values,e));return r.findClosest(a,e)},findClosest(t,e){const r=this,{$el:{main:a}}=r,o=t.filter(l=>l&&De(l.value));let i,s;return o.filter(l=>r.isBarType(l.id)||r.isCandlestickType(l.id)).forEach(l=>{const c=r.isBarType(l.id)?`.${zn.chartBar}.${Se.target}${r.getTargetSelectorSuffix(l.id)} .${zn.bar}-${l.index}`:`.${fr.chartCandlestick}.${Se.target}${r.getTargetSelectorSuffix(l.id)} .${fr.candlestick}-${l.index} path`;!s&&r.isWithinBar(a.select(c).node())&&(s=l)}),o.filter(l=>!r.isBarType(l.id)&&!r.isCandlestickType(l.id)).forEach(l=>{const c=r.dist(l,e);i=r.getPointSensitivity(l),c<i&&(i=c,s=l)}),s},dist(t,e){const r=this,{config:{axis_rotated:a},scale:o}=r,i=+a,s=+!a,l=r.circleY(t,t.index),c=(o.zoom||o.x)(t.x);return Math.sqrt(Math.pow(c-e[i],2)+Math.pow(l-e[s],2))},convertValuesToStep(t){const e=this,{axis:r,config:a}=e,o=a.line_step_type,i=r?r.isCategorized():!1,s=Ge(t)?t.concat():[t];if(!(i||/step\-(after|before)/.test(o)))return t;if(s.length){const l=s[0],c=s[s.length-1],{id:f}=l;let{x:g}=l;s.unshift({x:--g,value:l.value,id:f}),i&&o==="step-after"&&s.unshift({x:--g,value:l.value,id:f}),g=c.x,s.push({x:++g,value:c.value,id:f}),i&&o==="step-before"&&s.push({x:++g,value:c.value,id:f})}return s},convertValuesToRange(t){const e=Ge(t)?t.concat():[t],r=[];return e.forEach(a=>{const{x:o,id:i}=a;r.push({x:o,id:i,value:a.value[0]}),r.push({x:o,id:i,value:a.value[2]})}),r},updateDataAttributes(t,e){const r=this,{config:a}=r,o=a[`data_${t}`];return ln(e)||(Object.keys(e).forEach(i=>{o[i]=e[i]}),r.redraw({withLegend:!0})),o},getRangedData(t,e="",r="areaRange"){const a=t==null?void 0:t.value;if(Ge(a)){if(r==="bar")return a.reduce((o,i)=>i-o);{const o={areaRange:["high","mid","low"],candlestick:["open","high","low","close","volume"]}[r].indexOf(e);return o>=0&&a?a[o]:void 0}}else if(a&&e)return a[e];return a},setRatioForGroupedData(t){const e=this,{config:r}=e;if(r.data_groups.length&&t.some(a=>e.isGrouped(a.id))){const a=o=>e.getRatio("index",o,!0);t.forEach(o=>{"values"in o?o.values.forEach(a):a(o)})}},getRatio(t,e,r=!1){const a=this,{config:o,state:i}=a,s=a.api;let l=0;if(e&&s.data.shown().length)if(l=e.ratio||e.value,t==="arc")if(a.pie.padAngle()())l=e.value/a.getTotalDataSum(!0);else{const c=o.gauge_fullCircle?a.getArcLength():a.getStartingAngle()*-2,f=a.hasType("gauge")?c:Math.PI*2;l=(e.endAngle-e.startAngle)/f}else if(t==="index"){const c=s.data.values.bind(s);let f=this.getTotalPerIndex();if(i.hiddenTargetIds.length){let p=c(i.hiddenTargetIds,!1);p.length&&(p=p.reduce((m,E)=>m.map((w,U)=>~~w+E[U])),f=f.map((m,E)=>m-p[E]))}const g=f[e.index];e.ratio=pe(e.value)&&f&&g?e.value/g:0,l=e.ratio}else if(t==="radar")l=parseFloat(String(Math.max(e.value,0)))/i.current.dataMax*o.radar_size_ratio;else if(t==="bar"){const f=a.getYScaleById.bind(a)(e.id).domain().reduce((g,p)=>p-g);l=f===0?0:Math.abs(a.getRangedData(e,null,t)/f)}else t==="treemap"&&(l/=a.getTotalDataSum(!0));return r&&l?l*100:l},updateDataIndexByX(t){const e=this,r=t.reduce((a,o,i)=>(a[Number(o.x)]=i,a),{});e.data.targets.forEach(a=>{a.values.forEach((o,i)=>{let s=r[Number(o.x)];s===void 0&&(s=i),o.index=s})})},isBubbleZType(t){return this.isBubbleType(t)&&(ze(t.value)&&("z"in t.value||"y"in t.value)||Ge(t.value)&&t.value.length>=2)},isBarRangeType(t){const e=this,{value:r}=t;return e.isBarType(t)&&Ge(r)&&r.length>=2&&r.every(pe)},getDataById(t){var e;const r=this.cache.get(t)||this.api.data(t);return(e=r==null?void 0:r[0])!=null?e:r}};function hc(t,e=!1){const r=this,{api:a}=r;e&&r.api.flush(!0),t==null||t.call(a)}var Xg={load(t,e){const r=this,{axis:a,data:o,org:i,scale:s}=r,{append:l}=e,c={domain:null,currentDomain:null,x:null};let f=t;f&&(e.filter&&(f=f.filter(e.filter)),(e.type||e.types)&&f.forEach(g=>{var p;const m=((p=e.types)==null?void 0:p[g.id])||e.type;r.setTargetType(g.id,m)}),o.targets.forEach(g=>{for(let p=0;p<f.length;p++)if(g.id===f[p].id){g.values=l?g.values.concat(f[p].values):f[p].values,f.splice(p,1);break}}),o.targets=o.targets.concat(f)),r.updateTargets(o.targets),s.zoom&&(c.x=a.isCategorized()?s.x.orgScale():(i.xScale||s.x).copy(),c.domain=r.getXDomain(o.targets),c.x.domain(c.domain),c.currentDomain=r.zoom.getDomain(),r.withinRange(c.currentDomain,void 0,c.domain)||(s.x.domain(c.domain),s.zoom=null,r.$el.eventRect.property("__zoom",null))),r.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),s.zoom?(i.xDomain=c.domain,i.xScale=c.x,a.isCategorized()&&(c.currentDomain=r.getZoomDomainValue(c.currentDomain),i.xDomain=r.getZoomDomainValue(i.xDomain),i.xScale=c.x.domain(i.xDomain)),r.updateCurrentZoomTransform(c.x,c.currentDomain)):i.xScale&&i.xScale.domain(i.xDomain),r.updateTypesElements(),hc.call(r,e.done,e.resizeAfter)},loadFromArgs(t){const e=this;e.config&&(e.cache.reset(),e.convertData(t,r=>{const a=t.data||r;t.append&&(a.__append__=!0),a&&e.load(e.convertDataToTargets.call(e,a),t)}))},unload(t,e){var r;const a=this,{state:o,$el:i,$T:s}=a,l=!!((r=a.hasLegendDefsPoint)!=null&&r.call(a));let c=e,f=t;if(a.cache.reset(),c||(c=()=>{}),f=f.filter(p=>a.hasTarget(a.data.targets,p)),!f||f.length===0){c();return}const g=i.svg.selectAll(f.map(p=>a.selectorTarget(p)));s(g).style("opacity","0").remove().call(bo,c),f.forEach(p=>{var m;const E=a.getTargetSelectorSuffix(p);o.withoutFadeIn[p]=!1,i.legend&&i.legend.selectAll(`.${Ke.legendItem}${E}`).remove(),a.data.targets=a.data.targets.filter(w=>w.id!==p),l&&((m=i.defs)==null||m.select(`#${a.getDefsPointId(E)}`).remove())}),o.hasFunnel&&a.updateFunnel(a.data.targets),o.hasTreemap&&a.updateTargetsForTreemap(a.data.targets),a.updateTypesElements()}},Oo=(t=>()=>t);function Wi(t,{sourceEvent:e,subject:r,target:a,identifier:o,active:i,x:s,y:l,dx:c,dy:f,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:g}})}Wi.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Hg(t){return!t.ctrlKey&&!t.button}function Wg(){return this.parentNode}function Yg(t,e){return e==null?{x:t.x,y:t.y}:e}function Kg(){return navigator.maxTouchPoints||"ontouchstart"in this}function vc(){var t=Hg,e=Wg,r=Yg,a=Kg,o={},i=oo("start","drag","end"),s=0,l,c,f,g,p=0;function m(K){K.on("mousedown.drag",E).filter(a).on("touchstart.drag",N).on("touchmove.drag",D,nh).on("touchend.drag touchcancel.drag",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(K,nt){if(!(g||!t.call(this,K,nt))){var Q=J(this,e.call(this,K,nt),K,nt,"mouse");Q&&(it(K.view).on("mousemove.drag",w,Ea).on("mouseup.drag",U,Ea),di(K.view),fi(K),f=!1,l=K.clientX,c=K.clientY,Q("start",K))}}function w(K){if(Jr(K),!f){var nt=K.clientX-l,Q=K.clientY-c;f=nt*nt+Q*Q>p}o.mouse("drag",K)}function U(K){it(K.view).on("mousemove.drag mouseup.drag",null),hi(K.view,f),Jr(K),o.mouse("end",K)}function N(K,nt){if(t.call(this,K,nt)){var Q=K.changedTouches,ot=e.call(this,K,nt),pt=Q.length,Tt,yt;for(Tt=0;Tt<pt;++Tt)(yt=J(this,ot,K,nt,Q[Tt].identifier,Q[Tt]))&&(fi(K),yt("start",K,Q[Tt]))}}function D(K){var nt=K.changedTouches,Q=nt.length,ot,pt;for(ot=0;ot<Q;++ot)(pt=o[nt[ot].identifier])&&(Jr(K),pt("drag",K,nt[ot]))}function Y(K){var nt=K.changedTouches,Q=nt.length,ot,pt;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),ot=0;ot<Q;++ot)(pt=o[nt[ot].identifier])&&(fi(K),pt("end",K,nt[ot]))}function J(K,nt,Q,ot,pt,Tt){var yt=i.copy(),lt=Wn(Tt||Q,nt),jt,vt,tt;if((tt=r.call(K,new Wi("beforestart",{sourceEvent:Q,target:m,identifier:pt,active:s,x:lt[0],y:lt[1],dx:0,dy:0,dispatch:yt}),ot))!=null)return jt=tt.x-lt[0]||0,vt=tt.y-lt[1]||0,function St(ct,At,Wt){var Dt=lt,Zt;switch(ct){case"start":o[pt]=St,Zt=s++;break;case"end":delete o[pt],--s;case"drag":lt=Wn(Wt||At,nt),Zt=s;break}yt.call(ct,K,new Wi(ct,{sourceEvent:At,subject:tt,target:m,identifier:pt,active:Zt,x:lt[0]+jt,y:lt[1]+vt,dx:lt[0]-Dt[0],dy:lt[1]-Dt[1],dispatch:yt}),ot)}}return m.filter=function(K){return arguments.length?(t=typeof K=="function"?K:Oo(!!K),m):t},m.container=function(K){return arguments.length?(e=typeof K=="function"?K:Oo(K),m):e},m.subject=function(K){return arguments.length?(r=typeof K=="function"?K:Oo(K),m):r},m.touchable=function(K){return arguments.length?(a=typeof K=="function"?K:Oo(!!K),m):a},m.on=function(){var K=i.on.apply(i,arguments);return K===i?m:K},m.clickDistance=function(K){return arguments.length?(p=(K=+K)*K,m):Math.sqrt(p)},m}var Zg={setExpand(t,e,r){const a=this,{config:o,$el:{circle:i}}=a;i&&o.point_focus_expand_enabled&&a.expandCircles(t,e,r),a.expandBarTypeShapes(!0,t,e,r)},expandBarTypeShapes(t=!0,e,r,a){const o=this;["bar","candlestick"].filter(i=>o.$el[i]).forEach(i=>{a&&o.$el[i].classed(Se.EXPANDED,!1),o.getShapeByIndex(i,e,r).classed(Se.EXPANDED,t)})},setOverOut(t,e){const r=this,{config:a,state:{hasFunnel:o,hasRadar:i,hasTreemap:s},$el:{main:l}}=r,c=ze(e);if(c||e!==-1){const f=a[t?"data_onover":"data_onout"].bind(r.api);if(a.color_onover&&r.setOverColor(t,e,c),c){const g=r.getTargetSelectorSuffix(e.id),p=o||s?`${Se.target+g} .${sn.shape}`:Ve.arc+g;f(e,l.select(`.${p}`).node())}else if(a.tooltip_grouped)t&&(i&&r.isPointFocusOnly()?r.showCircleFocus(r.getAllValuesOnIndex(e,!0)):r.setExpand(e,null,!0)),!r.isMultipleX()&&l.selectAll(`.${sn.shape}-${e}`).each(function(g){f(g,this)});else{const g=r.cache.get(Mn.setOverOut)||[],p=l.selectAll(`.${sn.shape}-${e}`).filter(function(E){return r.isWithinShape(this,E)}),m=p.filter(function(){return g.every(E=>E!==this)});if(!t||p.empty()||g.length===m.size()&&m.nodes().every((E,w)=>E!==g[w]))for(;g.length;){const E=g.pop();a.data_onout.bind(r.api)(it(E).datum(),E)}m.each(function(){t&&(f(it(this).datum(),this),g.push(this))}),r.cache.add(Mn.setOverOut,g)}}},callOverOutForTouch(t){const e=this,r=e.cache.get(Mn.callOverOutForTouch);(ze(t)&&r?t.id!==r.id:t!==r)&&((r||pe(r))&&e.setOverOut(!1,r),(t||pe(t))&&e.setOverOut(!0,t),e.cache.add(Mn.callOverOutForTouch,t))},getDraggableSelection(){const t=this,{config:e,state:r}=t;return e.interaction_enabled&&e.data_selection_draggable&&t.drag?vc().on("drag",function(a){r.event=a,t.drag(Yn(a,this))}).on("start",function(a){r.event=a,t.dragstart(Yn(a,this))}).on("end",a=>{r.event=a,t.dragend()}):()=>{}},dispatchEvent(t,e,r){var a,o,i;const s=this,{config:l,state:{eventReceiver:c,hasAxis:f,hasFunnel:g,hasRadar:p,hasTreemap:m},$el:{eventRect:E,funnel:w,radar:U,svg:N,treemap:D}}=s;let Y=(i=(o=(g||m)&&c.rect||p&&U.axes.select(`.${vn.axis}-${e} text`)||E||((a=s.getArcElementByIdOrIndex)==null?void 0:a.call(s,e)))==null?void 0:o.node)==null?void 0:i.call(o);if(Y){const J=s.isMultipleX(),K=l.axis_rotated;let{width:nt,left:Q,top:ot}=mn(Y);if(f&&!p&&!J){const lt=c.coords[e];lt?(nt=lt.w,Q+=lt.x,ot+=lt.y):(nt=0,Q=0,ot=0)}let pt=Q+(r?r[0]:0)+(J||K?0:nt/2),Tt=ot+(r?r[1]:0)+(K?4:0);if(Li(N)){const lt=Io(s.$el.eventRect.node(),pt,Tt,!1);pt=lt.x,Tt=lt.y}const yt={screenX:pt,screenY:Tt,clientX:pt,clientY:Tt,bubbles:p};(g||m)&&(Y=(w!=null?w:D).node()),lg[/^(mouse|click)/.test(t)?"mouse":"touch"](Y,t,yt)}},setDragStatus(t){this.state.dragging=t},unbindZoomEvent(){const t=this,{$el:{eventRect:e,zoomResetBtn:r}}=t;e==null||e.on(".zoom wheel.zoom .drag",null),r==null||r.on("click",null).style("display","none")},unbindAllEvents(){var t;const e=this,{$el:{arcs:r,eventRect:a,legend:o,region:i,svg:s,treemap:l},brush:c}=e,f=["wheel","click","mouseover","mousemove","mouseout","touchstart","touchmove","touchend","touchstart.eventRect","touchmove.eventRect","touchend.eventRect",".brush",".drag",".zoom","wheel.zoom","dblclick.zoom"].join(" ");[s,a,i==null?void 0:i.list,c==null?void 0:c.getSelection(),r==null?void 0:r.selectAll("path"),o==null?void 0:o.selectAll("g"),l].forEach(g=>g==null?void 0:g.on(f,null)),(t=e.unbindZoomEvent)==null||t.call(e)}},Jg={categoryName(t){var e;const{axis_x_categories:r}=this.config;return(e=r==null?void 0:r[t])!=null?e:t}},Qg={generateClass(t,e){return` ${t} ${t+this.getTargetSelectorSuffix(e)}`},getClass(t,e){const r=/s$/.test(t),a=/^(area|arc|line|funnel|treemap)s?$/.test(t),o=r?"id":"index";return i=>{const s=i.data||i;return((e?this.generateClass(je[r?"shapes":"shape"],s[o]):"")+this.generateClass(je[t],s[a?"id":o])).trim()}},getChartClass(t){return e=>je[`chart${t}`]+this.classTarget((e.data?e.data:e).id)},generateExtraLineClass(){const e=this.config.line_classes||[],r=[];return function(a){var o;const i=a.id||((o=a.data)==null?void 0:o.id)||a;return r.indexOf(i)<0&&r.push(i),e[r.indexOf(i)%e.length]}},classRegion(t,e){return`${this.generateClass(je.region,e)} ${"class"in t?t.class:""}`},classTarget(t){const e=this.config.data_classes[t];let r="";return e&&(r=` ${je.target}-${e}`),this.generateClass(je.target,t)+r},classFocus(t){return this.classFocused(t)+this.classDefocused(t)},classFocused(t){return` ${this.state.focusedTargetIds.indexOf(t.id)>=0?je.focused:""}`},classDefocused(t){return` ${this.state.defocusedTargetIds.indexOf(t.id)>=0?je.defocused:""}`},getTargetSelectorSuffix(t){return(t||t===0?`-${t}`:"").replace(/[\x00-\x20\x7F-\xA0\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-")},selectorTarget(t,e="",r=""){const a=this.getTargetSelectorSuffix(t);return`${e}.${je.target+a} ${r}, ${e}.${je.circles+a} ${r}`},selectorTargets(t,e){const r=t||[];return r.length?r.map(a=>this.selectorTarget(a,e)):null},selectorLegend(t){return`.${je.legendItem+this.getTargetSelectorSuffix(t)}`},selectorLegends(t){return t!=null&&t.length?t.map(e=>this.selectorLegend(e)):null}};class gc extends Map{constructor(e,r=yc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[a,o]of e)this.set(a,o)}get(e){return super.get(Yi(this,e))}has(e){return super.has(Yi(this,e))}set(e,r){return super.set(pc(this,e),r)}delete(e){return super.delete(mc(this,e))}}class P1 extends Set{constructor(e,r=yc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const a of e)this.add(a)}has(e){return super.has(Yi(this,e))}add(e){return super.add(pc(this,e))}delete(e){return super.delete(mc(this,e))}}function Yi({_intern:t,_key:e},r){const a=e(r);return t.has(a)?t.get(a):r}function pc({_intern:t,_key:e},r){const a=e(r);return t.has(a)?t.get(a):(t.set(a,r),r)}function mc({_intern:t,_key:e},r){const a=e(r);return t.has(a)&&(r=t.get(a),t.delete(a)),r}function yc(t){return t!==null&&typeof t=="object"?t.valueOf():t}function oa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function M1(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const xc=Symbol("implicit");function Tc(){var t=new gc,e=[],r=[],a=xc;function o(i){let s=t.get(i);if(s===void 0){if(a!==xc)return a;t.set(i,s=e.push(i)-1)}return r[s%r.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new gc;for(const s of i)t.has(s)||t.set(s,e.push(s)-1);return o},o.range=function(i){return arguments.length?(r=Array.from(i),o):r.slice()},o.unknown=function(i){return arguments.length?(a=i,o):a},o.copy=function(){return Tc(e,r).unknown(a)},oa.apply(o,arguments),o}const kg=(t,e,r)=>{const a=it(t.cloneNode(!0));return a.attr("id",r).insert("rect",":first-child").attr("width",a.attr("width")).attr("height",a.attr("height")).style("fill",e),{id:r,node:a.node()}};function qg(t){const e=Mn.colorPattern,{body:r}=pn;let a=r[e];if(!a){const i=t.classed(ci.colorPattern,!0).style("background-image");t.classed(ci.colorPattern,!1),i.indexOf(";")>-1&&(a=i.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(";").map(s=>s.trim().replace(/[\"'\s]/g,"")).filter(Boolean),r[e]=a)}return a}const _g=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];var tp={generateColor(){const t=this,{$el:e,config:r}=t,a=[];let o=cn(r.color_pattern)?r.color_pattern:Tc(qg(e.chart)||_g).range();const i=o;if(he(r.color_tiles)){const s=r.color_tiles.bind(t.api)(),l=o.map((c,f)=>{const g=c.replace(/[#\(\)\s,]/g,""),p=`${t.state.datetimeId}-pattern-${g}-${f}`;return kg(s[f%s.length],c,p)});o=l.map(c=>`url(#${c.id})`),t.patterns=l}return function(s){var l;const c=r.data_colors,f=r.data_color,g=s.id||((l=s.data)==null?void 0:l.id)||s,p=t.isTypeOf(g,["line","spline","step"])||!r.data_types[g];let m;return he(c[g])?m=c[g].bind(t.api)(s):c[g]?m=c[g]:(a.indexOf(g)<0&&a.push(g),m=p?i[a.indexOf(g)%i.length]:o[a.indexOf(g)%o.length],c[g]=m),he(f)?f.bind(t.api)(m,s):m}},generateLevelColor(){const t=this,{config:e}=t,r=e.color_pattern,a=e.color_threshold,o=a.unit==="value",i=a.max||100,s=a.values&&a.values.length?a.values:[];return cn(a)?function(l){const c=o?l:l*100/i;let f=r[r.length-1];for(let g=0,p=s.length;g<p;g++)if(c<=s[g]){f=r[g];break}return f}:null},generateTextBGColorFilter(t,e={x:0,y:0,width:1,height:1}){const r=this,{$el:{defs:a},state:o}=r;if(t){let i=[];Ue(t)?i.push(""):ze(t)?i=Object.keys(t):he(t)&&(i=r.mapToTargetIds()),i.forEach(s=>{const l=`${o.datetimeId}-labels-bg${r.getTargetSelectorSuffix(s)}${Ue(t)?r.getTargetSelectorSuffix(t):""}`,c=s===""?t:(t==null?void 0:t[s])||"";a.select(`#${l}`).empty()&&a.append("filter").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height).attr("id",l).html(`<feFlood flood-color="${c}" />
|
|
42
|
-
<feComposite in="SourceGraphic" />`)})}},getGradienColortUrl(t){return`url(#${this.state.datetimeId}-gradient${this.getTargetSelectorSuffix(t)})`},updateLinearGradient(){const t=this,{config:e,data:{targets:r},state:{datetimeId:a},$el:{defs:o}}=t;r.forEach(i=>{const s=`${a}-gradient${t.getTargetSelectorSuffix(i.id)}`,l=t.hasPointType()&&e.point_radialGradient,c=t.isAreaType(i)&&"area"||t.isBarType(i)&&"bar";if((l||c)&&o.select(`#${s}`).empty()){const f=t.color(i),g={defs:null,stops:[]};if(l){const{cx:p=.3,cy:m=.3,r:E=.7,stops:w=[[.1,f,0],[.9,f,1]]}=l;g.stops=w,g.defs=o.append("radialGradient").attr("id",`${s}`).attr("cx",p).attr("cy",m).attr("r",E)}else{const p=e.axis_rotated,{x:m=p?[1,0]:[0,0],y:E=p?[0,0]:[0,1],stops:w=[[0,f,1],[1,f,0]]}=e[`${c}_linearGradient`];g.stops=w,g.defs=o.append("linearGradient").attr("id",`${s}`).attr("x1",m[0]).attr("x2",m[1]).attr("y1",E[0]).attr("y2",E[1])}g.stops.forEach(p=>{const[m,E,w]=p,U=he(E)?E.bind(t.api)(i.id):E;g.defs&&g.defs.append("stop").attr("offset",m).attr("stop-color",U||f).attr("stop-opacity",w)})}})},setOverColor(t,e){const r=this,{config:a,$el:{main:o}}=r,i=a.color_onover;let s=t?i:r.color;ze(s)?s=({id:l})=>l in i?i[l]:r.color(l):Ue(s)?s=()=>i:he(i)&&(s=s.bind(r.api)),o.selectAll(ze(e)?`.${Ve.arc}${r.getTargetSelectorSuffix(e.id)}`:`.${sn.shape}-${e}`).style("fill",s)}},ep={getYDomainMinMax(t,e){const r=this,{axis:a,config:o}=r,i=e==="min",s=o.data_groups,l=r.mapToIds(t),c=r.getValuesAsIdKeyed(t);if(s.length>0){const f=r[`has${i?"Negative":"Positive"}ValueInTargets`](t);s.forEach(g=>{const p=g.filter(m=>l.indexOf(m)>=0);if(p.length){const m=p[0],E=a.getId(m);f&&c[m]&&(c[m]=c[m].map(w=>(i?w<0:w>0)?w:0)),p.filter((w,U)=>U>0).forEach(w=>{if(c[w]){const U=a.getId(w);c[w].forEach((N,D)=>{const Y=+N,J=i?Y>0:Y<0;U===E&&!(f&&J)&&(c[m][D]+=Y)})}})}})}return tr(e,Object.keys(c).map(f=>tr(e,c[f])))},isHiddenTargetWithYDomain(t){const e=this;return e.state.hiddenTargetIds.some(r=>e.axis.getId(r)===t)},getYDomain(t,e,r){const a=this,{axis:o,config:i,scale:s}=a,l=`axis_${e}`;if(a.isStackNormalized())return[0,100];const c=(s==null?void 0:s[e])&&s[e].type==="log",f=t.filter(yt=>o.getId(yt.id)===e),g=r?a.filterByXDomain(f,r):f;if(g.length===0)return a.isHiddenTargetWithYDomain(e)?s[e].domain():e==="y2"?s.y.domain():a.getYDomain(t,"y2",r);const p=i[`${l}_min`],m=i[`${l}_max`],E=i[`${l}_center`],w=i[`${l}_inverted`],U=a.hasDataLabel()&&i.axis_rotated,N=a.hasDataLabel()&&!i.axis_rotated;let D=a.getYDomainMinMax(g,"min"),Y=a.getYDomainMinMax(g,"max"),J=[se.BAR,se.BUBBLE,se.SCATTER,...Ar.Line].some(yt=>{const lt=yt.indexOf("area")>-1?"area":yt;return a.hasType(yt,g,!0)&&i[`${lt}_zerobased`]});D=De(p)?p:De(m)?D<=m?D:m-10:D,Y=De(m)?m:De(p)?p<=Y?Y:p+10:Y,isNaN(D)&&(D=0),isNaN(Y)&&(Y=D),D===Y&&(D<0?Y=0:D=0);const K=D>=0&&Y>=0,nt=D<=0&&Y<=0;(De(p)&&K||De(m)&&nt)&&(J=!1),J&&(K&&(D=0),nt&&(Y=0));const Q=Math.abs(Y-D);let ot={top:Q*.1,bottom:Q*.1};if(Qe(E)){const yt=Math.max(Math.abs(D),Math.abs(Y));Y=E+yt,D=E-yt}if(U){const yt=Nr(s.y.range()),lt=a.getDataLabelLength(D,Y,"width").map(jt=>{const vt=jt/yt;return isFinite(vt)?vt:0});["bottom","top"].forEach((jt,vt)=>{ot[jt]+=Q*(lt[vt]/(1-lt[0]-lt[1]))})}else if(N){const yt=a.getDataLabelLength(D,Y,"height");["bottom","top"].forEach((lt,jt)=>{ot[lt]+=a.convertPixelToScale("y",yt[jt],Q)})}ot=a.getResettedPadding(ot);const pt=i[`${l}_padding`];cn(pt)&&["bottom","top"].forEach(yt=>{ot[yt]=o.getPadding(pt,yt,ot[yt],Q)}),J&&(K&&(ot.bottom=D),nt&&(ot.top=-Y));const Tt=c?[D,Y].map(yt=>yt<0?0:yt):[D-ot.bottom,Y+ot.top];return w?Tt.reverse():Tt},getXDomainMinMax(t,e){var r;const a=this,o=a.config[`axis_x_${e}`],i=tr(e,t.map(l=>tr(e,l.values.map(c=>c.x))));let s=ze(o)?o.value:o;return s=Qe(s)&&((r=a.axis)!=null&&r.isTimeSeries())?Kn.bind(this)(s):s,ze(o)&&o.fit&&(e==="min"&&s<i||e==="max"&&s>i)&&(s=void 0),Qe(s)?s:i},getXDomainPadding(t,e){const r=this,{axis:a,config:o}=r,i=o.axis_x_padding,s=a.isTimeSeries()&&e,l=Nr(t);let c;if(a.isCategorized()||s)c=0;else if(r.hasType("bar")){const p=r.getMaxDataCount();c=p>1?l/(p-1)/2:.5}else c=r.getResettedPadding(l*.01);let{left:f=c,right:g=c}=pe(i)?{left:i,right:i}:i;if(i.unit==="px"){const p=Math.abs(l+l*.2);f=a.getPadding(i,"left",c,p),g=a.getPadding(i,"right",c,p)}else{const p=l+f+g;if(s&&p){const m=l/e/p;f=f/p/m,g=g/p/m}}return{left:f,right:g}},getXDomain(t){const e=this,{axis:r,config:a,scale:{x:o}}=e,i=a.axis_x_inverted,s=[e.getXDomainMinMax(t,"min"),e.getXDomainMinMax(t,"max")];let[l=0,c=0]=s;if(o.type!=="log"){const f=r.isCategorized(),g=r.isTimeSeries(),p=e.getXDomainPadding(s);let[m,E]=s;m-E===0&&!f&&(g?(m=new Date(m.getTime()*.5),E=new Date(E.getTime()*1.5)):(m=m===0?1:m*.5,E=E===0?-1:E*1.5)),(m||m===0)&&(l=g?new Date(m.getTime()-p.left):m-p.left),(E||E===0)&&(c=g?new Date(E.getTime()+p.right):E+p.right)}return i?[c,l]:[l,c]},updateXDomain(t,e,r,a,o){var i;const s=this,{config:l,org:c,scale:{x:f,subX:g}}=s,p=l.zoom_enabled;if(r&&(f.domain(o||aa(s.getXDomain(t),!l.axis_x_inverted)),c.xDomain=f.domain(),g.domain(f.domain()),(i=s.brush)==null||i.scale(g)),e){const m=o||!s.brush||Ql(s)?c.xDomain:Zl(s).map(g.invert);f.domain(m)}return(r||e)&&p&&s.zoom.updateScaleExtent(),a&&f.domain(s.trimXDomain(f.orgDomain())),f.domain()},trimXDomain(t){const e=this,r=e.config.axis_x_inverted,a=e.getZoomDomain(),[o,i]=a;return(r?t[0]>=o:t[0]<=o)&&(t[1]=+t[1]+(o-t[0]),t[0]=o),(r?t[1]<=i:t[1]>=i)&&(t[0]=+t[0]-(t[1]-i),t[1]=i),t},getZoomDomain(t="zoom",e=!1){const r=this,{config:a,scale:o,org:i}=r;let[s,l]=e&&o[t]?o[t].domain():i.xDomain;return t==="zoom"&&(Qe(a.zoom_x_min)&&(s=tr("min",[s,a.zoom_x_min])),Qe(a.zoom_x_max)&&(l=tr("max",[l,a.zoom_x_max]))),[s,l]},getZoomDomainValue(t){const e=this,{config:r,axis:a}=e;if(a.isCategorized()&&Array.isArray(t)){const o=r.axis_x_inverted;return t.map((s,l)=>Number(s)+(l===0?+o:+!o))}return t},convertPixelToScale(t,e,r){const a=this,{config:o,state:i}=a,s=o.axis_rotated;let l;return t==="x"?l=s?"height":"width":l=s?"width":"height",r*(e/i[l])},withinRange(t,e=[0,0],r){const o=this.config.axis_x_inverted,[i,s]=r;if(Array.isArray(t)){const l=[...t];if(o&&l.reverse(),l[0]<l[1])return t.every((c,f)=>(f===0?o?+c<=i:+c>=i:o?+c>=s:+c<=s)&&!t.every((g,p)=>g===e[p]))}return!1}};function Sc(t,e,r){const{config:a}=t,o=`axis_${e}_tick_format`;return(a[o]?a[o]:t.defaultValueFormat).call(t.api,r)}var np={yFormat(t){return Sc(this,"y",t)},y2Format(t){return Sc(this,"y2",t)},getDefaultValueFormat(){const t=this,{defaultArcValueFormat:e,yFormat:r,y2Format:a}=t,o=t.hasArcType(null,["gauge","polar","radar"]);return function(i,s,l){return(o?e:t.axis&&t.axis.getId(l)==="y2"?a:r).call(t,i,s)}},defaultValueFormat(t){return Ge(t)?t.join("~"):De(t)?+t:""},defaultArcValueFormat(t,e){return`${(e*100).toFixed(1)}%`},defaultPolarValueFormat(t){return`${t}`},dataLabelFormat(t){const e=this,r=e.config.data_labels,a=i=>{let l=i;return Ge(i)?l=i.join("~"):ze(i)&&(l=Object.values(i).join("~")),l};let o=a;return he(r.format)?o=r.format:rr(r.format)&&(r.format[t]?o=r.format[t]===!0?a:r.format[t]:o=()=>""),o.bind(e.api)}};function Co(t){const e=this,r=e.getDataById(t);return e.levelColor?e.levelColor(r.values[0].value):e.color(r)}function Ki(t,e=!0){var r;const{config:a}=this;let o=(r=a.data_names[t])!=null?r:t;return e&&he(a.legend_format)&&(o=a.legend_format(o,t!==o?t:void 0)),o}var rp={initLegend(){const t=this,{config:e,$el:r}=t;t.legendItemTextBox={},t.state.legendHasRendered=!1,e.legend_show?(e.legend_contents_bindto||(r.legend=t.$el.svg.append("g").classed(Ke.legend,!0).attr("transform",t.getTranslate("legend"))),t.updateLegend()):t.state.hiddenLegendIds=t.mapToIds(t.data.targets)},updateLegend(t,e,r){var a;const o=this,{config:i,state:s,scale:l,$el:c}=o,f=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};f.withTransition=$r(f,"withTransition",!0),f.withTransitionForTransform=$r(f,"withTransitionForTransform",!0),i.legend_contents_bindto&&i.legend_contents_template?o.updateLegendTemplate():s.hasTreemap||o.updateLegendElement(t||o.mapToIds(o.data.targets),f,r),(a=c.legend)==null||a.selectAll(`.${Ke.legendItem}`).classed(Ke.legendItemHidden,function(g){const p=!o.isTargetToShow(g);return p&&(this.style.opacity=null),p}),o.updateScales(!1,!l.zoom),o.updateSvgSize(),o.transformAll(f.withTransitionForTransform,r),s.legendHasRendered=!0},updateLegendTemplate(){const t=this,{config:e,$el:r}=t,a=it(e.legend_contents_bindto),o=e.legend_contents_template;if(!a.empty()){const i=t.mapToIds(t.data.targets),s=[];let l="";i.forEach(f=>{const g=he(o)?o.bind(t.api)(f,t.color(f),t.api.data(f)[0].values):Na(o,{COLOR:t.color(f),TITLE:f});g&&(s.push(f),l+=g)});const c=a.html(l).selectAll(function(){return this.childNodes}).data(s);t.setLegendItem(c),r.legend=a}},updateSizeForLegend(t){const e=this,{config:r,state:{isLegendTop:a,isLegendLeft:o,isLegendRight:i,isLegendInset:s,current:l}}=e,{width:c,height:f}=t,g={top:a?e.getCurrentPaddingByDirection("top")+r.legend_inset_y+5.5:l.height-f-e.getCurrentPaddingByDirection("bottom")-r.legend_inset_y,left:o?e.getCurrentPaddingByDirection("left")+r.legend_inset_x+.5:l.width-c-e.getCurrentPaddingByDirection("right")-r.legend_inset_x+.5};e.state.margin3={top:i?0:s?g.top:l.height-f,right:NaN,bottom:0,left:i?l.width-c:s?g.left:0}},transformLegend(t){const e=this,{$el:{legend:r},$T:a}=e;a(r,t).attr("transform",e.getTranslate("legend"))},updateLegendStep(t){this.state.legendStep=t},updateLegendItemWidth(t){this.state.legendItemWidth=t},updateLegendItemHeight(t){this.state.legendItemHeight=t},updateLegendItemColor(t,e){const{legend:r}=this.$el;r&&r.select(`.${Ke.legendItem}-${t} line`).style("stroke",e)},getLegendWidth(){const t=this,{current:{width:e},isLegendRight:r,isLegendInset:a,legendItemWidth:o,legendStep:i}=t.state;return t.config.legend_show?r||a?o*(i+1):e:0},getLegendHeight(){var t;const e=this,{current:r,isLegendRight:a,legendItemHeight:o,legendStep:i}=e.state,s=((t=e.config.padding)==null?void 0:t.mode)==="fit";return e.config.legend_show?a?r.height:Math.max(s?10:20,o)*(i+1):0},opacityForUnfocusedLegend(t){return t.classed(Ke.legendItemHidden)?null:"0.3"},toggleFocusLegend(t,e){const r=this,{$el:{legend:a},$T:o}=r,i=r.mapToTargetIds(t);a&&o(a.selectAll(`.${Ke.legendItem}`).filter(s=>i.indexOf(s)>=0).classed(qe.legendItemFocused,e)).style("opacity",function(){return e?null:r.opacityForUnfocusedLegend.call(r,it(this))})},revertLegend(){const t=this,{$el:{legend:e},$T:r}=t;e&&r(e.selectAll(`.${Ke.legendItem}`).classed(qe.legendItemFocused,!1)).style("opacity",null)},showLegend(t){const e=this,{config:r,$el:a,$T:o}=e;r.legend_show||(r.legend_show=!0,a.legend?a.legend.style("visibility",null):e.initLegend(),!e.state.legendHasRendered&&e.updateLegend()),e.removeHiddenLegendIds(t),o(a.legend.selectAll(e.selectorLegends(t)).style("visibility",null)).style("opacity",null)},hideLegend(t){const e=this,{config:r,$el:{legend:a}}=e;r.legend_show&&_n(t)&&(r.legend_show=!1,a.style("visibility","hidden")),e.addHiddenLegendIds(t),a.selectAll(e.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},getLegendItemTextBox(t,e){const r=this,{cache:a,state:o}=r;let i;const s=Mn.legendItemTextBox;return t&&(i=!o.redrawing&&a.get(s)||{},i[t]||(i[t]=r.getTextRect(e,Ke.legendItem),a.add(s,i)),i=i[t]),i},setLegendItem(t){const e=this,{$el:r,api:a,config:o,state:i}=e,s=i.inputType==="touch",l=e.hasType("gauge"),c=o.boost_useCssRule,f=o.legend_item_interaction;t.attr("class",function(g){const p=it(this);return(!p.empty()&&p.attr("class")||"")+e.generateClass(Ke.legendItem,g)}).style("visibility",g=>e.isLegendToShow(g)?null:"hidden"),o.interaction_enabled&&(c&&[[`.${Ke.legendItem}`,"cursor:pointer"],[`.${Ke.legendItem} text`,"pointer-events:none"],[`.${Ke.legendItemPoint} text`,"pointer-events:none"],[`.${Ke.legendItemTile}`,"pointer-events:none"],[`.${Ke.legendItemEvent}`,"fill-opacity:0"]].forEach(g=>{const[p,m]=g;e.setCssRule(!1,p,[m])(r.legend)}),t.on(f.dblclick?"dblclick":"click",f||he(o.legend_item_onclick)?function(g,p){if(!_e(o.legend_item_onclick,a,p,!i.hiddenTargetIds.includes(p))){const{altKey:m,target:E,type:w}=g;w==="dblclick"||m?i.hiddenTargetIds.length&&E.parentNode.getAttribute("class").indexOf(Ke.legendItemHidden)===-1?a.show():(a.hide(),a.show(p)):(a.toggle(p),it(this).classed(qe.legendItemFocused,!1))}s&&e.hideTooltip()}:null),!s&&t.on("mouseout",f||he(o.legend_item_onout)?function(g,p){_e(o.legend_item_onout,a,p,!i.hiddenTargetIds.includes(p))||(it(this).classed(qe.legendItemFocused,!1),l&&e.undoMarkOverlapped(e,`.${jn.gaugeValue}`),e.api.revert())}:null).on("mouseover",f||he(o.legend_item_onover)?function(g,p){_e(o.legend_item_onover,a,p,!i.hiddenTargetIds.includes(p))||(it(this).classed(qe.legendItemFocused,!0),l&&e.markOverlapped(p,e,`.${jn.gaugeValue}`),!i.transiting&&e.isTargetToShow(p)&&a.focus(p))}:null),!t.empty()&&t.on("click mouseout mouseover")&&t.style("cursor",e.getStylePropValue("pointer")))},updateLegendElement(t,e){const r=this,{config:a,state:o,$el:{legend:i},$T:s}=r,c=a.legend_item_tile_type!=="circle",f=a.legend_item_tile_r,g={width:c?a.legend_item_tile_width:f*2,height:c?a.legend_item_tile_height:f*2},p={padding:{top:4,right:10},max:{width:0,height:0},posMin:10,step:0,tileWidth:g.width+5,totalLength:0},m={offsets:{},widths:{},heights:{},margins:[0],steps:{}};let E,w,U;const N=t.filter(Q=>!Qe(a.data_names[Q])||a.data_names[Q]!==null),D=e.withTransition,Y=r.getUpdateLegendPositions(N,p,m);o.isLegendInset&&(p.step=a.legend_inset_step?a.legend_inset_step:N.length,r.updateLegendStep(p.step)),o.isLegendRight?(E=Q=>p.max.width*m.steps[Q],w=Q=>m.margins[m.steps[Q]]+m.offsets[Q]):o.isLegendInset?(E=Q=>p.max.width*m.steps[Q]+10,w=Q=>m.margins[m.steps[Q]]+m.offsets[Q]):(E=Q=>m.margins[m.steps[Q]]+m.offsets[Q],w=Q=>p.max.height*m.steps[Q]);const J={xText:(Q,ot)=>E(Q,ot)+4+g.width,xRect:(Q,ot)=>E(Q,ot),x1Tile:(Q,ot)=>E(Q,ot)-2,x2Tile:(Q,ot)=>E(Q,ot)-2+g.width,yText:(Q,ot)=>w(Q,ot)+9,yRect:(Q,ot)=>w(Q,ot)-5,yTile:(Q,ot)=>w(Q,ot)+4};r.generateLegendItem(N,g,Y,J),U=i.select(`.${Ke.legendBackground} rect`),o.isLegendInset&&p.max.width>0&&U.size()===0&&(U=i.insert("g",`.${Ke.legendItem}`).attr("class",Ke.legendBackground).append("rect")),a.legend_tooltip&&i.selectAll("title").data(N).text(Q=>Ki.bind(r)(Q,!1));const K=i.selectAll("text").data(N).text(Q=>Ki.bind(r)(Q)).each(function(Q,ot){Y(this,Q,ot)});s(K,D).attr("x",J.xText).attr("y",J.yText);const nt=i.selectAll(`rect.${Ke.legendItemEvent}`).data(N);s(nt,D).attr("width",Q=>m.widths[Q]).attr("height",Q=>m.heights[Q]).attr("x",J.xRect).attr("y",J.yRect),r.updateLegendItemPos(N,D,J),U&&s(U,D).attr("height",r.getLegendHeight()-12).attr("width",p.max.width*(p.step+1)+10),r.updateLegendItemWidth(p.max.width),r.updateLegendItemHeight(p.max.height),r.updateLegendStep(p.step)},getUpdateLegendPositions(t,e,r){const a=this,{config:o,state:i}=a,s=i.isLegendRight||i.isLegendInset;return function(l,c,f){const g=f===0,p=f===t.length-1,m=a.getLegendItemTextBox(c,l),E=m.width+e.tileWidth+(p&&!s?0:e.padding.right)+o.legend_padding,w=m.height+e.padding.top,U=s?w:E,N=s?a.getLegendHeight():a.getLegendWidth();let D;const Y=function(K,nt){nt||(D=(N-e.totalLength-U)/2,D<e.posMin&&(D=(N-U)/2,e.totalLength=0,e.step++)),r.steps[K]=e.step,r.margins[e.step]=i.isLegendInset?10:D,r.offsets[K]=e.totalLength,e.totalLength+=U};if(g&&(e.totalLength=0,e.step=0,e.max.width=0,e.max.height=0),o.legend_show&&!a.isLegendToShow(c)){r.widths[c]=0,r.heights[c]=0,r.steps[c]=0,r.offsets[c]=0;return}r.widths[c]=E,r.heights[c]=w,(!e.max.width||E>=e.max.width)&&(e.max.width=E),(!e.max.height||w>=e.max.height)&&(e.max.height=w);const J=s?e.max.height:e.max.width;o.legend_equally?(Object.keys(r.widths).forEach(K=>r.widths[K]=e.max.width),Object.keys(r.heights).forEach(K=>r.heights[K]=e.max.height),D=(N-J*t.length)/2,D<e.posMin?(e.totalLength=0,e.step=0,t.forEach(K=>Y(K))):Y(c,!0)):Y(c)}},generateLegendItem(t,e,r,a){const o=this,{config:i,state:s,$el:{legend:l}}=o,c=i.legend_usePoint,f=i.legend_item_tile_r,g=i.legend_item_tile_type,p=g!=="circle",m=s.isLegendRight||s.isLegendInset,E=-200,w=l.selectAll(`.${Ke.legendItem}`).data(t).enter().append("g");if(o.setLegendItem(w),i.legend_tooltip&&w.append("title").text(U=>U),w.append("text").text(U=>Ki.bind(o)(U)).each(function(U,N){r(this,U,N)}).style("pointer-events",o.getStylePropValue("none")).attr("x",m?a.xText:E).attr("y",m?E:a.yText),w.append("rect").attr("class",Ke.legendItemEvent).style("fill-opacity",o.getStylePropValue("0")).attr("x",m?a.xRect:E).attr("y",m?E:a.yRect),c){const U=[];w.append(N=>{const D=cn(i.point_pattern)?i.point_pattern:[i.point_type];U.indexOf(N)===-1&&U.push(N);let Y=D[U.indexOf(N)%D.length];return Y==="rectangle"&&(Y="rect"),pn.createElementNS(te.svg,"hasValidPointType"in o&&o.hasValidPointType(Y)?Y:"use")}).attr("class",Ke.legendItemPoint).style("fill",Co.bind(o)).style("pointer-events",o.getStylePropValue("none")).attr("href",(N,D,Y)=>{const K=Y[D].nodeName.toLowerCase(),nt=o.getTargetSelectorSuffix(N);return K==="use"?`#${s.datetimeId}-point${nt}`:void 0})}else w.append(p?"line":g).attr("class",Ke.legendItemTile).style("stroke",Co.bind(o)).style("pointer-events",o.getStylePropValue("none")).call(U=>{g==="circle"?U.attr("r",f).style("fill",Co.bind(o)).attr("cx",m?a.x2Tile:E).attr("cy",m?E:a.yTile):p&&U.attr("stroke-width",e.height).attr("x1",m?a.x1Tile:E).attr("y1",m?E:a.yTile).attr("x2",m?a.x2Tile:E).attr("y2",m?E:a.yTile)})},updateLegendItemPos(t,e,r){const a=this,{config:o,$el:{legend:i},$T:s}=a,l=o.legend_usePoint,c=o.legend_item_tile_type,f=c!=="circle";if(l){const g=i.selectAll(`.${Ke.legendItemPoint}`).data(t);s(g,e).each(function(){const p=this.nodeName.toLowerCase(),m=o.point_r;let E="x",w="y",U=2,N=2.5,D=null,Y=null,J=null;if(p==="circle"){const K=m*.2;E="cx",w="cy",D=m+K,U=m*2,N=-K}else if(p==="rect"){const K=m*2.5;Y=K,J=K,N=3}it(this).attr(E,K=>r.x1Tile(K)+U).attr(w,K=>r.yTile(K)-N).attr("r",D).attr("width",Y).attr("height",J)})}else{const g=i.selectAll(`.${Ke.legendItemTile}`).data(t);s(g,e).style("stroke",Co.bind(a)).call(p=>{c==="circle"?p.attr("cx",m=>{const E=r.x2Tile(m);return E-(E-r.x1Tile(m))/2}).attr("cy",r.yTile):f&&p.attr("x1",r.x1Tile).attr("y1",r.yTile).attr("x2",r.x2Tile).attr("y2",r.yTile)})}}},ap={redraw(t={}){var e,r,a,o;const i=this,{config:s,state:l,$el:c}=i,{main:f,treemap:g}=c;l.redrawing=!0;const p=i.filterTargetsToShow(i.data.targets),{flow:m,initializing:E}=t,w=i.getWithOption(t),U=w.Transition?s.transition_duration:0,N=w.TransitionForExit?U:0,D=w.TransitionForAxis?U:0,Y=(e=i.axis)==null?void 0:e.generateTransitions(D);i.updateSizes(E),w.Legend&&s.legend_show?(t.withTransition=!!U,!g&&i.updateLegend(i.mapToIds(i.data.targets),t,Y)):w.Dimension&&i.updateDimension(!0),s.data_empty_label_text&&f.select(`text.${gn.text}.${Se.empty}`).attr("x",l.width/2).attr("y",l.height/2).text(s.data_empty_label_text).style("display",p.length?"none":null),l.hasAxis?(i.axis.redrawAxis(p,w,Y,m,E),i.hasGrid()&&i.updateGrid(),s.regions.length&&i.updateRegion(),["bar","candlestick","line","area"].forEach(J=>{const K=In(J);(/^(line|area)$/.test(J)&&i.hasTypeOf(K)||i.hasType(J))&&i[`update${K}`](w.TransitionForExit)}),c.text&&f.selectAll(`.${tn.selectedCircles}`).filter(i.isBarType.bind(i)).selectAll("circle").remove(),s.interaction_enabled&&!m&&w.EventRect&&(i.redrawEventRect(),(r=i.bindZoomEvent)==null||r.call(i))):(c.arcs&&i.redrawArc(U,N,w.Transform),c.radar&&i.redrawRadar(),c.polar&&i.redrawPolar(),c.funnel&&i.redrawFunnel(),g&&i.updateTreemap(N)),!l.resizing&&!g&&(i.hasPointType()||l.hasRadar)?i.updateCircle():(a=i.hasLegendDefsPoint)!=null&&a.call(i)&&i.data.targets.forEach(i.point("create",this)),i.hasDataLabel()&&!i.hasArcType(null,["radar"])&&i.updateText(),(o=i.redrawTitle)==null||o.call(i),E&&i.updateTypesElements(),i.generateRedrawList(p,m,U,w.Subchart),i.updateTooltipOnRedraw(),i.callPluginHook("$redraw",t,U)},generateRedrawList(t,e,r,a){const o=this,{config:i,state:s}=o,l=o.getDrawShape();s.hasAxis&&i.subchart_show&&o.redrawSubchart(a,r,l);const c=e&&o.generateFlow({targets:t,flow:e,duration:e.duration,shape:l,xv:o.xv.bind(o)}),f=(r||c)&&La(),g=o.getRedrawList(l,e,c,f),p=()=>{c&&c(),s.redrawing=!1,_e(i.onrendered,o.api)};if(p)if(f&&g.length){const m=oc();Nl().duration(r).each(()=>{g.reduce((E,w)=>E.concat(w),[]).forEach(E=>m.add(E))}).call(m,p)}else s.transiting||p();o.mapToIds(o.data.targets).forEach(m=>{s.withoutFadeIn[m]=!0})},getRedrawList(t,e,r,a){const o=this,{config:i,state:{hasAxis:s,hasRadar:l,hasTreemap:c},$el:{grid:f}}=o,{cx:g,cy:p,xForText:m,yForText:E}=t.pos,w=[];return s&&((i.grid_x_lines.length||i.grid_y_lines.length)&&w.push(o.redrawGrid(a)),i.regions.length&&w.push(o.redrawRegion(a)),Object.keys(t.type).forEach(U=>{const N=In(U),D=t.type[U];(/^(area|line)$/.test(U)&&o.hasTypeOf(N)||o.hasType(U))&&w.push(o[`redraw${N}`](D,a))}),!e&&f.main&&w.push(o.updateGridFocus())),(!o.hasArcType()||l)&&cn(i.data_labels)&&i.data_labels!==!1&&w.push(o.redrawText(m,E,e,a)),(o.hasPointType()||l)&&!o.isPointFocusOnly()&&o.redrawCircle&&w.push(o.redrawCircle(g,p,a,r)),c&&w.push(o.redrawTreemap(a)),w},updateAndRedraw(t={}){const e=this,{config:r,state:a}=e;let o;t.withTransition=$r(t,"withTransition",!0),t.withTransform=$r(t,"withTransform",!1),t.withLegend=$r(t,"withLegend",!1),t.withUpdateXDomain=!0,t.withUpdateOrgXDomain=!0,t.withTransitionForExit=!1,t.withTransitionForTransform=$r(t,"withTransitionForTransform",t.withTransition),t.withLegend&&r.legend_show||(a.hasAxis&&(o=e.axis.generateTransitions(t.withTransitionForAxis?r.transition_duration:0)),e.updateScales(),e.updateSvgSize(),e.transformAll(t.withTransitionForTransform,o)),e.redraw(t,o)}};const op=Math.sqrt(50),ip=Math.sqrt(10),sp=Math.sqrt(2);function Po(t,e,r){const a=(e-t)/Math.max(0,r),o=Math.floor(Math.log10(a)),i=a/Math.pow(10,o),s=i>=op?10:i>=ip?5:i>=sp?2:1;let l,c,f;return o<0?(f=Math.pow(10,-o)/s,l=Math.round(t*f),c=Math.round(e*f),l/f<t&&++l,c/f>e&&--c,f=-f):(f=Math.pow(10,o)*s,l=Math.round(t/f),c=Math.round(e/f),l*f<t&&++l,c*f>e&&--c),c<l&&.5<=r&&r<2?Po(t,e,r*2):[l,c,f]}function Zi(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const a=e<t,[o,i,s]=a?Po(e,t,r):Po(t,e,r);if(!(i>=o))return[];const l=i-o+1,c=new Array(l);if(a)if(s<0)for(let f=0;f<l;++f)c[f]=(i-f)/-s;else for(let f=0;f<l;++f)c[f]=(i-f)*s;else if(s<0)for(let f=0;f<l;++f)c[f]=(o+f)/-s;else for(let f=0;f<l;++f)c[f]=(o+f)*s;return c}function Ji(t,e,r){return e=+e,t=+t,r=+r,Po(t,e,r)[2]}function Qi(t,e,r){e=+e,t=+t,r=+r;const a=e<t,o=a?Ji(e,t,r):Ji(t,e,r);return(a?-1:1)*(o<0?1/-o:o)}function Mo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function lp(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ki(t){let e,r,a;t.length!==2?(e=Mo,r=(l,c)=>Mo(t(l),c),a=(l,c)=>t(l)-c):(e=t===Mo||t===lp?t:cp,r=t,a=t);function o(l,c,f=0,g=l.length){if(f<g){if(e(c,c)!==0)return g;do{const p=f+g>>>1;r(l[p],c)<0?f=p+1:g=p}while(f<g)}return f}function i(l,c,f=0,g=l.length){if(f<g){if(e(c,c)!==0)return g;do{const p=f+g>>>1;r(l[p],c)<=0?f=p+1:g=p}while(f<g)}return f}function s(l,c,f=0,g=l.length){const p=o(l,c,f,g-1);return p>f&&a(l[p-1],c)>-a(l[p],c)?p-1:p}return{left:o,center:s,right:i}}function cp(){return 0}function up(t){return t===null?NaN:+t}function*w1(t,e){if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let a of t)(a=e(a,++r,t))!=null&&(a=+a)>=a&&(yield a)}}const $c=ki(Mo),fp=$c.right,D1=$c.left,N1=ki(up).center;var dp=fp;function hp(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function vp(t){return function(){return t}}function gp(t){return+t}var Ac=[0,1];function ia(t){return t}function qi(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:vp(isNaN(e)?NaN:.5)}function pp(t,e){var r;return t>e&&(r=t,t=e,e=r),function(a){return Math.max(t,Math.min(e,a))}}function mp(t,e,r){var a=t[0],o=t[1],i=e[0],s=e[1];return o<a?(a=qi(o,a),i=r(s,i)):(a=qi(a,o),i=r(i,s)),function(l){return i(a(l))}}function yp(t,e,r){var a=Math.min(t.length,e.length)-1,o=new Array(a),i=new Array(a),s=-1;for(t[a]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<a;)o[s]=qi(t[s],t[s+1]),i[s]=r(e[s],e[s+1]);return function(l){var c=dp(t,l,1,a)-1;return i[c](o[c](l))}}function wo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function _i(){var t=Ac,e=Ac,r=kr,a,o,i,s=ia,l,c,f;function g(){var m=Math.min(t.length,e.length);return s!==ia&&(s=pp(t[0],t[m-1])),l=m>2?yp:mp,c=f=null,p}function p(m){return m==null||isNaN(m=+m)?i:(c||(c=l(t.map(a),e,r)))(a(s(m)))}return p.invert=function(m){return s(o((f||(f=l(e,t.map(a),kn)))(m)))},p.domain=function(m){return arguments.length?(t=Array.from(m,gp),g()):t.slice()},p.range=function(m){return arguments.length?(e=Array.from(m),g()):e.slice()},p.rangeRound=function(m){return e=Array.from(m),r=hp,g()},p.clamp=function(m){return arguments.length?(s=m?!0:ia,g()):s!==ia},p.interpolate=function(m){return arguments.length?(r=m,g()):r},p.unknown=function(m){return arguments.length?(i=m,p):i},function(m,E){return a=m,o=E,g()}}function Ec(){return _i()(ia,ia)}var xp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ba(t){if(!(e=xp.exec(t)))throw new Error("invalid format: "+t);var e;return new ts({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ba.prototype=ts.prototype;function ts(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ts.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Tp(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Do(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,a=t.slice(0,r);return[a.length>1?a[0]+a.slice(2):a,+t.slice(r+1)]}function sa(t){return t=Do(Math.abs(t)),t?t[1]:NaN}function Sp(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sa(e)/3)))*3-sa(Math.abs(t)))}function $p(t,e){return function(r,a){for(var o=r.length,i=[],s=0,l=t[0],c=0;o>0&&l>0&&(c+l+1>a&&(l=Math.max(1,a-c)),i.push(r.substring(o-=l,o+l)),!((c+=l+1)>a));)l=t[s=(s+1)%t.length];return i.reverse().join(e)}}function Ap(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}function Ep(t){t:for(var e=t.length,r=1,a=-1,o;r<e;++r)switch(t[r]){case".":a=o=r;break;case"0":a===0&&(a=r),o=r;break;default:if(!+t[r])break t;a>0&&(a=0);break}return a>0?t.slice(0,a)+t.slice(o+1):t}var bc;function bp(t,e){var r=Do(t,e);if(!r)return t+"";var a=r[0],o=r[1],i=o-(bc=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=a.length;return i===s?a:i>s?a+new Array(i-s+1).join("0"):i>0?a.slice(0,i)+"."+a.slice(i):"0."+new Array(1-i).join("0")+Do(t,Math.max(0,e+i-1))[0]}function Ic(t,e){var r=Do(t,e);if(!r)return t+"";var a=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+a:a.length>o+1?a.slice(0,o+1)+"."+a.slice(o+1):a+new Array(o-a.length+2).join("0")}var Rc={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Tp,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ic(t*100,e),r:Ic,s:bp,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Oc(t){return t}var Cc=Array.prototype.map,Pc=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Ip(t){var e=t.grouping===void 0||t.thousands===void 0?Oc:$p(Cc.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",a=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?Oc:Ap(Cc.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(p){p=Ba(p);var m=p.fill,E=p.align,w=p.sign,U=p.symbol,N=p.zero,D=p.width,Y=p.comma,J=p.precision,K=p.trim,nt=p.type;nt==="n"?(Y=!0,nt="g"):Rc[nt]||(J===void 0&&(J=12),K=!0,nt="g"),(N||m==="0"&&E==="=")&&(N=!0,m="0",E="=");var Q=U==="$"?r:U==="#"&&/[boxX]/.test(nt)?"0"+nt.toLowerCase():"",ot=U==="$"?a:/[%p]/.test(nt)?s:"",pt=Rc[nt],Tt=/[defgprs%]/.test(nt);J=J===void 0?6:/[gprs]/.test(nt)?Math.max(1,Math.min(21,J)):Math.max(0,Math.min(20,J));function yt(lt){var jt=Q,vt=ot,tt,St,ct;if(nt==="c")vt=pt(lt)+vt,lt="";else{lt=+lt;var At=lt<0||1/lt<0;if(lt=isNaN(lt)?c:pt(Math.abs(lt),J),K&&(lt=Ep(lt)),At&&+lt==0&&w!=="+"&&(At=!1),jt=(At?w==="("?w:l:w==="-"||w==="("?"":w)+jt,vt=(nt==="s"?Pc[8+bc/3]:"")+vt+(At&&w==="("?")":""),Tt){for(tt=-1,St=lt.length;++tt<St;)if(ct=lt.charCodeAt(tt),48>ct||ct>57){vt=(ct===46?o+lt.slice(tt+1):lt.slice(tt))+vt,lt=lt.slice(0,tt);break}}}Y&&!N&&(lt=e(lt,1/0));var Wt=jt.length+lt.length+vt.length,Dt=Wt<D?new Array(D-Wt+1).join(m):"";switch(Y&&N&&(lt=e(Dt+lt,Dt.length?D-vt.length:1/0),Dt=""),E){case"<":lt=jt+lt+vt+Dt;break;case"=":lt=jt+Dt+lt+vt;break;case"^":lt=Dt.slice(0,Wt=Dt.length>>1)+jt+lt+vt+Dt.slice(Wt);break;default:lt=Dt+jt+lt+vt;break}return i(lt)}return yt.toString=function(){return p+""},yt}function g(p,m){var E=f((p=Ba(p),p.type="f",p)),w=Math.max(-8,Math.min(8,Math.floor(sa(m)/3)))*3,U=Math.pow(10,-w),N=Pc[8+w/3];return function(D){return E(U*D)+N}}return{format:f,formatPrefix:g}}var No,es,Mc;Rp({thousands:",",grouping:[3],currency:["$",""]});function Rp(t){return No=Ip(t),es=No.format,Mc=No.formatPrefix,No}function Op(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,sa(e)-sa(t))+1}function Cp(t){return Math.max(0,-sa(Math.abs(t)))}function Pp(t,e,r,a){var o=Qi(t,e,r),i;switch(a=Ba(a==null?",f":a),a.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return a.precision==null&&!isNaN(i=Sp(o,s))&&(a.precision=i),Mc(a,s)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=Op(o,Math.max(Math.abs(t),Math.abs(e))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=Cp(o))&&(a.precision=i-(a.type==="%")*2);break}}return es(a)}function wc(t){var e=t.domain;return t.ticks=function(r){var a=e();return Zi(a[0],a[a.length-1],r==null?10:r)},t.tickFormat=function(r,a){var o=e();return Pp(o[0],o[o.length-1],r==null?10:r,a)},t.nice=function(r){r==null&&(r=10);var a=e(),o=0,i=a.length-1,s=a[o],l=a[i],c,f,g=10;for(l<s&&(f=s,s=l,l=f,f=o,o=i,i=f);g-- >0;){if(f=Ji(s,l,r),f===c)return a[o]=s,a[i]=l,e(a);if(f>0)s=Math.floor(s/f)*f,l=Math.ceil(l/f)*f;else if(f<0)s=Math.ceil(s*f)/f,l=Math.floor(l*f)/f;else break;c=f}return t},t}function Lo(){var t=Ec();return t.copy=function(){return wo(t,Lo())},oa.apply(t,arguments),wc(t)}function Dc(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Nc(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Mp(t){var e=1,r=t(Dc(e),Nc(e));return r.constant=function(a){return arguments.length?t(Dc(e=+a),Nc(e)):e},wc(r)}function Lc(){var t=Mp(_i());return t.copy=function(){return wo(t,Lc()).constant(t.constant())},oa.apply(t,arguments)}function Fc(t,e){t=t.slice();var r=0,a=t.length-1,o=t[r],i=t[a],s;return i<o&&(s=r,r=a,a=s,s=o,o=i,i=s),t[r]=e.floor(o),t[a]=e.ceil(i),t}function Bc(t){return Math.log(t)}function Uc(t){return Math.exp(t)}function wp(t){return-Math.log(-t)}function Dp(t){return-Math.exp(-t)}function Np(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Lp(t){return t===10?Np:t===Math.E?Math.exp:e=>Math.pow(t,e)}function Fp(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function zc(t){return(e,r)=>-t(-e,r)}function Bp(t){const e=t(Bc,Uc),r=e.domain;let a=10,o,i;function s(){return o=Fp(a),i=Lp(a),r()[0]<0?(o=zc(o),i=zc(i),t(wp,Dp)):t(Bc,Uc),e}return e.base=function(l){return arguments.length?(a=+l,s()):a},e.domain=function(l){return arguments.length?(r(l),s()):r()},e.ticks=l=>{const c=r();let f=c[0],g=c[c.length-1];const p=g<f;p&&([f,g]=[g,f]);let m=o(f),E=o(g),w,U;const N=l==null?10:+l;let D=[];if(!(a%1)&&E-m<N){if(m=Math.floor(m),E=Math.ceil(E),f>0){for(;m<=E;++m)for(w=1;w<a;++w)if(U=m<0?w/i(-m):w*i(m),!(U<f)){if(U>g)break;D.push(U)}}else for(;m<=E;++m)for(w=a-1;w>=1;--w)if(U=m>0?w/i(-m):w*i(m),!(U<f)){if(U>g)break;D.push(U)}D.length*2<N&&(D=Zi(f,g,N))}else D=Zi(m,E,Math.min(E-m,N)).map(i);return p?D.reverse():D},e.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=a===10?"s":","),typeof c!="function"&&(!(a%1)&&(c=Ba(c)).precision==null&&(c.trim=!0),c=es(c)),l===1/0)return c;const f=Math.max(1,a*l/e.ticks().length);return g=>{let p=g/i(Math.round(o(g)));return p*a<a-.5&&(p*=a),p<=f?c(g):""}},e.nice=()=>r(Fc(r(),{floor:l=>i(Math.floor(o(l))),ceil:l=>i(Math.ceil(o(l)))})),e}function jc(){const t=Bp(_i()).domain([1,10]);return t.copy=()=>wo(t,jc()).base(t.base()),oa.apply(t,arguments),t}const Fo=en(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Fo.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?en(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Fo);const L1=Fo.range,zr=en(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hn)},(t,e)=>(e-t)/Hn,t=>t.getUTCSeconds()),F1=zr.range,ns=en(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hn)},(t,e)=>{t.setTime(+t+e*Pn)},(t,e)=>(e-t)/Pn,t=>t.getMinutes()),B1=ns.range,rs=en(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Pn)},(t,e)=>(e-t)/Pn,t=>t.getUTCMinutes()),U1=rs.range,as=en(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hn-t.getMinutes()*Pn)},(t,e)=>{t.setTime(+t+e*Un)},(t,e)=>(e-t)/Un,t=>t.getHours()),z1=as.range,os=en(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Un)},(t,e)=>(e-t)/Un,t=>t.getUTCHours()),j1=os.range,is=en(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),G1=is.range,ss=en(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),V1=ss.range;function Gc(t,e,r,a,o,i){const s=[[zr,1,Hn],[zr,5,5*Hn],[zr,15,15*Hn],[zr,30,30*Hn],[i,1,Pn],[i,5,5*Pn],[i,15,15*Pn],[i,30,30*Pn],[o,1,Un],[o,3,3*Un],[o,6,6*Un],[o,12,12*Un],[a,1,lr],[a,2,2*lr],[r,1,ri],[e,1,ws],[e,3,3*ws],[t,1,ai]];function l(f,g,p){const m=g<f;m&&([f,g]=[g,f]);const E=p&&typeof p.range=="function"?p:c(f,g,p),w=E?E.range(f,+g+1):[];return m?w.reverse():w}function c(f,g,p){const m=Math.abs(g-f)/p,E=ki(([,,N])=>N).right(s,m);if(E===s.length)return t.every(Qi(f/ai,g/ai,p));if(E===0)return Fo.every(Math.max(Qi(f,g,p),1));const[w,U]=s[m/s[E-1][2]<s[E][2]/m?E-1:E];return w.every(U)}return[l,c]}const[Up,zp]=Gc(ur,ss,_a,Ds,os,rs),[jp,Gp]=Gc(cr,is,ka,ya,as,ns);function Vp(t){return new Date(t)}function Xp(t){return t instanceof Date?+t:+new Date(+t)}function ls(t,e,r,a,o,i,s,l,c,f){var g=Ec(),p=g.invert,m=g.domain,E=f(".%L"),w=f(":%S"),U=f("%I:%M"),N=f("%I %p"),D=f("%a %d"),Y=f("%b %d"),J=f("%B"),K=f("%Y");function nt(Q){return(c(Q)<Q?E:l(Q)<Q?w:s(Q)<Q?U:i(Q)<Q?N:a(Q)<Q?o(Q)<Q?D:Y:r(Q)<Q?J:K)(Q)}return g.invert=function(Q){return new Date(p(Q))},g.domain=function(Q){return arguments.length?m(Array.from(Q,Xp)):m().map(Vp)},g.ticks=function(Q){var ot=m();return t(ot[0],ot[ot.length-1],Q==null?10:Q)},g.tickFormat=function(Q,ot){return ot==null?nt:f(ot)},g.nice=function(Q){var ot=m();return(!Q||typeof Q.range!="function")&&(Q=e(ot[0],ot[ot.length-1],Q==null?10:Q)),Q?m(Fc(ot,Q)):g},g.copy=function(){return wo(g,ls(t,e,r,a,o,i,s,l,c,f))},g}function Hp(){return oa.apply(ls(jp,Gp,cr,is,ka,ya,as,ns,zr,si).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Wp(){return oa.apply(ls(Up,zp,ur,ss,_a,eo,os,rs,zr,li).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jr(t="linear",e,r){const a={linear:Lo,log:Lc,_log:jc,time:Hp,utc:Wp}[t]();return a.type=t,/_?log/.test(t)&&a.clamp(!0),a.range([e!=null?e:0,r!=null?r:1])}var Yp={getXScale(t,e,r,a){const o=this,i=o.state.loading!=="append"&&o.scale.zoom||jr(o.axis.getAxisType("x"),t,e);return o.getCustomizedXScale(r?i.domain(r):i,a)},getYScale(t,e,r,a){const i=jr(this.axis.getAxisType(t),e,r);return a&&i.domain(a),i},getYScaleById(t,e=!1){var r;const a=((r=this.axis)==null?void 0:r.getId(t))==="y2",o=e?a?"subY2":"subY":a?"y2":"y";return this.scale[o]},getCustomizedXScale(t,e){const r=this,a=e||(()=>r.axis.x.tickOffset()),o=r.config.axis_x_inverted,i=function(s){return t(s)+a()};for(const s in t)i[s]=t[s];return i.orgDomain=()=>t.domain(),i.orgScale=()=>t,r.axis.isCategorized()&&(i.domain=function(s){let l=s;return arguments.length?(t.domain(l),i):(l=this.orgDomain(),o?[l[0]+1,l[1]]:[l[0],l[1]+1])}),i},updateScales(t,e=!0){var r,a;const o=this,{axis:i,config:s,format:l,org:c,scale:f,state:{current:g,width:p,height:m,width2:E,height2:w,hasAxis:U,hasTreemap:N}}=o;if(U){const D=s.axis_rotated,Y=o.getResettedPadding(1),J={x:D?Y:0,y:D?0:m,subX:D?1:0,subY:D?0:w},K={x:D?m:p,y:D?p:Y,subX:D?m:p,subY:D?E:1},nt=e&&((r=f.x)==null?void 0:r.orgDomain()),Q=e&&c.xDomain;f.x=o.getXScale(J.x,K.x,nt,()=>i.x.tickOffset()),f.subX=o.getXScale(J.x,K.x,Q,ot=>{var pt;return ot%1?0:((pt=i.subX)!=null?pt:i.x).tickOffset()}),l.xAxisTick=i.getXAxisTickFormat(),l.subXAxisTick=i.getXAxisTickFormat(!0),i.setAxis("x",f.x,s.axis_x_tick_outer,t),s.subchart_show&&i.setAxis("subX",f.subX,s.axis_x_tick_outer,t),f.y=o.getYScale("y",J.y,K.y,f.y?f.y.domain():s.axis_y_default),f.subY=o.getYScale("y",J.subY,K.subY,f.subY?f.subY.domain():s.axis_y_default),i.setAxis("y",f.y,s.axis_y_tick_outer,t),s.axis_y2_show&&(f.y2=o.getYScale("y2",J.y,K.y,f.y2?f.y2.domain():s.axis_y2_default),f.subY2=o.getYScale("y2",J.subY,K.subY,f.subY2?f.subY2.domain():s.axis_y2_default),i.setAxis("y2",f.y2,s.axis_y2_tick_outer,t))}else if(N){const D=o.getCurrentPadding();f.x=Lo().rangeRound([D.left,g.width-D.right]),f.y=Lo().rangeRound([D.top,g.height-D.bottom])}else(a=o.updateArc)==null||a.call(o)},xx(t){const e=this,{config:r,scale:{x:a,zoom:o}}=e,i=r.zoom_enabled&&o?o:a;return t?i(De(t.x)?t.x:t):null},xv(t){const e=this,{axis:r,config:a,scale:{x:o,zoom:i}}=e,s=a.zoom_enabled&&i?i:o;let l=e.getBaseValue(t);return r.isTimeSeries()?l=Kn.call(e,l):r.isCategorized()&&Ue(l)&&(l=a.axis_x_categories.indexOf(l)),s(l)},yv(t){const e=this,{scale:{y:r,y2:a}}=e;return(t.axis&&t.axis==="y2"?a:r)(e.getBaseValue(t))},subxx(t){return t?this.scale.subX(t.x):null}},Kp={setContainerSize(){const t=this,{state:e}=t;e.current.width=t.getCurrentWidth(),e.current.height=t.getCurrentHeight()},getCurrentWidth(){const t=this;return t.config.size_width||t.getParentWidth()},getCurrentHeight(){const t=this,{config:e}=t,r=e.size_height||t.getParentHeight();return r>0?r:320/(t.hasType("gauge")&&!e.gauge_fullCircle?2:1)},getParentRectValue(t){const e=`offset${In(t)}`;let r=this.$el.chart.node(),a=0;for(;a<30&&r&&r.tagName!=="BODY";){try{a=mn(r,!0)[t]}catch(i){e in r&&(a=r[e])}r=r.parentNode}const o=pn.body[e];return a>o&&(a=o),a},getParentWidth(){return this.getParentRectValue("width")},getParentHeight(){const t=this.$el.chart.style("height");let e=0;return t&&(e=/px$/.test(t)?parseInt(t,10):this.getParentRectValue("height")),e},getSvgLeft(t){const e=this,{config:r,state:{hasAxis:a},$el:o}=e,i=r.axis_rotated,s=i||!i&&!r.axis_y_inner,l=i?vn.axisX:vn.axisY,c=o.main.select(`.${l}`).node(),f=a&&r[`axis_${i?"x":"y"}_label`];let g=0;if(a&&(Ue(f)||Ue(f.text)||/^inner-/.test(f==null?void 0:f.position))){const U=o.main.select(`.${l}-label`);U.empty()||(g=mn(U.node()).left)}const p=c&&s?mn(c,!t):{right:0},m=mn(o.chart.node(),!t).left+g,E=e.hasArcType(),w=p.right-m-(E?0:e.getCurrentPaddingByDirection("left",t));return w>0?w:0},updateDimension(t){var e;const r=this,{config:a,state:{hasAxis:o},$el:i}=r;o&&!t&&r.axis.x&&a.axis_rotated&&((e=r.axis.subX)==null||e.create(i.axis.subX)),r.updateScales(t),r.updateSvgSize(),r.transformAll(!1)},updateSvgSize(){const t=this,{config:e,state:{clip:r,current:a,hasAxis:o,width:i,height:s},$el:{svg:l}}=t;if(e.resize_auto==="viewBox"?l.attr("viewBox",`0 0 ${a.width} ${a.height}`):l.attr("width",a.width).attr("height",a.height),o){const c=l.select(`.${_s.brush} .overlay`),f={width:0,height:0};c.size()&&(f.width=+c.attr("width"),f.height=+c.attr("height")),l.selectAll([`#${r.id}`,`#${r.idGrid}`]).select("rect").attr("width",i).attr("height",s),l.select(`#${r.idXAxis}`).select("rect").call(t.setXAxisClipPath.bind(t)),l.select(`#${r.idYAxis}`).select("rect").call(t.setYAxisClipPath.bind(t)),r.idSubchart&&l.select(`#${r.idSubchart}`).select("rect").attr("width",i).attr("height",f.height)}},getCurrentPaddingByDirection(t,e=!1,r=!1){var a;const o=this,{config:i,$el:s,state:{hasAxis:l}}=o,c=i.axis_rotated,f=((a=i.padding)==null?void 0:a.mode)==="fit",g=pe(i[`padding_${t}`])?i[`padding_${t}`]:void 0,p=l?{top:c?"y2":null,bottom:c?"y":"x",left:c?"x":"y",right:c?null:"y2"}[t]:null,m=/^(left|right)$/.test(t),E=p&&i[`axis_${p}_inner`],w=p&&i[`axis_${p}_show`],U=p?i[`axis_${p}_axes`].length:0;let N=p?m?o.getAxisWidthByAxisId(p,e):o.getHorizontalAxisHeight(p):0;const D=20;let Y=0;!f&&m&&(N=ng(N));let J=l&&m&&(E||ln(g)&&!w)?0:f?(w?N:0)+(g!=null?g:0):ln(g)?N:g;return m&&l?(p&&(f||E)&&i[`axis_${p}_label`].text&&(J+=o.axis.getAxisLabelPosition(p).isOuter?D:0),t==="right"?(J+=c?!f&&ln(g)?10:2:!w||E?f?2:1:0,J+=r?o.axis.getXAxisTickTextY2Overflow(D):0):t==="left"&&c&&ln(g)&&(J=i.axis_x_show?f?N:Math.max(N,40):1)):t==="top"?(s.title&&s.title.node()&&(J+=o.getTitlePadding()),Y=c&&!E?U:0):t==="bottom"&&l&&c&&!w&&(J+=1),J+N*U-Y},getCurrentPadding(t=!1){const e=this,[r,a,o,i]=["top","bottom","left","right"].map(s=>e.getCurrentPaddingByDirection(s,null,t));return{top:r,bottom:a,left:o,right:i}},getResettedPadding(t){const e=this,{config:r}=e,a=pe(t);let o=a?0:{};return r.padding===!1?!a&&Object.keys(t).forEach(i=>{o[i]=!_n(r.data_labels)&&r.data_labels!==!1&&i==="top"?t[i]:0}):o=t,o},updateSizes(t){var e,r,a,o,i;const s=this,{config:l,state:c,$el:{legend:f}}=s,g=l.axis_rotated,p=s.hasArcType()||c.hasFunnel||c.hasTreemap,m=((e=l.padding)==null?void 0:e.mode)==="fit";!t&&s.setContainerSize();const E={width:f?s.getLegendWidth():0,height:f?s.getLegendHeight():0};!p&&l.axis_x_show&&l.axis_x_tick_autorotate&&s.updateXAxisTickClip();const w={right:l.legend_show&&c.isLegendRight?s.getLegendWidth()+(m?0:20):0,bottom:!l.legend_show||c.isLegendRight||c.isLegendInset?0:E.height},U=g||p?0:s.getHorizontalAxisHeight("x"),N=l.subchart_axis_x_show&&l.subchart_axis_x_tick_text_show?U:30,D=l.subchart_show&&!p?l.subchart_size_height+N:0,Y=s.hasType("gauge")&&l.arc_needle_show&&!l.gauge_fullCircle&&!l.gauge_label_show?10:0,J=s.getCurrentPadding(!0);if(c.margin=!p&&g?{top:J.top,right:p?0:J.right+w.right,bottom:w.bottom+J.bottom,left:D+(p?0:J.left)}:{top:(m?0:4)+J.top,right:p?0:J.right+w.right,bottom:Y+D+w.bottom+J.bottom,left:p?0:J.left},c.margin=s.getResettedPadding(c.margin),c.margin2=g?{top:c.margin.top,right:NaN,bottom:20+w.bottom,left:s.state.rotatedPadding.left}:{top:c.current.height-D-w.bottom,right:NaN,bottom:N+w.bottom,left:c.margin.left},c.margin3={top:0,right:NaN,bottom:0,left:0},(r=s.updateSizeForLegend)==null||r.call(s,E),c.width=c.current.width-c.margin.left-c.margin.right,c.height=c.current.height-c.margin.top-c.margin.bottom,c.width<0&&(c.width=0),c.height<0&&(c.height=0),c.width2=g?c.margin.left-c.rotatedPadding.left-c.rotatedPadding.right:c.width,c.height2=g?c.height:c.current.height-c.margin2.top-c.margin2.bottom,c.width2<0&&(c.width2=0),c.height2<0&&(c.height2=0),s.hasArcType()){const K=s.hasType("gauge"),nt=l.legend_show&&c.isLegendRight,Q=(a=c.hasRadar&&s.cache.get(Mn.radarTextWidth))!=null?a:0;c.arcWidth=c.width-(nt?E.width+10:0)-Q,c.arcHeight=c.height-(nt&&!K?0:10),(o=l.arc_rangeText_values)!=null&&o.length&&(K?(c.arcWidth-=25,c.arcHeight-=10,c.margin.left+=10):(c.arcHeight-=20,c.margin.top+=10)),K&&!l.gauge_fullCircle&&(c.arcHeight+=c.height-s.getPaddingBottomForGauge()),(i=s.updateRadius)==null||i.call(s)}c.isLegendRight&&p&&(c.margin3.left=c.arcWidth/2+c.radiusExpanded*1.1)}},Zp={setCssRule(t,e,r,a){const o=this,{config:i,state:{cssRule:s,style:l}}=o;return i.boost_useCssRule?c=>{c.each(f=>{const g=a&&(a==null?void 0:a.call(o,f)),p=`${t?`.${sn.shapes+o.getTargetSelectorSuffix(f.id)}`:""}${e}`;e in s&&l.sheet.deleteRule(s[p]),o.state.cssRule[p]=ig(l,p,r.filter(Boolean).map(m=>Ue(g)&&m.indexOf(":")===-1?`${m}: ${g}`:m||""))})}:()=>{}},getStylePropValue(t){const{config:{boost_useCssRule:e}}=this;return e?null:he(t)?t.bind(this):t}};function Vc(t){return typeof t=="string"?new Oe([document.querySelectorAll(t)],[document.documentElement]):new Oe([T(t)],qt)}function Jp(t){let e="middle";return t>0&&t<=170?e="end":t>190&&t<=360&&(e="start"),e}function Qp(t,e,r,a,o){var i;const s=this,{value:l}=t,c=s.isCandlestickType(t),f=pe(l)&&l<0||c&&!((i=s.getCandlestickData(t))!=null&&i._isUp);let{x:g,y:p}=e;const m=4,E=m*2;return a?r==="start"?(g+=f?0:E,p+=m):r==="middle"?(g+=E,p-=E):r==="end"&&(f&&(g-=E),p+=m):(r==="start"?(g+=m,f&&(p+=E*2)):r==="middle"?p-=E:r==="end"&&(g-=m,f&&(p+=E*2)),o&&(p+=f?-17:c?13:7)),{x:g,y:p}}function Xc(t,e){var r;const a=this.config.data_labels_position,{id:o,index:i,value:s}=t;return(r=he(a)?a.bind(this.api)(e,s,o,i,this.$el.text):(o in a?a[o]:a)[e])!=null?r:0}function kp(t,e,r){var a,o;const i=this,{config:s,$T:l}=i,c=s.axis_rotated,{border:{padding:f="3 5",radius:g=10,stroke:p="#000",strokeWidth:m=1,fill:E="none"}}=s.data_labels,w=fg(f),U=s.data_labels.border!==!0,N=na(t);let D=it(t.previousElementSibling);(D.empty()||((a=D.node())==null?void 0:a.tagName)!=="rect"||!((o=D.attr("class"))!=null&&o.includes(r)))&&(D=it(t.parentNode).insert("rect",()=>t).attr("class",`${gn.textBorderRect} ${r}`).attr("width",N.width+(U?w.left+w.right:0)).attr("height",N.height+(U?w.top+w.bottom:0)),U&&D.style("fill",E).style("stroke",p).style("stroke-width",`${m}px`).attr("rx",g).attr("ry",g)),l(D).attr("x",e.x-(U?w.left:0)-(c?0:N.width/2)).attr("y",e.y-(U?w.top:0)-N.height/4*3.2)}function cs(t=0,e){const r=this,{config:a}=r,o=a[`${e}_label_threshold`]||0;return t>=o}function Hc(){const t=this,{$el:{text:e},config:r}=t;(t.state.arcWidth?t.getArcLabelConfig("image"):r.data_labels.image)&&e.filter(function(){const o=this.previousElementSibling;return o?o.tagName!=="image"||!o.classList.contains(gn.textLabelImage):!0}).each(function(o){var i,s,l,c;const{url:f,width:g,height:p,pos:m}=qp.call(t,o);if(f){const E=it(this.parentNode);E==null||E.insert("image",`${(s=(i=this.getAttribute("class"))==null?void 0:i.replace(/(?:^(.)|\s)/g,".$1"))!=null?s:"text"}`).style("opacity","0").attr("href",w=>Na(f,{ID:"id"in w?w.id:w.data.id})).attr("class",gn.textLabelImage).style("pointer-events","none").attr("width",g).attr("height",p).attr("transform",m?`translate(${(l=m.x)!=null?l:0} ${(c=m.y)!=null?c:0})`:null)}})}function qp(t){var e;const r=this,{config:a,state:o}=r,i=o.arcWidth?r.getArcLabelConfig("image"):a.data_labels.image;if(he(i))return(e=i.call(r.api,t.value,t.id,t.index))!=null?e:{url:"",width:0,height:0,pos:{x:0,y:0}};if(i){const{url:s="",width:l=0,height:c=0,pos:f}=i;return{url:s,width:l,height:c,pos:f}}return null}function Wc(t,e){var r;const a=this,{config:o,state:{arcWidth:i,hasTreemap:s}}=a,l=o.axis_rotated,c=it(t.previousElementSibling),f=g=>{var p;const m=g.style.opacity!=="0"&&g.style.fillOpacity!=="0";return(i?g.textContent:m)&&((p=this.previousElementSibling)==null?void 0:p.tagName)!=="image"};if(!c.empty()&&((r=c.node())==null?void 0:r.tagName)==="image"){const g=mn(t),p=+c.attr("width")/2,m=+c.attr("height")/2;let E=e.x-p,w=e.y-m-g.height/2;l?e.x+=p:(s&&(E=-p,w=-(m*2+g.height)),a.hasType("pie")||a.hasType("polar")||(e.y+=m)),a.$T(c).style("opacity",f(t)?null:"0").attr("x",E).attr("y",w)}}var _p={opacityForText(t){const e=this;return e.isBarType(t)&&!cs.call(e,Math.abs(e.getRatio("bar",t)),"bar")?"0":e.hasDataLabel?null:"0"},initText(){const{$el:t}=this;t.main.select(`.${Se.chart}`).append("g").attr("class",gn.chartTexts).style("pointer-events",t.funnel||t.treemap?"none":null)},updateTargetsForText(t){const e=this,r=e.getChartClass("Text"),a=e.getClass("texts","id"),o=e.classFocus.bind(e);e.$el.main.select(`.${gn.chartTexts}`).selectAll(`.${gn.chartText}`).data(e.filterNullish(t)).attr("class",l=>`${r(l)}${o(l)}`.trim()).enter().append("g").style("opacity","0").attr("class",r).call(e.setCssRule(!0,` .${gn.text}`,["fill","pointer-events:none"],e.updateTextColor)).append("g").attr("class",a)},updateText(){const t=this,{$el:e,$T:r,config:a,axis:o}=t,i=t.getClass("text","index"),s=a.data_labels.centered,l=e.main.selectAll(`.${gn.texts}`).selectAll(`.${gn.text}`).data(t.labelishData.bind(t));r(l.exit()).style("fill-opacity","0").remove(),e.text=l.enter().append("text").merge(l).attr("class",i).attr("text-anchor",c=>{let g=a[`axis_${o==null?void 0:o.getId(c.id)}_inverted`]?c.value>0:c.value<0;if(t.isCandlestickType(c)){const p=t.getCandlestickData(c);g=!(p!=null&&p._isUp)}else if(t.isTreemapType(c))return s?"middle":"start";return a.axis_rotated?g?"end":"start":"middle"}).style("fill",t.getStylePropValue(t.updateTextColor)).style("fill-opacity","0").each(function(c,f,g){const p=it(this);let{value:m}=c;if(t.isBubbleZType(c))m=t.getBubbleZData(m,"z");else if(t.isCandlestickType(c)){const E=t.getCandlestickData(c);E&&(m=E.close)}m=t.isTreemapType(c)?t.treemapDataLabelFormat(c)(p):t.dataLabelFormat(c.id)(m,c.id,c.index,g),pe(m)?this.textContent=m:Da(p,m)}),Hc.call(t)},updateTextColor(t){const e=this,{config:r}=e,a=r.data_labels_colors,o=e.isArcType(t)&&!e.isRadarType(t)||e.isFunnelType(t)||e.isTreemapType(t)?null:e.color(t);let i;if(Ue(a))i=a;else if(ze(a)){const{id:s}=t.data||t;i=a[s]}else he(a)&&(i=a.bind(e.api)(o,t));if(e.isCandlestickType(t)&&!he(a)){const s=e.getCandlestickData(t);if(!(s!=null&&s._isUp)){const l=r.candlestick_color_down;i=ze(l)?l[t.id]:l}}return i||o},updateTextBGColor(t,e){const r=this,{$el:{defs:a}}=r;let o="";if(e){const i=Ue(e)?"":r.getTargetSelectorSuffix("id"in t?t.id:t.data.id),s=a.select(["filter[id*='labels-bg","']"].join(i));if(s.size()&&(o=`url(#${s.attr("id")})`),he(e)){r.generateTextBGColorFilter(e);const l=r.color(t),c=e.bind(r.api)(l,t);c?s.select("feFlood").attr("flood-color",c):o=""}}return o||null},redrawText(t,e,r,a){const o=this,{$T:i,axis:s,config:l,state:{hasTreemap:c}}=o,f=ar(!0),g=l.axis_rotated,p=l.data_labels.rotate,m=Jp(p),E=p?`rotate(${p})`:"";return o.$el.text.style("fill",o.getStylePropValue(o.updateTextColor)).attr("filter",w=>o.updateTextBGColor.bind(o)(w,l.data_labels_backgroundColors)).style("fill-opacity",r?0:o.opacityForText.bind(o)).each(function(w,U){const N=i(c&&this.childElementCount?this.parentNode:this,!!(a&&(this.getAttribute("x")||this.getAttribute("transform"))),f),D=l[`axis_${s==null?void 0:s.getId(w.id)}_inverted`];let Y={x:t.bind(this)(w,U),y:e.bind(this)(w,U)};p&&(Y=Qp.bind(o)(w,Y,m,g,D),N.attr("text-anchor",m)),Wc.call(o,this,Y),this.childElementCount||p?N.attr("transform",`translate(${Y.x} ${Y.y}) ${E}`):N.attr("x",Y.x).attr("y",Y.y),l.data_labels.border&&kp.call(o,N.node(),Y,`${gn.textBorderRect}-${U}`)}),!0},getTextRect(t,e){var r,a;const o=this;let i,s,l;Array.isArray(t)?i=`${Mn.textRect}-${t.join("_")}`:(s=(a=(r=t.node)==null?void 0:r.call(t))!=null?a:t,/text/i.test(s.tagName)||(s=s.querySelector("text")),l=s.textContent,i=`${Mn.textRect}-${l.replace(/\W/g,"_")}`);const c=o.cache.get(i)||[];return c.length===0&&((o.$el.svg||o.$el.chart.select("svg")).selectAll(`.${Se.dummy}`).data(l?[l]:t).enter().append("text").style("visibility","hidden").style("font",s?it(s).style("font"):null).classed(e||Se.dummy,!0).text(f=>f).each(function(f,g){c[g]=mn(this)}).remove(),o.cache.add(i,c)),c.length>1?c:c[0]},generateXYForText(t,e){const r=this,{state:{hasRadar:a,hasFunnel:o,hasTreemap:i}}=r,s=Object.keys(t),l={},c=e?r.getXForText:r.getYForText;return o&&s.push("funnel"),a&&s.push("radar"),i&&s.push("treemap"),s.forEach(f=>{l[f]=r[`generateGet${In(f)}Points`](t[f],!1)}),function(f,g){const p=r.isAreaType(f)&&"area"||r.isBarType(f)&&"bar"||r.isCandlestickType(f)&&"candlestick"||r.isFunnelType(f)&&"funnel"||r.isRadarType(f)&&"radar"||r.isTreemapType(f)&&"treemap"||"line";return c.call(r,l[p](f,g),f,this)}},getCenteredTextPos(t,e,r,a){const o=this,{config:i}=o,s=i.axis_rotated,l=o.isBarType(t),c=o.isTreemapType(t);if(i.data_labels.centered&&(l||c)){const f=mn(r);if(l){const g=o.getRangedData(t,null,"bar")>=0;if(s){const p=(g?e[1][1]-e[0][1]:e[0][1]-e[1][1])/2+f.width/2;return g?-p-3:p+2}else{const p=(g?e[0][1]-e[1][1]:e[1][1]-e[0][1])/2+f.height/2;return g?p:-p-2}}else if(c)return a==="x"?(e[1][0]-e[0][0])/2:(e[1][1]-e[0][1])/2+f.height/2}return 0},getXForText(t,e,r){var a;const o=this,{config:i}=o,s=i.axis_rotated,l=o.isFunnelType(e),c=o.isTreemapType(e);let f=t?t[0][0]:0;if(o.isCandlestickType(e))s?f=(a=o.getCandlestickData(e))!=null&&a._isUp?t[2][2]+4:t[2][1]-4:f+=(t[1][0]-f)/2;else if(l)f+=o.state.current.width/2;else if(c)f+=i.data_labels.centered?0:5;else if(s){const g=i[`axis_${o.axis.getId(e.id)}_inverted`],p=o.isBarType(e)?4:6,m=e.value;f=t[2][1],g?f-=p*(m>0?1:-1):f+=p*(m<0?-1:1)}else f=o.hasType("bar")?(t[2][0]+t[0][0])/2:f;return(s||c)&&(f+=o.getCenteredTextPos(e,t,r,"x")),f+Xc.call(this,e,"x")},getYForText(t,e,r){const a=this,{axis:o,config:i,state:s}=a,l=i.axis_rotated,c=i[`axis_${o==null?void 0:o.getId(e.id)}_inverted`],f=a.isBarType(e),g=a.isFunnelType(e),p=a.isTreemapType(e),m=i.point_r,E=mn(r);let{value:w}=e,U=3,N;if(a.isCandlestickType(e))w=a.getCandlestickData(e),l?(N=t[0][0],N+=(t[1][0]-N)/2+U):(N=w&&w._isUp?t[2][2]-U:t[2][1]+U*4,c&&(N+=15*(w._isUp?1:-1)));else if(g)N=t?t[0][1]+(t[1][1]-t[0][1])/2+E.height/2-3:0;else if(p)N=t[0][1]+(i.data_labels.centered?0:E.height+5);else if(l)N=(t[0][0]+t[2][0]+E.height*.6)/2;else if(N=t[2][1],pe(m)&&m>5&&(a.isLineType(e)||a.isScatterType(e))&&(U+=i.point_r/2.3),w<0||w===0&&!s.hasPositiveValue&&s.hasNegativeValue)N+=c?f?-3:-5:E.height+(f?-U:U);else{let D=-U*2;f?D=-U:a.isBubbleType(e)&&(D=U),c&&(D=f?10:15),N+=D}return(!l||p)&&(N+=a.getCenteredTextPos(e,t,r,"y")),N+Xc.call(this,e,"y")},markOverlapped(t,e,r){const a=e.$el.arcs.selectAll(r),o=a.filter(c=>c.data.id!==t),i=a.filter(c=>c.data.id===t),s=ql(i.node()),l=(c,f)=>Math.sqrt(Math.pow(c,2)+Math.pow(f,2));i.node()&&o.each(function(){const c=ql(this),f=it(this),g=l(s.e,s.f)>l(c.e,c.f)?i:f,p=Math.ceil(Math.abs(s.e-c.e))<Math.ceil(g.node().getComputedTextLength()),m=Math.ceil(Math.abs(s.f-c.f))<parseInt(i.style("font-size"),10);f.classed(gn.TextOverlapping,p&&m)})},undoMarkOverlapped(t,e){t.$el.arcs.selectAll(e).each(function(){Vc([this,this.previousSibling]).classed(gn.TextOverlapping,!1)})}};function Yc(t="left",e){const r=pe(e);let a;return t.indexOf("center")>-1?a=r?e/2:"middle":t.indexOf("right")>-1?a=r?e:"end":a=r?0:"start",a}var tm={initTitle(){const t=this,{config:e,$el:r}=t;if(e.title_text){r.title=r.svg.append("g");const a=r.title.append("text").style("text-anchor",Yc(e.title_position)).attr("class",gn.title);Da(a,e.title_text,[.3,1.5])}},redrawTitle(){const t=this,{config:e,state:{current:r},$el:{title:a}}=t;if(a){const o=Yc(e.title_position,r.width),i=(e.title_padding.top||0)+t.getTextRect(t.$el.title,gn.title).height;a.attr("transform",`translate(${o}, ${i})`)}},getTitlePadding(){const t=this,{$el:{title:e},config:r}=t;return(r.title_padding.top||0)+(e?t.getTextRect(e,gn.title).height:0)+(r.title_padding.bottom||0)}},em={initTooltip(){const t=this,{config:e,$el:r}=t;r.tooltip=it(e.tooltip_contents.bindto),r.tooltip.empty()&&(r.tooltip=r.chart.append("div").attr("class",ro.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),t.bindTooltipResizePos()},initShowTooltip(){var t;const e=this,{config:r,$el:a,state:{hasAxis:o,hasRadar:i}}=e;if(r.tooltip_init_show){const s=!(o||i);(t=e.axis)!=null&&t.isTimeSeries()&&Ue(r.tooltip_init_x)&&(r.tooltip_init_x=Kn.call(e,r.tooltip_init_x)),e.api.tooltip.show({data:{[s?"index":"x"]:r.tooltip_init_x}});const l=r.tooltip_init_position;if(!r.tooltip_contents.bindto&&!_n(l)){const{top:c=0,left:f=50}=l;a.tooltip.style("top",Ue(c)?c:`${c}px`).style("left",Ue(f)?f:`${f}px`).style("display",null)}}},getTooltipHTML(...t){const e=this,{api:r,config:a}=e;return he(a.tooltip_contents)?a.tooltip_contents.bind(r)(...t):e.getTooltipContent(...t)},getTooltipContent(t,e,r,a){var o;const i=this,{api:s,config:l,state:c,$el:f}=i,[g,p,m]=["title","name","value"].map(vt=>{const tt=l[`tooltip_format_${vt}`];return he(tt)?tt.bind(s):tt}),E=(...vt)=>wi((g||e)(...vt)),w=(...vt)=>wi((p||(tt=>tt))(...vt)),U=(...vt)=>{const tt=m||(c.hasTreemap||i.isStackNormalized()?(St,ct)=>`${(ct*100).toFixed(2)}%`:r);return wi(tt(...vt))},N=l.tooltip_order,D=vt=>i.axis&&i.isBubbleZType(vt)?i.getBubbleZData(vt.value,"z"):i.getBaseValue(vt),Y=i.levelColor?vt=>i.levelColor(vt.value):vt=>a(vt),J=l.tooltip_contents,K=J.template,nt=i.mapToTargetIds();if(N===null&&l.data_groups.length){const vt=i.orderTargets(i.data.targets).map(tt=>tt.id).reverse();t.sort((tt,St)=>{let ct=tt?tt.value:null,At=St?St.value:null;return ct>0&&At>0&&(ct=tt.id?vt.indexOf(tt.id):null,At=St.id?vt.indexOf(St.id):null),ct-At})}else if(/^(asc|desc)$/.test(N)){const vt=N==="asc";t.sort((tt,St)=>{const ct=tt?D(tt):null,At=St?D(St):null;return vt?ct-At:At-ct})}else he(N)&&t.sort(N.bind(s));const Q=i.getTooltipContentTemplate(K),ot=t.length;let pt,Tt,yt,lt,jt;for(jt=0;jt<ot;jt++)if(Tt=t[jt],!(!Tt||!(D(Tt)||D(Tt)===0))){if(ln(pt)){const vt=(c.hasAxis||c.hasRadar)&&E(Tt.x);pt=Na(Q[0],{CLASS_TOOLTIP:ro.tooltip,TITLE:De(vt)?K?vt:`<tr><th colspan="2">${vt}</th></tr>`:""})}if(!Tt.ratio&&f.arcs&&(yt=["arc",i.$el.arcs.select(`path.${Ve.arc}-${Tt.id}`).data()[0]],Tt.ratio=i.getRatio(...yt)),yt=[Tt.ratio,Tt.id,Tt.index],i.isAreaRangeType(Tt)){const[vt,tt]=["high","low"].map(ct=>U(i.getRangedData(Tt,ct),...yt));lt=`<b>Mid:</b> ${U(D(Tt),...yt)} <b>High:</b> ${vt} <b>Low:</b> ${tt}`}else if(i.isCandlestickType(Tt)){const[vt,tt,St,ct,At]=["open","high","low","close","volume"].map(Wt=>i.getRangedData(Tt,Wt,"candlestick")?U(i.getRangedData(Tt,Wt,"candlestick"),...yt):void 0);lt=`<b>Open:</b> ${vt} <b>High:</b> ${tt} <b>Low:</b> ${St} <b>Close:</b> ${ct}${At?` <b>Volume:</b> ${At}`:""}`}else if(i.isBarRangeType(Tt)){const{value:vt,id:tt,index:St}=Tt;lt=`${U(vt,void 0,tt,St)}`}else lt=U(D(Tt),...yt);if(lt!==void 0){if(Tt.name===null)continue;const vt=w((o=Tt.name)!=null?o:Tt.id,...yt),tt=Y(Tt),St={CLASS_TOOLTIP_NAME:ro.tooltipName+i.getTargetSelectorSuffix(Tt.id),COLOR:K||!i.patterns?tt:`<svg><rect style="fill:${tt}" width="10" height="10"></rect></svg>`,NAME:vt,VALUE:lt};if(K&&ze(J.text)){const ct=nt.indexOf(Tt.id);Object.keys(J.text).forEach(At=>{St[At]=J.text[At][ct]})}pt+=Na(Q[1],St)}}return`${pt}</table>`},getTooltipContentTemplate(t){return(t||`<table class="{=CLASS_TOOLTIP}"><tbody>
|
|
41
|
+
`)}function f(p){return p.map(g).join(t)}function g(p){return p==null?"":p instanceof Date?Dg(p):e.test(p+="")?'"'+p.replace(/"/g,'""')+'"':p}return{parse:a,parseRows:o,format:s,formatBody:l,formatRows:c,formatRow:f,formatValue:g}}var Br=cc(","),Ng=Br.parse,Lg=Br.parseRows,S1=Br.format,$1=Br.formatBody,A1=Br.formatRows,E1=Br.formatRow,b1=Br.formatValue,Ur=cc(" "),Fg=Ur.parse,Bg=Ur.parseRows,I1=Ur.format,R1=Ur.formatBody,O1=Ur.formatRows,C1=Ur.formatRow,P1=Ur.formatValue;function Xi(t){const e=[];return t.forEach(function(r,a){const o=r[0];r.forEach(function(i,s){if(s>0){if(typeof e[s-1]=="undefined"&&(e[s-1]={}),typeof i=="undefined")throw new Error(`Source data is missing a component at (${a}, ${s})!`);e[s-1][o]=i}})}),e}function Hi(t){const e=t[0],r=[];return t.forEach(function(a,o){if(o>0){const i={};a.forEach(function(s,l){if(typeof s=="undefined")throw new Error(`Source data is missing a component at (${o}, ${l})!`);i[e[l]]=s}),r.push(i)}}),r}function uc(t,e){const r=[];let a,o;if(Array.isArray(t)){const i=function(s,l){if(s[l]!==void 0)return s[l];const f=l.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");let g=s;return f.some(function(p){return!(g=g&&p in g?g[p]:void 0)}),g};e.x?a=e.value.concat(e.x):a=e.value,r.push(a),t.forEach(function(s){const l=a.map(function(c){let f=i(s,c);return typeof f=="undefined"&&(f=null),f});r.push(l)}),o=Hi(r)}else Object.keys(t).forEach(function(i){var s;const l=t[i].concat();(s=l.unshift)==null||s.call(l,i),r.push(l)}),o=Xi(r);return o}function Ug(t,e="csv",r,a,o){const i=new XMLHttpRequest,s={csv:zg,tsv:jg,json:uc};i.open("GET",t),r&&Object.keys(r).forEach(function(l){i.setRequestHeader(l,r[l])}),i.onreadystatechange=function(){if(i.readyState===4)if(i.status===200){const l=i.responseText;l&&o.call(this,s[e](e==="json"?JSON.parse(l):l,a))}else throw new Error(`${t}: Something went wrong loading!`)},i.send()}function fc(t,e){const r=t.rows(e);let a;return r.length===1?(a=[{}],r[0].forEach(o=>{a[0][o]=null})):a=t.parse(e),a}function zg(t){return fc({rows:Lg,parse:Ng},t)}function jg(t){return fc({rows:Bg,parse:Fg},t)}function dc(t,e){const r=t||(e==null?void 0:e.data_keys);return r!=null&&r.x&&(e.data_x=r.x),r}function Gg(t,e,r){const a=this,{config:o}=a;let i;t.forEach(s=>{const l=a.getXKey(s);if(r.customX||r.timeSeries?r.xs.indexOf(l)>=0?i=(r.appendXs&&a.data.xs[s]||[]).concat(e.map((c,f)=>{const g=De(c[l]);return g?a.generateTargetX(g,s,f):!1}).filter(c=>c!==!1)):o.data_x?i=this.getOtherTargetXs():cn(o.data_xs)&&(i=a.getXValuesOfXKey(l,a.data.targets)):i=e.map((c,f)=>f),i)a.data.xs[s]=i;else throw new Error(`x is not defined for id = "${s}".`)})}var Vg={convertData(t,e){const{config:r}=this,a=i=>i!=null&&i.length&&!Yn(i[0])?r.boost_useWorker:!1;let o=t;if(t.bindto&&(o={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(i=>{const s=`data_${i}`;s in t&&(o[i]=t[s])})),o.url&&e)Ug(o.url,o.mimeType,o.headers,dc(o.keys,r),e);else if(o.json)zi(a(o.json),uc,e,[Xi,Hi])(o.json,dc(o.keys,r));else if(o.rows)zi(a(o.rows),Hi,e)(o.rows);else if(o.columns)zi(a(o.columns),Xi,e)(o.columns);else if(t.bindto)throw Error("url or json or rows or columns is required.")},convertDataToTargets(t,e){const r=this,{axis:a,config:o,state:i}=r,s=o.data_type,l=Object.keys(t[0]||{}),{ids:c,xs:f}=l.length?l.reduce((m,E)=>(r.isX.call(r,E)?m.xs.push(E):r.isNotX.call(r,E)&&m.ids.push(E),m),{ids:[],xs:[]}):{ids:[],xs:[]},g={appendXs:e,xs:f,idConverter:o.data_idConverter.bind(r.api),categorized:a==null?void 0:a.isCategorized(),timeSeries:a==null?void 0:a.isTimeSeries(),customX:a==null?void 0:a.isCustomX()};Gg.bind(r)(c,t,g);const p=c.map((m,E)=>{const w=o.data_idConverter.bind(r.api)(m),U=r.getXKey(m),N=g.customX&&g.categorized,D=N&&(()=>{const K=new Set(o.axis_x_categories);return t.every(nt=>K.has(nt.x))})(),Y=t.__append__,J=U===null&&Y?r.api.data.values(m).length:0;return{id:w,id_org:m,values:t.map((K,nt)=>{const Q=K[U];let ot=K[m],pt;return ot=ot!==null&&!isNaN(ot)&&!ze(ot)?+ot:Ge(ot)||ze(ot)?ot:null,(N||i.hasRadar)&&E===0&&!ln(Q)?(!D&&E===0&&nt===0&&!Y&&(o.axis_x_categories=[]),pt=o.axis_x_categories.indexOf(Q),pt===-1&&(pt=o.axis_x_categories.length,o.axis_x_categories.push(Q))):pt=r.generateTargetX(Q,m,J+nt),(ln(ot)||r.data.xs[m].length<=nt)&&(pt=void 0),{x:pt,value:ot,id:w,index:-1}}).filter(K=>Qe(K.x))}});if(p.forEach(m=>{var E;o.data_xSort&&(m.values=m.values.sort((w,U)=>{const N=w.x||w.x===0?w.x:1/0,D=U.x||U.x===0?U.x:1/0;return N-D})),m.values.forEach((w,U)=>w.index=U),(E=r.data.xs[m.id])==null||E.sort((w,U)=>w-U)}),i.hasNegativeValue=r.hasNegativeValueInTargets(p),i.hasPositiveValue=r.hasPositiveValueInTargets(p),s&&r.isValidChartType(s)){const m=r.mapToIds(p).filter(E=>!(E in o.data_types)||!r.isValidChartType(o.data_types[E]));r.setTargetType(m,s)}return p.forEach(m=>r.cache.add(m.id_org,m,!0)),p}},Xg={isX(t){const e=this,{config:r}=e,a=r.data_x&&t===r.data_x,o=cn(r.data_xs)&&ag(r.data_xs,t);return a||o},isNotX(t){return!this.isX(t)},isStackNormalized(){const{config:t}=this;return!!(t.data_stack_normalize&&t.data_groups.length)},isGrouped(t){const e=this.config.data_groups;return t?e.some(r=>r.indexOf(t)>=0&&r.length>1):e.length>0},getXKey(t){const e=this,{config:r}=e;return r.data_x?r.data_x:cn(r.data_xs)?r.data_xs[t]:null},getXValuesOfXKey(t,e){const r=this,a=e&&cn(e)?r.mapToIds(e):[];let o;return a.forEach(i=>{r.getXKey(i)===t&&(o=r.data.xs[i])}),o},getIndexByX(t,e){const r=this;return e?e.indexOf(Ue(t)?t:+t):(r.filterByX(r.data.targets,t)[0]||{index:null}).index},getXValue(t,e){const r=this;return t in r.data.xs&&r.data.xs[t]&&De(r.data.xs[t][e])?r.data.xs[t][e]:e},getOtherTargetXs(){const t=this,e=Object.keys(t.data.xs);return e.length?t.data.xs[e[0]]:null},getOtherTargetX(t){const e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},addXs(t){const e=this,{config:r}=e;Object.keys(t).forEach(a=>{r.data_xs[a]=t[a]})},isMultipleX(){return!this.config.axis_x_forceAsSingle&&(cn(this.config.data_xs)||this.hasType("bubble")||this.hasType("scatter"))},addName(t){const e=this,{config:r}=e;let a;return t&&(a=r.data_names[t.id],t.name=a!==void 0?a:t.id),t},getAllValuesOnIndex(t,e=!1){const r=this;let a=r.filterTargetsToShow(r.data.targets).map(o=>r.addName(r.getValueOnIndex(o.values,t)));return e&&(a=a.filter(o=>o&&"value"in o&&De(o.value))),a},getValueOnIndex(t,e){const r=t.filter(a=>a.index===e);return r.length?r[0]:null},updateTargetX(t,e){const r=this;t.forEach(a=>{a.values.forEach((o,i)=>{o.x=r.generateTargetX(e[i],a.id,i)}),r.data.xs[a.id]=e})},updateTargetXs(t,e){const r=this;t.forEach(a=>{e[a.id]&&r.updateTargetX([a],e[a.id])})},generateTargetX(t,e,r){const a=this,{axis:o}=a;let i=o!=null&&o.isCategorized()?r:t||r;if(o!=null&&o.isTimeSeries()){const s=Zn.bind(a);i=s(t||a.getXValue(e,r))}else o!=null&&o.isCustomX()&&!(o!=null&&o.isCategorized())&&(i=De(t)?+t:a.getXValue(e,r));return i},updateXs(t){t.length&&(this.axis.xs=t.map(e=>e.x))},getPrevX(t){const e=this.axis.xs[t-1];return Qe(e)?e:null},getNextX(t){const e=this.axis.xs[t+1];return Qe(e)?e:null},getBaseValue(t){const e=this,{hasAxis:r}=e.state;let{value:a}=t;return a&&r&&(e.isAreaRangeType(t)?a=e.getRangedData(t,"mid"):e.isBubbleZType(t)&&(a=e.getBubbleZData(a,"y"))),a},getMinMaxValue(t){const e=this.getBaseValue.bind(this);let r,a;return(t||this.data.targets.map(o=>o.values)).forEach((o,i)=>{const s=o.map(e).filter(pe);r=Math.min(i?r:1/0,...s),a=Math.max(i?a:-1/0,...s)}),{min:r,max:a}},getMinMaxData(){const t=this,e=Mn.dataMinMax;let r=t.cache.get(e);if(!r){const a=t.data.targets.map(f=>f.values),o=t.getMinMaxValue(a);let i=[],s=[];const{min:l,max:c}=o;a.forEach(f=>{const g=t.getFilteredDataByValue(f,l),p=t.getFilteredDataByValue(f,c);g.length&&(i=i.concat(g)),p.length&&(s=s.concat(p))}),t.cache.add(e,r={min:i,max:s})}return r},getTotalPerIndex(){const t=this,e=Mn.dataTotalPerIndex;let r=t.cache.get(e);return(t.config.data_groups.length||t.isStackNormalized())&&!r&&(r=[],t.data.targets.forEach(a=>{a.values.forEach((o,i)=>{r[i]||(r[i]=0),r[i]+=~~o.value})})),r},getTotalDataSum(t){const e=this,r=Mn.dataTotalSum;let a=e.cache.get(r);return pe(a)||(a=e.data.targets.reduce((o,i)=>o+i.values.reduce((s,l)=>s+~~l.value,0),0),e.cache.add(r,a)),t&&(a-=e.getHiddenTotalDataSum()),a},getHiddenTotalDataSum(){const t=this,{api:e,state:{hiddenTargetIds:r}}=t;let a=0;return r.length&&(a=e.data.values.bind(e)(r).reduce((o,i)=>o+i)),a},getFilteredDataByValue(t,e){return t.filter(r=>this.getBaseValue(r)===e)},getMaxDataCount(){return Math.max(...this.data.targets.map(t=>t.values.length),0)},getMaxDataCountTarget(){let t=this.filterTargetsToShow()||[];const e=t.length,r=this.config.axis_x_inverted;return e>1?(t=t.map(a=>a.values).reduce((a,o)=>a.concat(o)).map(a=>a.x),t=aa(Ni(t)).map((a,o,i)=>({x:a,index:r?i.length-o-1:o}))):e&&(t=t[0].values.concat()),t},mapToIds(t){return t.map(e=>e.id)},mapToTargetIds(t){const e=this;return t?Ge(t)?t.concat():[t]:e.mapToIds(e.data.targets)},hasTarget(t,e){const r=this.mapToIds(t);for(let a=0,o;o=r[a];a++)if(o===e)return!0;return!1},isTargetToShow(t){return this.state.hiddenTargetIds.indexOf(t)<0},isLegendToShow(t){return this.state.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow(t){const e=this;return(t||e.data.targets).filter(r=>e.isTargetToShow(r.id))},mapTargetsToUniqueXs(t){const e=this,{axis:r}=e;let a=[];return t!=null&&t.length&&(a=Ni(_l(t.map(o=>o.values.map(i=>+i.x)))),a=r!=null&&r.isTimeSeries()?a.map(o=>new Date(+o)):a.map(Number)),aa(a)},addTargetIds(t,e){const{state:r}=this;(Ge(e)?e:[e]).forEach(o=>{r[t].indexOf(o)<0&&r[t].push(o)})},removeTargetIds(t,e){const{state:r}=this;(Ge(e)?e:[e]).forEach(o=>{const i=r[t].indexOf(o);i>=0&&r[t].splice(i,1)})},addHiddenTargetIds(t){this.addTargetIds("hiddenTargetIds",t)},removeHiddenTargetIds(t){this.removeTargetIds("hiddenTargetIds",t)},addHiddenLegendIds(t){this.addTargetIds("hiddenLegendIds",t)},removeHiddenLegendIds(t){this.removeTargetIds("hiddenLegendIds",t)},getValuesAsIdKeyed(t){const e=this,{hasAxis:r}=e.state,a={},o=e.isMultipleX(),i=o?e.mapTargetsToUniqueXs(t).map(s=>Ue(s)?s:+s):null;return t.forEach(s=>{const l=[];s.values.filter(({value:c})=>De(c)||c===null).forEach(c=>{let{value:f}=c;f!==null&&e.isCandlestickType(c)&&(f=Ge(f)?f.slice(0,4):[f.open,f.high,f.low,f.close]),Ge(f)?l.push(...f):ze(f)&&"high"in f?l.push(...Object.values(f)):e.isBubbleZType(c)?l.push(r&&e.getBubbleZData(f,"y")):o?l[e.getIndexByX(c.x,i)]=f:l.push(f)}),a[s.id]=l}),a},checkValueInTargets(t,e){return Object.keys(t).some(r=>t[r].values.some(a=>e(a.value)))},hasMultiTargets(){return this.filterTargetsToShow().length>1},hasNegativeValueInTargets(t){return this.checkValueInTargets(t,e=>e<0)},hasPositiveValueInTargets(t){return this.checkValueInTargets(t,e=>e>0)},orderTargets(t){const e=this,r=[...t],a=e.getSortCompareFn();return a&&r.sort(a),r},getSortCompareFn(t=!1){const e=this,{config:r}=e,a=r.data_order,o=/asc/i.test(a),i=/desc/i.test(a);let s;if(o||i){const l=(f,g)=>f+Math.abs(g.value),c=f=>pe(f)?f:"values"in f?f.values.reduce(l,0):f.value;s=(f,g)=>{const p=c(f),m=c(g);return t?o?p-m:m-p:o?m-p:p-m}}else he(a)&&(s=a.bind(e.api));return s||null},filterByX(t,e){return _l(t.map(r=>r.values)).filter(r=>r.x-e===0)},filterNullish(t){const e=r=>De(r.value);return t&&t.filter(r=>"value"in r?e(r):r.values.some(e))},filterRemoveNull(t){return t.filter(e=>De(this.getBaseValue(e)))},filterByXDomain(t,e){return t.map(r=>({id:r.id,id_org:r.id_org,values:r.values.filter(a=>e[0]<=a.x&&a.x<=e[1])}))},hasDataLabel(){const t=this.config.data_labels;return Mi(t)&&t||rr(t)&&cn(t)},hasNullDataValue(t){return t.some(({value:e})=>e===null)},getDataIndexFromEvent(t){const e=this,{$el:r,config:a,state:{hasRadar:o,inputType:i,eventReceiver:{coords:s,rect:l}}}=e;let c;if(o){let f=t.target;/tspan/i.test(f.tagName)&&(f=f.parentNode);const g=it(f).datum();c=g&&Object.keys(g).length===1?g.index:void 0}else{const f=a.axis_rotated,g=kl(r.chart.node()),p=i==="touch"&&t.changedTouches?t.changedTouches[0]:t;let m=f?p.clientY+g.y:p.clientX+g.x;if(Li(r.svg)){const E=[m,0];f&&E.reverse(),m=Io(r.eventRect.node(),...E)[f?"y":"x"]}else m-=f?l.top:l.left;c=Di(s,m,0,s.length-1,f)}return c},getDataLabelLength(t,e,r){var a;const o=this,i=1.3;return((a=o.getTextRect([t,e].map(s=>o.dataLabelFormat()(s))))==null?void 0:a.map(s=>s[r]*i))||[0,0]},isNoneArc(t){return this.hasTarget(this.data.targets,t.id)},isArc(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},findSameXOfValues(t,e){const r=t[e].x,a=[];let o;for(o=e-1;o>=0&&r===t[o].x;o--)a.push(t[o]);for(o=e;o<t.length&&r===t[o].x;o++)a.push(t[o]);return a},findClosestFromTargets(t,e){const r=this,a=t.map(o=>r.findClosest(o.values,e));return r.findClosest(a,e)},findClosest(t,e){const r=this,{$el:{main:a}}=r,o=t.filter(l=>l&&De(l.value));let i,s;return o.filter(l=>r.isBarType(l.id)||r.isCandlestickType(l.id)).forEach(l=>{const c=r.isBarType(l.id)?`.${zn.chartBar}.${Se.target}${r.getTargetSelectorSuffix(l.id)} .${zn.bar}-${l.index}`:`.${fr.chartCandlestick}.${Se.target}${r.getTargetSelectorSuffix(l.id)} .${fr.candlestick}-${l.index} path`;!s&&r.isWithinBar(a.select(c).node())&&(s=l)}),o.filter(l=>!r.isBarType(l.id)&&!r.isCandlestickType(l.id)).forEach(l=>{const c=r.dist(l,e);i=r.getPointSensitivity(l),c<i&&(i=c,s=l)}),s},dist(t,e){const r=this,{config:{axis_rotated:a},scale:o}=r,i=+a,s=+!a,l=r.circleY(t,t.index),c=(o.zoom||o.x)(t.x);return Math.sqrt(Math.pow(c-e[i],2)+Math.pow(l-e[s],2))},convertValuesToStep(t){const e=this,{axis:r,config:a}=e,o=a.line_step_type,i=r?r.isCategorized():!1,s=Ge(t)?t.concat():[t];if(!(i||/step\-(after|before)/.test(o)))return t;if(s.length){const l=s[0],c=s[s.length-1],{id:f}=l;let{x:g}=l;s.unshift({x:--g,value:l.value,id:f}),i&&o==="step-after"&&s.unshift({x:--g,value:l.value,id:f}),g=c.x,s.push({x:++g,value:c.value,id:f}),i&&o==="step-before"&&s.push({x:++g,value:c.value,id:f})}return s},convertValuesToRange(t){const e=Ge(t)?t.concat():[t],r=[];return e.forEach(a=>{const{x:o,id:i}=a;r.push({x:o,id:i,value:a.value[0]}),r.push({x:o,id:i,value:a.value[2]})}),r},updateDataAttributes(t,e){const r=this,{config:a}=r,o=a[`data_${t}`];return ln(e)||(Object.keys(e).forEach(i=>{o[i]=e[i]}),r.redraw({withLegend:!0})),o},getRangedData(t,e="",r="areaRange"){const a=t==null?void 0:t.value;if(Ge(a)){if(r==="bar")return a.reduce((o,i)=>i-o);{const o={areaRange:["high","mid","low"],candlestick:["open","high","low","close","volume"]}[r].indexOf(e);return o>=0&&a?a[o]:void 0}}else if(a&&e)return a[e];return a},setRatioForGroupedData(t){const e=this,{config:r}=e;if(r.data_groups.length&&t.some(a=>e.isGrouped(a.id))){const a=o=>e.getRatio("index",o,!0);t.forEach(o=>{"values"in o?o.values.forEach(a):a(o)})}},getRatio(t,e,r=!1){const a=this,{config:o,state:i}=a,s=a.api;let l=0;if(e&&s.data.shown().length)if(l=e.ratio||e.value,t==="arc")if(a.pie.padAngle()())l=e.value/a.getTotalDataSum(!0);else{const c=o.gauge_fullCircle?a.getArcLength():a.getStartingAngle()*-2,f=a.hasType("gauge")?c:Math.PI*2;l=(e.endAngle-e.startAngle)/f}else if(t==="index"){const c=s.data.values.bind(s);let f=this.getTotalPerIndex();if(i.hiddenTargetIds.length){let p=c(i.hiddenTargetIds,!1);p.length&&(p=p.reduce((m,E)=>m.map((w,U)=>~~w+E[U])),f=f.map((m,E)=>m-p[E]))}const g=f[e.index];e.ratio=pe(e.value)&&f&&g?e.value/g:0,l=e.ratio}else if(t==="radar")l=parseFloat(String(Math.max(e.value,0)))/i.current.dataMax*o.radar_size_ratio;else if(t==="bar"){const f=a.getYScaleById.bind(a)(e.id).domain().reduce((g,p)=>p-g);l=f===0?0:Math.abs(a.getRangedData(e,null,t)/f)}else t==="treemap"&&(l/=a.getTotalDataSum(!0));return r&&l?l*100:l},updateDataIndexByX(t){const e=this,r=t.reduce((a,o,i)=>(a[Number(o.x)]=i,a),{});e.data.targets.forEach(a=>{a.values.forEach((o,i)=>{let s=r[Number(o.x)];s===void 0&&(s=i),o.index=s})})},isBubbleZType(t){return this.isBubbleType(t)&&(ze(t.value)&&("z"in t.value||"y"in t.value)||Ge(t.value)&&t.value.length>=2)},isBarRangeType(t){const e=this,{value:r}=t;return e.isBarType(t)&&Ge(r)&&r.length>=2&&r.every(pe)},getDataById(t){var e;const r=this.cache.get(t)||this.api.data(t);return(e=r==null?void 0:r[0])!=null?e:r}};function hc(t,e=!1){const r=this,{api:a}=r;e&&r.api.flush(!0),t==null||t.call(a)}var Hg={load(t,e){const r=this,{axis:a,data:o,org:i,scale:s}=r,{append:l}=e,c={domain:null,currentDomain:null,x:null};let f=t;f&&(e.filter&&(f=f.filter(e.filter)),(e.type||e.types)&&f.forEach(g=>{var p;const m=((p=e.types)==null?void 0:p[g.id])||e.type;r.setTargetType(g.id,m)}),o.targets.forEach(g=>{for(let p=0;p<f.length;p++)if(g.id===f[p].id){g.values=l?g.values.concat(f[p].values):f[p].values,f.splice(p,1);break}}),o.targets=o.targets.concat(f)),r.updateTargets(o.targets),s.zoom&&(c.x=a.isCategorized()?s.x.orgScale():(i.xScale||s.x).copy(),c.domain=r.getXDomain(o.targets),c.x.domain(c.domain),c.currentDomain=r.zoom.getDomain(),r.withinRange(c.currentDomain,void 0,c.domain)||(s.x.domain(c.domain),s.zoom=null,r.$el.eventRect.property("__zoom",null))),r.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),s.zoom?(i.xDomain=c.domain,i.xScale=c.x,a.isCategorized()&&(c.currentDomain=r.getZoomDomainValue(c.currentDomain),i.xDomain=r.getZoomDomainValue(i.xDomain),i.xScale=c.x.domain(i.xDomain)),r.updateCurrentZoomTransform(c.x,c.currentDomain)):i.xScale&&i.xScale.domain(i.xDomain),r.updateTypesElements(),hc.call(r,e.done,e.resizeAfter)},loadFromArgs(t){const e=this;e.config&&(e.cache.reset(),e.convertData(t,r=>{const a=t.data||r;t.append&&(a.__append__=!0),a&&e.load(e.convertDataToTargets.call(e,a),t)}))},unload(t,e){var r;const a=this,{state:o,$el:i,$T:s}=a,l=!!((r=a.hasLegendDefsPoint)!=null&&r.call(a));let c=e,f=t;if(a.cache.reset(),c||(c=()=>{}),f=f.filter(p=>a.hasTarget(a.data.targets,p)),!f||f.length===0){c();return}const g=i.svg.selectAll(f.map(p=>a.selectorTarget(p)));s(g).style("opacity","0").remove().call(bo,c),f.forEach(p=>{var m;const E=a.getTargetSelectorSuffix(p);o.withoutFadeIn[p]=!1,i.legend&&i.legend.selectAll(`.${Ke.legendItem}${E}`).remove(),a.data.targets=a.data.targets.filter(w=>w.id!==p),l&&((m=i.defs)==null||m.select(`#${a.getDefsPointId(E)}`).remove())}),o.hasFunnel&&a.updateFunnel(a.data.targets),o.hasTreemap&&a.updateTargetsForTreemap(a.data.targets),a.updateTypesElements()}},Oo=(t=>()=>t);function Wi(t,{sourceEvent:e,subject:r,target:a,identifier:o,active:i,x:s,y:l,dx:c,dy:f,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:g}})}Wi.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Wg(t){return!t.ctrlKey&&!t.button}function Yg(){return this.parentNode}function Kg(t,e){return e==null?{x:t.x,y:t.y}:e}function Zg(){return navigator.maxTouchPoints||"ontouchstart"in this}function vc(){var t=Wg,e=Yg,r=Kg,a=Zg,o={},i=oo("start","drag","end"),s=0,l,c,f,g,p=0;function m(K){K.on("mousedown.drag",E).filter(a).on("touchstart.drag",N).on("touchmove.drag",D,nh).on("touchend.drag touchcancel.drag",Y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(K,nt){if(!(g||!t.call(this,K,nt))){var Q=J(this,e.call(this,K,nt),K,nt,"mouse");Q&&(it(K.view).on("mousemove.drag",w,Ea).on("mouseup.drag",U,Ea),di(K.view),fi(K),f=!1,l=K.clientX,c=K.clientY,Q("start",K))}}function w(K){if(Jr(K),!f){var nt=K.clientX-l,Q=K.clientY-c;f=nt*nt+Q*Q>p}o.mouse("drag",K)}function U(K){it(K.view).on("mousemove.drag mouseup.drag",null),hi(K.view,f),Jr(K),o.mouse("end",K)}function N(K,nt){if(t.call(this,K,nt)){var Q=K.changedTouches,ot=e.call(this,K,nt),pt=Q.length,Tt,yt;for(Tt=0;Tt<pt;++Tt)(yt=J(this,ot,K,nt,Q[Tt].identifier,Q[Tt]))&&(fi(K),yt("start",K,Q[Tt]))}}function D(K){var nt=K.changedTouches,Q=nt.length,ot,pt;for(ot=0;ot<Q;++ot)(pt=o[nt[ot].identifier])&&(Jr(K),pt("drag",K,nt[ot]))}function Y(K){var nt=K.changedTouches,Q=nt.length,ot,pt;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),ot=0;ot<Q;++ot)(pt=o[nt[ot].identifier])&&(fi(K),pt("end",K,nt[ot]))}function J(K,nt,Q,ot,pt,Tt){var yt=i.copy(),lt=Wn(Tt||Q,nt),jt,vt,tt;if((tt=r.call(K,new Wi("beforestart",{sourceEvent:Q,target:m,identifier:pt,active:s,x:lt[0],y:lt[1],dx:0,dy:0,dispatch:yt}),ot))!=null)return jt=tt.x-lt[0]||0,vt=tt.y-lt[1]||0,function St(ct,At,Wt){var Dt=lt,Zt;switch(ct){case"start":o[pt]=St,Zt=s++;break;case"end":delete o[pt],--s;case"drag":lt=Wn(Wt||At,nt),Zt=s;break}yt.call(ct,K,new Wi(ct,{sourceEvent:At,subject:tt,target:m,identifier:pt,active:Zt,x:lt[0]+jt,y:lt[1]+vt,dx:lt[0]-Dt[0],dy:lt[1]-Dt[1],dispatch:yt}),ot)}}return m.filter=function(K){return arguments.length?(t=typeof K=="function"?K:Oo(!!K),m):t},m.container=function(K){return arguments.length?(e=typeof K=="function"?K:Oo(K),m):e},m.subject=function(K){return arguments.length?(r=typeof K=="function"?K:Oo(K),m):r},m.touchable=function(K){return arguments.length?(a=typeof K=="function"?K:Oo(!!K),m):a},m.on=function(){var K=i.on.apply(i,arguments);return K===i?m:K},m.clickDistance=function(K){return arguments.length?(p=(K=+K)*K,m):Math.sqrt(p)},m}var Jg={setExpand(t,e,r){const a=this,{config:o,$el:{circle:i}}=a;i&&o.point_focus_expand_enabled&&a.expandCircles(t,e,r),a.expandBarTypeShapes(!0,t,e,r)},expandBarTypeShapes(t=!0,e,r,a){const o=this;["bar","candlestick"].filter(i=>o.$el[i]).forEach(i=>{a&&o.$el[i].classed(Se.EXPANDED,!1),o.getShapeByIndex(i,e,r).classed(Se.EXPANDED,t)})},setOverOut(t,e){const r=this,{config:a,state:{hasFunnel:o,hasRadar:i,hasTreemap:s},$el:{main:l}}=r,c=ze(e);if(c||e!==-1){const f=a[t?"data_onover":"data_onout"].bind(r.api);if(a.color_onover&&r.setOverColor(t,e,c),c){const g=r.getTargetSelectorSuffix(e.id),p=o||s?`${Se.target+g} .${sn.shape}`:Ve.arc+g;f(e,l.select(`.${p}`).node())}else if(a.tooltip_grouped)t&&(i&&r.isPointFocusOnly()?r.showCircleFocus(r.getAllValuesOnIndex(e,!0)):r.setExpand(e,null,!0)),!r.isMultipleX()&&l.selectAll(`.${sn.shape}-${e}`).each(function(g){f(g,this)});else{const g=r.cache.get(Mn.setOverOut)||[],p=l.selectAll(`.${sn.shape}-${e}`).filter(function(E){return r.isWithinShape(this,E)}),m=p.filter(function(){return g.every(E=>E!==this)});if(!t||p.empty()||g.length===m.size()&&m.nodes().every((E,w)=>E!==g[w]))for(;g.length;){const E=g.pop();a.data_onout.bind(r.api)(it(E).datum(),E)}m.each(function(){t&&(f(it(this).datum(),this),g.push(this))}),r.cache.add(Mn.setOverOut,g)}}},callOverOutForTouch(t){const e=this,r=e.cache.get(Mn.callOverOutForTouch);(ze(t)&&r?t.id!==r.id:t!==r)&&((r||pe(r))&&e.setOverOut(!1,r),(t||pe(t))&&e.setOverOut(!0,t),e.cache.add(Mn.callOverOutForTouch,t))},getDraggableSelection(){const t=this,{config:e,state:r}=t;return e.interaction_enabled&&e.data_selection_draggable&&t.drag?vc().on("drag",function(a){r.event=a,t.drag(Kn(a,this))}).on("start",function(a){r.event=a,t.dragstart(Kn(a,this))}).on("end",a=>{r.event=a,t.dragend()}):()=>{}},dispatchEvent(t,e,r){var a,o,i;const s=this,{config:l,state:{eventReceiver:c,hasAxis:f,hasFunnel:g,hasRadar:p,hasTreemap:m},$el:{eventRect:E,funnel:w,radar:U,svg:N,treemap:D}}=s;let Y=(i=(o=(g||m)&&c.rect||p&&U.axes.select(`.${vn.axis}-${e} text`)||E||((a=s.getArcElementByIdOrIndex)==null?void 0:a.call(s,e)))==null?void 0:o.node)==null?void 0:i.call(o);if(Y){const J=s.isMultipleX(),K=l.axis_rotated;let{width:nt,left:Q,top:ot}=mn(Y);if(f&&!p&&!J){const lt=c.coords[e];lt?(nt=lt.w,Q+=lt.x,ot+=lt.y):(nt=0,Q=0,ot=0)}let pt=Q+(r?r[0]:0)+(J||K?0:nt/2),Tt=ot+(r?r[1]:0)+(K?4:0);if(Li(N)){const lt=Io(s.$el.eventRect.node(),pt,Tt,!1);pt=lt.x,Tt=lt.y}const yt={screenX:pt,screenY:Tt,clientX:pt,clientY:Tt,bubbles:p};(g||m)&&(Y=(w!=null?w:D).node()),cg[/^(mouse|click)/.test(t)?"mouse":"touch"](Y,t,yt)}},setDragStatus(t){this.state.dragging=t},unbindZoomEvent(){const t=this,{$el:{eventRect:e,zoomResetBtn:r}}=t;e==null||e.on(".zoom wheel.zoom .drag",null),r==null||r.on("click",null).style("display","none")},unbindAllEvents(){var t;const e=this,{$el:{arcs:r,eventRect:a,legend:o,region:i,svg:s,treemap:l},brush:c}=e,f=["wheel","click","mouseover","mousemove","mouseout","touchstart","touchmove","touchend","touchstart.eventRect","touchmove.eventRect","touchend.eventRect",".brush",".drag",".zoom","wheel.zoom","dblclick.zoom"].join(" ");[s,a,i==null?void 0:i.list,c==null?void 0:c.getSelection(),r==null?void 0:r.selectAll("path"),o==null?void 0:o.selectAll("g"),l].forEach(g=>g==null?void 0:g.on(f,null)),(t=e.unbindZoomEvent)==null||t.call(e)}},Qg={categoryName(t){var e;const{axis_x_categories:r}=this.config;return(e=r==null?void 0:r[t])!=null?e:t}},kg={generateClass(t,e){return` ${t} ${t+this.getTargetSelectorSuffix(e)}`},getClass(t,e){const r=/s$/.test(t),a=/^(area|arc|line|funnel|treemap)s?$/.test(t),o=r?"id":"index";return i=>{const s=i.data||i;return((e?this.generateClass(je[r?"shapes":"shape"],s[o]):"")+this.generateClass(je[t],s[a?"id":o])).trim()}},getChartClass(t){return e=>je[`chart${t}`]+this.classTarget((e.data?e.data:e).id)},generateExtraLineClass(){const e=this.config.line_classes||[],r=[];return function(a){var o;const i=a.id||((o=a.data)==null?void 0:o.id)||a;return r.indexOf(i)<0&&r.push(i),e[r.indexOf(i)%e.length]}},classRegion(t,e){return`${this.generateClass(je.region,e)} ${"class"in t?t.class:""}`},classTarget(t){const e=this.config.data_classes[t];let r="";return e&&(r=` ${je.target}-${e}`),this.generateClass(je.target,t)+r},classFocus(t){return this.classFocused(t)+this.classDefocused(t)},classFocused(t){return` ${this.state.focusedTargetIds.indexOf(t.id)>=0?je.focused:""}`},classDefocused(t){return` ${this.state.defocusedTargetIds.indexOf(t.id)>=0?je.defocused:""}`},getTargetSelectorSuffix(t){return(t||t===0?`-${t}`:"").replace(/[\x00-\x20\x7F-\xA0\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-")},selectorTarget(t,e="",r=""){const a=this.getTargetSelectorSuffix(t);return`${e}.${je.target+a} ${r}, ${e}.${je.circles+a} ${r}`},selectorTargets(t,e){const r=t||[];return r.length?r.map(a=>this.selectorTarget(a,e)):null},selectorLegend(t){return`.${je.legendItem+this.getTargetSelectorSuffix(t)}`},selectorLegends(t){return t!=null&&t.length?t.map(e=>this.selectorLegend(e)):null}};class gc extends Map{constructor(e,r=yc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[a,o]of e)this.set(a,o)}get(e){return super.get(Yi(this,e))}has(e){return super.has(Yi(this,e))}set(e,r){return super.set(pc(this,e),r)}delete(e){return super.delete(mc(this,e))}}class M1 extends Set{constructor(e,r=yc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const a of e)this.add(a)}has(e){return super.has(Yi(this,e))}add(e){return super.add(pc(this,e))}delete(e){return super.delete(mc(this,e))}}function Yi({_intern:t,_key:e},r){const a=e(r);return t.has(a)?t.get(a):r}function pc({_intern:t,_key:e},r){const a=e(r);return t.has(a)?t.get(a):(t.set(a,r),r)}function mc({_intern:t,_key:e},r){const a=e(r);return t.has(a)&&(r=t.get(a),t.delete(a)),r}function yc(t){return t!==null&&typeof t=="object"?t.valueOf():t}function oa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function w1(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const xc=Symbol("implicit");function Tc(){var t=new gc,e=[],r=[],a=xc;function o(i){let s=t.get(i);if(s===void 0){if(a!==xc)return a;t.set(i,s=e.push(i)-1)}return r[s%r.length]}return o.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new gc;for(const s of i)t.has(s)||t.set(s,e.push(s)-1);return o},o.range=function(i){return arguments.length?(r=Array.from(i),o):r.slice()},o.unknown=function(i){return arguments.length?(a=i,o):a},o.copy=function(){return Tc(e,r).unknown(a)},oa.apply(o,arguments),o}const qg=(t,e,r)=>{const a=it(t.cloneNode(!0));return a.attr("id",r).insert("rect",":first-child").attr("width",a.attr("width")).attr("height",a.attr("height")).style("fill",e),{id:r,node:a.node()}};function _g(t){const e=Mn.colorPattern,{body:r}=pn;let a=r[e];if(!a){const i=t.classed(ci.colorPattern,!0).style("background-image");t.classed(ci.colorPattern,!1),i.indexOf(";")>-1&&(a=i.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(";").map(s=>s.trim().replace(/[\"'\s]/g,"")).filter(Boolean),r[e]=a)}return a}const tp=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];var ep={generateColor(){const t=this,{$el:e,config:r}=t,a=[];let o=cn(r.color_pattern)?r.color_pattern:Tc(_g(e.chart)||tp).range();const i=o;if(he(r.color_tiles)){const s=r.color_tiles.bind(t.api)(),l=o.map((c,f)=>{const g=c.replace(/[#\(\)\s,]/g,""),p=`${t.state.datetimeId}-pattern-${g}-${f}`;return qg(s[f%s.length],c,p)});o=l.map(c=>`url(#${c.id})`),t.patterns=l}return function(s){var l;const c=r.data_colors,f=r.data_color,g=s.id||((l=s.data)==null?void 0:l.id)||s,p=t.isTypeOf(g,["line","spline","step"])||!r.data_types[g];let m;return he(c[g])?m=c[g].bind(t.api)(s):c[g]?m=c[g]:(a.indexOf(g)<0&&a.push(g),m=p?i[a.indexOf(g)%i.length]:o[a.indexOf(g)%o.length],c[g]=m),he(f)?f.bind(t.api)(m,s):m}},generateLevelColor(){const t=this,{config:e}=t,r=e.color_pattern,a=e.color_threshold,o=a.unit==="value",i=a.max||100,s=a.values&&a.values.length?a.values:[];return cn(a)?function(l){const c=o?l:l*100/i;let f=r[r.length-1];for(let g=0,p=s.length;g<p;g++)if(c<=s[g]){f=r[g];break}return f}:null},generateTextBGColorFilter(t,e={x:0,y:0,width:1,height:1}){const r=this,{$el:{defs:a},state:o}=r;if(t){let i=[];Ue(t)?i.push(""):ze(t)?i=Object.keys(t):he(t)&&(i=r.mapToTargetIds()),i.forEach(s=>{const l=`${o.datetimeId}-labels-bg${r.getTargetSelectorSuffix(s)}${Ue(t)?r.getTargetSelectorSuffix(t):""}`,c=s===""?t:(t==null?void 0:t[s])||"";a.select(`#${l}`).empty()&&a.append("filter").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height).attr("id",l).html(`<feFlood flood-color="${c}" />
|
|
42
|
+
<feComposite in="SourceGraphic" />`)})}},getGradienColortUrl(t){return`url(#${this.state.datetimeId}-gradient${this.getTargetSelectorSuffix(t)})`},updateLinearGradient(){const t=this,{config:e,data:{targets:r},state:{datetimeId:a},$el:{defs:o}}=t;r.forEach(i=>{const s=`${a}-gradient${t.getTargetSelectorSuffix(i.id)}`,l=t.hasPointType()&&e.point_radialGradient,c=t.isAreaType(i)&&"area"||t.isBarType(i)&&"bar";if((l||c)&&o.select(`#${s}`).empty()){const f=t.color(i),g={defs:null,stops:[]};if(l){const{cx:p=.3,cy:m=.3,r:E=.7,stops:w=[[.1,f,0],[.9,f,1]]}=l;g.stops=w,g.defs=o.append("radialGradient").attr("id",`${s}`).attr("cx",p).attr("cy",m).attr("r",E)}else{const p=e.axis_rotated,{x:m=p?[1,0]:[0,0],y:E=p?[0,0]:[0,1],stops:w=[[0,f,1],[1,f,0]]}=e[`${c}_linearGradient`];g.stops=w,g.defs=o.append("linearGradient").attr("id",`${s}`).attr("x1",m[0]).attr("x2",m[1]).attr("y1",E[0]).attr("y2",E[1])}g.stops.forEach(p=>{const[m,E,w]=p,U=he(E)?E.bind(t.api)(i.id):E;g.defs&&g.defs.append("stop").attr("offset",m).attr("stop-color",U||f).attr("stop-opacity",w)})}})},setOverColor(t,e){const r=this,{config:a,$el:{main:o}}=r,i=a.color_onover;let s=t?i:r.color;ze(s)?s=({id:l})=>l in i?i[l]:r.color(l):Ue(s)?s=()=>i:he(i)&&(s=s.bind(r.api)),o.selectAll(ze(e)?`.${Ve.arc}${r.getTargetSelectorSuffix(e.id)}`:`.${sn.shape}-${e}`).style("fill",s)}},np={getYDomainMinMax(t,e){const r=this,{axis:a,config:o}=r,i=e==="min",s=o.data_groups,l=r.mapToIds(t),c=r.getValuesAsIdKeyed(t);if(s.length>0){const f=r[`has${i?"Negative":"Positive"}ValueInTargets`](t);s.forEach(g=>{const p=g.filter(m=>l.indexOf(m)>=0);if(p.length){const m=p[0],E=a.getId(m);f&&c[m]&&(c[m]=c[m].map(w=>(i?w<0:w>0)?w:0)),p.filter((w,U)=>U>0).forEach(w=>{if(c[w]){const U=a.getId(w);c[w].forEach((N,D)=>{const Y=+N,J=i?Y>0:Y<0;U===E&&!(f&&J)&&(c[m][D]+=Y)})}})}})}return tr(e,Object.keys(c).map(f=>tr(e,c[f])))},isHiddenTargetWithYDomain(t){const e=this;return e.state.hiddenTargetIds.some(r=>e.axis.getId(r)===t)},getYDomain(t,e,r){const a=this,{axis:o,config:i,scale:s}=a,l=`axis_${e}`;if(a.isStackNormalized())return[0,100];const c=(s==null?void 0:s[e])&&s[e].type==="log",f=t.filter(yt=>o.getId(yt.id)===e),g=r?a.filterByXDomain(f,r):f;if(g.length===0)return a.isHiddenTargetWithYDomain(e)?s[e].domain():e==="y2"?s.y.domain():a.getYDomain(t,"y2",r);const p=i[`${l}_min`],m=i[`${l}_max`],E=i[`${l}_center`],w=i[`${l}_inverted`],U=a.hasDataLabel()&&i.axis_rotated,N=a.hasDataLabel()&&!i.axis_rotated;let D=a.getYDomainMinMax(g,"min"),Y=a.getYDomainMinMax(g,"max"),J=[se.BAR,se.BUBBLE,se.SCATTER,...Ar.Line].some(yt=>{const lt=yt.indexOf("area")>-1?"area":yt;return a.hasType(yt,g,!0)&&i[`${lt}_zerobased`]});D=De(p)?p:De(m)?D<=m?D:m-10:D,Y=De(m)?m:De(p)?p<=Y?Y:p+10:Y,isNaN(D)&&(D=0),isNaN(Y)&&(Y=D),D===Y&&(D<0?Y=0:D=0);const K=D>=0&&Y>=0,nt=D<=0&&Y<=0;(De(p)&&K||De(m)&&nt)&&(J=!1),J&&(K&&(D=0),nt&&(Y=0));const Q=Math.abs(Y-D);let ot={top:Q*.1,bottom:Q*.1};if(Qe(E)){const yt=Math.max(Math.abs(D),Math.abs(Y));Y=E+yt,D=E-yt}if(U){const yt=Nr(s.y.range()),lt=a.getDataLabelLength(D,Y,"width").map(jt=>{const vt=jt/yt;return isFinite(vt)?vt:0});["bottom","top"].forEach((jt,vt)=>{ot[jt]+=Q*(lt[vt]/(1-lt[0]-lt[1]))})}else if(N){const yt=a.getDataLabelLength(D,Y,"height");["bottom","top"].forEach((lt,jt)=>{ot[lt]+=a.convertPixelToScale("y",yt[jt],Q)})}ot=a.getResettedPadding(ot);const pt=i[`${l}_padding`];cn(pt)&&["bottom","top"].forEach(yt=>{ot[yt]=o.getPadding(pt,yt,ot[yt],Q)}),J&&(K&&(ot.bottom=D),nt&&(ot.top=-Y));const Tt=c?[D,Y].map(yt=>yt<0?0:yt):[D-ot.bottom,Y+ot.top];return w?Tt.reverse():Tt},getXDomainMinMax(t,e){var r;const a=this,o=a.config[`axis_x_${e}`],i=tr(e,t.map(l=>tr(e,l.values.map(c=>c.x))));let s=ze(o)?o.value:o;return s=Qe(s)&&((r=a.axis)!=null&&r.isTimeSeries())?Zn.bind(this)(s):s,ze(o)&&o.fit&&(e==="min"&&s<i||e==="max"&&s>i)&&(s=void 0),Qe(s)?s:i},getXDomainPadding(t,e){const r=this,{axis:a,config:o}=r,i=o.axis_x_padding,s=a.isTimeSeries()&&e,l=Nr(t);let c;if(a.isCategorized()||s)c=0;else if(r.hasType("bar")){const p=r.getMaxDataCount();c=p>1?l/(p-1)/2:.5}else c=r.getResettedPadding(l*.01);let{left:f=c,right:g=c}=pe(i)?{left:i,right:i}:i;if(i.unit==="px"){const p=Math.abs(l+l*.2);f=a.getPadding(i,"left",c,p),g=a.getPadding(i,"right",c,p)}else{const p=l+f+g;if(s&&p){const m=l/e/p;f=f/p/m,g=g/p/m}}return{left:f,right:g}},getXDomain(t){const e=this,{axis:r,config:a,scale:{x:o}}=e,i=a.axis_x_inverted,s=[e.getXDomainMinMax(t,"min"),e.getXDomainMinMax(t,"max")];let[l=0,c=0]=s;if(o.type!=="log"){const f=r.isCategorized(),g=r.isTimeSeries(),p=e.getXDomainPadding(s);let[m,E]=s;m-E===0&&!f&&(g?(m=new Date(m.getTime()*.5),E=new Date(E.getTime()*1.5)):(m=m===0?1:m*.5,E=E===0?-1:E*1.5)),(m||m===0)&&(l=g?new Date(m.getTime()-p.left):m-p.left),(E||E===0)&&(c=g?new Date(E.getTime()+p.right):E+p.right)}return i?[c,l]:[l,c]},updateXDomain(t,e,r,a,o){var i;const s=this,{config:l,org:c,scale:{x:f,subX:g}}=s,p=l.zoom_enabled;if(r&&(f.domain(o||aa(s.getXDomain(t),!l.axis_x_inverted)),c.xDomain=f.domain(),g.domain(f.domain()),(i=s.brush)==null||i.scale(g)),e){const m=o||!s.brush||Ql(s)?c.xDomain:Zl(s).map(g.invert);f.domain(m)}return(r||e)&&p&&s.zoom.updateScaleExtent(),a&&f.domain(s.trimXDomain(f.orgDomain())),f.domain()},trimXDomain(t){const e=this,r=e.config.axis_x_inverted,a=e.getZoomDomain(),[o,i]=a;return(r?t[0]>=o:t[0]<=o)&&(t[1]=+t[1]+(o-t[0]),t[0]=o),(r?t[1]<=i:t[1]>=i)&&(t[0]=+t[0]-(t[1]-i),t[1]=i),t},getZoomDomain(t="zoom",e=!1){const r=this,{config:a,scale:o,org:i}=r;let[s,l]=e&&o[t]?o[t].domain():i.xDomain;return t==="zoom"&&(Qe(a.zoom_x_min)&&(s=tr("min",[s,a.zoom_x_min])),Qe(a.zoom_x_max)&&(l=tr("max",[l,a.zoom_x_max]))),[s,l]},getZoomDomainValue(t){const e=this,{config:r,axis:a}=e;if(a.isCategorized()&&Array.isArray(t)){const o=r.axis_x_inverted;return t.map((s,l)=>Number(s)+(l===0?+o:+!o))}return t},convertPixelToScale(t,e,r){const a=this,{config:o,state:i}=a,s=o.axis_rotated;let l;return t==="x"?l=s?"height":"width":l=s?"width":"height",r*(e/i[l])},withinRange(t,e=[0,0],r){const o=this.config.axis_x_inverted,[i,s]=r;if(Array.isArray(t)){const l=[...t];if(o&&l.reverse(),l[0]<l[1])return t.every((c,f)=>(f===0?o?+c<=i:+c>=i:o?+c>=s:+c<=s)&&!t.every((g,p)=>g===e[p]))}return!1}};function Sc(t,e,r){const{config:a}=t,o=`axis_${e}_tick_format`;return(a[o]?a[o]:t.defaultValueFormat).call(t.api,r)}var rp={yFormat(t){return Sc(this,"y",t)},y2Format(t){return Sc(this,"y2",t)},getDefaultValueFormat(){const t=this,{defaultArcValueFormat:e,yFormat:r,y2Format:a}=t,o=t.hasArcType(null,["gauge","polar","radar"]);return function(i,s,l){return(o?e:t.axis&&t.axis.getId(l)==="y2"?a:r).call(t,i,s)}},defaultValueFormat(t){return Ge(t)?t.join("~"):De(t)?+t:""},defaultArcValueFormat(t,e){return`${(e*100).toFixed(1)}%`},defaultPolarValueFormat(t){return`${t}`},dataLabelFormat(t){const e=this,r=e.config.data_labels,a=i=>{let l=i;return Ge(i)?l=i.join("~"):ze(i)&&(l=Object.values(i).join("~")),l};let o=a;return he(r.format)?o=r.format:rr(r.format)&&(r.format[t]?o=r.format[t]===!0?a:r.format[t]:o=()=>""),o.bind(e.api)}};function Co(t){const e=this,r=e.getDataById(t);return e.levelColor?e.levelColor(r.values[0].value):e.color(r)}function Ki(t,e=!0){var r;const{config:a}=this;let o=(r=a.data_names[t])!=null?r:t;return e&&he(a.legend_format)&&(o=a.legend_format(o,t!==o?t:void 0)),o}var ap={initLegend(){const t=this,{config:e,$el:r}=t;t.legendItemTextBox={},t.state.legendHasRendered=!1,e.legend_show?(e.legend_contents_bindto||(r.legend=t.$el.svg.append("g").classed(Ke.legend,!0).attr("transform",t.getTranslate("legend"))),t.updateLegend()):t.state.hiddenLegendIds=t.mapToIds(t.data.targets)},updateLegend(t,e,r){var a;const o=this,{config:i,state:s,scale:l,$el:c}=o,f=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};f.withTransition=$r(f,"withTransition",!0),f.withTransitionForTransform=$r(f,"withTransitionForTransform",!0),i.legend_contents_bindto&&i.legend_contents_template?o.updateLegendTemplate():s.hasTreemap||o.updateLegendElement(t||o.mapToIds(o.data.targets),f,r),(a=c.legend)==null||a.selectAll(`.${Ke.legendItem}`).classed(Ke.legendItemHidden,function(g){const p=!o.isTargetToShow(g);return p&&(this.style.opacity=null),p}),o.updateScales(!1,!l.zoom),o.updateSvgSize(),o.transformAll(f.withTransitionForTransform,r),s.legendHasRendered=!0},updateLegendTemplate(){const t=this,{config:e,$el:r}=t,a=it(e.legend_contents_bindto),o=e.legend_contents_template;if(!a.empty()){const i=t.mapToIds(t.data.targets),s=[];let l="";i.forEach(f=>{const g=he(o)?o.bind(t.api)(f,t.color(f),t.api.data(f)[0].values):Na(o,{COLOR:t.color(f),TITLE:f});g&&(s.push(f),l+=g)});const c=a.html(l).selectAll(function(){return this.childNodes}).data(s);t.setLegendItem(c),r.legend=a}},updateSizeForLegend(t){const e=this,{config:r,state:{isLegendTop:a,isLegendLeft:o,isLegendRight:i,isLegendInset:s,current:l}}=e,{width:c,height:f}=t,g={top:a?e.getCurrentPaddingByDirection("top")+r.legend_inset_y+5.5:l.height-f-e.getCurrentPaddingByDirection("bottom")-r.legend_inset_y,left:o?e.getCurrentPaddingByDirection("left")+r.legend_inset_x+.5:l.width-c-e.getCurrentPaddingByDirection("right")-r.legend_inset_x+.5};e.state.margin3={top:i?0:s?g.top:l.height-f,right:NaN,bottom:0,left:i?l.width-c:s?g.left:0}},transformLegend(t){const e=this,{$el:{legend:r},$T:a}=e;a(r,t).attr("transform",e.getTranslate("legend"))},updateLegendStep(t){this.state.legendStep=t},updateLegendItemWidth(t){this.state.legendItemWidth=t},updateLegendItemHeight(t){this.state.legendItemHeight=t},updateLegendItemColor(t,e){const{legend:r}=this.$el;r&&r.select(`.${Ke.legendItem}-${t} line`).style("stroke",e)},getLegendWidth(){const t=this,{current:{width:e},isLegendRight:r,isLegendInset:a,legendItemWidth:o,legendStep:i}=t.state;return t.config.legend_show?r||a?o*(i+1):e:0},getLegendHeight(){var t;const e=this,{current:r,isLegendRight:a,legendItemHeight:o,legendStep:i}=e.state,s=((t=e.config.padding)==null?void 0:t.mode)==="fit";return e.config.legend_show?a?r.height:Math.max(s?10:20,o)*(i+1):0},opacityForUnfocusedLegend(t){return t.classed(Ke.legendItemHidden)?null:"0.3"},toggleFocusLegend(t,e){const r=this,{$el:{legend:a},$T:o}=r,i=r.mapToTargetIds(t);a&&o(a.selectAll(`.${Ke.legendItem}`).filter(s=>i.indexOf(s)>=0).classed(qe.legendItemFocused,e)).style("opacity",function(){return e?null:r.opacityForUnfocusedLegend.call(r,it(this))})},revertLegend(){const t=this,{$el:{legend:e},$T:r}=t;e&&r(e.selectAll(`.${Ke.legendItem}`).classed(qe.legendItemFocused,!1)).style("opacity",null)},showLegend(t){const e=this,{config:r,$el:a,$T:o}=e;r.legend_show||(r.legend_show=!0,a.legend?a.legend.style("visibility",null):e.initLegend(),!e.state.legendHasRendered&&e.updateLegend()),e.removeHiddenLegendIds(t),o(a.legend.selectAll(e.selectorLegends(t)).style("visibility",null)).style("opacity",null)},hideLegend(t){const e=this,{config:r,$el:{legend:a}}=e;r.legend_show&&Yn(t)&&(r.legend_show=!1,a.style("visibility","hidden")),e.addHiddenLegendIds(t),a.selectAll(e.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},getLegendItemTextBox(t,e){const r=this,{cache:a,state:o}=r;let i;const s=Mn.legendItemTextBox;return t&&(i=!o.redrawing&&a.get(s)||{},i[t]||(i[t]=r.getTextRect(e,Ke.legendItem),a.add(s,i)),i=i[t]),i},setLegendItem(t){const e=this,{$el:r,api:a,config:o,state:i}=e,s=i.inputType==="touch",l=e.hasType("gauge"),c=o.boost_useCssRule,f=o.legend_item_interaction;t.attr("class",function(g){const p=it(this);return(!p.empty()&&p.attr("class")||"")+e.generateClass(Ke.legendItem,g)}).style("visibility",g=>e.isLegendToShow(g)?null:"hidden"),o.interaction_enabled&&(c&&[[`.${Ke.legendItem}`,"cursor:pointer"],[`.${Ke.legendItem} text`,"pointer-events:none"],[`.${Ke.legendItemPoint} text`,"pointer-events:none"],[`.${Ke.legendItemTile}`,"pointer-events:none"],[`.${Ke.legendItemEvent}`,"fill-opacity:0"]].forEach(g=>{const[p,m]=g;e.setCssRule(!1,p,[m])(r.legend)}),t.on(f.dblclick?"dblclick":"click",f||he(o.legend_item_onclick)?function(g,p){if(!_e(o.legend_item_onclick,a,p,!i.hiddenTargetIds.includes(p))){const{altKey:m,target:E,type:w}=g;w==="dblclick"||m?i.hiddenTargetIds.length&&E.parentNode.getAttribute("class").indexOf(Ke.legendItemHidden)===-1?a.show():(a.hide(),a.show(p)):(a.toggle(p),it(this).classed(qe.legendItemFocused,!1))}s&&e.hideTooltip()}:null),!s&&t.on("mouseout",f||he(o.legend_item_onout)?function(g,p){_e(o.legend_item_onout,a,p,!i.hiddenTargetIds.includes(p))||(it(this).classed(qe.legendItemFocused,!1),l&&e.undoMarkOverlapped(e,`.${jn.gaugeValue}`),e.api.revert())}:null).on("mouseover",f||he(o.legend_item_onover)?function(g,p){_e(o.legend_item_onover,a,p,!i.hiddenTargetIds.includes(p))||(it(this).classed(qe.legendItemFocused,!0),l&&e.markOverlapped(p,e,`.${jn.gaugeValue}`),!i.transiting&&e.isTargetToShow(p)&&a.focus(p))}:null),!t.empty()&&t.on("click mouseout mouseover")&&t.style("cursor",e.getStylePropValue("pointer")))},updateLegendElement(t,e){const r=this,{config:a,state:o,$el:{legend:i},$T:s}=r,c=a.legend_item_tile_type!=="circle",f=a.legend_item_tile_r,g={width:c?a.legend_item_tile_width:f*2,height:c?a.legend_item_tile_height:f*2},p={padding:{top:4,right:10},max:{width:0,height:0},posMin:10,step:0,tileWidth:g.width+5,totalLength:0},m={offsets:{},widths:{},heights:{},margins:[0],steps:{}};let E,w,U;const N=t.filter(Q=>!Qe(a.data_names[Q])||a.data_names[Q]!==null),D=e.withTransition,Y=r.getUpdateLegendPositions(N,p,m);o.isLegendInset&&(p.step=a.legend_inset_step?a.legend_inset_step:N.length,r.updateLegendStep(p.step)),o.isLegendRight?(E=Q=>p.max.width*m.steps[Q],w=Q=>m.margins[m.steps[Q]]+m.offsets[Q]):o.isLegendInset?(E=Q=>p.max.width*m.steps[Q]+10,w=Q=>m.margins[m.steps[Q]]+m.offsets[Q]):(E=Q=>m.margins[m.steps[Q]]+m.offsets[Q],w=Q=>p.max.height*m.steps[Q]);const J={xText:(Q,ot)=>E(Q,ot)+4+g.width,xRect:(Q,ot)=>E(Q,ot),x1Tile:(Q,ot)=>E(Q,ot)-2,x2Tile:(Q,ot)=>E(Q,ot)-2+g.width,yText:(Q,ot)=>w(Q,ot)+9,yRect:(Q,ot)=>w(Q,ot)-5,yTile:(Q,ot)=>w(Q,ot)+4};r.generateLegendItem(N,g,Y,J),U=i.select(`.${Ke.legendBackground} rect`),o.isLegendInset&&p.max.width>0&&U.size()===0&&(U=i.insert("g",`.${Ke.legendItem}`).attr("class",Ke.legendBackground).append("rect")),a.legend_tooltip&&i.selectAll("title").data(N).text(Q=>Ki.bind(r)(Q,!1));const K=i.selectAll("text").data(N).text(Q=>Ki.bind(r)(Q)).each(function(Q,ot){Y(this,Q,ot)});s(K,D).attr("x",J.xText).attr("y",J.yText);const nt=i.selectAll(`rect.${Ke.legendItemEvent}`).data(N);s(nt,D).attr("width",Q=>m.widths[Q]).attr("height",Q=>m.heights[Q]).attr("x",J.xRect).attr("y",J.yRect),r.updateLegendItemPos(N,D,J),U&&s(U,D).attr("height",r.getLegendHeight()-12).attr("width",p.max.width*(p.step+1)+10),r.updateLegendItemWidth(p.max.width),r.updateLegendItemHeight(p.max.height),r.updateLegendStep(p.step)},getUpdateLegendPositions(t,e,r){const a=this,{config:o,state:i}=a,s=i.isLegendRight||i.isLegendInset;return function(l,c,f){const g=f===0,p=f===t.length-1,m=a.getLegendItemTextBox(c,l),E=m.width+e.tileWidth+(p&&!s?0:e.padding.right)+o.legend_padding,w=m.height+e.padding.top,U=s?w:E,N=s?a.getLegendHeight():a.getLegendWidth();let D;const Y=function(K,nt){nt||(D=(N-e.totalLength-U)/2,D<e.posMin&&(D=(N-U)/2,e.totalLength=0,e.step++)),r.steps[K]=e.step,r.margins[e.step]=i.isLegendInset?10:D,r.offsets[K]=e.totalLength,e.totalLength+=U};if(g&&(e.totalLength=0,e.step=0,e.max.width=0,e.max.height=0),o.legend_show&&!a.isLegendToShow(c)){r.widths[c]=0,r.heights[c]=0,r.steps[c]=0,r.offsets[c]=0;return}r.widths[c]=E,r.heights[c]=w,(!e.max.width||E>=e.max.width)&&(e.max.width=E),(!e.max.height||w>=e.max.height)&&(e.max.height=w);const J=s?e.max.height:e.max.width;o.legend_equally?(Object.keys(r.widths).forEach(K=>r.widths[K]=e.max.width),Object.keys(r.heights).forEach(K=>r.heights[K]=e.max.height),D=(N-J*t.length)/2,D<e.posMin?(e.totalLength=0,e.step=0,t.forEach(K=>Y(K))):Y(c,!0)):Y(c)}},generateLegendItem(t,e,r,a){const o=this,{config:i,state:s,$el:{legend:l}}=o,c=i.legend_usePoint,f=i.legend_item_tile_r,g=i.legend_item_tile_type,p=g!=="circle",m=s.isLegendRight||s.isLegendInset,E=-200,w=l.selectAll(`.${Ke.legendItem}`).data(t).enter().append("g");if(o.setLegendItem(w),i.legend_tooltip&&w.append("title").text(U=>U),w.append("text").text(U=>Ki.bind(o)(U)).each(function(U,N){r(this,U,N)}).style("pointer-events",o.getStylePropValue("none")).attr("x",m?a.xText:E).attr("y",m?E:a.yText),w.append("rect").attr("class",Ke.legendItemEvent).style("fill-opacity",o.getStylePropValue("0")).attr("x",m?a.xRect:E).attr("y",m?E:a.yRect),c){const U=[];w.append(N=>{const D=cn(i.point_pattern)?i.point_pattern:[i.point_type];U.indexOf(N)===-1&&U.push(N);let Y=D[U.indexOf(N)%D.length];return Y==="rectangle"&&(Y="rect"),pn.createElementNS(te.svg,"hasValidPointType"in o&&o.hasValidPointType(Y)?Y:"use")}).attr("class",Ke.legendItemPoint).style("fill",Co.bind(o)).style("pointer-events",o.getStylePropValue("none")).attr("href",(N,D,Y)=>{const K=Y[D].nodeName.toLowerCase(),nt=o.getTargetSelectorSuffix(N);return K==="use"?`#${s.datetimeId}-point${nt}`:void 0})}else w.append(p?"line":g).attr("class",Ke.legendItemTile).style("stroke",Co.bind(o)).style("pointer-events",o.getStylePropValue("none")).call(U=>{g==="circle"?U.attr("r",f).style("fill",Co.bind(o)).attr("cx",m?a.x2Tile:E).attr("cy",m?E:a.yTile):p&&U.attr("stroke-width",e.height).attr("x1",m?a.x1Tile:E).attr("y1",m?E:a.yTile).attr("x2",m?a.x2Tile:E).attr("y2",m?E:a.yTile)})},updateLegendItemPos(t,e,r){const a=this,{config:o,$el:{legend:i},$T:s}=a,l=o.legend_usePoint,c=o.legend_item_tile_type,f=c!=="circle";if(l){const g=i.selectAll(`.${Ke.legendItemPoint}`).data(t);s(g,e).each(function(){const p=this.nodeName.toLowerCase(),m=o.point_r;let E="x",w="y",U=2,N=2.5,D=null,Y=null,J=null;if(p==="circle"){const K=m*.2;E="cx",w="cy",D=m+K,U=m*2,N=-K}else if(p==="rect"){const K=m*2.5;Y=K,J=K,N=3}it(this).attr(E,K=>r.x1Tile(K)+U).attr(w,K=>r.yTile(K)-N).attr("r",D).attr("width",Y).attr("height",J)})}else{const g=i.selectAll(`.${Ke.legendItemTile}`).data(t);s(g,e).style("stroke",Co.bind(a)).call(p=>{c==="circle"?p.attr("cx",m=>{const E=r.x2Tile(m);return E-(E-r.x1Tile(m))/2}).attr("cy",r.yTile):f&&p.attr("x1",r.x1Tile).attr("y1",r.yTile).attr("x2",r.x2Tile).attr("y2",r.yTile)})}}},op={redraw(t={}){var e,r,a,o;const i=this,{config:s,state:l,$el:c}=i,{main:f,treemap:g}=c;l.redrawing=!0;const p=i.filterTargetsToShow(i.data.targets),{flow:m,initializing:E}=t,w=i.getWithOption(t),U=w.Transition?s.transition_duration:0,N=w.TransitionForExit?U:0,D=w.TransitionForAxis?U:0,Y=(e=i.axis)==null?void 0:e.generateTransitions(D);i.updateSizes(E),w.Legend&&s.legend_show?(t.withTransition=!!U,!g&&i.updateLegend(i.mapToIds(i.data.targets),t,Y)):w.Dimension&&i.updateDimension(!0),s.data_empty_label_text&&f.select(`text.${gn.text}.${Se.empty}`).attr("x",l.width/2).attr("y",l.height/2).text(s.data_empty_label_text).style("display",p.length?"none":null),l.hasAxis?(i.axis.redrawAxis(p,w,Y,m,E),i.hasGrid()&&i.updateGrid(),s.regions.length&&i.updateRegion(),["bar","candlestick","line","area"].forEach(J=>{const K=In(J);(/^(line|area)$/.test(J)&&i.hasTypeOf(K)||i.hasType(J))&&i[`update${K}`](w.TransitionForExit)}),c.text&&f.selectAll(`.${tn.selectedCircles}`).filter(i.isBarType.bind(i)).selectAll("circle").remove(),s.interaction_enabled&&!m&&w.EventRect&&(i.redrawEventRect(),(r=i.bindZoomEvent)==null||r.call(i))):(c.arcs&&i.redrawArc(U,N,w.Transform),c.radar&&i.redrawRadar(),c.polar&&i.redrawPolar(),c.funnel&&i.redrawFunnel(),g&&i.updateTreemap(N)),!l.resizing&&!g&&(i.hasPointType()||l.hasRadar)?i.updateCircle():(a=i.hasLegendDefsPoint)!=null&&a.call(i)&&i.data.targets.forEach(i.point("create",this)),i.hasDataLabel()&&!i.hasArcType(null,["radar"])&&i.updateText(),(o=i.redrawTitle)==null||o.call(i),E&&i.updateTypesElements(),i.generateRedrawList(p,m,U,w.Subchart),i.updateTooltipOnRedraw(),i.callPluginHook("$redraw",t,U)},generateRedrawList(t,e,r,a){const o=this,{config:i,state:s}=o,l=o.getDrawShape();s.hasAxis&&i.subchart_show&&o.redrawSubchart(a,r,l);const c=e&&o.generateFlow({targets:t,flow:e,duration:e.duration,shape:l,xv:o.xv.bind(o)}),f=(r||c)&&La(),g=o.getRedrawList(l,e,c,f),p=()=>{c&&c(),s.redrawing=!1,_e(i.onrendered,o.api)};if(p)if(f&&g.length){const m=oc();Nl().duration(r).each(()=>{g.reduce((E,w)=>E.concat(w),[]).forEach(E=>m.add(E))}).call(m,p)}else s.transiting||p();o.mapToIds(o.data.targets).forEach(m=>{s.withoutFadeIn[m]=!0})},getRedrawList(t,e,r,a){const o=this,{config:i,state:{hasAxis:s,hasRadar:l,hasTreemap:c},$el:{grid:f}}=o,{cx:g,cy:p,xForText:m,yForText:E}=t.pos,w=[];return s&&((i.grid_x_lines.length||i.grid_y_lines.length)&&w.push(o.redrawGrid(a)),i.regions.length&&w.push(o.redrawRegion(a)),Object.keys(t.type).forEach(U=>{const N=In(U),D=t.type[U];(/^(area|line)$/.test(U)&&o.hasTypeOf(N)||o.hasType(U))&&w.push(o[`redraw${N}`](D,a))}),!e&&f.main&&w.push(o.updateGridFocus())),(!o.hasArcType()||l)&&cn(i.data_labels)&&i.data_labels!==!1&&w.push(o.redrawText(m,E,e,a)),(o.hasPointType()||l)&&!o.isPointFocusOnly()&&o.redrawCircle&&w.push(o.redrawCircle(g,p,a,r)),c&&w.push(o.redrawTreemap(a)),w},updateAndRedraw(t={}){const e=this,{config:r,state:a}=e;let o;t.withTransition=$r(t,"withTransition",!0),t.withTransform=$r(t,"withTransform",!1),t.withLegend=$r(t,"withLegend",!1),t.withUpdateXDomain=!0,t.withUpdateOrgXDomain=!0,t.withTransitionForExit=!1,t.withTransitionForTransform=$r(t,"withTransitionForTransform",t.withTransition),t.withLegend&&r.legend_show||(a.hasAxis&&(o=e.axis.generateTransitions(t.withTransitionForAxis?r.transition_duration:0)),e.updateScales(),e.updateSvgSize(),e.transformAll(t.withTransitionForTransform,o)),e.redraw(t,o)}};const ip=Math.sqrt(50),sp=Math.sqrt(10),lp=Math.sqrt(2);function Po(t,e,r){const a=(e-t)/Math.max(0,r),o=Math.floor(Math.log10(a)),i=a/Math.pow(10,o),s=i>=ip?10:i>=sp?5:i>=lp?2:1;let l,c,f;return o<0?(f=Math.pow(10,-o)/s,l=Math.round(t*f),c=Math.round(e*f),l/f<t&&++l,c/f>e&&--c,f=-f):(f=Math.pow(10,o)*s,l=Math.round(t/f),c=Math.round(e/f),l*f<t&&++l,c*f>e&&--c),c<l&&.5<=r&&r<2?Po(t,e,r*2):[l,c,f]}function Zi(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const a=e<t,[o,i,s]=a?Po(e,t,r):Po(t,e,r);if(!(i>=o))return[];const l=i-o+1,c=new Array(l);if(a)if(s<0)for(let f=0;f<l;++f)c[f]=(i-f)/-s;else for(let f=0;f<l;++f)c[f]=(i-f)*s;else if(s<0)for(let f=0;f<l;++f)c[f]=(o+f)/-s;else for(let f=0;f<l;++f)c[f]=(o+f)*s;return c}function Ji(t,e,r){return e=+e,t=+t,r=+r,Po(t,e,r)[2]}function Qi(t,e,r){e=+e,t=+t,r=+r;const a=e<t,o=a?Ji(e,t,r):Ji(t,e,r);return(a?-1:1)*(o<0?1/-o:o)}function Mo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function cp(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ki(t){let e,r,a;t.length!==2?(e=Mo,r=(l,c)=>Mo(t(l),c),a=(l,c)=>t(l)-c):(e=t===Mo||t===cp?t:up,r=t,a=t);function o(l,c,f=0,g=l.length){if(f<g){if(e(c,c)!==0)return g;do{const p=f+g>>>1;r(l[p],c)<0?f=p+1:g=p}while(f<g)}return f}function i(l,c,f=0,g=l.length){if(f<g){if(e(c,c)!==0)return g;do{const p=f+g>>>1;r(l[p],c)<=0?f=p+1:g=p}while(f<g)}return f}function s(l,c,f=0,g=l.length){const p=o(l,c,f,g-1);return p>f&&a(l[p-1],c)>-a(l[p],c)?p-1:p}return{left:o,center:s,right:i}}function up(){return 0}function fp(t){return t===null?NaN:+t}function*D1(t,e){if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let a of t)(a=e(a,++r,t))!=null&&(a=+a)>=a&&(yield a)}}const $c=ki(Mo),dp=$c.right,N1=$c.left,L1=ki(fp).center;var hp=dp;function vp(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function gp(t){return function(){return t}}function pp(t){return+t}var Ac=[0,1];function ia(t){return t}function qi(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:gp(isNaN(e)?NaN:.5)}function mp(t,e){var r;return t>e&&(r=t,t=e,e=r),function(a){return Math.max(t,Math.min(e,a))}}function yp(t,e,r){var a=t[0],o=t[1],i=e[0],s=e[1];return o<a?(a=qi(o,a),i=r(s,i)):(a=qi(a,o),i=r(i,s)),function(l){return i(a(l))}}function xp(t,e,r){var a=Math.min(t.length,e.length)-1,o=new Array(a),i=new Array(a),s=-1;for(t[a]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<a;)o[s]=qi(t[s],t[s+1]),i[s]=r(e[s],e[s+1]);return function(l){var c=hp(t,l,1,a)-1;return i[c](o[c](l))}}function wo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function _i(){var t=Ac,e=Ac,r=kr,a,o,i,s=ia,l,c,f;function g(){var m=Math.min(t.length,e.length);return s!==ia&&(s=mp(t[0],t[m-1])),l=m>2?xp:yp,c=f=null,p}function p(m){return m==null||isNaN(m=+m)?i:(c||(c=l(t.map(a),e,r)))(a(s(m)))}return p.invert=function(m){return s(o((f||(f=l(e,t.map(a),qn)))(m)))},p.domain=function(m){return arguments.length?(t=Array.from(m,pp),g()):t.slice()},p.range=function(m){return arguments.length?(e=Array.from(m),g()):e.slice()},p.rangeRound=function(m){return e=Array.from(m),r=vp,g()},p.clamp=function(m){return arguments.length?(s=m?!0:ia,g()):s!==ia},p.interpolate=function(m){return arguments.length?(r=m,g()):r},p.unknown=function(m){return arguments.length?(i=m,p):i},function(m,E){return a=m,o=E,g()}}function Ec(){return _i()(ia,ia)}var Tp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ba(t){if(!(e=Tp.exec(t)))throw new Error("invalid format: "+t);var e;return new ts({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ba.prototype=ts.prototype;function ts(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ts.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Sp(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Do(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,a=t.slice(0,r);return[a.length>1?a[0]+a.slice(2):a,+t.slice(r+1)]}function sa(t){return t=Do(Math.abs(t)),t?t[1]:NaN}function $p(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sa(e)/3)))*3-sa(Math.abs(t)))}function Ap(t,e){return function(r,a){for(var o=r.length,i=[],s=0,l=t[0],c=0;o>0&&l>0&&(c+l+1>a&&(l=Math.max(1,a-c)),i.push(r.substring(o-=l,o+l)),!((c+=l+1)>a));)l=t[s=(s+1)%t.length];return i.reverse().join(e)}}function Ep(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}function bp(t){t:for(var e=t.length,r=1,a=-1,o;r<e;++r)switch(t[r]){case".":a=o=r;break;case"0":a===0&&(a=r),o=r;break;default:if(!+t[r])break t;a>0&&(a=0);break}return a>0?t.slice(0,a)+t.slice(o+1):t}var bc;function Ip(t,e){var r=Do(t,e);if(!r)return t+"";var a=r[0],o=r[1],i=o-(bc=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=a.length;return i===s?a:i>s?a+new Array(i-s+1).join("0"):i>0?a.slice(0,i)+"."+a.slice(i):"0."+new Array(1-i).join("0")+Do(t,Math.max(0,e+i-1))[0]}function Ic(t,e){var r=Do(t,e);if(!r)return t+"";var a=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+a:a.length>o+1?a.slice(0,o+1)+"."+a.slice(o+1):a+new Array(o-a.length+2).join("0")}var Rc={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Sp,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ic(t*100,e),r:Ic,s:Ip,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Oc(t){return t}var Cc=Array.prototype.map,Pc=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Rp(t){var e=t.grouping===void 0||t.thousands===void 0?Oc:Ap(Cc.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",a=t.currency===void 0?"":t.currency[1]+"",o=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?Oc:Ep(Cc.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(p){p=Ba(p);var m=p.fill,E=p.align,w=p.sign,U=p.symbol,N=p.zero,D=p.width,Y=p.comma,J=p.precision,K=p.trim,nt=p.type;nt==="n"?(Y=!0,nt="g"):Rc[nt]||(J===void 0&&(J=12),K=!0,nt="g"),(N||m==="0"&&E==="=")&&(N=!0,m="0",E="=");var Q=U==="$"?r:U==="#"&&/[boxX]/.test(nt)?"0"+nt.toLowerCase():"",ot=U==="$"?a:/[%p]/.test(nt)?s:"",pt=Rc[nt],Tt=/[defgprs%]/.test(nt);J=J===void 0?6:/[gprs]/.test(nt)?Math.max(1,Math.min(21,J)):Math.max(0,Math.min(20,J));function yt(lt){var jt=Q,vt=ot,tt,St,ct;if(nt==="c")vt=pt(lt)+vt,lt="";else{lt=+lt;var At=lt<0||1/lt<0;if(lt=isNaN(lt)?c:pt(Math.abs(lt),J),K&&(lt=bp(lt)),At&&+lt==0&&w!=="+"&&(At=!1),jt=(At?w==="("?w:l:w==="-"||w==="("?"":w)+jt,vt=(nt==="s"?Pc[8+bc/3]:"")+vt+(At&&w==="("?")":""),Tt){for(tt=-1,St=lt.length;++tt<St;)if(ct=lt.charCodeAt(tt),48>ct||ct>57){vt=(ct===46?o+lt.slice(tt+1):lt.slice(tt))+vt,lt=lt.slice(0,tt);break}}}Y&&!N&&(lt=e(lt,1/0));var Wt=jt.length+lt.length+vt.length,Dt=Wt<D?new Array(D-Wt+1).join(m):"";switch(Y&&N&&(lt=e(Dt+lt,Dt.length?D-vt.length:1/0),Dt=""),E){case"<":lt=jt+lt+vt+Dt;break;case"=":lt=jt+Dt+lt+vt;break;case"^":lt=Dt.slice(0,Wt=Dt.length>>1)+jt+lt+vt+Dt.slice(Wt);break;default:lt=Dt+jt+lt+vt;break}return i(lt)}return yt.toString=function(){return p+""},yt}function g(p,m){var E=f((p=Ba(p),p.type="f",p)),w=Math.max(-8,Math.min(8,Math.floor(sa(m)/3)))*3,U=Math.pow(10,-w),N=Pc[8+w/3];return function(D){return E(U*D)+N}}return{format:f,formatPrefix:g}}var No,es,Mc;Op({thousands:",",grouping:[3],currency:["$",""]});function Op(t){return No=Rp(t),es=No.format,Mc=No.formatPrefix,No}function Cp(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,sa(e)-sa(t))+1}function Pp(t){return Math.max(0,-sa(Math.abs(t)))}function Mp(t,e,r,a){var o=Qi(t,e,r),i;switch(a=Ba(a==null?",f":a),a.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return a.precision==null&&!isNaN(i=$p(o,s))&&(a.precision=i),Mc(a,s)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=Cp(o,Math.max(Math.abs(t),Math.abs(e))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=Pp(o))&&(a.precision=i-(a.type==="%")*2);break}}return es(a)}function wc(t){var e=t.domain;return t.ticks=function(r){var a=e();return Zi(a[0],a[a.length-1],r==null?10:r)},t.tickFormat=function(r,a){var o=e();return Mp(o[0],o[o.length-1],r==null?10:r,a)},t.nice=function(r){r==null&&(r=10);var a=e(),o=0,i=a.length-1,s=a[o],l=a[i],c,f,g=10;for(l<s&&(f=s,s=l,l=f,f=o,o=i,i=f);g-- >0;){if(f=Ji(s,l,r),f===c)return a[o]=s,a[i]=l,e(a);if(f>0)s=Math.floor(s/f)*f,l=Math.ceil(l/f)*f;else if(f<0)s=Math.ceil(s*f)/f,l=Math.floor(l*f)/f;else break;c=f}return t},t}function Lo(){var t=Ec();return t.copy=function(){return wo(t,Lo())},oa.apply(t,arguments),wc(t)}function Dc(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Nc(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function wp(t){var e=1,r=t(Dc(e),Nc(e));return r.constant=function(a){return arguments.length?t(Dc(e=+a),Nc(e)):e},wc(r)}function Lc(){var t=wp(_i());return t.copy=function(){return wo(t,Lc()).constant(t.constant())},oa.apply(t,arguments)}function Fc(t,e){t=t.slice();var r=0,a=t.length-1,o=t[r],i=t[a],s;return i<o&&(s=r,r=a,a=s,s=o,o=i,i=s),t[r]=e.floor(o),t[a]=e.ceil(i),t}function Bc(t){return Math.log(t)}function Uc(t){return Math.exp(t)}function Dp(t){return-Math.log(-t)}function Np(t){return-Math.exp(-t)}function Lp(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Fp(t){return t===10?Lp:t===Math.E?Math.exp:e=>Math.pow(t,e)}function Bp(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function zc(t){return(e,r)=>-t(-e,r)}function Up(t){const e=t(Bc,Uc),r=e.domain;let a=10,o,i;function s(){return o=Bp(a),i=Fp(a),r()[0]<0?(o=zc(o),i=zc(i),t(Dp,Np)):t(Bc,Uc),e}return e.base=function(l){return arguments.length?(a=+l,s()):a},e.domain=function(l){return arguments.length?(r(l),s()):r()},e.ticks=l=>{const c=r();let f=c[0],g=c[c.length-1];const p=g<f;p&&([f,g]=[g,f]);let m=o(f),E=o(g),w,U;const N=l==null?10:+l;let D=[];if(!(a%1)&&E-m<N){if(m=Math.floor(m),E=Math.ceil(E),f>0){for(;m<=E;++m)for(w=1;w<a;++w)if(U=m<0?w/i(-m):w*i(m),!(U<f)){if(U>g)break;D.push(U)}}else for(;m<=E;++m)for(w=a-1;w>=1;--w)if(U=m>0?w/i(-m):w*i(m),!(U<f)){if(U>g)break;D.push(U)}D.length*2<N&&(D=Zi(f,g,N))}else D=Zi(m,E,Math.min(E-m,N)).map(i);return p?D.reverse():D},e.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=a===10?"s":","),typeof c!="function"&&(!(a%1)&&(c=Ba(c)).precision==null&&(c.trim=!0),c=es(c)),l===1/0)return c;const f=Math.max(1,a*l/e.ticks().length);return g=>{let p=g/i(Math.round(o(g)));return p*a<a-.5&&(p*=a),p<=f?c(g):""}},e.nice=()=>r(Fc(r(),{floor:l=>i(Math.floor(o(l))),ceil:l=>i(Math.ceil(o(l)))})),e}function jc(){const t=Up(_i()).domain([1,10]);return t.copy=()=>wo(t,jc()).base(t.base()),oa.apply(t,arguments),t}const Fo=en(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Fo.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?en(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Fo);const F1=Fo.range,zr=en(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Hn)},(t,e)=>(e-t)/Hn,t=>t.getUTCSeconds()),B1=zr.range,ns=en(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hn)},(t,e)=>{t.setTime(+t+e*Pn)},(t,e)=>(e-t)/Pn,t=>t.getMinutes()),U1=ns.range,rs=en(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Pn)},(t,e)=>(e-t)/Pn,t=>t.getUTCMinutes()),z1=rs.range,as=en(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Hn-t.getMinutes()*Pn)},(t,e)=>{t.setTime(+t+e*Un)},(t,e)=>(e-t)/Un,t=>t.getHours()),j1=as.range,os=en(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Un)},(t,e)=>(e-t)/Un,t=>t.getUTCHours()),G1=os.range,is=en(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),V1=is.range,ss=en(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),X1=ss.range;function Gc(t,e,r,a,o,i){const s=[[zr,1,Hn],[zr,5,5*Hn],[zr,15,15*Hn],[zr,30,30*Hn],[i,1,Pn],[i,5,5*Pn],[i,15,15*Pn],[i,30,30*Pn],[o,1,Un],[o,3,3*Un],[o,6,6*Un],[o,12,12*Un],[a,1,lr],[a,2,2*lr],[r,1,ri],[e,1,ws],[e,3,3*ws],[t,1,ai]];function l(f,g,p){const m=g<f;m&&([f,g]=[g,f]);const E=p&&typeof p.range=="function"?p:c(f,g,p),w=E?E.range(f,+g+1):[];return m?w.reverse():w}function c(f,g,p){const m=Math.abs(g-f)/p,E=ki(([,,N])=>N).right(s,m);if(E===s.length)return t.every(Qi(f/ai,g/ai,p));if(E===0)return Fo.every(Math.max(Qi(f,g,p),1));const[w,U]=s[m/s[E-1][2]<s[E][2]/m?E-1:E];return w.every(U)}return[l,c]}const[zp,jp]=Gc(ur,ss,_a,Ds,os,rs),[Gp,Vp]=Gc(cr,is,ka,ya,as,ns);function Xp(t){return new Date(t)}function Hp(t){return t instanceof Date?+t:+new Date(+t)}function ls(t,e,r,a,o,i,s,l,c,f){var g=Ec(),p=g.invert,m=g.domain,E=f(".%L"),w=f(":%S"),U=f("%I:%M"),N=f("%I %p"),D=f("%a %d"),Y=f("%b %d"),J=f("%B"),K=f("%Y");function nt(Q){return(c(Q)<Q?E:l(Q)<Q?w:s(Q)<Q?U:i(Q)<Q?N:a(Q)<Q?o(Q)<Q?D:Y:r(Q)<Q?J:K)(Q)}return g.invert=function(Q){return new Date(p(Q))},g.domain=function(Q){return arguments.length?m(Array.from(Q,Hp)):m().map(Xp)},g.ticks=function(Q){var ot=m();return t(ot[0],ot[ot.length-1],Q==null?10:Q)},g.tickFormat=function(Q,ot){return ot==null?nt:f(ot)},g.nice=function(Q){var ot=m();return(!Q||typeof Q.range!="function")&&(Q=e(ot[0],ot[ot.length-1],Q==null?10:Q)),Q?m(Fc(ot,Q)):g},g.copy=function(){return wo(g,ls(t,e,r,a,o,i,s,l,c,f))},g}function Wp(){return oa.apply(ls(Gp,Vp,cr,is,ka,ya,as,ns,zr,si).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Yp(){return oa.apply(ls(zp,jp,ur,ss,_a,eo,os,rs,zr,li).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jr(t="linear",e,r){const a={linear:Lo,log:Lc,_log:jc,time:Wp,utc:Yp}[t]();return a.type=t,/_?log/.test(t)&&a.clamp(!0),a.range([e!=null?e:0,r!=null?r:1])}var Kp={getXScale(t,e,r,a){const o=this,i=o.state.loading!=="append"&&o.scale.zoom||jr(o.axis.getAxisType("x"),t,e);return o.getCustomizedXScale(r?i.domain(r):i,a)},getYScale(t,e,r,a){const i=jr(this.axis.getAxisType(t),e,r);return a&&i.domain(a),i},getYScaleById(t,e=!1){var r;const a=((r=this.axis)==null?void 0:r.getId(t))==="y2",o=e?a?"subY2":"subY":a?"y2":"y";return this.scale[o]},getCustomizedXScale(t,e){const r=this,a=e||(()=>r.axis.x.tickOffset()),o=r.config.axis_x_inverted,i=function(s){return t(s)+a()};for(const s in t)i[s]=t[s];return i.orgDomain=()=>t.domain(),i.orgScale=()=>t,r.axis.isCategorized()&&(i.domain=function(s){let l=s;return arguments.length?(t.domain(l),i):(l=this.orgDomain(),o?[l[0]+1,l[1]]:[l[0],l[1]+1])}),i},updateScales(t,e=!0){var r,a;const o=this,{axis:i,config:s,format:l,org:c,scale:f,state:{current:g,width:p,height:m,width2:E,height2:w,hasAxis:U,hasTreemap:N}}=o;if(U){const D=s.axis_rotated,Y=o.getResettedPadding(1),J={x:D?Y:0,y:D?0:m,subX:D?1:0,subY:D?0:w},K={x:D?m:p,y:D?p:Y,subX:D?m:p,subY:D?E:1},nt=e&&((r=f.x)==null?void 0:r.orgDomain()),Q=e&&c.xDomain;f.x=o.getXScale(J.x,K.x,nt,()=>i.x.tickOffset()),f.subX=o.getXScale(J.x,K.x,Q,ot=>{var pt;return ot%1?0:((pt=i.subX)!=null?pt:i.x).tickOffset()}),l.xAxisTick=i.getXAxisTickFormat(),l.subXAxisTick=i.getXAxisTickFormat(!0),i.setAxis("x",f.x,s.axis_x_tick_outer,t),s.subchart_show&&i.setAxis("subX",f.subX,s.axis_x_tick_outer,t),f.y=o.getYScale("y",J.y,K.y,f.y?f.y.domain():s.axis_y_default),f.subY=o.getYScale("y",J.subY,K.subY,f.subY?f.subY.domain():s.axis_y_default),i.setAxis("y",f.y,s.axis_y_tick_outer,t),s.axis_y2_show&&(f.y2=o.getYScale("y2",J.y,K.y,f.y2?f.y2.domain():s.axis_y2_default),f.subY2=o.getYScale("y2",J.subY,K.subY,f.subY2?f.subY2.domain():s.axis_y2_default),i.setAxis("y2",f.y2,s.axis_y2_tick_outer,t))}else if(N){const D=o.getCurrentPadding();f.x=Lo().rangeRound([D.left,g.width-D.right]),f.y=Lo().rangeRound([D.top,g.height-D.bottom])}else(a=o.updateArc)==null||a.call(o)},xx(t){const e=this,{config:r,scale:{x:a,zoom:o}}=e,i=r.zoom_enabled&&o?o:a;return t?i(De(t.x)?t.x:t):null},xv(t){const e=this,{axis:r,config:a,scale:{x:o,zoom:i}}=e,s=a.zoom_enabled&&i?i:o;let l=e.getBaseValue(t);return r.isTimeSeries()?l=Zn.call(e,l):r.isCategorized()&&Ue(l)&&(l=a.axis_x_categories.indexOf(l)),s(l)},yv(t){const e=this,{scale:{y:r,y2:a}}=e;return(t.axis&&t.axis==="y2"?a:r)(e.getBaseValue(t))},subxx(t){return t?this.scale.subX(t.x):null}},Zp={setContainerSize(){const t=this,{state:e}=t;e.current.width=t.getCurrentWidth(),e.current.height=t.getCurrentHeight()},getCurrentWidth(){const t=this;return t.config.size_width||t.getParentWidth()},getCurrentHeight(){const t=this,{config:e}=t,r=e.size_height||t.getParentHeight();return r>0?r:320/(t.hasType("gauge")&&!e.gauge_fullCircle?2:1)},getParentRectValue(t){const e=`offset${In(t)}`;let r=this.$el.chart.node(),a=0;for(;a<30&&r&&r.tagName!=="BODY";){try{a=mn(r,!0)[t]}catch(i){e in r&&(a=r[e])}r=r.parentNode}const o=pn.body[e];return a>o&&(a=o),a},getParentWidth(){return this.getParentRectValue("width")},getParentHeight(){const t=this.$el.chart.style("height");let e=0;return t&&(e=/px$/.test(t)?parseInt(t,10):this.getParentRectValue("height")),e},getSvgLeft(t){const e=this,{config:r,state:{hasAxis:a},$el:o}=e,i=r.axis_rotated,s=i||!i&&!r.axis_y_inner,l=i?vn.axisX:vn.axisY,c=o.main.select(`.${l}`).node(),f=a&&r[`axis_${i?"x":"y"}_label`];let g=0;if(a&&(Ue(f)||Ue(f.text)||/^inner-/.test(f==null?void 0:f.position))){const U=o.main.select(`.${l}-label`);U.empty()||(g=mn(U.node()).left)}const p=c&&s?mn(c,!t):{right:0},m=mn(o.chart.node(),!t).left+g,E=e.hasArcType(),w=p.right-m-(E?0:e.getCurrentPaddingByDirection("left",t));return w>0?w:0},updateDimension(t){var e;const r=this,{config:a,state:{hasAxis:o},$el:i}=r;o&&!t&&r.axis.x&&a.axis_rotated&&((e=r.axis.subX)==null||e.create(i.axis.subX)),r.updateScales(t),r.updateSvgSize(),r.transformAll(!1)},updateSvgSize(){const t=this,{config:e,state:{clip:r,current:a,hasAxis:o,width:i,height:s},$el:{svg:l}}=t;if(e.resize_auto==="viewBox"?l.attr("viewBox",`0 0 ${a.width} ${a.height}`):l.attr("width",a.width).attr("height",a.height),o){const c=l.select(`.${_s.brush} .overlay`),f={width:0,height:0};c.size()&&(f.width=+c.attr("width"),f.height=+c.attr("height")),l.selectAll([`#${r.id}`,`#${r.idGrid}`]).select("rect").attr("width",i).attr("height",s),l.select(`#${r.idXAxis}`).select("rect").call(t.setXAxisClipPath.bind(t)),l.select(`#${r.idYAxis}`).select("rect").call(t.setYAxisClipPath.bind(t)),r.idSubchart&&l.select(`#${r.idSubchart}`).select("rect").attr("width",i).attr("height",f.height)}},getCurrentPaddingByDirection(t,e=!1,r=!1){var a;const o=this,{config:i,$el:s,state:{hasAxis:l}}=o,c=i.axis_rotated,f=((a=i.padding)==null?void 0:a.mode)==="fit",g=pe(i[`padding_${t}`])?i[`padding_${t}`]:void 0,p=l?{top:c?"y2":null,bottom:c?"y":"x",left:c?"x":"y",right:c?null:"y2"}[t]:null,m=/^(left|right)$/.test(t),E=p&&i[`axis_${p}_inner`],w=p&&i[`axis_${p}_show`],U=p?i[`axis_${p}_axes`].length:0;let N=p?m?o.getAxisWidthByAxisId(p,e):o.getHorizontalAxisHeight(p):0;const D=20;let Y=0;!f&&m&&(N=ng(N));let J=l&&m&&(E||ln(g)&&!w)?0:f?(w?N:0)+(g!=null?g:0):ln(g)?N:g;return m&&l?(p&&(f||E)&&i[`axis_${p}_label`].text&&(J+=o.axis.getAxisLabelPosition(p).isOuter?D:0),t==="right"?(J+=c?!f&&ln(g)?10:2:!w||E?f?2:1:0,J+=r?o.axis.getXAxisTickTextY2Overflow(D):0):t==="left"&&c&&ln(g)&&(J=i.axis_x_show?f?N:Math.max(N,40):1)):t==="top"?(s.title&&s.title.node()&&(J+=o.getTitlePadding()),Y=c&&!E?U:0):t==="bottom"&&l&&c&&!w&&(J+=1),J+N*U-Y},getCurrentPadding(t=!1){const e=this,[r,a,o,i]=["top","bottom","left","right"].map(s=>e.getCurrentPaddingByDirection(s,null,t));return{top:r,bottom:a,left:o,right:i}},getResettedPadding(t){const e=this,{config:r}=e,a=pe(t);let o=a?0:{};return r.padding===!1?!a&&Object.keys(t).forEach(i=>{o[i]=!Yn(r.data_labels)&&r.data_labels!==!1&&i==="top"?t[i]:0}):o=t,o},updateSizes(t){var e,r,a,o,i;const s=this,{config:l,state:c,$el:{legend:f}}=s,g=l.axis_rotated,p=s.hasArcType()||c.hasFunnel||c.hasTreemap,m=((e=l.padding)==null?void 0:e.mode)==="fit";!t&&s.setContainerSize();const E={width:f?s.getLegendWidth():0,height:f?s.getLegendHeight():0};!p&&l.axis_x_show&&l.axis_x_tick_autorotate&&s.updateXAxisTickClip();const w={right:l.legend_show&&c.isLegendRight?s.getLegendWidth()+(m?0:20):0,bottom:!l.legend_show||c.isLegendRight||c.isLegendInset?0:E.height},U=g||p?0:s.getHorizontalAxisHeight("x"),N=l.subchart_axis_x_show&&l.subchart_axis_x_tick_text_show?U:30,D=l.subchart_show&&!p?l.subchart_size_height+N:0,Y=s.hasType("gauge")&&l.arc_needle_show&&!l.gauge_fullCircle&&!l.gauge_label_show?10:0,J=s.getCurrentPadding(!0);if(c.margin=!p&&g?{top:J.top,right:p?0:J.right+w.right,bottom:w.bottom+J.bottom,left:D+(p?0:J.left)}:{top:(m?0:4)+J.top,right:p?0:J.right+w.right,bottom:Y+D+w.bottom+J.bottom,left:p?0:J.left},c.margin=s.getResettedPadding(c.margin),c.margin2=g?{top:c.margin.top,right:NaN,bottom:20+w.bottom,left:s.state.rotatedPadding.left}:{top:c.current.height-D-w.bottom,right:NaN,bottom:N+w.bottom,left:c.margin.left},c.margin3={top:0,right:NaN,bottom:0,left:0},(r=s.updateSizeForLegend)==null||r.call(s,E),c.width=c.current.width-c.margin.left-c.margin.right,c.height=c.current.height-c.margin.top-c.margin.bottom,c.width<0&&(c.width=0),c.height<0&&(c.height=0),c.width2=g?c.margin.left-c.rotatedPadding.left-c.rotatedPadding.right:c.width,c.height2=g?c.height:c.current.height-c.margin2.top-c.margin2.bottom,c.width2<0&&(c.width2=0),c.height2<0&&(c.height2=0),s.hasArcType()){const K=s.hasType("gauge"),nt=l.legend_show&&c.isLegendRight,Q=(a=c.hasRadar&&s.cache.get(Mn.radarTextWidth))!=null?a:0;c.arcWidth=c.width-(nt?E.width+10:0)-Q,c.arcHeight=c.height-(nt&&!K?0:10),(o=l.arc_rangeText_values)!=null&&o.length&&(K?(c.arcWidth-=25,c.arcHeight-=10,c.margin.left+=10):(c.arcHeight-=20,c.margin.top+=10)),K&&!l.gauge_fullCircle&&(c.arcHeight+=c.height-s.getPaddingBottomForGauge()),(i=s.updateRadius)==null||i.call(s)}c.isLegendRight&&p&&(c.margin3.left=c.arcWidth/2+c.radiusExpanded*1.1)}},Jp={setCssRule(t,e,r,a){const o=this,{config:i,state:{cssRule:s,style:l}}=o;return i.boost_useCssRule?c=>{c.each(f=>{const g=a&&(a==null?void 0:a.call(o,f)),p=`${t?`.${sn.shapes+o.getTargetSelectorSuffix(f.id)}`:""}${e}`;e in s&&l.sheet.deleteRule(s[p]),o.state.cssRule[p]=sg(l,p,r.filter(Boolean).map(m=>Ue(g)&&m.indexOf(":")===-1?`${m}: ${g}`:m||""))})}:()=>{}},getStylePropValue(t){const{config:{boost_useCssRule:e}}=this;return e?null:he(t)?t.bind(this):t}};function Vc(t){return typeof t=="string"?new Oe([document.querySelectorAll(t)],[document.documentElement]):new Oe([T(t)],qt)}function Qp(t){let e="middle";return t>0&&t<=170?e="end":t>190&&t<=360&&(e="start"),e}function kp(t,e,r,a,o){var i;const s=this,{value:l}=t,c=s.isCandlestickType(t),f=pe(l)&&l<0||c&&!((i=s.getCandlestickData(t))!=null&&i._isUp);let{x:g,y:p}=e;const m=4,E=m*2;return a?r==="start"?(g+=f?0:E,p+=m):r==="middle"?(g+=E,p-=E):r==="end"&&(f&&(g-=E),p+=m):(r==="start"?(g+=m,f&&(p+=E*2)):r==="middle"?p-=E:r==="end"&&(g-=m,f&&(p+=E*2)),o&&(p+=f?-17:c?13:7)),{x:g,y:p}}function Xc(t,e){var r;const a=this.config.data_labels_position,{id:o,index:i,value:s}=t;return(r=he(a)?a.bind(this.api)(e,s,o,i,this.$el.text):(o in a?a[o]:a)[e])!=null?r:0}function qp(t,e,r){var a,o;const i=this,{config:s,$T:l}=i,c=s.axis_rotated,{border:{padding:f="3 5",radius:g=10,stroke:p="#000",strokeWidth:m=1,fill:E="none"}}=s.data_labels,w=dg(f),U=s.data_labels.border!==!0,N=na(t);let D=it(t.previousElementSibling);(D.empty()||((a=D.node())==null?void 0:a.tagName)!=="rect"||!((o=D.attr("class"))!=null&&o.includes(r)))&&(D=it(t.parentNode).insert("rect",()=>t).attr("class",`${gn.textBorderRect} ${r}`).attr("width",N.width+(U?w.left+w.right:0)).attr("height",N.height+(U?w.top+w.bottom:0)),U&&D.style("fill",E).style("stroke",p).style("stroke-width",`${m}px`).attr("rx",g).attr("ry",g)),l(D).attr("x",e.x-(U?w.left:0)-(c?0:N.width/2)).attr("y",e.y-(U?w.top:0)-N.height/4*3.2)}function cs(t=0,e){const r=this,{config:a}=r,o=a[`${e}_label_threshold`]||0;return t>=o}function Hc(){const t=this,{$el:{text:e},config:r}=t;(t.state.arcWidth?t.getArcLabelConfig("image"):r.data_labels.image)&&e.filter(function(){const o=this.previousElementSibling;return o?o.tagName!=="image"||!o.classList.contains(gn.textLabelImage):!0}).each(function(o){var i,s,l,c;const{url:f,width:g,height:p,pos:m}=_p.call(t,o);if(f){const E=it(this.parentNode);E==null||E.insert("image",`${(s=(i=this.getAttribute("class"))==null?void 0:i.replace(/(?:^(.)|\s)/g,".$1"))!=null?s:"text"}`).style("opacity","0").attr("href",w=>Na(f,{ID:"id"in w?w.id:w.data.id})).attr("class",gn.textLabelImage).style("pointer-events","none").attr("width",g).attr("height",p).attr("transform",m?`translate(${(l=m.x)!=null?l:0} ${(c=m.y)!=null?c:0})`:null)}})}function _p(t){var e;const r=this,{config:a,state:o}=r,i=o.arcWidth?r.getArcLabelConfig("image"):a.data_labels.image;if(he(i))return(e=i.call(r.api,t.value,t.id,t.index))!=null?e:{url:"",width:0,height:0,pos:{x:0,y:0}};if(i){const{url:s="",width:l=0,height:c=0,pos:f}=i;return{url:s,width:l,height:c,pos:f}}return null}function Wc(t,e){var r;const a=this,{config:o,state:{arcWidth:i,hasTreemap:s}}=a,l=o.axis_rotated,c=it(t.previousElementSibling),f=g=>{var p;const m=g.style.opacity!=="0"&&g.style.fillOpacity!=="0";return(i?g.textContent:m)&&((p=this.previousElementSibling)==null?void 0:p.tagName)!=="image"};if(!c.empty()&&((r=c.node())==null?void 0:r.tagName)==="image"){const g=mn(t),p=+c.attr("width")/2,m=+c.attr("height")/2;let E=e.x-p,w=e.y-m-g.height/2;l?e.x+=p:(s&&(E=-p,w=-(m*2+g.height)),a.hasType("pie")||a.hasType("polar")||(e.y+=m)),a.$T(c).style("opacity",f(t)?null:"0").attr("x",E).attr("y",w)}}var tm={opacityForText(t){const e=this;return e.isBarType(t)&&!cs.call(e,Math.abs(e.getRatio("bar",t)),"bar")?"0":e.hasDataLabel?null:"0"},initText(){const{$el:t}=this;t.main.select(`.${Se.chart}`).append("g").attr("class",gn.chartTexts).style("pointer-events",t.funnel||t.treemap?"none":null)},updateTargetsForText(t){const e=this,r=e.getChartClass("Text"),a=e.getClass("texts","id"),o=e.classFocus.bind(e);e.$el.main.select(`.${gn.chartTexts}`).selectAll(`.${gn.chartText}`).data(e.filterNullish(t)).attr("class",l=>`${r(l)}${o(l)}`.trim()).enter().append("g").style("opacity","0").attr("class",r).call(e.setCssRule(!0,` .${gn.text}`,["fill","pointer-events:none"],e.updateTextColor)).append("g").attr("class",a)},updateText(){const t=this,{$el:e,$T:r,config:a,axis:o}=t,i=t.getClass("text","index"),s=a.data_labels.centered,l=e.main.selectAll(`.${gn.texts}`).selectAll(`.${gn.text}`).data(t.labelishData.bind(t));r(l.exit()).style("fill-opacity","0").remove(),e.text=l.enter().append("text").merge(l).attr("class",i).attr("text-anchor",c=>{let g=a[`axis_${o==null?void 0:o.getId(c.id)}_inverted`]?c.value>0:c.value<0;if(t.isCandlestickType(c)){const p=t.getCandlestickData(c);g=!(p!=null&&p._isUp)}else if(t.isTreemapType(c))return s?"middle":"start";return a.axis_rotated?g?"end":"start":"middle"}).style("fill",t.getStylePropValue(t.updateTextColor)).style("fill-opacity","0").each(function(c,f,g){const p=it(this);let{value:m}=c;if(t.isBubbleZType(c))m=t.getBubbleZData(m,"z");else if(t.isCandlestickType(c)){const E=t.getCandlestickData(c);E&&(m=E.close)}m=t.isTreemapType(c)?t.treemapDataLabelFormat(c)(p):t.dataLabelFormat(c.id)(m,c.id,c.index,g),pe(m)?this.textContent=m:Da(p,m)}),Hc.call(t)},updateTextColor(t){const e=this,{config:r}=e,a=r.data_labels_colors,o=e.isArcType(t)&&!e.isRadarType(t)||e.isFunnelType(t)||e.isTreemapType(t)?null:e.color(t);let i;if(Ue(a))i=a;else if(ze(a)){const{id:s}=t.data||t;i=a[s]}else he(a)&&(i=a.bind(e.api)(o,t));if(e.isCandlestickType(t)&&!he(a)){const s=e.getCandlestickData(t);if(!(s!=null&&s._isUp)){const l=r.candlestick_color_down;i=ze(l)?l[t.id]:l}}return i||o},updateTextBGColor(t,e){const r=this,{$el:{defs:a}}=r;let o="";if(e){const i=Ue(e)?"":r.getTargetSelectorSuffix("id"in t?t.id:t.data.id),s=a.select(["filter[id*='labels-bg","']"].join(i));if(s.size()&&(o=`url(#${s.attr("id")})`),he(e)){r.generateTextBGColorFilter(e);const l=r.color(t),c=e.bind(r.api)(l,t);c?s.select("feFlood").attr("flood-color",c):o=""}}return o||null},redrawText(t,e,r,a){const o=this,{$T:i,axis:s,config:l,state:{hasTreemap:c}}=o,f=ar(!0),g=l.axis_rotated,p=l.data_labels.rotate,m=Qp(p),E=p?`rotate(${p})`:"";return o.$el.text.style("fill",o.getStylePropValue(o.updateTextColor)).attr("filter",w=>o.updateTextBGColor.bind(o)(w,l.data_labels_backgroundColors)).style("fill-opacity",r?0:o.opacityForText.bind(o)).each(function(w,U){const N=i(c&&this.childElementCount?this.parentNode:this,!!(a&&(this.getAttribute("x")||this.getAttribute("transform"))),f),D=l[`axis_${s==null?void 0:s.getId(w.id)}_inverted`];let Y={x:t.bind(this)(w,U),y:e.bind(this)(w,U)};p&&(Y=kp.bind(o)(w,Y,m,g,D),N.attr("text-anchor",m)),Wc.call(o,this,Y),this.childElementCount||p?N.attr("transform",`translate(${Y.x} ${Y.y}) ${E}`):N.attr("x",Y.x).attr("y",Y.y),l.data_labels.border&&qp.call(o,N.node(),Y,`${gn.textBorderRect}-${U}`)}),!0},getTextRect(t,e){var r,a;const o=this;let i,s,l;Array.isArray(t)?i=`${Mn.textRect}-${t.join("_")}`:(s=(a=(r=t.node)==null?void 0:r.call(t))!=null?a:t,/text/i.test(s.tagName)||(s=s.querySelector("text")),l=s.textContent,i=`${Mn.textRect}-${l.replace(/\W/g,"_")}`);const c=o.cache.get(i)||[];return c.length===0&&((o.$el.svg||o.$el.chart.select("svg")).selectAll(`.${Se.dummy}`).data(l?[l]:t).enter().append("text").style("visibility","hidden").style("font",s?it(s).style("font"):null).classed(e||Se.dummy,!0).text(f=>f).each(function(f,g){c[g]=mn(this)}).remove(),o.cache.add(i,c)),c.length>1?c:c[0]},generateXYForText(t,e){const r=this,{state:{hasRadar:a,hasFunnel:o,hasTreemap:i}}=r,s=Object.keys(t),l={},c=e?r.getXForText:r.getYForText;return o&&s.push("funnel"),a&&s.push("radar"),i&&s.push("treemap"),s.forEach(f=>{l[f]=r[`generateGet${In(f)}Points`](t[f],!1)}),function(f,g){const p=r.isAreaType(f)&&"area"||r.isBarType(f)&&"bar"||r.isCandlestickType(f)&&"candlestick"||r.isFunnelType(f)&&"funnel"||r.isRadarType(f)&&"radar"||r.isTreemapType(f)&&"treemap"||"line";return c.call(r,l[p](f,g),f,this)}},getCenteredTextPos(t,e,r,a){const o=this,{config:i}=o,s=i.axis_rotated,l=o.isBarType(t),c=o.isTreemapType(t);if(i.data_labels.centered&&(l||c)){const f=mn(r);if(l){const g=o.getRangedData(t,null,"bar")>=0;if(s){const p=(g?e[1][1]-e[0][1]:e[0][1]-e[1][1])/2+f.width/2;return g?-p-3:p+2}else{const p=(g?e[0][1]-e[1][1]:e[1][1]-e[0][1])/2+f.height/2;return g?p:-p-2}}else if(c)return a==="x"?(e[1][0]-e[0][0])/2:(e[1][1]-e[0][1])/2+f.height/2}return 0},getXForText(t,e,r){var a;const o=this,{config:i}=o,s=i.axis_rotated,l=o.isFunnelType(e),c=o.isTreemapType(e);let f=t?t[0][0]:0;if(o.isCandlestickType(e))s?f=(a=o.getCandlestickData(e))!=null&&a._isUp?t[2][2]+4:t[2][1]-4:f+=(t[1][0]-f)/2;else if(l)f+=o.state.current.width/2;else if(c)f+=i.data_labels.centered?0:5;else if(s){const g=i[`axis_${o.axis.getId(e.id)}_inverted`],p=o.isBarType(e)?4:6,m=e.value;f=t[2][1],g?f-=p*(m>0?1:-1):f+=p*(m<0?-1:1)}else f=o.hasType("bar")?(t[2][0]+t[0][0])/2:f;return(s||c)&&(f+=o.getCenteredTextPos(e,t,r,"x")),f+Xc.call(this,e,"x")},getYForText(t,e,r){const a=this,{axis:o,config:i,state:s}=a,l=i.axis_rotated,c=i[`axis_${o==null?void 0:o.getId(e.id)}_inverted`],f=a.isBarType(e),g=a.isFunnelType(e),p=a.isTreemapType(e),m=i.point_r,E=mn(r);let{value:w}=e,U=3,N;if(a.isCandlestickType(e))w=a.getCandlestickData(e),l?(N=t[0][0],N+=(t[1][0]-N)/2+U):(N=w&&w._isUp?t[2][2]-U:t[2][1]+U*4,c&&(N+=15*(w._isUp?1:-1)));else if(g)N=t?t[0][1]+(t[1][1]-t[0][1])/2+E.height/2-3:0;else if(p)N=t[0][1]+(i.data_labels.centered?0:E.height+5);else if(l)N=(t[0][0]+t[2][0]+E.height*.6)/2;else if(N=t[2][1],pe(m)&&m>5&&(a.isLineType(e)||a.isScatterType(e))&&(U+=i.point_r/2.3),w<0||w===0&&!s.hasPositiveValue&&s.hasNegativeValue)N+=c?f?-3:-5:E.height+(f?-U:U);else{let D=-U*2;f?D=-U:a.isBubbleType(e)&&(D=U),c&&(D=f?10:15),N+=D}return(!l||p)&&(N+=a.getCenteredTextPos(e,t,r,"y")),N+Xc.call(this,e,"y")},markOverlapped(t,e,r){const a=e.$el.arcs.selectAll(r),o=a.filter(c=>c.data.id!==t),i=a.filter(c=>c.data.id===t),s=ql(i.node()),l=(c,f)=>Math.sqrt(Math.pow(c,2)+Math.pow(f,2));i.node()&&o.each(function(){const c=ql(this),f=it(this),g=l(s.e,s.f)>l(c.e,c.f)?i:f,p=Math.ceil(Math.abs(s.e-c.e))<Math.ceil(g.node().getComputedTextLength()),m=Math.ceil(Math.abs(s.f-c.f))<parseInt(i.style("font-size"),10);f.classed(gn.TextOverlapping,p&&m)})},undoMarkOverlapped(t,e){t.$el.arcs.selectAll(e).each(function(){Vc([this,this.previousSibling]).classed(gn.TextOverlapping,!1)})}};function Yc(t="left",e){const r=pe(e);let a;return t.indexOf("center")>-1?a=r?e/2:"middle":t.indexOf("right")>-1?a=r?e:"end":a=r?0:"start",a}var em={initTitle(){const t=this,{config:e,$el:r}=t;if(e.title_text){r.title=r.svg.append("g");const a=r.title.append("text").style("text-anchor",Yc(e.title_position)).attr("class",gn.title);Da(a,e.title_text,[.3,1.5])}},redrawTitle(){const t=this,{config:e,state:{current:r},$el:{title:a}}=t;if(a){const o=Yc(e.title_position,r.width),i=(e.title_padding.top||0)+t.getTextRect(t.$el.title,gn.title).height;a.attr("transform",`translate(${o}, ${i})`)}},getTitlePadding(){const t=this,{$el:{title:e},config:r}=t;return(r.title_padding.top||0)+(e?t.getTextRect(e,gn.title).height:0)+(r.title_padding.bottom||0)}},nm={initTooltip(){const t=this,{config:e,$el:r}=t;r.tooltip=it(e.tooltip_contents.bindto),r.tooltip.empty()&&(r.tooltip=r.chart.append("div").attr("class",ro.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),t.bindTooltipResizePos()},initShowTooltip(){var t;const e=this,{config:r,$el:a,state:{hasAxis:o,hasRadar:i}}=e;if(r.tooltip_init_show){const s=!(o||i);(t=e.axis)!=null&&t.isTimeSeries()&&Ue(r.tooltip_init_x)&&(r.tooltip_init_x=Zn.call(e,r.tooltip_init_x)),e.api.tooltip.show({data:{[s?"index":"x"]:r.tooltip_init_x}});const l=r.tooltip_init_position;if(!r.tooltip_contents.bindto&&!Yn(l)){const{top:c=0,left:f=50}=l;a.tooltip.style("top",Ue(c)?c:`${c}px`).style("left",Ue(f)?f:`${f}px`).style("display",null)}}},getTooltipHTML(...t){const e=this,{api:r,config:a}=e;return he(a.tooltip_contents)?a.tooltip_contents.bind(r)(...t):e.getTooltipContent(...t)},getTooltipContent(t,e,r,a){var o;const i=this,{api:s,config:l,state:c,$el:f}=i,[g,p,m]=["title","name","value"].map(vt=>{const tt=l[`tooltip_format_${vt}`];return he(tt)?tt.bind(s):tt}),E=(...vt)=>wi((g||e)(...vt)),w=(...vt)=>wi((p||(tt=>tt))(...vt)),U=(...vt)=>{const tt=m||(c.hasTreemap||i.isStackNormalized()?(St,ct)=>`${(ct*100).toFixed(2)}%`:r);return wi(tt(...vt))},N=l.tooltip_order,D=vt=>i.axis&&i.isBubbleZType(vt)?i.getBubbleZData(vt.value,"z"):i.getBaseValue(vt),Y=i.levelColor?vt=>i.levelColor(vt.value):vt=>a(vt),J=l.tooltip_contents,K=J.template,nt=i.mapToTargetIds();if(N===null&&l.data_groups.length){const vt=i.orderTargets(i.data.targets).map(tt=>tt.id).reverse();t.sort((tt,St)=>{let ct=tt?tt.value:null,At=St?St.value:null;return ct>0&&At>0&&(ct=tt.id?vt.indexOf(tt.id):null,At=St.id?vt.indexOf(St.id):null),ct-At})}else if(/^(asc|desc)$/.test(N)){const vt=N==="asc";t.sort((tt,St)=>{const ct=tt?D(tt):null,At=St?D(St):null;return vt?ct-At:At-ct})}else he(N)&&t.sort(N.bind(s));const Q=i.getTooltipContentTemplate(K),ot=t.length;let pt,Tt,yt,lt,jt;for(jt=0;jt<ot;jt++)if(Tt=t[jt],!(!Tt||!(D(Tt)||D(Tt)===0))){if(ln(pt)){const vt=(c.hasAxis||c.hasRadar)&&E(Tt.x);pt=Na(Q[0],{CLASS_TOOLTIP:ro.tooltip,TITLE:De(vt)?K?vt:`<tr><th colspan="2">${vt}</th></tr>`:""})}if(!Tt.ratio&&f.arcs&&(yt=["arc",i.$el.arcs.select(`path.${Ve.arc}-${Tt.id}`).data()[0]],Tt.ratio=i.getRatio(...yt)),yt=[Tt.ratio,Tt.id,Tt.index],i.isAreaRangeType(Tt)){const[vt,tt]=["high","low"].map(ct=>U(i.getRangedData(Tt,ct),...yt));lt=`<b>Mid:</b> ${U(D(Tt),...yt)} <b>High:</b> ${vt} <b>Low:</b> ${tt}`}else if(i.isCandlestickType(Tt)){const[vt,tt,St,ct,At]=["open","high","low","close","volume"].map(Wt=>i.getRangedData(Tt,Wt,"candlestick")?U(i.getRangedData(Tt,Wt,"candlestick"),...yt):void 0);lt=`<b>Open:</b> ${vt} <b>High:</b> ${tt} <b>Low:</b> ${St} <b>Close:</b> ${ct}${At?` <b>Volume:</b> ${At}`:""}`}else if(i.isBarRangeType(Tt)){const{value:vt,id:tt,index:St}=Tt;lt=`${U(vt,void 0,tt,St)}`}else lt=U(D(Tt),...yt);if(lt!==void 0){if(Tt.name===null)continue;const vt=w((o=Tt.name)!=null?o:Tt.id,...yt),tt=Y(Tt),St={CLASS_TOOLTIP_NAME:ro.tooltipName+i.getTargetSelectorSuffix(Tt.id),COLOR:K||!i.patterns?tt:`<svg><rect style="fill:${tt}" width="10" height="10"></rect></svg>`,NAME:vt,VALUE:lt};if(K&&ze(J.text)){const ct=nt.indexOf(Tt.id);Object.keys(J.text).forEach(At=>{St[At]=J.text[At][ct]})}pt+=Na(Q[1],St)}}return`${pt}</table>`},getTooltipContentTemplate(t){return(t||`<table class="{=CLASS_TOOLTIP}"><tbody>
|
|
43
43
|
{=TITLE}
|
|
44
44
|
{{<tr class="{=CLASS_TOOLTIP_NAME}">
|
|
45
45
|
<td class="name">${this.patterns?"{=COLOR}":'<span style="background-color:{=COLOR}"></span>'}{=NAME}</td>
|
|
46
46
|
<td class="value">{=VALUE}</td>
|
|
47
47
|
</tr>}}
|
|
48
|
-
</tbody></table>`).replace(/(\r?\n|\t)/g,"").split(/{{(.*)}}/)},setTooltipPosition(t,e){var r,a;const o=this,{config:i,scale:s,state:l,$el:{eventRect:c,tooltip:f,svg:g}}=o,{bindto:p}=i.tooltip_contents,m=i.axis_rotated,E=f==null?void 0:f.datum();if(!p&&E){const w=t!=null?t:JSON.parse(E.current),[U,N]=Yn(l.event,e!=null?e:c==null?void 0:c.node()),D={x:U,y:N};if(l.hasAxis&&s.x&&E&&"x"in E){const nt=(Q=0,ot,pt="y")=>{var Tt;const yt=s[ot?(Tt=o.axis)==null?void 0:Tt.getId(ot):pt];return yt?yt(Q)+(m?l.margin.left:l.margin.top):0};D.xAxis=s.x(E.x)+(i.tooltip_position?m?l.margin.top:l.margin.left:0),w.length===1?D.yAxis=nt(w[0].value,w[0].id):D.yAxis=nt}const{width:Y=0,height:J=0}=E,K=(a=(r=i.tooltip_position)==null?void 0:r.bind(o.api)(w,Y,J,c==null?void 0:c.node(),D))!=null?a:Li(g)?o.getTooltipPositionViewBox.bind(o)(Y,J,D):o.getTooltipPosition.bind(o)(Y,J,D);["top","left"].forEach(nt=>{const Q=K[nt];f.style(nt,`${Q}px`),nt==="left"&&!E.xPosInPercent&&(E.xPosInPercent=Q/l.current.width*100)})}},getTooltipPositionViewBox(t,e,r){var a,o;const i=this,{$el:{eventRect:s,svg:l},config:c,state:f}=i,g=c.axis_rotated,p=i.hasArcType()||f.hasFunnel||f.hasTreemap,m=(o=(a=p?l:s)==null?void 0:a.node())!=null?o:f.event.target;let{x:E,y:w}=r;f.hasAxis&&(E=g?E:r.xAxis,w=g?r.xAxis:w);const U=Io(m,E,w,!1),N=mn(m),D=Io(m,20,0,!1).x;let Y=U.y,J=U.x+t/2+D;return p&&(f.hasFunnel||f.hasTreemap||f.hasRadar?(J-=t/2+D,Y+=e):(Y+=N.height/2,J+=N.width/2-(t-D))),J+t>N.width&&(J=N.width-t-D),Y+e>N.height&&(Y-=e*2),{top:Y,left:J}},getTooltipPosition(t,e,r){var a,o,i;const s=this,{config:l,scale:c,state:f}=s,{width:g,height:p,current:m,hasFunnel:E,hasRadar:w,hasTreemap:U,isLegendRight:N,inputType:D}=f,Y=s.hasType("gauge")&&!l.gauge_fullCircle,J=l.axis_rotated,K=s.hasArcType(),nt=s.getSvgLeft(!0);let Q=nt+m.width-s.getCurrentPaddingByDirection("right");const ot=20;let{x:pt,y:Tt}=r;if(w)pt+=pt>=g/2?15:-(t+15),Tt+=15;else if(K){if(D!=="touch"){let jt=(o=(a=s.getTitlePadding)==null?void 0:a.call(s))!=null?o:0;jt&&Y&&((i=l.arc_rangeText_values)!=null&&i.length)&&(jt+=10),pt+=(g-(N?s.getLegendWidth():0))/2,Tt+=(Y?p:p/2+e)+jt}}else if(E||U)Tt+=e;else{const lt={top:s.getCurrentPaddingByDirection("top",!0),left:s.getCurrentPaddingByDirection("left",!0)};J?(pt+=nt+lt.left+ot,Tt=lt.top+r.xAxis+ot,Q-=nt):(pt=nt+lt.left+ot+(c.zoom?pt:r.xAxis),Tt+=lt.top-5)}if(pt+t+15>Q&&(pt-=t+(E||U||K?0:J?ot*2:38)),Tt+e>m.height){const lt=U?e+10:30;Tt-=Y?e*1.5:e+lt}const yt={top:Tt,left:pt};return Object.keys(yt).forEach(lt=>{yt[lt]<0&&(yt[lt]=0)}),yt},showTooltip(t,e){const r=this,{config:a,$el:{tooltip:o}}=r,i=t.filter(c=>c&&De(r.getBaseValue(c)));if(!o||i.length===0||!a.tooltip_show)return;let s=o.datum();const l=JSON.stringify(t);if(!s||s.current!==l){const{index:c,x:f}=t.concat().sort()[0];_e(a.tooltip_onshow,r.api,t),o.html(r.getTooltipHTML(t,r.axis?r.axis.getXAxisTickFormat():r.categoryName.bind(r),r.getDefaultValueFormat(),r.color)).style("display",null).style("visibility",null).datum(s={index:c,x:f,current:l,width:o.property("offsetWidth"),height:o.property("offsetHeight")}),_e(a.tooltip_onshown,r.api,t),r._handleLinkedCharts(!0,c)}r.setTooltipPosition(i,e)},bindTooltipResizePos(){const t=this,{resizeFunction:e,state:r,$el:{tooltip:a}}=t;e.add(()=>{if(a.style("display")==="block"){const{current:o}=r,{width:i,xPosInPercent:s}=a.datum();let l=o.width/100*s;const c=o.width-(l+i);c<0&&(l+=c),a.style("left",`${l}px`)}})},hideTooltip(t){var e;const r=this,{api:a,config:o,$el:{tooltip:i}}=r;if(i&&i.style("display")!=="none"&&(!o.tooltip_doNotHide||t)){const s=JSON.parse((e=i.datum().current)!=null?e:{});_e(o.tooltip_onhide,a,s),i.style("display","none").style("visibility","hidden").datum(null),_e(o.tooltip_onhidden,a,s)}},_handleLinkedCharts(t,e){const r=this,{charts:a,config:o,state:{event:i}}=r;if(i!=null&&i.isTrusted&&o.tooltip_linked&&a.length>1){const s=o.tooltip_linked_name;a.filter(l=>l!==r.api).forEach(l=>{const{config:c,$el:f}=l.internal,g=c.tooltip_linked,p=c.tooltip_linked_name,m=pn.body.contains(f.chart.node());if(g&&s===p&&m){const E=f.tooltip.data()[0],w=e!==(E==null?void 0:E.index);try{l.tooltip[t&&w?"show":"hide"]({index:e})}catch(U){}}})}},updateTooltipOnRedraw(t,e){var r;const a=this,{config:o,$el:{eventRect:i,svg:s,tooltip:l},state:{event:c,hasAxis:f,hasRadar:g,hasTreemap:p}}=a;if((l==null?void 0:l.style("display"))==="block"&&c){const m=t!=null?t:(r=g?s:i)==null?void 0:r.node();if(f||g)if(a.isMultipleX())a.selectRectForMultipleXs(m,!1);else{const E=e!=null?e:a.getDataIndexFromEvent(c);e===-1?a.api.tooltip.hide():(a.selectRectForSingle(m,E),a.setExpand(E,null,!0))}else{const{clientX:E,clientY:w}=c;setTimeout(()=>{let U=[E,w].every(Number.isFinite)&&pn.elementFromPoint(E,w);const N=U&&it(U).datum();if(N){const D=a.hasArcType()?a.convertToArcData(a.updateAngle(N)):N==null?void 0:N.data;p&&(U=s.node()),D&&a.showTooltip([D],U)}else a.api.tooltip.hide()},o.transition_duration)}}}},nm={getTranslate(t,e=0){var r;const a=this,{config:o,state:i}=a,s=o.axis_rotated;let l=0,c,f;if(e&&/^(x|y2?)$/.test(t)&&(l=a.getAxisSize(t)*e),t==="main")c=Eo(i.margin.left),f=Eo(i.margin.top);else if(t==="context")c=Eo(i.margin2.left),f=Eo(i.margin2.top);else if(t==="legend")c=i.margin3.left,f=i.margin3.top;else if(t==="x")c=s?-l:0,f=s?0:i.height+l;else if(t==="y")c=s?0:-l,f=s?i.height+l:0;else if(t==="y2")c=s?0:i.width+l,f=s?-l-1:0;else if(t==="subX")c=0,f=s?0:i.height2;else if(t==="arc")c=i.arcWidth/2,f=i.arcHeight/2,(r=o.arc_rangeText_values)!=null&&r.length&&(f+=5+(a.hasType("gauge")&&o.title_text?10:0));else if(t==="polar")c=i.arcWidth/2,f=i.arcHeight/2;else if(t==="radar"){const[g,p]=a.getRadarSize();c=i.width/2-g,f=i.height/2-p}return`translate(${c}, ${f})`},transformMain(t,e){const r=this,{$el:{main:a},$T:o}=r,i=e!=null&&e.axisX?e.axisX:o(a.select(`.${vn.axisX}`),t),s=e!=null&&e.axisY?e.axisY:o(a.select(`.${vn.axisY}`),t),l=e!=null&&e.axisY2?e.axisY2:o(a.select(`.${vn.axisY2}`),t);o(a,t).attr("transform",r.getTranslate("main")),i.attr("transform",r.getTranslate("x")),s.attr("transform",r.getTranslate("y")),l.attr("transform",r.getTranslate("y2")),a.select(`.${Ve.chartArcs}`).attr("transform",r.getTranslate("arc"))},transformAll(t,e){const r=this,{config:a,state:{hasAxis:o,hasFunnel:i,hasTreemap:s},$el:l}=r;!i&&!s&&r.transformMain(t,e),o&&a.subchart_show&&r.transformContext(t,e),l.legend&&r.transformLegend(t)}},rm={isValidChartType(t){return!!(t&&Object.values(se).indexOf(t)>-1)},setTargetType(t,e){const r=this,{config:a,state:{withoutFadeIn:o}}=r;r.mapToTargetIds(t).forEach(i=>{o[i]=e===a.data_types[i],a.data_types[i]=e}),t||(a.data_type=e)},updateTypesElements(){const t=this,{state:{current:e}}=t;Object.keys(se).forEach(r=>{const a=se[r],o=t.hasType(a,null,!0),i=e.types.indexOf(a);i===-1&&o?e.types.push(a):i>-1&&!o&&e.types.splice(i,1)}),t.setChartElements()},hasType(t,e,r=!1){var a;const o=this,{config:i,state:{current:s}}=o,l=i.data_types,c=e||o.data.targets;let f=!1;return!r&&((a=s.types)==null?void 0:a.indexOf(t))>-1?f=!0:c!=null&&c.length?c.forEach(g=>{const p=l[g.id];(p===t||!p&&t==="line")&&(f=!0)}):Object.keys(l).length?Object.keys(l).forEach(g=>{l[g]===t&&(f=!0)}):f=i.data_type===t,f},hasTypeOf(t,e,r=[]){return t in Ar?!Ar[t].filter(a=>r.indexOf(a)===-1).every(a=>!this.hasType(a,e)):!1},isTypeOf(t,e){var r;const a=Ue(t)?t:t.id,o=this.config&&(((r=this.config.data_types)==null?void 0:r[a])||this.config.data_type);return Ge(e)?e.indexOf(o)>=0:o===e},hasPointType(){const t=this;return t.hasTypeOf("Line")||t.hasType("bubble")||t.hasType("scatter")},hasArcType(t,e){return this.hasTypeOf("Arc",t,e)},hasMultiArcGauge(){return this.hasType("gauge")&&this.config.gauge_type==="multi"},isLineType(t){const e=Ue(t)?t:t.id;return!this.config.data_types[e]||this.isTypeOf(e,Ar.Line)},isStepType(t){return this.isTypeOf(t,Ar.Step)},isSplineType(t){return this.isTypeOf(t,Ar.Spline)},isAreaType(t){return this.isTypeOf(t,Ar.Area)},isAreaRangeType(t){return this.isTypeOf(t,Ar.AreaRange)},isBarType(t){return this.isTypeOf(t,"bar")},isBubbleType(t){return this.isTypeOf(t,"bubble")},isCandlestickType(t){return this.isTypeOf(t,"candlestick")},isScatterType(t){return this.isTypeOf(t,"scatter")},isTreemapType(t){return this.isTypeOf(t,"treemap")},isPieType(t){return this.isTypeOf(t,"pie")},isFunnelType(t){return this.isTypeOf(t,"funnel")},isGaugeType(t){return this.isTypeOf(t,"gauge")},isDonutType(t){return this.isTypeOf(t,"donut")},isPolarType(t){return this.isTypeOf(t,"polar")},isRadarType(t){return this.isTypeOf(t,"radar")},isArcType(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)||this.isPolarType(t)||this.isRadarType(t)},isCirclePoint(t){const{config:e}=this,r=e.point_pattern;let a=!1;return(t==null?void 0:t.tagName)==="circle"?a=!0:a=e.point_type==="circle"&&(!r||Ge(r)&&r.length===0),a},lineData(t){return this.isLineType(t)?[t]:[]},arcData(t){return this.isArcType(t.data)?[t]:[]},labelishData(t){return this.isBarType(t)||this.isLineType(t)||this.isScatterType(t)||this.isBubbleType(t)||this.isCandlestickType(t)||this.isFunnelType(t)||this.isRadarType(t)||this.isTreemapType(t)?t.values.filter(e=>pe(e.value)||!!e.value):[]},barLineBubbleData(t){return this.isBarType(t)||this.isLineType(t)||this.isBubbleType(t)?t.values:[]},isInterpolationType(t){return["basis","basis-closed","basis-open","bundle","cardinal","cardinal-closed","cardinal-open","catmull-rom","catmull-rom-closed","catmull-rom-open","linear","linear-closed","monotone-x","monotone-y","natural"].indexOf(t)>=0}};function Bo(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function Uo(t){this._context=t}Uo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bo(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function am(t){return new Uo(t)}function Er(){}function Kc(t){this._context=t}Kc.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Bo(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function om(t){return new Kc(t)}function Zc(t){this._context=t}Zc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,a=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,a):this._context.moveTo(r,a);break;case 3:this._point=4;default:Bo(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function im(t){return new Zc(t)}function Jc(t,e){this._basis=new Uo(t),this._beta=e}Jc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var a=t[0],o=e[0],i=t[r]-a,s=e[r]-o,l=-1,c;++l<=r;)c=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(a+c*i),this._beta*e[l]+(1-this._beta)*(o+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var sm=(function t(e){function r(a){return e===1?new Uo(a):new Jc(a,e)}return r.beta=function(a){return t(+a)},r})(.85);function zo(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function us(t,e){this._context=t,this._k=(1-e)/6}us.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:zo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:zo(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var lm=(function t(e){function r(a){return new us(a,e)}return r.tension=function(a){return t(+a)},r})(0);function fs(t,e){this._context=t,this._k=(1-e)/6}fs.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:zo(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var cm=(function t(e){function r(a){return new fs(a,e)}return r.tension=function(a){return t(+a)},r})(0);function ds(t,e){this._context=t,this._k=(1-e)/6}ds.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:zo(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var um=(function t(e){function r(a){return new ds(a,e)}return r.tension=function(a){return t(+a)},r})(0);const Qc=Math.abs,Rn=Math.atan2,Gr=Math.cos,fm=Math.max,hs=Math.min,or=Math.sin,la=Math.sqrt,On=1e-12,Ua=Math.PI,jo=Ua/2,Go=2*Ua;function dm(t){return t>1?0:t<-1?Ua:Math.acos(t)}function kc(t){return t>=1?jo:t<=-1?-jo:Math.asin(t)}function vs(t,e,r){var a=t._x1,o=t._y1,i=t._x2,s=t._y2;if(t._l01_a>On){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);a=(a*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>On){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,g=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*f+t._x1*t._l23_2a-e*t._l12_2a)/g,s=(s*f+t._y1*t._l23_2a-r*t._l12_2a)/g}t._context.bezierCurveTo(a,o,i,s,t._x2,t._y2)}function qc(t,e){this._context=t,this._alpha=e}qc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,a=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+a*a,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:vs(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var hm=(function t(e){function r(a){return e?new qc(a,e):new us(a,0)}return r.alpha=function(a){return t(+a)},r})(.5);function _c(t,e){this._context=t,this._alpha=e}_c.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,a=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+a*a,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vs(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vm=(function t(e){function r(a){return e?new _c(a,e):new fs(a,0)}return r.alpha=function(a){return t(+a)},r})(.5);function tu(t,e){this._context=t,this._alpha=e}tu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,a=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+a*a,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vs(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gm=(function t(e){function r(a){return e?new tu(a,e):new ds(a,0)}return r.alpha=function(a){return t(+a)},r})(.5);function eu(t){return t<0?-1:1}function nu(t,e,r){var a=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(a||o<0&&-0),s=(r-t._y1)/(o||a<0&&-0),l=(i*o+s*a)/(a+o);return(eu(i)+eu(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function ru(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function gs(t,e,r){var a=t._x0,o=t._y0,i=t._x1,s=t._y1,l=(i-a)/3;t._context.bezierCurveTo(a+l,o+l*e,i-l,s-l*r,i,s)}function Vo(t){this._context=t}Vo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:gs(this,this._t0,ru(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,gs(this,ru(this,r=nu(this,t,e)),r);break;default:gs(this,this._t0,r=nu(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function au(t){this._context=new ou(t)}(au.prototype=Object.create(Vo.prototype)).point=function(t,e){Vo.prototype.point.call(this,e,t)};function ou(t){this._context=t}ou.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,a,o,i){this._context.bezierCurveTo(e,t,a,r,i,o)}};function pm(t){return new Vo(t)}function mm(t){return new au(t)}function iu(t){this._context=t}iu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var a=su(t),o=su(e),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(a[0][i],o[0][i],a[1][i],o[1][i],t[s],e[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function su(t){var e,r=t.length-1,a,o=new Array(r),i=new Array(r),s=new Array(r);for(o[0]=0,i[0]=2,s[0]=t[0]+2*t[1],e=1;e<r-1;++e)o[e]=1,i[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[r-1]=2,i[r-1]=7,s[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)a=o[e]/i[e-1],i[e]-=a,s[e]-=a*s[e-1];for(o[r-1]=s[r-1]/i[r-1],e=r-2;e>=0;--e)o[e]=(s[e]-o[e+1])/i[e];for(i[r-1]=(t[r]+o[r-1])/2,e=0;e<r-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function ym(t){return new iu(t)}function lu(t){this._context=t}lu.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function xm(t){return new lu(t)}function cu(t){this._context=t}cu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function ps(t){return new cu(t)}function Xo(t,e){this._context=t,this._t=e}Xo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Tm(t){return new Xo(t,.5)}function Sm(t){return new Xo(t,0)}function $m(t){return new Xo(t,1)}function Am(t){const e=this;let r;return e.isLineType(t)?r=e.generateGetLinePoints(e.getShapeIndices(e.isLineType)):e.isBarType(t)&&(r=e.generateGetBarPoints(e.getShapeIndices(e.isBarType))),r}var Em={getDrawShape(){const t=this,e=t.config.axis_rotated,{hasRadar:r,hasTreemap:a}=t.state,o={type:{},indices:{},pos:{}};if(!a&&["bar","candlestick","line","area"].forEach(i=>{const s=In(/^(bubble|scatter)$/.test(i)?"line":i);if(t.hasType(i)||t.hasTypeOf(s)||i==="line"&&(t.hasType("bubble")||t.hasType("scatter"))){const l=t.getShapeIndices(t[`is${s}Type`]),c=t[`generateDraw${s}`];o.indices[i]=l,o.type[i]=c?c.bind(t)(l,!1):void 0}}),!t.hasArcType()||r||a){let i,s;a||(i=r?t.radarCircleX:e?t.circleY:t.circleX,s=r?t.radarCircleY:e?t.circleX:t.circleY),o.pos={xForText:t.generateXYForText(o.indices,!0),yForText:t.generateXYForText(o.indices,!1),cx:(i||function(){}).bind(t),cy:(s||function(){}).bind(t)}}return o},getShapeIndices(t){const e=this,{config:r}=e,a=r.data_xs,o=cn(a),i={};let s=o?{}:0;return o&&Ni(Object.keys(a).map(l=>a[l])).forEach(l=>{s[l]=0,i[l]={}}),e.filterTargetsToShow(e.data.targets.filter(t,e)).forEach(l=>{var c;const f=l.id in a?a[l.id]:"",g=f?i[f]:i;for(let p=0,m;m=r.data_groups[p];p++)if(!(m.indexOf(l.id)<0))for(let E=0,w;w=m[E];E++){if(w in g){g[l.id]=g[w];break}l.id!==w&&f&&(g[w]=(c=g[l.id])!=null?c:s[f])}ln(g[l.id])&&(g[l.id]=f?s[f]++:s++,g.__max__=(f?s[f]:s)-1)}),i},getIndices(t,e,r){const a=this,{data_xs:o,bar_indices_removeNull:i}=a.config,{id:s,index:l}=e;if(a.isBarType(s)&&i){const c={};return a.getAllValuesOnIndex(l,!0).forEach((f,g)=>{c[f.id]=g,c.__max__=g}),c}return cn(o)?t[o[s]]:t},getIndicesMax(t){return cn(this.config.data_xs)?Object.keys(t).map(e=>t[e].__max__||0).reduce((e,r)=>e+r):t.__max__},getShapeX(t,e,r){const a=this,{config:o,scale:i}=a,s=r?i.subX:i.zoom||i.x,l=o.bar_overlap,c=o.bar_padding,f=(p,m)=>p+m,g=rr(t)&&(t._$total.length?t._$total.reduce(f)/2:0);return p=>{const m=a.getIndices(e,p,"getShapeX"),E=p.id in m?m[p.id]:0,w=(m.__max__||0)+1;let U=0;if(cn(p.x)){const N=s(p.x,!0);if(g){const D=t[p.id]||t._$width;U=l?N-D/2:N-D+t._$total.slice(0,E+1).reduce(f)-g}else U=N-(pe(t)?t:t._$width)*(w/2-(l?1:E))}return t&&U&&w>1&&c&&(E&&(U+=c*E),w>2?U-=(w-1)*c/2:w===2&&(U-=c/2)),U}},getShapeY(t){const e=this,r=e.isStackNormalized();return a=>{let{value:o}=a;return pe(a)?o=a:e.isAreaRangeType(a)?o=e.getBaseValue(a,"mid"):r?o=e.getRatio("index",a,!0):e.isBubbleZType(a)?o=e.getBubbleZData(a.value,"y"):e.isBarRangeType(a)&&(o=o[1]),e.getYScaleById(a.id,t)(o)}},getShapeYMin(t){const e=this,r=e.axis.getId(t),a=e.scale[r],[o]=a.domain(),i=e.config[`axis_${r}_inverted`];return!e.isGrouped(t)&&!i&&o>0?o:0},getShapeOffsetData(t){const e=this,r=e.orderTargets(e.filterTargetsToShow(e.data.targets.filter(t,e))),a=e.isStackNormalized(),o=r.map(s=>{let l=s.values;const c={};e.isStepType(s)&&(l=e.convertValuesToStep(l));const f=l.reduce((g,p)=>{const m=Number(p.x);return g[m]=p,c[m]=a?e.getRatio("index",p,!0):p.value,g},{});return{id:s.id,rowValues:l,rowValueMapByXValue:f,values:c}});return{indexMapByTargetId:r.reduce((s,{id:l},c)=>(s[l]=c,s),{}),shapeOffsetTargets:o}},getShapeOffset(t,e,r){const a=this,{shapeOffsetTargets:o,indexMapByTargetId:i}=a.getShapeOffsetData(t),s=a.config.data_groupsZeroAs;return(l,c)=>{const{id:f,value:g,x:p}=l,m=a.getIndices(e,l),E=a.getYScaleById(f,r);if(a.isBarRangeType(l))return E(g[0]);const w=Number(p),U=E(s==="zero"?0:a.getShapeYMin(f));let N=U;return o.filter(D=>D.id!==f&&m[D.id]===m[f]).forEach(D=>{const{id:Y,rowValueMapByXValue:J,rowValues:K,values:nt}=D;if(i[Y]<i[f]){const Q=nt[w];let ot=K[c];(!ot||Number(ot.x)!==w)&&(ot=J[w]),(ot==null?void 0:ot.value)*g>=0&&pe(Q)&&(g!==0||s==="positive"&&Q>0||s==="negative"&&Q<0)&&(N+=E(Q)-U)}}),N}},circleY(t,e){const r=this,a=t.id;let o;return r.isGrouped(a)&&(o=Am.bind(r)(t)),o?o(t,e)[0][1]:r.getYScaleById(a)(r.getBaseValue(t))},getBarW(t,e,r){var a,o,i,s,l;const c=this,{config:f,org:g,scale:p,state:m}=c,E=c.getMaxDataCount(),w=t==="bar"&&((a=f.data_groups)==null?void 0:a.length),U=`${t}_width`,{k:N}=(i=(o=c.getZoomTransform)==null?void 0:o.call(c))!=null?i:{k:1},D=[(s=f.axis_x_min)!=null?s:g.xDomain[0],(l=f.axis_x_max)!=null?l:g.xDomain[1]].map(c.axis.isTimeSeries()?Kn.bind(c):Number);let Y=e.tickInterval(E);if(p.zoom&&!c.axis.isCategorized()&&N>1){const nt=D.every((Q,ot)=>Q===g.xDomain[ot]);Y=g.xDomain.map((Q,ot)=>{const pt=nt?Q:Q-Math.abs(D[ot]);return p.zoom(pt)}).reduce((Q,ot)=>Math.abs(Q)+ot)/E}const J=nt=>{const Q=nt?f[U][nt]:f[U],ot=nt?Q.ratio:f[`${U}_ratio`],pt=nt?Q.max:f[`${U}_max`],Tt=pe(Q)?Q:he(Q)?Q.call(c,m.width,r,E):r?Y*ot/r:0;return pt&&Tt>pt?pt:Tt};let K=J();return!w&&rr(f[U])&&(K={_$width:K,_$total:[]},c.filterTargetsToShow(c.data.targets).forEach(nt=>{f[U][nt.id]&&(K[nt.id]=J(nt.id),K._$total.push(K[nt.id]||K._$width))})),K},getShapeByIndex(t,e,r){const a=this,{$el:o}=a,i=De(e)?`-${e}`:"";let s=o[t];return s&&!s.empty()?s=s.filter(l=>r?l.id===r:!0).filter(l=>De(e)?l.index===e:!0):s=(r?o.main.selectAll(`.${je[`${t}s`]}${a.getTargetSelectorSuffix(r)}`):o.main).selectAll(`.${je[t]}${i}`),s},isWithinShape(t,e){var r;const a=this,o=it(t);let i;return a.isTargetToShow(e.id)?(r=a.hasValidPointType)!=null&&r.call(a,t.nodeName)?i=a.isStepType(e)?a.isWithinStep(t,a.getYScaleById(e.id)(a.getBaseValue(e))):a.isWithinCircle(t,a.isBubbleType(e)?a.pointSelectR(e)*1.5:0):t.nodeName==="path"&&(i=o.classed(je.bar)?a.isWithinBar(t):!0):i=!1,i},getInterpolate(t){const r=this.getInterpolateType(t);return{basis:am,"basis-closed":om,"basis-open":im,bundle:sm,cardinal:lm,"cardinal-closed":cm,"cardinal-open":um,"catmull-rom":hm,"catmull-rom-closed":vm,"catmull-rom-open":gm,"monotone-x":pm,"monotone-y":mm,natural:ym,"linear-closed":xm,linear:ps,step:Tm,"step-after":$m,"step-before":Sm}[r]},getInterpolateType(t){const e=this,{config:r}=e,a=r.spline_interpolation_type,o=e.isInterpolationType(a)?a:"cardinal";return e.isSplineType(t)?o:e.isStepType(t)?r.line_step_type:"linear"},isWithinBar(t){const e=Yn(this.state.event,t),r=Yl(t),[a,o]=r,i=Math.min(a.x,o.x),s=Math.min(a.y,o.y),l=this.config.bar_sensitivity,{width:c,height:f}=na(t,!0),g=i-l,p=i+c+l,m=s+f+l,E=s-l;return g<e[0]&&e[0]<p&&E<e[1]&&e[1]<m}},bm=Object.defineProperty,Im=(t,e,r)=>e in t?bm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cn=(t,e,r)=>Im(t,typeof e!="symbol"?e+"":e,r);class Vr{constructor(e){Cn(this,"api"),Cn(this,"config"),Cn(this,"cache"),Cn(this,"$el"),Cn(this,"state"),Cn(this,"charts"),Cn(this,"data",{xs:{},targets:[]}),Cn(this,"axis"),Cn(this,"scale",{x:null,y:null,y2:null,subX:null,subY:null,subY2:null,zoom:null}),Cn(this,"org",{xScale:null,xDomain:null}),Cn(this,"color"),Cn(this,"patterns"),Cn(this,"levelColor"),Cn(this,"point"),Cn(this,"brush"),Cn(this,"format",{extraLineClasses:null,xAxisTick:null,dataTime:null,defaultAxisTime:null,axisTime:null});const r=this;r.api=e,r.config=new Fr,r.cache=new $g;const a=new yg;r.$el=a.getStore("element"),r.state=a.getStore("state"),r.$T=r.$T.bind(r)}$T(e,r,a){const{config:o,state:i}=this,s=o.transition_duration,l=o.subchart_show;let c=e;return c&&("tagName"in c&&(c=it(c)),c=(r!==!1&&s||r)&&(!i.zooming||i.dragging)&&!i.resizing&&i.rendered&&!l?c.transition(a).duration(s):c),c}beforeInit(){const e=this;e.callPluginHook("$beforeInit"),_e(e.config.onbeforeinit,e.api)}afterInit(){const e=this;e.callPluginHook("$afterInit"),_e(e.config.onafterinit,e.api)}init(){const e=this,{config:r,state:a,$el:o}=e,{boost_useCssRule:i,bindto:s}=r;Ag(e);const l=e.hasArcType();if(a.hasRadar=!a.hasAxis&&e.hasType("radar"),a.hasFunnel=!a.hasAxis&&e.hasType("funnel"),a.hasTreemap=!a.hasAxis&&e.hasType("treemap"),a.hasAxis=!l&&!a.hasFunnel&&!a.hasTreemap,a.datetimeId=`bb-${+new Date*ar()}`,i){const f=pn.createElement("style");f.type="text/css",pn.head.appendChild(f),a.style={rootSelctor:`.${a.datetimeId}`,sheet:f.sheet},o.style=f}const c={element:s,classname:"bb"};ze(s)&&(c.element=s.element||"#chart",c.classname=s.classname||c.classname),o.chart=he(c.element.node)?s.element:it(c.element||[]),o.chart.empty()&&(o.chart=it(pn.body.appendChild(pn.createElement("div")))),o.chart.html("").classed(c.classname,!0).classed(a.datetimeId,i).style("position","relative"),e.initParams(),e.initToRender()}initToRender(e){const r=this,{config:a,state:o,$el:{chart:i}}=r,s=()=>cg(i,{display:"none",visibility:"hidden"}),l=a.render.lazy===!1?!1:a.render.lazy||s(),c=Ze.MutationObserver;l&&c&&a.render.observe!==!1&&!e&&new c((f,g)=>{s()||(g.disconnect(),!o.rendered&&r.initToRender(!0))}).observe(i.node(),{attributes:!0,attributeFilter:["class","style"]}),(!l||e)&&r.convertData(a,f=>{r.initWithData(f),r.afterInit()})}initParams(){var e;const r=this,{config:a,format:o,state:i}=r;if(r.color=r.generateColor(),r.levelColor=r.generateLevelColor(),a.padding===!1&&(a.axis_x_show=!1,a.axis_y_show=!1,a.axis_y2_show=!1,a.subchart_show=!1),(r.hasPointType()||(e=r.hasLegendDefsPoint)!=null&&e.call(r))&&(r.point=r.generatePoint()),i.hasAxis){r.initClip(),o.extraLineClasses=r.generateExtraLineClass(),o.dataTime=a.data_xLocaltime?Zs:Js,o.axisTime=a.axis_x_localtime?si:li;const f=a.zoom_enabled&&a.zoom_type==="drag";o.defaultAxisTime=g=>{const{x:p,zoom:m}=r.scale,E=f?m:m&&p.orgDomain().toString()!==m.domain().toString(),w=g.getMilliseconds()&&".%L"||g.getSeconds()&&".:%S"||g.getMinutes()&&"%I:%M"||g.getHours()&&"%I %p"||g.getDate()!==1&&"%b %d"||E&&g.getDate()===1&&"%b'%y"||g.getMonth()&&"%-m/%-d"||"%Y";return o.axisTime(w)(g)}}const{legend_position:s,legend_inset_anchor:l,axis_rotated:c}=a;i.isLegendRight=s==="right",i.isLegendInset=s==="inset",i.isLegendTop=l==="top-left"||l==="top-right",i.isLegendLeft=l==="top-left"||l==="bottom-left",i.rotatedPadding.top=r.getResettedPadding(i.rotatedPadding.top),i.rotatedPadding.right=c&&!a.axis_x_show?0:30,i.inputType=ug(a.interaction_inputType_mouse,a.interaction_inputType_touch)}initWithData(e){var r,a,o;const i=this,{config:s,scale:l,state:c,$el:f,org:g}=i,{hasAxis:p,hasFunnel:m,hasTreemap:E}=c,w=s.interaction_enabled,U=i.hasType("polar"),N=s.data_labels_backgroundColors;if(p&&(i.axis=i.getAxisInstance(),s.zoom_enabled&&i.initZoom()),i.data.xs={},i.data.targets=i.convertDataToTargets(e),s.data_filter&&(i.data.targets=i.data.targets.filter(s.data_filter.bind(i.api))),s.data_hide&&i.addHiddenTargetIds(s.data_hide===!0?i.mapToIds(i.data.targets):s.data_hide),s.legend_hide&&i.addHiddenLegendIds(s.legend_hide===!0?i.mapToIds(i.data.targets):s.legend_hide),i.updateSizes(),i.updateScales(!0),p){const{x:J,y:K,y2:nt,subX:Q,subY:ot,subY2:pt}=l;J&&(J.domain(aa(i.getXDomain(i.data.targets),!s.axis_x_inverted)),Q.domain(J.domain()),g.xDomain=J.domain()),K&&(K.domain(i.getYDomain(i.data.targets,"y")),ot.domain(K.domain())),nt&&(nt.domain(i.getYDomain(i.data.targets,"y2")),pt&&pt.domain(nt.domain()))}if(f.svg=f.chart.append("svg").style("overflow","hidden").style("display","block"),w&&c.inputType){const J=c.inputType==="touch",{onclick:K,onover:nt,onout:Q}=s;f.svg.on("click",(K==null?void 0:K.bind(i.api))||null).on(J?"touchstart":"mouseenter",(nt==null?void 0:nt.bind(i.api))||null).on(J?"touchend":"mouseleave",(Q==null?void 0:Q.bind(i.api))||null)}s.svg_classname&&f.svg.attr("class",s.svg_classname);const D=he(s.color_tiles)&&i.patterns;(p||D||U||E||N||(r=i.hasLegendDefsPoint)!=null&&r.call(i))&&(f.defs=f.svg.append("defs"),p&&["id","idXAxis","idYAxis","idGrid"].forEach(J=>{i.appendClip(f.defs,c.clip[J])}),i.generateTextBGColorFilter(N),D&&i.patterns.forEach(J=>f.defs.append(()=>J.node))),i.updateSvgSize(),i.bindResize();const Y=f.svg.append("g").classed(Se.main,!0).attr("transform",m||E?null:i.getTranslate("main"));if(f.main=Y,s.subchart_show&&i.initSubchart(),s.tooltip_show&&i.initTooltip(),s.title_text&&i.initTitle(),!E&&s.legend_show&&i.initLegend(),s.data_empty_label_text&&Y.append("text").attr("class",`${gn.text} ${Se.empty}`).attr("text-anchor","middle").attr("dominant-baseline","middle"),p&&(s.regions.length&&i.initRegion(),!s.clipPath&&i.axis.init()),Y.append("g").classed(Se.chart,!0).attr("clip-path",p?c.clip.path:null),i.callPluginHook("$init"),i.initChartElements(),p&&(w&&((a=i.initEventRect)==null||a.call(i)),i.initGrid(),s.clipPath&&((o=i.axis)==null||o.init())),i.updateTargets(i.data.targets),i.updateDimension(),_e(s.oninit,i.api),i.setBackground(),i.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1,initializing:!0}),s.data_onmin||s.data_onmax){const J=i.getMinMaxData();_e(s.data_onmin,i.api,J.min),_e(s.data_onmax,i.api,J.max)}s.tooltip_show&&i.initShowTooltip(),c.rendered=!0}initChartElements(){const e=this,{hasAxis:r,hasRadar:a,hasTreemap:o}=e.state,i=[];if(r){const s=["bar","bubble","candlestick","line"];e.config.bar_front&&s.push(s.shift());for(const l of s){const c=In(l);(l==="line"&&e.hasTypeOf(c)||e.hasType(l))&&i.push(c)}}else if(o)i.push("Treemap");else if(e.hasType("funnel"))i.push("Funnel");else{const s=e.hasType("polar"),l=e.hasType("gauge");a||i.push("Arc","Pie"),l?i.push("Gauge"):a?i.push("Radar"):s&&i.push("Polar")}for(const s of i)e[`init${s}`]();cn(e.config.data_labels)&&!e.hasArcType(null,["radar"])&&e.initText()}setChartElements(){const e=this,{$el:{chart:r,svg:a,defs:o,main:i,tooltip:s,legend:l,title:c,grid:f,needle:g,arcs:p,circle:m,bar:E,candlestick:w,line:U,area:N,text:D}}=e;e.api.$={chart:r,svg:a,defs:o,main:i,tooltip:s,legend:l,title:c,grid:f,arc:p,circles:m,bar:{bars:E},candlestick:w,line:{lines:U,areas:N},needle:g,text:{texts:D}}}setBackground(){const e=this,{config:{background:r},state:a,$el:{svg:o}}=e;if(cn(r)){const i=o.select("g").insert(r.imgUrl?"image":"rect",":first-child");r.imgUrl?i.attr("href",r.imgUrl):r.color&&i.style("fill",r.color).attr("clip-path",a.clip.path),i.attr("class",r.class||null).attr("width","100%").attr("height","100%")}}updateTargets(e){var r,a;const o=this,{hasAxis:i,hasFunnel:s,hasRadar:l,hasTreemap:c}=o.state,f=p=>o[`updateTargetsFor${p}`](e.filter(o[`is${p}Type`].bind(o)));if(o.updateTargetsForText(e),i){const p=["bar","candlestick","line"];for(const m of p){const E=In(m);(m==="line"&&o.hasTypeOf(E)||o.hasType(m))&&f(E)}(r=o.updateTargetsForSubchart)==null||r.call(o,e)}else if(o.hasArcType(e)){let p="Arc";l?p="Radar":o.hasType("polar")&&(p="Polar"),f(p)}else s?f("Funnel"):c&&f("Treemap");const g=o.hasType("bubble")||o.hasType("scatter");g&&((a=o.updateTargetForCircle)==null||a.call(o)),o.filterTargetsToShowAtInit(g)}filterTargetsToShowAtInit(e=!1){const r=this,{$el:{svg:a},$T:o}=r;let i=`.${Se.target}`;e&&(i+=`, .${An.chartCircles} > .${An.circles}`),o(a.selectAll(i).filter(s=>r.isTargetToShow(s.id))).style("opacity",null)}getWithOption(e){const r={Dimension:!0,EventRect:!0,Legend:!1,Subchart:!0,Transform:!1,Transition:!0,TrimXDomain:!0,UpdateXAxis:"UpdateXDomain",UpdateXDomain:!1,UpdateOrgXDomain:!1,TransitionForExit:"Transition",TransitionForAxis:"Transition",Y:!0};for(const[a,o]of Object.entries(r)){const i=Ue(o)?r[o]:o;r[a]=$r(e,`with${a}`,i)}return r}initialOpacity(e){const r=this,{withoutFadeIn:a}=r.state;return r.getBaseValue(e)!==null&&a[e.id]?null:"0"}bindResize(){const e=this,{$el:r,config:a,state:o}=e,i=Rg(a.resize_timer),{resize_auto:s}=a,l=[];l.push(()=>_e(a.onresize,e.api)),/^(true|parent)$/.test(s)&&l.push(()=>{o.resizing=!0,a.legend_show&&(e.updateSizes(),e.updateLegend()),e.api.flush(!1)}),l.push(()=>{_e(a.onresized,e.api),o.resizing=!1}),l.forEach(c=>i.add(c)),e.resizeFunction=i,s==="parent"?(e.resizeFunction.resizeObserver=new ResizeObserver(e.resizeFunction.bind(e))).observe(r.chart.node().parentNode):Ze.addEventListener("resize",e.resizeFunction)}callPluginHook(e,...r){this.config.plugins.forEach(a=>{e==="$beforeInit"&&(a.$$=this,this.api.plugins.push(a)),a[e](...r)})}}Sn(Vr.prototype,[Gg,Vg,Xg,Jg,Qg,tp,ep,Zg,np,rp,ap,Yp,Em,Kp,Zp,_p,tm,em,nm,rm]);function Rm(t){const e=this.config;let r,a,o;const i=()=>{const s=a.shift();if(s&&r&&rr(r)&&s in r)return r=r[s],i();if(!s)return r};Object.keys(e).forEach(s=>{r=t,a=s.split("_"),o=i(),Qe(o)&&(e[s]=o)}),this.api&&(this.state.orgConfig=t)}var Om={resize(t){const e=this.internal,{config:r,state:a}=e;a.rendered&&(r.size_width=t?t.width:null,r.size_height=t?t.height:null,a.resizing=!0,this.flush(!1),e.resizeFunction())},flush(t){var e,r;const a=this.internal,{state:o,$el:{zoomResetBtn:i}}=a;o.rendered?(o.resizing?(e=a.brush)==null||e.updateResize():(r=a.axis)==null||r.setOrient(),i==null||i.style("display","none"),a.scale.zoom&&(o.current.zoomDomain=a.scale.zoom.domain()),a.scale.zoom=null,t?a.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withLegend:!0}):a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1}),!o.resizing&&a.brush&&(a.brush.getSelection().call(a.brush.move),a.unselectRect()),o.current.zoomDomain&&(a.api.zoom(o.current.zoomDomain),o.current.zoomDomain=null)):a.initToRender(!0)},destroy(){var t;const e=this.internal,{$el:{chart:r,style:a,svg:o}}=e;if(cn(e)){e.callPluginHook("$willDestroy"),e.charts.splice(e.charts.indexOf(this),1),e.unbindAllEvents(),o.select("*").interrupt(),e.resizeFunction.clear(),(t=e.resizeFunction.resizeObserver)==null||t.disconnect(),Ze.removeEventListener("resize",e.resizeFunction),r.classed("bb",!1).style("position",null).selectChildren().remove(),a&&a.parentNode.removeChild(a),Object.keys(this).forEach(i=>{i==="internal"&&Object.keys(e).forEach(s=>{e[s]=null}),this[i]=null,delete this[i]});for(const i in this)this[i]=()=>{}}return null},config(t,e,r){const a=this.internal,{config:o,state:i}=a,s=t==null?void 0:t.replace(/\./g,"_");let l;return t&&s in o?Qe(e)?(o[s]=e,l=e,r&&this.flush()):l=o[s]:(arguments.length===0||_n(t))&&(l=i.orgConfig),l}},Cm={color(t){return this.internal.color(t)}};const uu=function(t){const{targets:e}=this.internal.data;if(!ln(t)){const r=Ge(t)?t:[t];return e.filter(a=>r.some(o=>o===a.id))}return e};Sn(uu,{shown:function(t){return this.internal.filterTargetsToShow(this.data(t))},values:function(t,e=!0){let r=null;if(t){const a=this.data(t);Ge(a)&&(r=[],a.forEach(o=>{const i=o.values.map(s=>s.value);e?r=r.concat(i):r.push(i)}))}return r},names:function(t){return this.internal.updateDataAttributes("names",t)},colors:function(t){return this.internal.updateDataAttributes("colors",t)},axes:function(t){return this.internal.updateDataAttributes("axes",t)},min:function(){return this.internal.getMinMaxData().min},max:function(){return this.internal.getMinMaxData().max}});var Pm={data:uu};const Mm=t=>{var e,r;return(r=(e=Ze).btoa)==null?void 0:r.call(e,encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(a,o)=>String.fromCharCode(+`0x${o}`)))};function wm(t,e,r){const{width:a,height:o}=e||r,i=new XMLSerializer,s=t.cloneNode(!0),l=sg(Lr(pn.styleSheets)).filter(m=>m.cssText).map(m=>m.cssText);s.setAttribute("xmlns",te.xhtml),s.style.margin="0",s.style.padding="0",e.preserveFontStyle&&s.querySelectorAll("text").forEach(m=>{m.innerHTML=""});const c=i.serializeToString(s),f=pn.createElement("style");f.appendChild(pn.createTextNode(l.join(`
|
|
48
|
+
</tbody></table>`).replace(/(\r?\n|\t)/g,"").split(/{{(.*)}}/)},setTooltipPosition(t,e){var r,a;const o=this,{config:i,scale:s,state:l,$el:{eventRect:c,tooltip:f,svg:g}}=o,{bindto:p}=i.tooltip_contents,m=i.axis_rotated,E=f==null?void 0:f.datum();if(!p&&E){const w=t!=null?t:JSON.parse(E.current),[U,N]=Kn(l.event,e!=null?e:c==null?void 0:c.node()),D={x:U,y:N};if(l.hasAxis&&s.x&&E&&"x"in E){const nt=(Q=0,ot,pt="y")=>{var Tt;const yt=s[ot?(Tt=o.axis)==null?void 0:Tt.getId(ot):pt];return yt?yt(Q)+(m?l.margin.left:l.margin.top):0};D.xAxis=s.x(E.x)+(i.tooltip_position?m?l.margin.top:l.margin.left:0),w.length===1?D.yAxis=nt(w[0].value,w[0].id):D.yAxis=nt}const{width:Y=0,height:J=0}=E,K=(a=(r=i.tooltip_position)==null?void 0:r.bind(o.api)(w,Y,J,c==null?void 0:c.node(),D))!=null?a:Li(g)?o.getTooltipPositionViewBox.bind(o)(Y,J,D):o.getTooltipPosition.bind(o)(Y,J,D);["top","left"].forEach(nt=>{const Q=K[nt];f.style(nt,`${Q}px`),nt==="left"&&!E.xPosInPercent&&(E.xPosInPercent=Q/l.current.width*100)})}},getTooltipPositionViewBox(t,e,r){var a,o;const i=this,{$el:{eventRect:s,svg:l},config:c,state:f}=i,g=c.axis_rotated,p=i.hasArcType()||f.hasFunnel||f.hasTreemap,m=(o=(a=p?l:s)==null?void 0:a.node())!=null?o:f.event.target;let{x:E,y:w}=r;f.hasAxis&&(E=g?E:r.xAxis,w=g?r.xAxis:w);const U=Io(m,E,w,!1),N=mn(m),D=Io(m,20,0,!1).x;let Y=U.y,J=U.x+t/2+D;return p&&(f.hasFunnel||f.hasTreemap||f.hasRadar?(J-=t/2+D,Y+=e):(Y+=N.height/2,J+=N.width/2-(t-D))),J+t>N.width&&(J=N.width-t-D),Y+e>N.height&&(Y-=e*2),{top:Y,left:J}},getTooltipPosition(t,e,r){var a,o,i;const s=this,{config:l,scale:c,state:f}=s,{width:g,height:p,current:m,hasFunnel:E,hasRadar:w,hasTreemap:U,isLegendRight:N,inputType:D}=f,Y=s.hasType("gauge")&&!l.gauge_fullCircle,J=l.axis_rotated,K=s.hasArcType(),nt=s.getSvgLeft(!0);let Q=nt+m.width-s.getCurrentPaddingByDirection("right");const ot=20;let{x:pt,y:Tt}=r;if(w)pt+=pt>=g/2?15:-(t+15),Tt+=15;else if(K){if(D!=="touch"){let jt=(o=(a=s.getTitlePadding)==null?void 0:a.call(s))!=null?o:0;jt&&Y&&((i=l.arc_rangeText_values)!=null&&i.length)&&(jt+=10),pt+=(g-(N?s.getLegendWidth():0))/2,Tt+=(Y?p:p/2+e)+jt}}else if(E||U)Tt+=e;else{const lt={top:s.getCurrentPaddingByDirection("top",!0),left:s.getCurrentPaddingByDirection("left",!0)};J?(pt+=nt+lt.left+ot,Tt=lt.top+r.xAxis+ot,Q-=nt):(pt=nt+lt.left+ot+(c.zoom?pt:r.xAxis),Tt+=lt.top-5)}if(pt+t+15>Q&&(pt-=t+(E||U||K?0:J?ot*2:38)),Tt+e>m.height){const lt=U?e+10:30;Tt-=Y?e*1.5:e+lt}const yt={top:Tt,left:pt};return Object.keys(yt).forEach(lt=>{yt[lt]<0&&(yt[lt]=0)}),yt},showTooltip(t,e){const r=this,{config:a,$el:{tooltip:o}}=r,i=t.filter(c=>c&&De(r.getBaseValue(c)));if(!o||i.length===0||!a.tooltip_show)return;let s=o.datum();const l=JSON.stringify(t);if(!s||s.current!==l){const{index:c,x:f}=t.concat().sort()[0];_e(a.tooltip_onshow,r.api,t),o.html(r.getTooltipHTML(t,r.axis?r.axis.getXAxisTickFormat():r.categoryName.bind(r),r.getDefaultValueFormat(),r.color)).style("display",null).style("visibility",null).datum(s={index:c,x:f,current:l,width:o.property("offsetWidth"),height:o.property("offsetHeight")}),_e(a.tooltip_onshown,r.api,t),r._handleLinkedCharts(!0,c)}r.setTooltipPosition(i,e)},bindTooltipResizePos(){const t=this,{resizeFunction:e,state:r,$el:{tooltip:a}}=t;e.add(()=>{if(a.style("display")==="block"){const{current:o}=r,{width:i,xPosInPercent:s}=a.datum();let l=o.width/100*s;const c=o.width-(l+i);c<0&&(l+=c),a.style("left",`${l}px`)}})},hideTooltip(t){var e;const r=this,{api:a,config:o,$el:{tooltip:i}}=r;if(i&&i.style("display")!=="none"&&(!o.tooltip_doNotHide||t)){const s=JSON.parse((e=i.datum().current)!=null?e:{});_e(o.tooltip_onhide,a,s),i.style("display","none").style("visibility","hidden").datum(null),_e(o.tooltip_onhidden,a,s)}},_handleLinkedCharts(t,e){const r=this,{charts:a,config:o,state:{event:i}}=r;if(i!=null&&i.isTrusted&&o.tooltip_linked&&a.length>1){const s=o.tooltip_linked_name;a.filter(l=>l!==r.api).forEach(l=>{const{config:c,$el:f}=l.internal,g=c.tooltip_linked,p=c.tooltip_linked_name,m=pn.body.contains(f.chart.node());if(g&&s===p&&m){const E=f.tooltip.data()[0],w=e!==(E==null?void 0:E.index);try{l.tooltip[t&&w?"show":"hide"]({index:e})}catch(U){}}})}},updateTooltipOnRedraw(t,e){var r;const a=this,{config:o,$el:{eventRect:i,svg:s,tooltip:l},state:{event:c,hasAxis:f,hasRadar:g,hasTreemap:p}}=a;if((l==null?void 0:l.style("display"))==="block"&&c){const m=t!=null?t:(r=g?s:i)==null?void 0:r.node();if(f||g)if(a.isMultipleX())a.selectRectForMultipleXs(m,!1);else{const E=e!=null?e:a.getDataIndexFromEvent(c);e===-1?a.api.tooltip.hide():(a.selectRectForSingle(m,E),a.setExpand(E,null,!0))}else{const{clientX:E,clientY:w}=c;setTimeout(()=>{let U=[E,w].every(Number.isFinite)&&pn.elementFromPoint(E,w);const N=U&&it(U).datum();if(N){const D=a.hasArcType()?a.convertToArcData(a.updateAngle(N)):N==null?void 0:N.data;p&&(U=s.node()),D&&a.showTooltip([D],U)}else a.api.tooltip.hide()},o.transition_duration)}}}},rm={getTranslate(t,e=0){var r;const a=this,{config:o,state:i}=a,s=o.axis_rotated;let l=0,c,f;if(e&&/^(x|y2?)$/.test(t)&&(l=a.getAxisSize(t)*e),t==="main")c=Eo(i.margin.left),f=Eo(i.margin.top);else if(t==="context")c=Eo(i.margin2.left),f=Eo(i.margin2.top);else if(t==="legend")c=i.margin3.left,f=i.margin3.top;else if(t==="x")c=s?-l:0,f=s?0:i.height+l;else if(t==="y")c=s?0:-l,f=s?i.height+l:0;else if(t==="y2")c=s?0:i.width+l,f=s?-l-1:0;else if(t==="subX")c=0,f=s?0:i.height2;else if(t==="arc")c=i.arcWidth/2,f=i.arcHeight/2,(r=o.arc_rangeText_values)!=null&&r.length&&(f+=5+(a.hasType("gauge")&&o.title_text?10:0));else if(t==="polar")c=i.arcWidth/2,f=i.arcHeight/2;else if(t==="radar"){const[g,p]=a.getRadarSize();c=i.width/2-g,f=i.height/2-p}return`translate(${c}, ${f})`},transformMain(t,e){const r=this,{$el:{main:a},$T:o}=r,i=e!=null&&e.axisX?e.axisX:o(a.select(`.${vn.axisX}`),t),s=e!=null&&e.axisY?e.axisY:o(a.select(`.${vn.axisY}`),t),l=e!=null&&e.axisY2?e.axisY2:o(a.select(`.${vn.axisY2}`),t);o(a,t).attr("transform",r.getTranslate("main")),i.attr("transform",r.getTranslate("x")),s.attr("transform",r.getTranslate("y")),l.attr("transform",r.getTranslate("y2")),a.select(`.${Ve.chartArcs}`).attr("transform",r.getTranslate("arc"))},transformAll(t,e){const r=this,{config:a,state:{hasAxis:o,hasFunnel:i,hasTreemap:s},$el:l}=r;!i&&!s&&r.transformMain(t,e),o&&a.subchart_show&&r.transformContext(t,e),l.legend&&r.transformLegend(t)}},am={isValidChartType(t){return!!(t&&Object.values(se).indexOf(t)>-1)},setTargetType(t,e){const r=this,{config:a,state:{withoutFadeIn:o}}=r;r.mapToTargetIds(t).forEach(i=>{o[i]=e===a.data_types[i],a.data_types[i]=e}),t||(a.data_type=e)},updateTypesElements(){const t=this,{state:{current:e}}=t;Object.keys(se).forEach(r=>{const a=se[r],o=t.hasType(a,null,!0),i=e.types.indexOf(a);i===-1&&o?e.types.push(a):i>-1&&!o&&e.types.splice(i,1)}),t.setChartElements()},hasType(t,e,r=!1){var a;const o=this,{config:i,state:{current:s}}=o,l=i.data_types,c=e||o.data.targets;let f=!1;return!r&&((a=s.types)==null?void 0:a.indexOf(t))>-1?f=!0:c!=null&&c.length?c.forEach(g=>{const p=l[g.id];(p===t||!p&&t==="line")&&(f=!0)}):Object.keys(l).length?Object.keys(l).forEach(g=>{l[g]===t&&(f=!0)}):f=i.data_type===t,f},hasTypeOf(t,e,r=[]){return t in Ar?!Ar[t].filter(a=>r.indexOf(a)===-1).every(a=>!this.hasType(a,e)):!1},isTypeOf(t,e){var r;const a=Ue(t)?t:t.id,o=this.config&&(((r=this.config.data_types)==null?void 0:r[a])||this.config.data_type);return Ge(e)?e.indexOf(o)>=0:o===e},hasPointType(){const t=this;return t.hasTypeOf("Line")||t.hasType("bubble")||t.hasType("scatter")},hasArcType(t,e){return this.hasTypeOf("Arc",t,e)},hasMultiArcGauge(){return this.hasType("gauge")&&this.config.gauge_type==="multi"},isLineType(t){const e=Ue(t)?t:t.id;return!this.config.data_types[e]||this.isTypeOf(e,Ar.Line)},isStepType(t){return this.isTypeOf(t,Ar.Step)},isSplineType(t){return this.isTypeOf(t,Ar.Spline)},isAreaType(t){return this.isTypeOf(t,Ar.Area)},isAreaRangeType(t){return this.isTypeOf(t,Ar.AreaRange)},isBarType(t){return this.isTypeOf(t,"bar")},isBubbleType(t){return this.isTypeOf(t,"bubble")},isCandlestickType(t){return this.isTypeOf(t,"candlestick")},isScatterType(t){return this.isTypeOf(t,"scatter")},isTreemapType(t){return this.isTypeOf(t,"treemap")},isPieType(t){return this.isTypeOf(t,"pie")},isFunnelType(t){return this.isTypeOf(t,"funnel")},isGaugeType(t){return this.isTypeOf(t,"gauge")},isDonutType(t){return this.isTypeOf(t,"donut")},isPolarType(t){return this.isTypeOf(t,"polar")},isRadarType(t){return this.isTypeOf(t,"radar")},isArcType(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)||this.isPolarType(t)||this.isRadarType(t)},isCirclePoint(t){const{config:e}=this,r=e.point_pattern;let a=!1;return(t==null?void 0:t.tagName)==="circle"?a=!0:a=e.point_type==="circle"&&(!r||Ge(r)&&r.length===0),a},lineData(t){return this.isLineType(t)?[t]:[]},arcData(t){return this.isArcType(t.data)?[t]:[]},labelishData(t){return this.isBarType(t)||this.isLineType(t)||this.isScatterType(t)||this.isBubbleType(t)||this.isCandlestickType(t)||this.isFunnelType(t)||this.isRadarType(t)||this.isTreemapType(t)?t.values.filter(e=>pe(e.value)||!!e.value):[]},barLineBubbleData(t){return this.isBarType(t)||this.isLineType(t)||this.isBubbleType(t)?t.values:[]},isInterpolationType(t){return["basis","basis-closed","basis-open","bundle","cardinal","cardinal-closed","cardinal-open","catmull-rom","catmull-rom-closed","catmull-rom-open","linear","linear-closed","monotone-x","monotone-y","natural"].indexOf(t)>=0}};function Bo(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function Uo(t){this._context=t}Uo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bo(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function om(t){return new Uo(t)}function Er(){}function Kc(t){this._context=t}Kc.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Bo(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function im(t){return new Kc(t)}function Zc(t){this._context=t}Zc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,a=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,a):this._context.moveTo(r,a);break;case 3:this._point=4;default:Bo(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function sm(t){return new Zc(t)}function Jc(t,e){this._basis=new Uo(t),this._beta=e}Jc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var a=t[0],o=e[0],i=t[r]-a,s=e[r]-o,l=-1,c;++l<=r;)c=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(a+c*i),this._beta*e[l]+(1-this._beta)*(o+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var lm=(function t(e){function r(a){return e===1?new Uo(a):new Jc(a,e)}return r.beta=function(a){return t(+a)},r})(.85);function zo(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function us(t,e){this._context=t,this._k=(1-e)/6}us.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:zo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:zo(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var cm=(function t(e){function r(a){return new us(a,e)}return r.tension=function(a){return t(+a)},r})(0);function fs(t,e){this._context=t,this._k=(1-e)/6}fs.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:zo(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var um=(function t(e){function r(a){return new fs(a,e)}return r.tension=function(a){return t(+a)},r})(0);function ds(t,e){this._context=t,this._k=(1-e)/6}ds.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:zo(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var fm=(function t(e){function r(a){return new ds(a,e)}return r.tension=function(a){return t(+a)},r})(0);const Qc=Math.abs,Rn=Math.atan2,Gr=Math.cos,dm=Math.max,hs=Math.min,or=Math.sin,la=Math.sqrt,On=1e-12,Ua=Math.PI,jo=Ua/2,Go=2*Ua;function hm(t){return t>1?0:t<-1?Ua:Math.acos(t)}function kc(t){return t>=1?jo:t<=-1?-jo:Math.asin(t)}function vs(t,e,r){var a=t._x1,o=t._y1,i=t._x2,s=t._y2;if(t._l01_a>On){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);a=(a*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>On){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,g=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*f+t._x1*t._l23_2a-e*t._l12_2a)/g,s=(s*f+t._y1*t._l23_2a-r*t._l12_2a)/g}t._context.bezierCurveTo(a,o,i,s,t._x2,t._y2)}function qc(t,e){this._context=t,this._alpha=e}qc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,a=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+a*a,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:vs(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vm=(function t(e){function r(a){return e?new qc(a,e):new us(a,0)}return r.alpha=function(a){return t(+a)},r})(.5);function _c(t,e){this._context=t,this._alpha=e}_c.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,a=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+a*a,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vs(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gm=(function t(e){function r(a){return e?new _c(a,e):new fs(a,0)}return r.alpha=function(a){return t(+a)},r})(.5);function tu(t,e){this._context=t,this._alpha=e}tu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,a=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+a*a,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vs(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var pm=(function t(e){function r(a){return e?new tu(a,e):new ds(a,0)}return r.alpha=function(a){return t(+a)},r})(.5);function eu(t){return t<0?-1:1}function nu(t,e,r){var a=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(a||o<0&&-0),s=(r-t._y1)/(o||a<0&&-0),l=(i*o+s*a)/(a+o);return(eu(i)+eu(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function ru(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function gs(t,e,r){var a=t._x0,o=t._y0,i=t._x1,s=t._y1,l=(i-a)/3;t._context.bezierCurveTo(a+l,o+l*e,i-l,s-l*r,i,s)}function Vo(t){this._context=t}Vo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:gs(this,this._t0,ru(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,gs(this,ru(this,r=nu(this,t,e)),r);break;default:gs(this,this._t0,r=nu(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function au(t){this._context=new ou(t)}(au.prototype=Object.create(Vo.prototype)).point=function(t,e){Vo.prototype.point.call(this,e,t)};function ou(t){this._context=t}ou.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,a,o,i){this._context.bezierCurveTo(e,t,a,r,i,o)}};function mm(t){return new Vo(t)}function ym(t){return new au(t)}function iu(t){this._context=t}iu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var a=su(t),o=su(e),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(a[0][i],o[0][i],a[1][i],o[1][i],t[s],e[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function su(t){var e,r=t.length-1,a,o=new Array(r),i=new Array(r),s=new Array(r);for(o[0]=0,i[0]=2,s[0]=t[0]+2*t[1],e=1;e<r-1;++e)o[e]=1,i[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[r-1]=2,i[r-1]=7,s[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)a=o[e]/i[e-1],i[e]-=a,s[e]-=a*s[e-1];for(o[r-1]=s[r-1]/i[r-1],e=r-2;e>=0;--e)o[e]=(s[e]-o[e+1])/i[e];for(i[r-1]=(t[r]+o[r-1])/2,e=0;e<r-1;++e)i[e]=2*t[e+1]-o[e+1];return[o,i]}function xm(t){return new iu(t)}function lu(t){this._context=t}lu.prototype={areaStart:Er,areaEnd:Er,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Tm(t){return new lu(t)}function cu(t){this._context=t}cu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function ps(t){return new cu(t)}function Xo(t,e){this._context=t,this._t=e}Xo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Sm(t){return new Xo(t,.5)}function $m(t){return new Xo(t,0)}function Am(t){return new Xo(t,1)}function Em(t){const e=this;let r;return e.isLineType(t)?r=e.generateGetLinePoints(e.getShapeIndices(e.isLineType)):e.isBarType(t)&&(r=e.generateGetBarPoints(e.getShapeIndices(e.isBarType))),r}var bm={getDrawShape(){const t=this,e=t.config.axis_rotated,{hasRadar:r,hasTreemap:a}=t.state,o={type:{},indices:{},pos:{}};if(!a&&["bar","candlestick","line","area"].forEach(i=>{const s=In(/^(bubble|scatter)$/.test(i)?"line":i);if(t.hasType(i)||t.hasTypeOf(s)||i==="line"&&(t.hasType("bubble")||t.hasType("scatter"))){const l=t.getShapeIndices(t[`is${s}Type`]),c=t[`generateDraw${s}`];o.indices[i]=l,o.type[i]=c?c.bind(t)(l,!1):void 0}}),!t.hasArcType()||r||a){let i,s;a||(i=r?t.radarCircleX:e?t.circleY:t.circleX,s=r?t.radarCircleY:e?t.circleX:t.circleY),o.pos={xForText:t.generateXYForText(o.indices,!0),yForText:t.generateXYForText(o.indices,!1),cx:(i||function(){}).bind(t),cy:(s||function(){}).bind(t)}}return o},getShapeIndices(t){const e=this,{config:r}=e,a=r.data_xs,o=cn(a),i={};let s=o?{}:0;return o&&Ni(Object.keys(a).map(l=>a[l])).forEach(l=>{s[l]=0,i[l]={}}),e.filterTargetsToShow(e.data.targets.filter(t,e)).forEach(l=>{var c;const f=l.id in a?a[l.id]:"",g=f?i[f]:i;for(let p=0,m;m=r.data_groups[p];p++)if(!(m.indexOf(l.id)<0))for(let E=0,w;w=m[E];E++){if(w in g){g[l.id]=g[w];break}l.id!==w&&f&&(g[w]=(c=g[l.id])!=null?c:s[f])}ln(g[l.id])&&(g[l.id]=f?s[f]++:s++,g.__max__=(f?s[f]:s)-1)}),i},getIndices(t,e,r){const a=this,{data_xs:o,bar_indices_removeNull:i}=a.config,{id:s,index:l}=e;if(a.isBarType(s)&&i){const c={};return a.getAllValuesOnIndex(l,!0).forEach((f,g)=>{c[f.id]=g,c.__max__=g}),c}return cn(o)?t[o[s]]:t},getIndicesMax(t){return cn(this.config.data_xs)?Object.keys(t).map(e=>t[e].__max__||0).reduce((e,r)=>e+r):t.__max__},getShapeX(t,e,r){const a=this,{config:o,scale:i}=a,s=r?i.subX:i.zoom||i.x,l=o.bar_overlap,c=o.bar_padding,f=(p,m)=>p+m,g=rr(t)&&(t._$total.length?t._$total.reduce(f)/2:0);return p=>{const m=a.getIndices(e,p,"getShapeX"),E=p.id in m?m[p.id]:0,w=(m.__max__||0)+1;let U=0;if(cn(p.x)){const N=s(p.x,!0);if(g){const D=t[p.id]||t._$width;U=l?N-D/2:N-D+t._$total.slice(0,E+1).reduce(f)-g}else U=N-(pe(t)?t:t._$width)*(w/2-(l?1:E))}return t&&U&&w>1&&c&&(E&&(U+=c*E),w>2?U-=(w-1)*c/2:w===2&&(U-=c/2)),U}},getShapeY(t){const e=this,r=e.isStackNormalized();return a=>{let{value:o}=a;return pe(a)?o=a:e.isAreaRangeType(a)?o=e.getBaseValue(a,"mid"):r?o=e.getRatio("index",a,!0):e.isBubbleZType(a)?o=e.getBubbleZData(a.value,"y"):e.isBarRangeType(a)&&(o=o[1]),e.getYScaleById(a.id,t)(o)}},getShapeYMin(t){const e=this,r=e.axis.getId(t),a=e.scale[r],[o]=a.domain(),i=e.config[`axis_${r}_inverted`];return!e.isGrouped(t)&&!i&&o>0?o:0},getShapeOffsetData(t){const e=this,r=e.orderTargets(e.filterTargetsToShow(e.data.targets.filter(t,e))),a=e.isStackNormalized(),o=r.map(s=>{let l=s.values;const c={};e.isStepType(s)&&(l=e.convertValuesToStep(l));const f=l.reduce((g,p)=>{const m=Number(p.x);return g[m]=p,c[m]=a?e.getRatio("index",p,!0):p.value,g},{});return{id:s.id,rowValues:l,rowValueMapByXValue:f,values:c}});return{indexMapByTargetId:r.reduce((s,{id:l},c)=>(s[l]=c,s),{}),shapeOffsetTargets:o}},getShapeOffset(t,e,r){const a=this,{shapeOffsetTargets:o,indexMapByTargetId:i}=a.getShapeOffsetData(t),s=a.config.data_groupsZeroAs;return(l,c)=>{const{id:f,value:g,x:p}=l,m=a.getIndices(e,l),E=a.getYScaleById(f,r);if(a.isBarRangeType(l))return E(g[0]);const w=Number(p),U=E(s==="zero"?0:a.getShapeYMin(f));let N=U;return o.filter(D=>D.id!==f&&m[D.id]===m[f]).forEach(D=>{const{id:Y,rowValueMapByXValue:J,rowValues:K,values:nt}=D;if(i[Y]<i[f]){const Q=nt[w];let ot=K[c];(!ot||Number(ot.x)!==w)&&(ot=J[w]),(ot==null?void 0:ot.value)*g>=0&&pe(Q)&&(g!==0||s==="positive"&&Q>0||s==="negative"&&Q<0)&&(N+=E(Q)-U)}}),N}},circleY(t,e){const r=this,a=t.id;let o;return r.isGrouped(a)&&(o=Em.bind(r)(t)),o?o(t,e)[0][1]:r.getYScaleById(a)(r.getBaseValue(t))},getBarW(t,e,r){var a,o,i,s,l;const c=this,{config:f,org:g,scale:p,state:m}=c,E=c.getMaxDataCount(),w=t==="bar"&&((a=f.data_groups)==null?void 0:a.length),U=`${t}_width`,{k:N}=(i=(o=c.getZoomTransform)==null?void 0:o.call(c))!=null?i:{k:1},D=[(s=f.axis_x_min)!=null?s:g.xDomain[0],(l=f.axis_x_max)!=null?l:g.xDomain[1]].map(c.axis.isTimeSeries()?Zn.bind(c):Number);let Y=e.tickInterval(E);if(p.zoom&&!c.axis.isCategorized()&&N>1){const nt=D.every((Q,ot)=>Q===g.xDomain[ot]);Y=g.xDomain.map((Q,ot)=>{const pt=nt?Q:Q-Math.abs(D[ot]);return p.zoom(pt)}).reduce((Q,ot)=>Math.abs(Q)+ot)/E}const J=nt=>{const Q=nt?f[U][nt]:f[U],ot=nt?Q.ratio:f[`${U}_ratio`],pt=nt?Q.max:f[`${U}_max`],Tt=pe(Q)?Q:he(Q)?Q.call(c,m.width,r,E):r?Y*ot/r:0;return pt&&Tt>pt?pt:Tt};let K=J();return!w&&rr(f[U])&&(K={_$width:K,_$total:[]},c.filterTargetsToShow(c.data.targets).forEach(nt=>{f[U][nt.id]&&(K[nt.id]=J(nt.id),K._$total.push(K[nt.id]||K._$width))})),K},getShapeByIndex(t,e,r){const a=this,{$el:o}=a,i=De(e)?`-${e}`:"";let s=o[t];return s&&!s.empty()?s=s.filter(l=>r?l.id===r:!0).filter(l=>De(e)?l.index===e:!0):s=(r?o.main.selectAll(`.${je[`${t}s`]}${a.getTargetSelectorSuffix(r)}`):o.main).selectAll(`.${je[t]}${i}`),s},isWithinShape(t,e){var r;const a=this,o=it(t);let i;return a.isTargetToShow(e.id)?(r=a.hasValidPointType)!=null&&r.call(a,t.nodeName)?i=a.isStepType(e)?a.isWithinStep(t,a.getYScaleById(e.id)(a.getBaseValue(e))):a.isWithinCircle(t,a.isBubbleType(e)?a.pointSelectR(e)*1.5:0):t.nodeName==="path"&&(i=o.classed(je.bar)?a.isWithinBar(t):!0):i=!1,i},getInterpolate(t){const r=this.getInterpolateType(t);return{basis:om,"basis-closed":im,"basis-open":sm,bundle:lm,cardinal:cm,"cardinal-closed":um,"cardinal-open":fm,"catmull-rom":vm,"catmull-rom-closed":gm,"catmull-rom-open":pm,"monotone-x":mm,"monotone-y":ym,natural:xm,"linear-closed":Tm,linear:ps,step:Sm,"step-after":Am,"step-before":$m}[r]},getInterpolateType(t){const e=this,{config:r}=e,a=r.spline_interpolation_type,o=e.isInterpolationType(a)?a:"cardinal";return e.isSplineType(t)?o:e.isStepType(t)?r.line_step_type:"linear"},isWithinBar(t){const e=Kn(this.state.event,t),r=Yl(t),[a,o]=r,i=Math.min(a.x,o.x),s=Math.min(a.y,o.y),l=this.config.bar_sensitivity,{width:c,height:f}=na(t,!0),g=i-l,p=i+c+l,m=s+f+l,E=s-l;return g<e[0]&&e[0]<p&&E<e[1]&&e[1]<m}},Im=Object.defineProperty,Rm=(t,e,r)=>e in t?Im(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cn=(t,e,r)=>Rm(t,typeof e!="symbol"?e+"":e,r);class Vr{constructor(e){Cn(this,"api"),Cn(this,"config"),Cn(this,"cache"),Cn(this,"$el"),Cn(this,"state"),Cn(this,"charts"),Cn(this,"data",{xs:{},targets:[]}),Cn(this,"axis"),Cn(this,"scale",{x:null,y:null,y2:null,subX:null,subY:null,subY2:null,zoom:null}),Cn(this,"org",{xScale:null,xDomain:null}),Cn(this,"color"),Cn(this,"patterns"),Cn(this,"levelColor"),Cn(this,"point"),Cn(this,"brush"),Cn(this,"format",{extraLineClasses:null,xAxisTick:null,dataTime:null,defaultAxisTime:null,axisTime:null});const r=this;r.api=e,r.config=new Fr,r.cache=new Ag;const a=new xg;r.$el=a.getStore("element"),r.state=a.getStore("state"),r.$T=r.$T.bind(r)}$T(e,r,a){const{config:o,state:i}=this,s=o.transition_duration,l=o.subchart_show;let c=e;return c&&("tagName"in c&&(c=it(c)),c=(r!==!1&&s||r)&&(!i.zooming||i.dragging)&&!i.resizing&&i.rendered&&!l?c.transition(a).duration(s):c),c}beforeInit(){const e=this;e.callPluginHook("$beforeInit"),_e(e.config.onbeforeinit,e.api)}afterInit(){const e=this;e.callPluginHook("$afterInit"),_e(e.config.onafterinit,e.api)}init(){const e=this,{config:r,state:a,$el:o}=e,{boost_useCssRule:i,bindto:s}=r;Eg(e);const l=e.hasArcType();if(a.hasRadar=!a.hasAxis&&e.hasType("radar"),a.hasFunnel=!a.hasAxis&&e.hasType("funnel"),a.hasTreemap=!a.hasAxis&&e.hasType("treemap"),a.hasAxis=!l&&!a.hasFunnel&&!a.hasTreemap,a.datetimeId=`bb-${+new Date*ar()}`,i){const f=pn.createElement("style");f.type="text/css",pn.head.appendChild(f),a.style={rootSelctor:`.${a.datetimeId}`,sheet:f.sheet},o.style=f}const c={element:s,classname:"bb"};ze(s)&&(c.element=s.element||"#chart",c.classname=s.classname||c.classname),o.chart=he(c.element.node)?s.element:it(c.element||[]),o.chart.empty()&&(o.chart=it(pn.body.appendChild(pn.createElement("div")))),o.chart.html("").classed(c.classname,!0).classed(a.datetimeId,i).style("position","relative"),e.initParams(),e.initToRender()}initToRender(e){const r=this,{config:a,state:o,$el:{chart:i}}=r,s=()=>ug(i,{display:"none",visibility:"hidden"}),l=a.render.lazy===!1?!1:a.render.lazy||s(),c=Ze.MutationObserver;l&&c&&a.render.observe!==!1&&!e&&new c((f,g)=>{s()||(g.disconnect(),!o.rendered&&r.initToRender(!0))}).observe(i.node(),{attributes:!0,attributeFilter:["class","style"]}),(!l||e)&&r.convertData(a,f=>{r.initWithData(f),r.afterInit()})}initParams(){var e;const r=this,{config:a,format:o,state:i}=r;if(r.color=r.generateColor(),r.levelColor=r.generateLevelColor(),a.padding===!1&&(a.axis_x_show=!1,a.axis_y_show=!1,a.axis_y2_show=!1,a.subchart_show=!1),(r.hasPointType()||(e=r.hasLegendDefsPoint)!=null&&e.call(r))&&(r.point=r.generatePoint()),i.hasAxis){r.initClip(),o.extraLineClasses=r.generateExtraLineClass(),o.dataTime=a.data_xLocaltime?Zs:Js,o.axisTime=a.axis_x_localtime?si:li;const f=a.zoom_enabled&&a.zoom_type==="drag";o.defaultAxisTime=g=>{const{x:p,zoom:m}=r.scale,E=f?m:m&&p.orgDomain().toString()!==m.domain().toString(),w=g.getMilliseconds()&&".%L"||g.getSeconds()&&".:%S"||g.getMinutes()&&"%I:%M"||g.getHours()&&"%I %p"||g.getDate()!==1&&"%b %d"||E&&g.getDate()===1&&"%b'%y"||g.getMonth()&&"%-m/%-d"||"%Y";return o.axisTime(w)(g)}}const{legend_position:s,legend_inset_anchor:l,axis_rotated:c}=a;i.isLegendRight=s==="right",i.isLegendInset=s==="inset",i.isLegendTop=l==="top-left"||l==="top-right",i.isLegendLeft=l==="top-left"||l==="bottom-left",i.rotatedPadding.top=r.getResettedPadding(i.rotatedPadding.top),i.rotatedPadding.right=c&&!a.axis_x_show?0:30,i.inputType=fg(a.interaction_inputType_mouse,a.interaction_inputType_touch)}initWithData(e){var r,a,o;const i=this,{config:s,scale:l,state:c,$el:f,org:g}=i,{hasAxis:p,hasFunnel:m,hasTreemap:E}=c,w=s.interaction_enabled,U=i.hasType("polar"),N=s.data_labels_backgroundColors;if(p&&(i.axis=i.getAxisInstance(),s.zoom_enabled&&i.initZoom()),i.data.xs={},i.data.targets=i.convertDataToTargets(e),s.data_filter&&(i.data.targets=i.data.targets.filter(s.data_filter.bind(i.api))),s.data_hide&&i.addHiddenTargetIds(s.data_hide===!0?i.mapToIds(i.data.targets):s.data_hide),s.legend_hide&&i.addHiddenLegendIds(s.legend_hide===!0?i.mapToIds(i.data.targets):s.legend_hide),i.updateSizes(),i.updateScales(!0),p){const{x:J,y:K,y2:nt,subX:Q,subY:ot,subY2:pt}=l;J&&(J.domain(aa(i.getXDomain(i.data.targets),!s.axis_x_inverted)),Q.domain(J.domain()),g.xDomain=J.domain()),K&&(K.domain(i.getYDomain(i.data.targets,"y")),ot.domain(K.domain())),nt&&(nt.domain(i.getYDomain(i.data.targets,"y2")),pt&&pt.domain(nt.domain()))}if(f.svg=f.chart.append("svg").style("overflow","hidden").style("display","block"),w&&c.inputType){const J=c.inputType==="touch",{onclick:K,onover:nt,onout:Q}=s;f.svg.on("click",(K==null?void 0:K.bind(i.api))||null).on(J?"touchstart":"mouseenter",(nt==null?void 0:nt.bind(i.api))||null).on(J?"touchend":"mouseleave",(Q==null?void 0:Q.bind(i.api))||null)}s.svg_classname&&f.svg.attr("class",s.svg_classname);const D=he(s.color_tiles)&&i.patterns;(p||D||U||E||N||(r=i.hasLegendDefsPoint)!=null&&r.call(i))&&(f.defs=f.svg.append("defs"),p&&["id","idXAxis","idYAxis","idGrid"].forEach(J=>{i.appendClip(f.defs,c.clip[J])}),i.generateTextBGColorFilter(N),D&&i.patterns.forEach(J=>f.defs.append(()=>J.node))),i.updateSvgSize(),i.bindResize();const Y=f.svg.append("g").classed(Se.main,!0).attr("transform",m||E?null:i.getTranslate("main"));if(f.main=Y,s.subchart_show&&i.initSubchart(),s.tooltip_show&&i.initTooltip(),s.title_text&&i.initTitle(),!E&&s.legend_show&&i.initLegend(),s.data_empty_label_text&&Y.append("text").attr("class",`${gn.text} ${Se.empty}`).attr("text-anchor","middle").attr("dominant-baseline","middle"),p&&(s.regions.length&&i.initRegion(),!s.clipPath&&i.axis.init()),Y.append("g").classed(Se.chart,!0).attr("clip-path",p?c.clip.path:null),i.callPluginHook("$init"),i.initChartElements(),p&&(w&&((a=i.initEventRect)==null||a.call(i)),i.initGrid(),s.clipPath&&((o=i.axis)==null||o.init())),i.updateTargets(i.data.targets),i.updateDimension(),_e(s.oninit,i.api),i.setBackground(),i.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1,initializing:!0}),s.data_onmin||s.data_onmax){const J=i.getMinMaxData();_e(s.data_onmin,i.api,J.min),_e(s.data_onmax,i.api,J.max)}s.tooltip_show&&i.initShowTooltip(),c.rendered=!0}initChartElements(){const e=this,{hasAxis:r,hasRadar:a,hasTreemap:o}=e.state,i=[];if(r){const s=["bar","bubble","candlestick","line"];e.config.bar_front&&s.push(s.shift());for(const l of s){const c=In(l);(l==="line"&&e.hasTypeOf(c)||e.hasType(l))&&i.push(c)}}else if(o)i.push("Treemap");else if(e.hasType("funnel"))i.push("Funnel");else{const s=e.hasType("polar"),l=e.hasType("gauge");a||i.push("Arc","Pie"),l?i.push("Gauge"):a?i.push("Radar"):s&&i.push("Polar")}for(const s of i)e[`init${s}`]();cn(e.config.data_labels)&&!e.hasArcType(null,["radar"])&&e.initText()}setChartElements(){const e=this,{$el:{chart:r,svg:a,defs:o,main:i,tooltip:s,legend:l,title:c,grid:f,needle:g,arcs:p,circle:m,bar:E,candlestick:w,line:U,area:N,text:D}}=e;e.api.$={chart:r,svg:a,defs:o,main:i,tooltip:s,legend:l,title:c,grid:f,arc:p,circles:m,bar:{bars:E},candlestick:w,line:{lines:U,areas:N},needle:g,text:{texts:D}}}setBackground(){const e=this,{config:{background:r},state:a,$el:{svg:o}}=e;if(cn(r)){const i=o.select("g").insert(r.imgUrl?"image":"rect",":first-child");r.imgUrl?i.attr("href",r.imgUrl):r.color&&i.style("fill",r.color).attr("clip-path",a.clip.path),i.attr("class",r.class||null).attr("width","100%").attr("height","100%")}}updateTargets(e){var r,a;const o=this,{hasAxis:i,hasFunnel:s,hasRadar:l,hasTreemap:c}=o.state,f=p=>o[`updateTargetsFor${p}`](e.filter(o[`is${p}Type`].bind(o)));if(o.updateTargetsForText(e),i){const p=["bar","candlestick","line"];for(const m of p){const E=In(m);(m==="line"&&o.hasTypeOf(E)||o.hasType(m))&&f(E)}(r=o.updateTargetsForSubchart)==null||r.call(o,e)}else if(o.hasArcType(e)){let p="Arc";l?p="Radar":o.hasType("polar")&&(p="Polar"),f(p)}else s?f("Funnel"):c&&f("Treemap");const g=o.hasType("bubble")||o.hasType("scatter");g&&((a=o.updateTargetForCircle)==null||a.call(o)),o.filterTargetsToShowAtInit(g)}filterTargetsToShowAtInit(e=!1){const r=this,{$el:{svg:a},$T:o}=r;let i=`.${Se.target}`;e&&(i+=`, .${An.chartCircles} > .${An.circles}`),o(a.selectAll(i).filter(s=>r.isTargetToShow(s.id))).style("opacity",null)}getWithOption(e){const r={Dimension:!0,EventRect:!0,Legend:!1,Subchart:!0,Transform:!1,Transition:!0,TrimXDomain:!0,UpdateXAxis:"UpdateXDomain",UpdateXDomain:!1,UpdateOrgXDomain:!1,TransitionForExit:"Transition",TransitionForAxis:"Transition",Y:!0};for(const[a,o]of Object.entries(r)){const i=Ue(o)?r[o]:o;r[a]=$r(e,`with${a}`,i)}return r}initialOpacity(e){const r=this,{withoutFadeIn:a}=r.state;return r.getBaseValue(e)!==null&&a[e.id]?null:"0"}bindResize(){const e=this,{$el:r,config:a,state:o}=e,i=Og(a.resize_timer),{resize_auto:s}=a,l=[];l.push(()=>_e(a.onresize,e.api)),/^(true|parent)$/.test(s)&&l.push(()=>{o.resizing=!0,a.legend_show&&(e.updateSizes(),e.updateLegend()),e.api.flush(!1)}),l.push(()=>{_e(a.onresized,e.api),o.resizing=!1}),l.forEach(c=>i.add(c)),e.resizeFunction=i,s==="parent"?(e.resizeFunction.resizeObserver=new ResizeObserver(e.resizeFunction.bind(e))).observe(r.chart.node().parentNode):Ze.addEventListener("resize",e.resizeFunction)}callPluginHook(e,...r){this.config.plugins.forEach(a=>{e==="$beforeInit"&&(a.$$=this,this.api.plugins.push(a)),a[e](...r)})}}Sn(Vr.prototype,[Vg,Xg,Hg,Qg,kg,ep,np,Jg,rp,ap,op,Kp,bm,Zp,Jp,tm,em,nm,rm,am]);function Om(t){const e=this.config;let r,a,o;const i=()=>{const s=a.shift();if(s&&r&&rr(r)&&s in r)return r=r[s],i();if(!s)return r};Object.keys(e).forEach(s=>{r=t,a=s.split("_"),o=i(),Qe(o)&&(e[s]=o)}),this.api&&(this.state.orgConfig=t)}var Cm={resize(t){const e=this.internal,{config:r,state:a}=e;a.rendered&&(r.size_width=t?t.width:null,r.size_height=t?t.height:null,a.resizing=!0,this.flush(!1),e.resizeFunction())},flush(t){var e,r;const a=this.internal,{state:o,$el:{zoomResetBtn:i}}=a;o.rendered?(o.resizing?(e=a.brush)==null||e.updateResize():(r=a.axis)==null||r.setOrient(),i==null||i.style("display","none"),a.scale.zoom&&(o.current.zoomDomain=a.scale.zoom.domain()),a.scale.zoom=null,t?a.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withLegend:!0}):a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1}),!o.resizing&&a.brush&&(a.brush.getSelection().call(a.brush.move),a.unselectRect()),o.current.zoomDomain&&(a.api.zoom(o.current.zoomDomain),o.current.zoomDomain=null)):a.initToRender(!0)},destroy(){var t;const e=this.internal,{$el:{chart:r,style:a,svg:o}}=e;if(cn(e)){e.callPluginHook("$willDestroy"),e.charts.splice(e.charts.indexOf(this),1),e.unbindAllEvents(),o.select("*").interrupt(),e.resizeFunction.clear(),(t=e.resizeFunction.resizeObserver)==null||t.disconnect(),Ze.removeEventListener("resize",e.resizeFunction),r.classed("bb",!1).style("position",null).selectChildren().remove(),a&&a.parentNode.removeChild(a),Object.keys(this).forEach(i=>{i==="internal"&&Object.keys(e).forEach(s=>{e[s]=null}),this[i]=null,delete this[i]});for(const i in this)this[i]=()=>{}}return null},config(t,e,r){const a=this.internal,{config:o,state:i}=a,s=t==null?void 0:t.replace(/\./g,"_");let l;return t&&s in o?Qe(e)?(o[s]=e,l=e,r&&this.flush()):l=o[s]:(arguments.length===0||Yn(t))&&(l=i.orgConfig),l}},Pm={color(t){return this.internal.color(t)}};const uu=function(t){const{targets:e}=this.internal.data;if(!ln(t)){const r=Ge(t)?t:[t];return e.filter(a=>r.some(o=>o===a.id))}return e};Sn(uu,{shown:function(t){return this.internal.filterTargetsToShow(this.data(t))},values:function(t,e=!0){let r=null;if(t){const a=this.data(t);Ge(a)&&(r=[],a.forEach(o=>{const i=o.values.map(s=>s.value);e?r=r.concat(i):r.push(i)}))}return r},names:function(t){return this.internal.updateDataAttributes("names",t)},colors:function(t){return this.internal.updateDataAttributes("colors",t)},axes:function(t){return this.internal.updateDataAttributes("axes",t)},min:function(){return this.internal.getMinMaxData().min},max:function(){return this.internal.getMinMaxData().max}});var Mm={data:uu};const wm=t=>{var e,r;return(r=(e=Ze).btoa)==null?void 0:r.call(e,encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(a,o)=>String.fromCharCode(+`0x${o}`)))};function Dm(t,e,r){const{width:a,height:o}=e||r,i=new XMLSerializer,s=t.cloneNode(!0),l=lg(Lr(pn.styleSheets)).filter(m=>m.cssText).map(m=>m.cssText);s.setAttribute("xmlns",te.xhtml),s.style.margin="0",s.style.padding="0",e.preserveFontStyle&&s.querySelectorAll("text").forEach(m=>{m.innerHTML=""});const c=i.serializeToString(s),f=pn.createElement("style");f.appendChild(pn.createTextNode(l.join(`
|
|
49
49
|
`)));const g=i.serializeToString(f),p=`<svg xmlns="${te.svg}" width="${a}" height="${o}"
|
|
50
50
|
viewBox="0 0 ${r.width} ${r.height}"
|
|
51
51
|
preserveAspectRatio="${(e==null?void 0:e.preserveAspectRatio)===!1?"none":"xMinYMid meet"}">
|
|
52
52
|
<foreignObject width="100%" height="100%">
|
|
53
53
|
${g}
|
|
54
54
|
${c.replace(/(url\()[^#]+/g,"$1")}
|
|
55
|
-
</foreignObject></svg>`;return`data:image/svg+xml;base64,${Mm(p)}`}function Dm(t,e){const{top:r,left:a}=e,{x:o,y:i}=na(t,!0),{a:s,b:l,c,d:f,e:g,f:p}=t.getScreenCTM(),{width:m,height:E}=mn(t,!0);return{x:s*o+c*i+g-a,y:l*o+f*i+p-r+(E-Math.round(E/4)),width:m,height:E}}function Nm(t){const{left:e,top:r}=mn(t),a=i=>i.textContent||i.childElementCount,o=[];return Lr(t.querySelectorAll("text")).filter(a).forEach(i=>{const s=l=>{const{fill:c,fontFamily:f,fontSize:g,textAnchor:p,transform:m}=Ze.getComputedStyle(l),{x:E,y:w,width:U,height:N}=Dm(l,{left:e,top:r});return{[l.textContent]:{x:E,y:w,width:U,height:N,fill:c,fontFamily:f,fontSize:g,textAnchor:p,transform:m}}};if(i.childElementCount>1){const l=[];return Lr(i.querySelectorAll("tspan")).filter(a).forEach(c=>{o.push(s(c))}),l}else o.push(s(i))}),o}function Lm(t,e){e.forEach(r=>{Object.keys(r).forEach(a=>{const{x:o,y:i,width:s,height:l,fill:c,fontFamily:f,fontSize:g,transform:p}=r[a];if(t.save(),t.font=`${g} ${f}`,t.fillStyle=c,p==="none")t.fillText(a,o,i);else{const m=p.replace(/(matrix|\(|\))/g,"").split(",");m.splice(4).every(E=>+E==0)?(m.push(o+s-s/4),m.push(i-l+l/3)):(m.push(o),m.push(i)),t.transform(...m),t.fillText(a,0,0)}t.restore()})})}var Fm={export(t,e){const r=this.internal,{state:a,$el:{chart:o,svg:i}}=r,{width:s,height:l}=a.current,c=ra(Object.create(null),{width:s,height:l,preserveAspectRatio:!0,preserveFontStyle:!1,mimeType:"image/png"},t),f=wm(o.node(),c,{width:s,height:l}),g=c.preserveFontStyle?Nm(i.node()):[];if(e&&he(e)){const p=new Image;p.crossOrigin="Anonymous",p.onload=()=>{const m=pn.createElement("canvas"),E=m.getContext("2d");m.width=c.width||s,m.height=c.height||l,E.drawImage(p,0,0),g.length&&(Lm(E,g),g.length=0),e.bind(this)(m.toDataURL(c.mimeType))},p.src=f}return f}},Bm={focus(t){const e=this.internal,{state:r}=e,a=e.mapToTargetIds(t),o=e.$el.svg.selectAll(e.selectorTargets(a.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),o.classed(qe.focused,!0).classed(qe.defocused,!1),e.hasArcType()&&!r.hasRadar&&(e.expandArc(a),e.hasType("gauge")&&e.markOverlapped(t,e,`.${jn.gaugeValue}`)),e.toggleFocusLegend(a,!0),r.focusedTargetIds=a,r.defocusedTargetIds=r.defocusedTargetIds.filter(i=>a.indexOf(i)<0)},defocus(t){const e=this.internal,{state:r}=e,a=e.mapToTargetIds(t);e.$el.svg.selectAll(e.selectorTargets(a.filter(e.isTargetToShow,e))).classed(qe.focused,!1).classed(qe.defocused,!0),e.hasArcType(null,["polar"])&&(e.unexpandArc(a),e.hasType("gauge")&&e.undoMarkOverlapped(e,`.${jn.gaugeValue}`)),e.toggleFocusLegend(a,!1),r.focusedTargetIds=r.focusedTargetIds.filter(i=>a.indexOf(i)<0),r.defocusedTargetIds=a},revert(t){const e=this.internal,{config:r,state:a,$el:o}=e,i=e.mapToTargetIds(t);o.svg.selectAll(e.selectorTargets(i)).classed(qe.focused,!1).classed(qe.defocused,!1),e.hasArcType(null,["polar"])&&e.unexpandArc(i),r.legend_show&&(e.showLegend(i.filter(e.isLegendToShow.bind(e))),o.legend.selectAll(e.selectorLegends(i)).filter(function(){return it(this).classed(qe.legendItemFocused)}).classed(qe.legendItemFocused,!1)),a.focusedTargetIds=[],a.defocusedTargetIds=[]}},Um={legend:{show:function(t){const e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},hide:function(t){const e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})}}},zm={load(t){const e=this.internal,{config:r}=e;t.xs&&e.addXs(t.xs),"names"in t&&this.data.names(t.names),"classes"in t&&Object.keys(t.classes).forEach(a=>{r.data_classes[a]=t.classes[a]}),"categories"in t&&e.axis.isCategorized()&&(r.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(a=>{r.data_axes[a]=t.axes[a]}),"colors"in t&&Object.keys(t.colors).forEach(a=>{r.data_colors[a]=t.colors[a]}),"unload"in t&&t.unload!==!1?e.unload(e.mapToTargetIds(t.unload===!0?null:t.unload),()=>{Vl(()=>e.loadFromArgs(t))}):e.loadFromArgs(t)},unload(t){const e=this.internal;let r=t||{};_n(r)&&this.tooltip.hide(),Ge(r)?r={ids:r}:Ue(r)&&(r={ids:[r]});const a=e.mapToTargetIds(r.ids);e.unload(a,()=>{e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.cache.remove(a),hc.call(e,r.done,r.resizeAfter)})}};function fu(t,e,r){const a=this.internal,o=a.mapToTargetIds(e),i=a.state.hiddenTargetIds.map(c=>o.indexOf(c)>-1&&c).filter(Boolean);a.state.toggling=!0,a[`${t?"remove":"add"}HiddenTargetIds`](o);const s=a.$el.svg.selectAll(a.selectorTargets(o)),l=t?null:"0";t&&i.length&&(s.style("display",null),_e(a.config.data_onshown,this,i)),a.$T(s).style("opacity",l,"important").call(bo,()=>{var c;!t&&i.length===0&&(s.style("display","none"),_e((c=a.config)==null?void 0:c.data_onhidden,this,o)),s.style("opacity",l)}),r.withLegend&&a[`${t?"show":"hide"}Legend`](o),a.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.state.toggling=!1}var jm={show(t,e={}){fu.call(this,!0,t,e)},hide(t,e={}){fu.call(this,!1,t,e)},toggle(t,e={}){const r=this.internal,a={show:[],hide:[]};r.mapToTargetIds(t).forEach(o=>a[r.isTargetToShow(o)?"hide":"show"].push(o)),a.show.length&&this.show(a.show,e),a.hide.length&&setTimeout(()=>this.hide(a.hide,e),0)}},Gm={tooltip:{show:function(t){var e,r,a;const o=this.internal,{$el:i,config:s,state:{eventReceiver:l,hasFunnel:c,hasTreemap:f,inputType:g}}=o;let p,m;if(t.mouse&&(m=t.mouse),t.data){const{data:E}=t,w=(e=o.getYScaleById(E.id))==null?void 0:e(E.value);if((c||f)&&E.id){const U=o.selectorTarget(E.id,void 0,`.${sn.shape}`);l.rect=i.main.select(U)}else o.isMultipleX()?m=[o.xx(E),w]:(s.tooltip_grouped||(m=[0,w]),p=(a=E.index)!=null?a:o.hasArcType()&&E.id?(r=o.getArcElementByIdOrIndex(E.id))==null?void 0:r.datum().index:o.getIndexByX(E.x))}else Qe(t.x)?p=o.getIndexByX(t.x):Qe(t.index)&&(p=t.index);(g==="mouse"?["mouseover","mousemove"]:["touchstart"]).forEach(E=>{o.dispatchEvent(E,p,m)})},hide:function(){var t,e,r;const a=this.internal,{state:{inputType:o},$el:{tooltip:i}}=a,s=i==null?void 0:i.datum();if(s){const{index:l}=JSON.parse(s.current)[0];(o==="mouse"?["mouseout"]:["touchend"]).forEach(c=>{a.dispatchEvent(c,l)})}o==="touch"&&a.callOverOutForTouch(),a.hideTooltip(!0),(t=a.hideGridFocus)==null||t.call(a),(e=a.unexpandCircles)==null||e.call(a),(r=a.expandBarTypeShapes)==null||r.call(a,!1)}}},Vm=Object.defineProperty,Xm=(t,e,r)=>e in t?Vm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,du=(t,e,r)=>Xm(t,typeof e!="symbol"?e+"":e,r);class br{constructor(e){du(this,"plugins",[]),du(this,"internal");const r=new Vr(this);this.internal=r,(function a(o,i,s){Object.keys(o).forEach(l=>{const c=he(o[l]),f=i!==s,g=cn(o[l]),p=g&&Object.keys(o[l]).length>0;c&&(!f&&p||f)?i[l]=o[l].bind(s):g&&!c?i[l]={}:i[l]=o[l],p&&a(o[l],i[l],s)})})(br.prototype,this,this),Rm.call(r,e),r.beforeInit(),r.init()}}Sn(br.prototype,[Om,Cm,Pm,Fm,Bm,Um,zm,jm,Gm]);function hu(t=!1,e,r,a){const o=this,{config:i,$el:{main:s}}=o,l=i.data_selection_grouped,c=i.data_selection_isselectable.bind(o.api);i.data_selection_enabled&&s.selectAll(`.${sn.shapes}`).selectAll(`.${sn.shape}`).each(function(f){const g=it(this),{id:p,index:m}=f.data?f.data:f,E=o.getToggle(this,f).bind(o),w=l||!e||e.indexOf(p)>=0,U=!r||r.indexOf(m)>=0,N=g.classed(tn.SELECTED);g.classed(dr.line)||g.classed(no.area)||(t?w&&U&&c(f)&&!N?E(!0,g.classed(tn.SELECTED,!0),f,m):Qe(a)&&a&&N&&E(!1,g.classed(tn.SELECTED,!1),f,m):w&&U&&c(f)&&N&&E(!1,g.classed(tn.SELECTED,!1),f,m))})}var Hm={selected(t){const e=this.internal,r=[];return e.$el.main.selectAll(`.${sn.shapes+e.getTargetSelectorSuffix(t)}`).selectAll(`.${sn.shape}`).filter(function(){return it(this).classed(tn.SELECTED)}).each(a=>r.push(a)),r},select(t,e,r){const a=this.internal;hu.bind(a)(!0,t,e,r)},unselect(t,e){const r=this.internal;hu.bind(r)(!1,t,e)}};const vu=function(t){var e;const r=this.internal,{axis:a,brush:o,config:i,scale:{x:s,subX:l},state:c}=r;let f;return i.subchart_show&&(f=t,Array.isArray(f)?(a.isTimeSeries()&&(f=f.map(p=>Kn.bind(r)(p))),r.withinRange(f,r.getZoomDomain("subX",!0),r.getZoomDomain("subX"))&&(c.domain=f,o.move(o.getSelection(),f.map(l)))):f=(e=c.domain)!=null?e:s.orgDomain()),f};Sn(vu,{show(){var t,e;const r=this.internal,{$el:{subchart:a},config:o}=r,i=o.subchart_show;if(!i){r.unbindZoomEvent(),o.subchart_show=!i,!a.main&&r.initSubchart();let s=a.main.selectAll(`.${Se.target}`);r.data.targets.length!==s.size()&&(r.updateSizes(),r.updateTargetsForSubchart(r.data.targets),s=(t=a.main)==null?void 0:t.selectAll(`.${Se.target}`)),s==null||s.style("opacity",null),(e=a.main)==null||e.style("display",null),this.resize()}},hide(){const t=this.internal,{$el:{subchart:{main:e}},config:r}=t;r.subchart_show&&(e==null?void 0:e.style("display"))!=="none"&&(r.subchart_show=!1,e.style("display","none"),this.resize())},toggle(){const t=this.internal,{config:e}=t;this.subchart[e.subchart_show?"hide":"show"]()},reset(){const t=this.internal,{brush:e}=t;e.clear(e.getSelection())}});var Wm={subchart:vu},Ym=1e-12;function gu(t){return((t=Math.exp(t))+1/t)/2}function Km(t){return((t=Math.exp(t))-1/t)/2}function Zm(t){return((t=Math.exp(2*t))-1)/(t+1)}var Jm=(function t(e,r,a){function o(i,s){var l=i[0],c=i[1],f=i[2],g=s[0],p=s[1],m=s[2],E=g-l,w=p-c,U=E*E+w*w,N,D;if(U<Ym)D=Math.log(m/f)/e,N=function(ot){return[l+ot*E,c+ot*w,f*Math.exp(e*ot*D)]};else{var Y=Math.sqrt(U),J=(m*m-f*f+a*U)/(2*f*r*Y),K=(m*m-f*f-a*U)/(2*m*r*Y),nt=Math.log(Math.sqrt(J*J+1)-J),Q=Math.log(Math.sqrt(K*K+1)-K);D=(Q-nt)/e,N=function(ot){var pt=ot*D,Tt=gu(nt),yt=f/(r*Y)*(Tt*Zm(e*pt+nt)-Km(nt));return[l+yt*E,c+yt*w,f*Tt/gu(e*pt+nt)]}}return N.duration=D*1e3*e/Math.SQRT2,N}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,c=l*l;return t(s,l,c)},o})(Math.SQRT2,2,4),Ho=(t=>()=>t);function Qm(t,{sourceEvent:e,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function pr(t,e,r){this.k=t,this.x=e,this.y=r}pr.prototype={constructor:pr,scale:function(t){return t===1?this:new pr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new pr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ir=new pr(1,0,0);ms.prototype=pr.prototype;function ms(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ir;return t.__zoom}function ys(t){t.stopImmediatePropagation()}function za(t){t.preventDefault(),t.stopImmediatePropagation()}function km(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function qm(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function pu(){return this.__zoom||ir}function _m(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ty(){return navigator.maxTouchPoints||"ontouchstart"in this}function ey(t,e,r){var a=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],s=t.invertY(e[1][1])-r[1][1];return t.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ny(){var t=km,e=qm,r=ey,a=_m,o=ty,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Jm,f=oo("start","zoom","end"),g,p,m,E=500,w=150,U=0,N=10;function D(tt){tt.property("__zoom",pu).on("wheel.zoom",pt,{passive:!1}).on("mousedown.zoom",Tt).on("dblclick.zoom",yt).filter(o).on("touchstart.zoom",lt).on("touchmove.zoom",jt).on("touchend.zoom touchcancel.zoom",vt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(tt,St,ct,At){var Wt=tt.selection?tt.selection():tt;Wt.property("__zoom",pu),tt!==Wt?nt(tt,St,ct,At):Wt.interrupt().each(function(){Q(this,arguments).event(At).start().zoom(null,typeof St=="function"?St.apply(this,arguments):St).end()})},D.scaleBy=function(tt,St,ct,At){D.scaleTo(tt,function(){var Wt=this.__zoom.k,Dt=typeof St=="function"?St.apply(this,arguments):St;return Wt*Dt},ct,At)},D.scaleTo=function(tt,St,ct,At){D.transform(tt,function(){var Wt=e.apply(this,arguments),Dt=this.__zoom,Zt=ct==null?K(Wt):typeof ct=="function"?ct.apply(this,arguments):ct,re=Dt.invert(Zt),ce=typeof St=="function"?St.apply(this,arguments):St;return r(J(Y(Dt,ce),Zt,re),Wt,s)},ct,At)},D.translateBy=function(tt,St,ct,At){D.transform(tt,function(){return r(this.__zoom.translate(typeof St=="function"?St.apply(this,arguments):St,typeof ct=="function"?ct.apply(this,arguments):ct),e.apply(this,arguments),s)},null,At)},D.translateTo=function(tt,St,ct,At,Wt){D.transform(tt,function(){var Dt=e.apply(this,arguments),Zt=this.__zoom,re=At==null?K(Dt):typeof At=="function"?At.apply(this,arguments):At;return r(ir.translate(re[0],re[1]).scale(Zt.k).translate(typeof St=="function"?-St.apply(this,arguments):-St,typeof ct=="function"?-ct.apply(this,arguments):-ct),Dt,s)},At,Wt)};function Y(tt,St){return St=Math.max(i[0],Math.min(i[1],St)),St===tt.k?tt:new pr(St,tt.x,tt.y)}function J(tt,St,ct){var At=St[0]-ct[0]*tt.k,Wt=St[1]-ct[1]*tt.k;return At===tt.x&&Wt===tt.y?tt:new pr(tt.k,At,Wt)}function K(tt){return[(+tt[0][0]+ +tt[1][0])/2,(+tt[0][1]+ +tt[1][1])/2]}function nt(tt,St,ct,At){tt.on("start.zoom",function(){Q(this,arguments).event(At).start()}).on("interrupt.zoom end.zoom",function(){Q(this,arguments).event(At).end()}).tween("zoom",function(){var Wt=this,Dt=arguments,Zt=Q(Wt,Dt).event(At),re=e.apply(Wt,Dt),ce=ct==null?K(re):typeof ct=="function"?ct.apply(Wt,Dt):ct,Ie=Math.max(re[1][0]-re[0][0],re[1][1]-re[0][1]),Ce=Wt.__zoom,Pe=typeof St=="function"?St.apply(Wt,Dt):St,Ye=c(Ce.invert(ce).concat(Ie/Ce.k),Pe.invert(ce).concat(Ie/Pe.k));return function(Be){if(Be===1)Be=Pe;else{var dn=Ye(Be),kt=Ie/dn[2];Be=new pr(kt,ce[0]-dn[0]*kt,ce[1]-dn[1]*kt)}Zt.zoom(null,Be)}})}function Q(tt,St,ct){return!ct&&tt.__zooming||new ot(tt,St)}function ot(tt,St){this.that=tt,this.args=St,this.active=0,this.sourceEvent=null,this.extent=e.apply(tt,St),this.taps=0}ot.prototype={event:function(tt){return tt&&(this.sourceEvent=tt),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(tt,St){return this.mouse&&tt!=="mouse"&&(this.mouse[1]=St.invert(this.mouse[0])),this.touch0&&tt!=="touch"&&(this.touch0[1]=St.invert(this.touch0[0])),this.touch1&&tt!=="touch"&&(this.touch1[1]=St.invert(this.touch1[0])),this.that.__zoom=St,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(tt){var St=it(this.that).datum();f.call(tt,this.that,new Qm(tt,{sourceEvent:this.sourceEvent,target:D,type:tt,transform:this.that.__zoom,dispatch:f}),St)}};function pt(tt,...St){if(!t.apply(this,arguments))return;var ct=Q(this,St).event(tt),At=this.__zoom,Wt=Math.max(i[0],Math.min(i[1],At.k*Math.pow(2,a.apply(this,arguments)))),Dt=Wn(tt);if(ct.wheel)(ct.mouse[0][0]!==Dt[0]||ct.mouse[0][1]!==Dt[1])&&(ct.mouse[1]=At.invert(ct.mouse[0]=Dt)),clearTimeout(ct.wheel);else{if(At.k===Wt)return;ct.mouse=[Dt,At.invert(Dt)],_r(this),ct.start()}za(tt),ct.wheel=setTimeout(Zt,w),ct.zoom("mouse",r(J(Y(At,Wt),ct.mouse[0],ct.mouse[1]),ct.extent,s));function Zt(){ct.wheel=null,ct.end()}}function Tt(tt,...St){if(m||!t.apply(this,arguments))return;var ct=tt.currentTarget,At=Q(this,St,!0).event(tt),Wt=it(tt.view).on("mousemove.zoom",ce,!0).on("mouseup.zoom",Ie,!0),Dt=Wn(tt,ct),Zt=tt.clientX,re=tt.clientY;di(tt.view),ys(tt),At.mouse=[Dt,this.__zoom.invert(Dt)],_r(this),At.start();function ce(Ce){if(za(Ce),!At.moved){var Pe=Ce.clientX-Zt,Ye=Ce.clientY-re;At.moved=Pe*Pe+Ye*Ye>U}At.event(Ce).zoom("mouse",r(J(At.that.__zoom,At.mouse[0]=Wn(Ce,ct),At.mouse[1]),At.extent,s))}function Ie(Ce){Wt.on("mousemove.zoom mouseup.zoom",null),hi(Ce.view,At.moved),za(Ce),At.event(Ce).end()}}function yt(tt,...St){if(t.apply(this,arguments)){var ct=this.__zoom,At=Wn(tt.changedTouches?tt.changedTouches[0]:tt,this),Wt=ct.invert(At),Dt=ct.k*(tt.shiftKey?.5:2),Zt=r(J(Y(ct,Dt),At,Wt),e.apply(this,St),s);za(tt),l>0?it(this).transition().duration(l).call(nt,Zt,At,tt):it(this).call(D.transform,Zt,At,tt)}}function lt(tt,...St){if(t.apply(this,arguments)){var ct=tt.touches,At=ct.length,Wt=Q(this,St,tt.changedTouches.length===At).event(tt),Dt,Zt,re,ce;for(ys(tt),Zt=0;Zt<At;++Zt)re=ct[Zt],ce=Wn(re,this),ce=[ce,this.__zoom.invert(ce),re.identifier],Wt.touch0?!Wt.touch1&&Wt.touch0[2]!==ce[2]&&(Wt.touch1=ce,Wt.taps=0):(Wt.touch0=ce,Dt=!0,Wt.taps=1+!!g);g&&(g=clearTimeout(g)),Dt&&(Wt.taps<2&&(p=ce[0],g=setTimeout(function(){g=null},E)),_r(this),Wt.start())}}function jt(tt,...St){if(this.__zooming){var ct=Q(this,St).event(tt),At=tt.changedTouches,Wt=At.length,Dt,Zt,re,ce;for(za(tt),Dt=0;Dt<Wt;++Dt)Zt=At[Dt],re=Wn(Zt,this),ct.touch0&&ct.touch0[2]===Zt.identifier?ct.touch0[0]=re:ct.touch1&&ct.touch1[2]===Zt.identifier&&(ct.touch1[0]=re);if(Zt=ct.that.__zoom,ct.touch1){var Ie=ct.touch0[0],Ce=ct.touch0[1],Pe=ct.touch1[0],Ye=ct.touch1[1],Be=(Be=Pe[0]-Ie[0])*Be+(Be=Pe[1]-Ie[1])*Be,dn=(dn=Ye[0]-Ce[0])*dn+(dn=Ye[1]-Ce[1])*dn;Zt=Y(Zt,Math.sqrt(Be/dn)),re=[(Ie[0]+Pe[0])/2,(Ie[1]+Pe[1])/2],ce=[(Ce[0]+Ye[0])/2,(Ce[1]+Ye[1])/2]}else if(ct.touch0)re=ct.touch0[0],ce=ct.touch0[1];else return;ct.zoom("touch",r(J(Zt,re,ce),ct.extent,s))}}function vt(tt,...St){if(this.__zooming){var ct=Q(this,St).event(tt),At=tt.changedTouches,Wt=At.length,Dt,Zt;for(ys(tt),m&&clearTimeout(m),m=setTimeout(function(){m=null},E),Dt=0;Dt<Wt;++Dt)Zt=At[Dt],ct.touch0&&ct.touch0[2]===Zt.identifier?delete ct.touch0:ct.touch1&&ct.touch1[2]===Zt.identifier&&delete ct.touch1;if(ct.touch1&&!ct.touch0&&(ct.touch0=ct.touch1,delete ct.touch1),ct.touch0)ct.touch0[1]=this.__zoom.invert(ct.touch0[0]);else if(ct.end(),ct.taps===2&&(Zt=Wn(Zt,this),Math.hypot(p[0]-Zt[0],p[1]-Zt[1])<N)){var re=it(this).on("dblclick.zoom");re&&re.apply(this,arguments)}}}return D.wheelDelta=function(tt){return arguments.length?(a=typeof tt=="function"?tt:Ho(+tt),D):a},D.filter=function(tt){return arguments.length?(t=typeof tt=="function"?tt:Ho(!!tt),D):t},D.touchable=function(tt){return arguments.length?(o=typeof tt=="function"?tt:Ho(!!tt),D):o},D.extent=function(tt){return arguments.length?(e=typeof tt=="function"?tt:Ho([[+tt[0][0],+tt[0][1]],[+tt[1][0],+tt[1][1]]]),D):e},D.scaleExtent=function(tt){return arguments.length?(i[0]=+tt[0],i[1]=+tt[1],D):[i[0],i[1]]},D.translateExtent=function(tt){return arguments.length?(s[0][0]=+tt[0][0],s[1][0]=+tt[1][0],s[0][1]=+tt[0][1],s[1][1]=+tt[1][1],D):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},D.constrain=function(tt){return arguments.length?(r=tt,D):r},D.duration=function(tt){return arguments.length?(l=+tt,D):l},D.interpolate=function(tt){return arguments.length?(c=tt,D):c},D.on=function(){var tt=f.on.apply(f,arguments);return tt===f?D:tt},D.clickDistance=function(tt){return arguments.length?(U=(tt=+tt)*tt,D):Math.sqrt(U)},D.tapDistance=function(tt){return arguments.length?(N=+tt,D):N},D}const mu=function(t){var e;const r=this.internal,{axis:a,config:o,org:i,scale:s,state:l}=r,c=a.isCategorized();let f;if(o.zoom_enabled)if(f=t,Array.isArray(f)){if(a.isTimeSeries()&&(f=f.map(p=>Kn.bind(r)(p))),r.withinRange(f,r.getZoomDomain("zoom",!0),r.getZoomDomain("zoom"))){if(l.domain=f,f=r.getZoomDomainValue(f),r.api.tooltip.hide(),o.subchart_show){const p=s.zoom||s.x;r.brush.getSelection().call(r.brush.move,f.map(p))}else{const p=c?s.x.orgScale():i.xScale||s.x;r.updateCurrentZoomTransform(p,f)}r.setZoomResetButton()}}else f=r.zoom.getDomain();return(e=l.domain)!=null?e:f};Sn(mu,{enable(t){const e=this.internal,{config:r}=e;/^(drag|wheel)$/.test(t)&&(r.zoom_type=t),r.zoom_enabled=!!t,e.zoom?t===!1&&e.bindZoomEvent(!1):(e.initZoom(),e.bindZoomEvent()),e.updateAndRedraw()},max(t){const e=this.internal,{config:r,org:{xDomain:a}}=e;return(t===0||t)&&(r.zoom_x_max=tr("max",[a[1],t])),r.zoom_x_max},min(t){const e=this.internal,{config:r,org:{xDomain:a}}=e;return(t===0||t)&&(r.zoom_x_min=tr("min",[a[0],t])),r.zoom_x_min},range(t){const e=this.zoom;if(ze(t)){const{min:r,max:a}=t;Qe(r)&&e.min(r),Qe(a)&&e.max(a)}return{min:e.min(),max:e.max()}}});var ry={zoom:mu,unzoom(){const t=this.internal,{config:e,$el:{eventRect:r,zoomResetBtn:a},scale:{zoom:o},state:i}=t;o&&(e.subchart_show?t.brush.getSelection().call(t.brush.move,null):t.zoom.updateTransformScale(ir),t.updateZoom(!0),a==null||a.style("display","none"),ms(r.node())!==ir&&t.zoom.transform(r,ir),i.domain=void 0)}},ay={initBrush(){const t=this,{config:e,scale:r,$el:{subchart:a},state:o}=t,i=e.axis_rotated,s=e.subchart_size_height;let l,c,f;t.brush=(i?Jv():Zv()).handleSize(5),t.brush.on("start brush end",g=>{const{selection:p,sourceEvent:m,target:E,type:w}=g;w==="start"&&(t.state.inputType==="touch"&&t.hideTooltip(),c=m?p:null),/(start|brush)/.test(w)&&(w==="brush"&&m&&o.domain&&(c==null||c.forEach((U,N)=>{U!==p[N]&&(o.domain[N]=r.x.orgDomain()[N])})),t.redrawForBrush(w!=="start")),w==="end"&&(l=r.x.orgDomain()),E!=null&&E.handle&&(p===null?t.brush.handle.attr("display","none"):t.brush.handle.attr("display",null).attr("transform",(U,N)=>{const D=[p[N],s/2];return`translate(${i?D.reverse():D})`}))}),t.brush.updateResize=function(){f&&clearTimeout(f),f=setTimeout(()=>{const g=this.getSelection();l&&Gl(g.node())&&this.move(g,l.map(r.subX.orgScale()))},0)},t.brush.update=function(){var g;return this.extent()()[1].filter(m=>isNaN(m)).length===0&&((g=a.main)==null||g.select(`.${je.brush}`).call(this)),this},t.brush.scale=function(g){const p=e.subchart_size_height;let m=t.axis.getExtent();!m&&g.range?m=[[0,0],[g.range()[1],p]]:Ge(m)&&(m=m.map((E,w)=>[E,w>0?p:w])),i&&m[1].reverse(),this.extent(m),this.update()},t.brush.getSelection=()=>a.main?a.main.select(`.${je.brush}`):it([])},initSubchart(){const t=this,{config:e,state:{clip:r,hasAxis:a},$el:{defs:o,svg:i,subchart:s,axis:l}}=t;if(!a)return;const c=e.subchart_show?null:"hidden",f=`${r.id}-subchart`,g=t.getClipPath(f);r.idSubchart=f,t.appendClip(o,f),t.initBrush(),s.main=i.append("g").classed(je.subchart,!0).attr("transform",t.getTranslate("context"));const{main:p}=s;p.style("visibility",c),p.append("g").attr("clip-path",g).attr("class",je.chart),["bar","line","bubble","candlestick","scatter"].forEach(E=>{const w=In(/^(bubble|scatter)$/.test(E)?"circle":E);if(t.hasType(E)||t.hasTypeOf(w)){const U=p.select(`.${je.chart}`),N=je[`chart${w}s`];U.select(`.${N}`).empty()&&U.append("g").attr("class",N)}});const m=p.append("g").attr("clip-path",g).attr("class",je.brush).call(t.brush);e.subchart_showHandle&&t.addBrushHandle(m),l.subX=p.append("g").attr("class",je.axisX).attr("transform",t.getTranslate("subX")).attr("clip-path",e.axis_rotated?"":r.pathXAxis).style("visibility",e.subchart_axis_x_show?c:"hidden")},addBrushHandle(t){const e=this,{config:r}=e,a=r.axis_rotated,o=r.subchart_init_range,i="handle--custom",s=a?["M8.5 0 a6 6 0 0 0 -6 -6.5 H-2.5 a 6 6 0 0 0 -6 6.5 z m-5 -2 H-3.5 m7 -2 H-3.5z","M8.5 0 a6 -6 0 0 1 -6 6.5 H-2.5 a 6 -6 0 0 1 -6 -6.5z m-5 2 H-3.5 m7 2 H-3.5z"]:["M0 -8.5 A6 6 0 0 0 -6.5 -3.5 V2.5 A6 6 0 0 0 0 8.5 Z M-2 -3.5 V3.5 M-4 -3.5 V3.5z","M0 -8.5 A6 6 0 0 1 6.5 -3.5 V2.5 A6 6 0 0 1 0 8.5 Z M2 -3.5 V3.5 M4 -3.5 V3.5z"];e.brush.handle=t.selectAll(`.${i}`).data(a?[{type:"n"},{type:"s"}]:[{type:"w"},{type:"e"}]).enter().append("path").attr("class",i).attr("cursor",`${a?"ns":"ew"}-resize`).attr("d",l=>s[+/[se]/.test(l.type)]).attr("display",o?null:"none")},updateTargetsForSubchart(t){const e=this,{config:r,state:a,$el:{subchart:{main:o}}}=e;r.subchart_show&&(["bar","line","bubble","candlestick","scatter"].filter(i=>e.hasType(i)||e.hasTypeOf(In(i))).forEach(i=>{const s=/^(bubble|scatter)$/.test(i),l=In(s?"circle":i),c=e.getChartClass(l,!0),f=e.getClass(s?"circles":`${i}s`,!0),g=o.select(`.${je[`chart${`${l}s`}`]}`);if(s){const p=g.selectAll(`.${je.circles}`).data(t.filter(e[`is${In(i)}Type`].bind(e))).attr("class",f);p.exit().remove(),p.enter().append("g").attr("class",f)}else{const p=g.selectAll(`.${je[`chart${l}`]}`).attr("class",c).data(t.filter(e[`is${l}Type`].bind(e))),m=p.enter().append("g").style("opacity","0").attr("class",c).append("g").attr("class",f);p.exit().remove(),i==="line"&&e.hasTypeOf("Area")&&m.append("g").attr("class",e.getClass("areas",!0))}}),o.selectAll(`.${je.brush} rect`).attr(r.axis_rotated?"width":"height",r.axis_rotated?a.width2:a.height2))},redrawSubchart(t,e,r){var a;const o=this,{config:i,$el:{subchart:{main:s}},state:l}=o,c=!!e;if(s.style("visibility",i.subchart_show?null:"hidden"),i.subchart_show&&(((a=l.event)==null?void 0:a.type)==="zoom"&&o.brush.update(),t)){const f=i.subchart_init_range;if(!Ql(o)&&o.brush.update(),Object.keys(r.type).forEach(g=>{const p=In(g),m=o[`generateDraw${p}`](r.indices[g],!0);o[`update${p}`](c,!0),o[`redraw${p}`](m,c,!0)}),o.hasType("bubble")||o.hasType("scatter")){const{cx:g}=r.pos,p=o.updateCircleY(!0);o.updateCircle(!0),o.redrawCircle(g,p,c,void 0,!0)}!l.rendered&&f&&(l.domain=f,o.brush.move(o.brush.getSelection(),f.map(o.scale.x)))}},redrawForBrush(t=!0){var e;const r=this,{config:{subchart_onbrush:a,zoom_rescale:o},scale:i,state:s}=r;r.redraw({withTransition:!1,withY:o,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),t&&s.rendered&&a.bind(r.api)((e=s.domain)!=null?e:i.x.orgDomain())},transformContext(t,e){const r=this,{$el:{subchart:a},$T:o}=r,i=e!=null&&e.axisSubX?e.axisSubX:o(a.main.select(`.${je.axisX}`),t);a.main.attr("transform",r.getTranslate("context")),i.attr("transform",r.getTranslate("subX"))}},oy={initZoom(){const t=this;t.scale.zoom=null,t.generateZoom(),t.config.zoom_type==="drag"&&t.initZoomBehaviour()},bindZoomEvent(t=!0){const e=this,{config:r}=e;r.zoom_enabled&&t?!r.subchart_show&&e.bindZoomOnEventRect():t===!1&&(e.api.unzoom(),e.unbindZoomEvent())},generateZoom(){const t=this,{config:e,org:r,scale:a}=t,o=ny().duration(0).on("start",t.onZoomStart.bind(t)).on("zoom",t.onZoom.bind(t)).on("end",t.onZoomEnd.bind(t));o.orgScaleExtent=()=>{const i=e.zoom_extent||[1,10];return[i[0],Math.max(t.getMaxDataCount()/i[1],i[1])]},o.updateScaleExtent=function(){const i=Nr(t.scale.x.orgDomain())/Nr(t.getZoomDomain()),s=this.orgScaleExtent();return this.scaleExtent([s[0]*i,s[1]*i]),this},o.updateTransformScale=(i,s)=>{var l;const c=e.axis_rotated;(l=r.xScale)==null||l.range(a.x.range());const f=i[c?"rescaleY":"rescaleX"](r.xScale||a.x);if(f.domain().some(m=>/(Invalid Date|NaN)/.test(m.toString())))return;const g=t.trimXDomain(f.domain()),p=e.zoom_rescale;if(f.domain(g,r.xDomain),s){const m=f(a.x.domain()[0]),E=c?i.x:m,w=c?m:i.y;t.$el.eventRect.property("__zoom",ir.translate(E,w).scale(i.k))}t.state.xTickOffset||(t.state.xTickOffset=t.axis.x.tickOffset()),a.zoom=t.getCustomizedXScale(f),t.axis.x.scale(a.zoom),p?(!r.xScale&&(r.xScale=a.x.copy()),a.x.domain(g)):r.xScale&&(a.x.domain(r.xScale.domain()),r.xScale=null)},o.getDomain=()=>{const i=a[a.zoom?"zoom":"subX"].domain();return t.axis.isCategorized()&&(i[1]-=2),i},t.zoom=o},onZoomStart(t){const e=this,{sourceEvent:r}=t;r&&(e.zoom.startEvent=r,e.state.zooming=!0,_e(e.config.zoom_onzoomstart,e.api,t))},onZoom(t){var e;const r=this,{config:a,scale:o,state:i,org:s}=r,{sourceEvent:l}=t,c=(t==null?void 0:t.transform)===ir;if(!a.zoom_enabled||r.filterTargetsToShow(r.data.targets).length===0||!o.zoom&&(l==null?void 0:l.type.indexOf("touch"))>-1&&(l==null?void 0:l.touches.length)===1)return;t.sourceEvent&&(i.zooming=!0,i.domain=void 0);const f=(l==null?void 0:l.type)==="mousemove",g=(l==null?void 0:l.wheelDelta)<0,{transform:p}=t;!f&&g&&o.x.domain().every((E,w)=>E!==s.xDomain[w])&&o.x.domain(s.xDomain),r.zoom.updateTransformScale(p,a.zoom_type==="wheel"&&l);const m=a.transition_duration>0&&!a.subchart_show&&(i.dragging||c||!t.sourceEvent);r.redraw({withTransition:m,withY:a.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),r.state.cancelClick=f,!c&&_e(a.zoom_onzoom,r.api,(e=r.state.domain)!=null?e:r.zoom.getDomain())},onZoomEnd(t){var e,r;const a=this,{config:o,state:i}=a;let{startEvent:s}=a.zoom,l=t==null?void 0:t.sourceEvent;const c=(t==null?void 0:t.transform)===ir;(s==null?void 0:s.type.indexOf("touch"))>-1&&(s=s.changedTouches[0],l=(e=l==null?void 0:l.changedTouches)==null?void 0:e[0]),!(o.zoom_type==="drag"&&l&&s.clientX===l.clientX&&s.clientY===l.clientY)&&(i.zooming=!1,a.redrawEventRect(),a.updateZoom(),!c&&(l||i.dragging)&&_e(o.zoom_onzoomend,a.api,(r=a.state.domain)!=null?r:a.zoom.getDomain()))},updateZoom(t){const e=this,{subX:r,x:a,zoom:o}=e.scale;if(o){const i=o.domain(),s=r.domain(),l=.015,c=e.config.axis_x_inverted?(i[0]>=s[0]||i[0]+l>=s[0])&&(s[1]>=i[1]||s[1]>=i[1]+l):(i[0]<=s[0]||i[0]-l<=s[0])&&(s[1]<=i[1]||s[1]<=i[1]-l);(t||c)&&(e.axis.x.scale(r),a.domain(r.orgDomain()),e.scale.zoom=null)}},updateCurrentZoomTransform(t,e){const r=this,{$el:{eventRect:a},config:o}=r,i=o.axis_rotated,s=[-t(e[0]),0],l=ir.scale(t.range()[1]/(t(e[1])-t(e[0]))).translate(...i?s.reverse():s);a.call(r.zoom.transform,l)},bindZoomOnEventRect(){var t;const e=this,{config:r,$el:{eventRect:a,svg:o}}=e,i=r.zoom_type==="drag"?e.zoomBehaviour:e.zoom;Ze.GestureEvent&&/^((?!chrome|android|mobile).)*safari/i.test((t=Ze.navigator)==null?void 0:t.userAgent)&&o.on("wheel",()=>{}),a==null||a.call(i).on("dblclick.zoom",null)},initZoomBehaviour(){const t=this,{config:e,state:r}=t,a=e.axis_rotated;let o=0,i=0,s,l;const c={axis:a?"y":"x",attr:a?"height":"width",index:a?1:0};t.zoomBehaviour=vc().clickDistance(4).on("start",function(f){l=t.scale.zoom?null:t.axis.getExtent(),r.event=f,t.setDragStatus(!0),t.unselectRect(),s||(s=t.$el.main.append("rect").attr("clip-path",r.clip.path).attr("class",ui.zoomBrush).attr("width",a?r.width:0).attr("height",a?0:r.height)),o=Yn(f,this)[c.index],l&&(o<l[0]?o=l[0]:o>l[1]&&(o=l[1])),i=o,s.attr(c.axis,o).attr(c.attr,0),t.onZoomStart(f)}).on("drag",function(f){i=Yn(f,this)[c.index],l&&(i>l[1]?i=l[1]:i<l[0]&&(i=l[0])),s.attr(c.axis,Math.min(o,i)).attr(c.attr,Math.abs(i-o))}).on("end",f=>{const g=t.scale.zoom||t.scale.x;r.event=f,s.attr(c.axis,0).attr(c.attr,0),o>i&&([o,i]=[i,o]),o<0&&(i+=Math.abs(o),o=0),o!==i&&t.api.zoom([o,i].map(p=>g.invert(p))),t.setDragStatus(!1)})},setZoomResetButton(){const t=this,{config:e,$el:r}=t,a=e.zoom_resetButton;a&&e.zoom_type==="drag"&&(r.zoomResetBtn?r.zoomResetBtn.style("display",null):r.zoomResetBtn=t.$el.chart.append("div").classed(Se.button,!0).append("span").on("click",function(){he(a.onclick)&&a.onclick.bind(t.api)(this),t.api.unzoom()}).classed(ui.buttonZoomReset,!0).text(a.text||"Reset Zoom"))},getZoomTransform(){const t=this,{$el:{eventRect:e}}=t;return e!=null&&e.node()?ms(e.node()):{k:1}}},iy={drag(t){const e=this,{config:r,state:a,$el:{main:o}}=e,i=r.data_selection_grouped,s=r.interaction_enabled&&r.data_selection_isselectable;if(e.hasArcType()||!r.data_selection_enabled||r.zoom_enabled&&!e.zoom.altDomain||!r.data_selection_multiple)return;const[l,c]=a.dragStart||[0,0],[f,g]=t,p=Math.min(l,f),m=Math.max(l,f),E=i?a.margin.top:Math.min(c,g),w=i?a.height:Math.max(c,g);o.select(`.${Cr.dragarea}`).attr("x",p).attr("y",E).attr("width",m-p).attr("height",w-E),o.selectAll(`.${sn.shapes}`).selectAll(`.${sn.shape}`).filter(U=>s==null?void 0:s.bind(e.api)(U)).each(function(U,N){const D=it(this),Y=D.classed(tn.SELECTED),J=D.classed(Cr.INCLUDED);let K=!1,nt;if(D.classed(An.circle)){const Q=+D.attr("cx")*1,ot=+D.attr("cy")*1;nt=e.togglePoint,K=p<Q&&Q<m&&E<ot&&ot<w}else if(D.classed(zn.bar)){const{x:Q,y:ot,width:pt,height:Tt}=Kl(this);nt=e.togglePath,K=!(m<Q||Q+pt<p)&&!(w<ot||ot+Tt<E)}else return;K^J&&(D.classed(Cr.INCLUDED,!J),D.classed(tn.SELECTED,!Y),nt.call(e,!Y,D,U,N))})},dragstart(t){const e=this,{config:r,state:a,$el:{main:o}}=e;e.hasArcType()||!r.data_selection_enabled||(a.dragStart=t,o.select(`.${Se.chart}`).append("rect").attr("class",Cr.dragarea).style("opacity","0.1"),e.setDragStatus(!0))},dragend(){const t=this,{config:e,$el:{main:r},$T:a}=t;t.hasArcType()||!e.data_selection_enabled||(a(r.select(`.${Cr.dragarea}`)).style("opacity","0").remove(),r.selectAll(`.${sn.shape}`).classed(Cr.INCLUDED,!1),t.setDragStatus(!1))}},sy=Object.defineProperty,ly=Object.defineProperties,cy=Object.getOwnPropertyDescriptors,yu=Object.getOwnPropertySymbols,uy=Object.prototype.hasOwnProperty,fy=Object.prototype.propertyIsEnumerable,xu=(t,e,r)=>e in t?sy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,dy=(t,e)=>{for(var r in e||(e={}))uy.call(e,r)&&xu(t,r,e[r]);if(yu)for(var r of yu(e))fy.call(e,r)&&xu(t,r,e[r]);return t},hy=(t,e)=>ly(t,cy(e)),vy=hy(dy({},iy),{selectPoint(t,e,r){const a=this,{config:o,$el:{main:i},$T:s}=a,l=o.axis_rotated,c=(l?a.circleY:a.circleX).bind(a),f=(l?a.circleX:a.circleY).bind(a),g=a.pointSelectR.bind(a);_e(o.data_onselected,a.api,e,t.node()),s(i.select(`.${tn.selectedCircles}${a.getTargetSelectorSuffix(e.id)}`).selectAll(`.${tn.selectedCircle}-${r}`).data([e]).enter().append("circle").attr("class",()=>a.generateClass(tn.selectedCircle,r)).attr("cx",c).attr("cy",f).attr("stroke",a.color).attr("r",p=>a.pointSelectR(p)*1.4)).attr("r",g)},unselectPoint(t,e,r){const a=this,{config:o,$el:{main:i},$T:s}=a;_e(o.data_onunselected,a.api,e,t==null?void 0:t.node()),s(i.select(`.${tn.selectedCircles}${a.getTargetSelectorSuffix(e.id)}`).selectAll(`.${tn.selectedCircle}-${r}`)).attr("r",0).remove()},togglePoint(t,e,r,a){this[`${t?"":"un"}selectPoint`](e,r,a)},selectPath(t,e){const r=this,{config:a}=r;_e(a.data_onselected,r.api,e,t.node()),a.interaction_brighten&&t.style("filter","brightness(1.25)")},unselectPath(t,e){const r=this,{config:a}=r;_e(a.data_onunselected,r.api,e,t.node()),a.interaction_brighten&&t.style("filter",null)},togglePath(t,e,r,a){this[`${t?"":"un"}selectPath`](e,r,a)},getToggle(t,e){const r=this;return t.nodeName==="path"?r.togglePath:r.isStepType(e)?()=>{}:r.togglePoint},toggleShape(t,e,r){var a;const o=this,{config:i,$el:{main:s}}=o;if(i.data_selection_enabled&&i.data_selection_isselectable.bind(o.api)(e)){const l=it(t),c=l.classed(tn.SELECTED),f=o.getToggle(t,e).bind(o);let g;if(!i.data_selection_multiple){const p=(a=o.isPointFocusOnly)==null?void 0:a.call(o);let m=`.${p?tn.selectedCircles:sn.shapes}`;i.data_selection_grouped&&(m+=o.getTargetSelectorSuffix(e.id)),s.selectAll(m).selectAll(p?`.${tn.selectedCircle}`:`.${sn.shape}.${tn.SELECTED}`).classed(tn.SELECTED,!1).each(function(E){const w=it(this);g=w,f(!1,w,E,E.index)})}(!g||g.node()!==l.node())&&(l.classed(tn.SELECTED,!c),f(!c,l,e,r))}}}),gy={data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:()=>!0,data_selection_multiple:!0,data_selection_draggable:!1,data_onselected:()=>{},data_onunselected:()=>{}},py={subchart_show:!1,subchart_showHandle:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_axis_x_tick_show:!0,subchart_axis_x_tick_format:void 0,subchart_axis_x_tick_text_show:!0,subchart_init_range:void 0,subchart_onbrush:()=>{}},my={zoom_enabled:!1,zoom_type:"wheel",zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:void 0,zoom_onzoomstart:void 0,zoom_onzoomend:void 0,zoom_resetButton:!0,zoom_x_min:void 0,zoom_x_max:void 0};let Tu=()=>(Sn(Vr.prototype,vy),Sn(br.prototype,Hm),Fr.setOptions([gy]),(Tu=()=>!0)()),Su=()=>(Sn(Vr.prototype,ay),Sn(br.prototype,Wm),Fr.setOptions([py]),(Su=()=>!0)()),$u=()=>(Sn(Vr.prototype,oy),Sn(br.prototype,ry),Fr.setOptions([my]),($u=()=>!0)());function Au(t,e,r){const{config:a}=t,o=(i,s)=>{const l=pe(s)?s:s===!1?void 0:null;l!==null&&(a[`axis_${i}_${e}`]=l)};Qe(r)&&(rr(r)?Object.keys(r).forEach(i=>{o(i,r[i])}):(pe(r)||r===!1)&&["y","y2"].forEach(i=>{o(i,r)}),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function Eu(t,e){const{config:r}=t;return{x:r[`axis_x_${e}`],y:r[`axis_y_${e}`],y2:r[`axis_y2_${e}`]}}var yy={axis:{labels:function(t){const e=this.internal;let r;return t&&(Object.keys(t).forEach(a=>{e.axis.setLabelText(a,t[a])}),e.axis.updateLabels()),["x","y","y2"].forEach(a=>{const o=e.axis.getLabelText(a);o&&(!r&&(r={}),r[a]=o)}),r},min:function(t){const e=this.internal;return De(t)||t===!1?Au(e,"min",t):Eu(e,"min")},max:function(t){const e=this.internal;return De(t)||t===!1?Au(e,"max",t):Eu(e,"max")},range:function(t){const{axis:e}=this;if(arguments.length){const{min:r,max:a}=t;Qe(a)&&e.max(a),Qe(r)&&e.min(r)}else return{max:e.max(),min:e.min()}}}},xy={category(t,e){const r=this.internal,{config:a}=r;return arguments.length>1&&(a.axis_x_categories[t]=e,r.redraw()),a.axis_x_categories[t]},categories(t){const e=this.internal,{config:r}=e;if(!t||!Array.isArray(t)){const a=r.axis_x_categories;return _n(a)?Object.values(e.data.xs)[0]:a}return r.axis_x_categories=t,e.redraw(),r.axis_x_categories}},Ty={flow(t){const e=this.internal;let r;(t.json||t.rows||t.columns)&&e.convertData(t,o=>{r=o,a()});function a(){let o,i=0,s=0,l,c;if(e.state.redrawing||!r||!La())return;const f=[],g=e.getMaxDataCount(),p=e.convertDataToTargets(r,!0),m=e.axis.isTimeSeries();e.data.targets.forEach(U=>{let N=!1;for(let D=0;D<p.length;D++)if(U.id===p[D].id){N=!0,U.values[U.values.length-1]&&(s=U.values[U.values.length-1].index+1),i=p[D].values.length;for(let Y=0;Y<i;Y++)p[D].values[Y].index=s+Y,m||(p[D].values[Y].x=s+Y);U.values=U.values.concat(p[D].values),p.splice(D,1);break}!N&&f.push(U.id)}),e.data.targets.forEach(U=>{for(let N=0;N<f.length;N++)if(U.id===f[N]){s=U.values[U.values.length-1].index+1;for(let D=0;D<i;D++)U.values.push({id:U.id,index:s+D,x:m?e.getOtherTargetX(s+D):s+D,value:null})}}),e.data.targets.length&&p.forEach(U=>{const N=[];for(let D=e.data.targets[0].values[0].index;D<s;D++)N.push({id:U.id,index:D,x:m?e.getOtherTargetX(D):D,value:null});U.values.forEach(D=>{D.index+=s,m||(D.x+=s)}),U.values=N.concat(U.values)}),e.data.targets=e.data.targets.concat(p);const E=e.data.targets[0],w=E.values[0];Qe(t.to)?(i=0,c=m?Kn.call(e,t.to):t.to,E.values.forEach(U=>{U.x<c&&i++})):Qe(t.length)&&(i=t.length),g?g===1&&m&&(l=(E.values[E.values.length-1].x-w.x)/2,o=[new Date(+w.x-l),new Date(+w.x+l)]):(m?l=E.values.length>1?E.values[E.values.length-1].x-w.x:w.x-e.getXDomain(e.data.targets)[0]:l=1,o=[w.x-l,w.x]),o&&e.updateXDomain(null,!0,!0,!1,o),e.updateTargets(e.data.targets),e.redraw({flow:{index:w.index,length:i,duration:De(t.duration)?t.duration:e.config.transition_duration,done:t.done,orgDataCount:g},withLegend:!0,withTransition:g>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}};function xs(t,e){const r=this.internal,{config:a}=r,o=a.transition_duration&&La(),i=`grid_${e}_lines`;return t&&(a[i]=t,r.updateGrid(),r.redrawGrid(o)),a[i]}function bu(t,e){const r=`grid_${e}_lines`;return xs.bind(this)(this.internal.config[r].concat(t||[]),e)}function Iu(t,e){this.internal.removeGridLines(t,e)}const Ru=function(t){return xs.bind(this)(t,"x")};Sn(Ru,{add(t){return bu.bind(this)(t,"x")},remove(t){return Iu.bind(this)(t,!0)}});const Ou=function(t){return xs.bind(this)(t,"y")};Sn(Ou,{add(t){return bu.bind(this)(t,"y")},remove(t){return Iu.bind(this)(t,!1)}});var Sy={xgrids:Ru,ygrids:Ou},$y={groups(t){const e=this.internal,{config:r}=e;return ln(t)||(r.data_groups=t,e.redraw()),r.data_groups}};function Cu(t,e=!1){const r=this.internal,{config:a}=r,o=a.transition_duration&&La();return t?(a.regions=e?a.regions.concat(t):t,r.updateRegion(),r.redrawRegion(o),e?a.regions:t):a.regions}const Pu=function(t){return Cu.bind(this)(t)};Sn(Pu,{add:function(t){return Cu.bind(this)(t,!0)},remove:function(t){const e=this.internal,{config:r,$T:a}=e,o=t||{},i=$r(o,"classes",[Aa.region]);let s=e.$el.main.select(`.${Aa.regions}`).selectAll(i.map(l=>`.${l}`));return a(s).style("opacity","0").remove(),s=r.regions,Object.keys(o).length?(s=s.filter(l=>{let c=!1;return l.class?(l.class.split(" ").forEach(f=>{i.indexOf(f)>=0&&(c=!0)}),!c):!0}),r.regions=s):r.regions=[],s}});var Ay={regions:Pu},Ey={x(t){const e=this.internal,{axis:r,data:a}=e,o=r.isCustomX()&&r.isCategorized();return Ge(t)&&(o?this.categories(t):(e.updateTargetX(a.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),o?this.categories():a.xs},xs(t){const e=this.internal;return ze(t)&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}};function by(t){return t}var Wo=1,Yo=2,Ts=3,ja=4,Mu=1e-6;function Iy(t){return"translate("+t+",0)"}function Ry(t){return"translate(0,"+t+")"}function Oy(t){return e=>+t(e)}function Cy(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Py(){return!this.__axis}function Ko(t,e){var r=[],a=null,o=null,i=6,s=6,l=3,c=typeof window!="undefined"&&window.devicePixelRatio>1?0:.5,f=t===Wo||t===ja?-1:1,g=t===ja||t===Yo?"x":"y",p=t===Wo||t===Ts?Iy:Ry;function m(E){var w=a==null?e.ticks?e.ticks.apply(e,r):e.domain():a,U=o==null?e.tickFormat?e.tickFormat.apply(e,r):by:o,N=Math.max(i,0)+l,D=e.range(),Y=+D[0]+c,J=+D[D.length-1]+c,K=(e.bandwidth?Cy:Oy)(e.copy(),c),nt=E.selection?E.selection():E,Q=nt.selectAll(".domain").data([null]),ot=nt.selectAll(".tick").data(w,e).order(),pt=ot.exit(),Tt=ot.enter().append("g").attr("class","tick"),yt=ot.select("line"),lt=ot.select("text");Q=Q.merge(Q.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),ot=ot.merge(Tt),yt=yt.merge(Tt.append("line").attr("stroke","currentColor").attr(g+"2",f*i)),lt=lt.merge(Tt.append("text").attr("fill","currentColor").attr(g,f*N).attr("dy",t===Wo?"0em":t===Ts?"0.71em":"0.32em")),E!==nt&&(Q=Q.transition(E),ot=ot.transition(E),yt=yt.transition(E),lt=lt.transition(E),pt=pt.transition(E).attr("opacity",Mu).attr("transform",function(jt){return isFinite(jt=K(jt))?p(jt+c):this.getAttribute("transform")}),Tt.attr("opacity",Mu).attr("transform",function(jt){var vt=this.parentNode.__axis;return p((vt&&isFinite(vt=vt(jt))?vt:K(jt))+c)})),pt.remove(),Q.attr("d",t===ja||t===Yo?s?"M"+f*s+","+Y+"H"+c+"V"+J+"H"+f*s:"M"+c+","+Y+"V"+J:s?"M"+Y+","+f*s+"V"+c+"H"+J+"V"+f*s:"M"+Y+","+c+"H"+J),ot.attr("opacity",1).attr("transform",function(jt){return p(K(jt)+c)}),yt.attr(g+"2",f*i),lt.attr(g,f*N).text(U),nt.filter(Py).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Yo?"start":t===ja?"end":"middle"),nt.each(function(){this.__axis=K})}return m.scale=function(E){return arguments.length?(e=E,m):e},m.ticks=function(){return r=Array.from(arguments),m},m.tickArguments=function(E){return arguments.length?(r=E==null?[]:Array.from(E),m):r.slice()},m.tickValues=function(E){return arguments.length?(a=E==null?null:Array.from(E),m):a&&a.slice()},m.tickFormat=function(E){return arguments.length?(o=E,m):o},m.tickSize=function(E){return arguments.length?(i=s=+E,m):i},m.tickSizeInner=function(E){return arguments.length?(i=+E,m):i},m.tickSizeOuter=function(E){return arguments.length?(s=+E,m):s},m.tickPadding=function(E){return arguments.length?(l=+E,m):l},m.offset=function(E){return arguments.length?(c=+E,m):c},m}function My(t){return Ko(Wo,t)}function wy(t){return Ko(Yo,t)}function wu(t){return Ko(Ts,t)}function Du(t){return Ko(ja,t)}var Dy=Object.defineProperty,Ny=(t,e,r)=>e in t?Dy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zo=(t,e,r)=>Ny(t,typeof e!="symbol"?e+"":e,r);class Ly{constructor(e){Zo(this,"owner"),Zo(this,"config"),Zo(this,"scale"),Zo(this,"charSize",{});const r=jr(),{config:a,params:o}=e;this.owner=e,this.config=a,this.scale=r,(a.noTransition||!o.config.transition_duration)&&(a.withoutTransition=!0),a.range=this.scaleExtent((o.orgXScale||r).range())}getSizeFor1Char(e,r,a=!0){const o={w:5.5,h:11.5};return this.charSize[e]&&a?this.charSize[e]:(!r.empty()&&r.text("0").call(i=>{try{const{width:s,height:l}=na(i.node(),!0);s&&l&&(o.w=s,o.h=l)}finally{i.text("")}}),this.charSize[e]=o,o)}getTickTransformSetter(e){const{config:r}=this,a=e==="x"?o=>`translate(${o+r.tickOffset},0)`:o=>`translate(0,${o})`;return(o,i)=>{o.attr("transform",s=>{const l=i(s);return De(s)?a(l):null})}}scaleExtent(e){const r=e[0],a=e[e.length-1];return r<a?[r,a]:[a,r]}generateTicks(e,r){const{tickStepSize:a}=this.owner.params,[o,i]=e.domain();let s=[];if(r&&a){let l=Math.round(o);for(;l<=i;)s.push(l),l+=a}else if(e.ticks){const{tickArguments:l}=this.config;if(e.type==="log"&&!l){const c=jr("_log").domain([o>0?o:1,i]).range(e.range());s=c.ticks();for(let f=i.toFixed().length;s.length>15;f--)s=c.ticks(f);s.splice(0,1,o),s.splice(s.length-1,1,i)}else s=e.ticks(...this.config.tickArguments||[]);s=s.map(c=>Ue(c)&&pe(c)&&!isNaN(c)&&Math.round(c*10)/10||c)}return s}copyScale(){const e=this.scale.copy();return e.domain().length||e.domain(this.scale.domain()),e.type=this.scale.type,e}textFormatted(e){const r=this.config.tickFormat,a=/\d+\.\d+0{5,}\d$/.test(e)?+String(e).replace(/0+\d$/,""):e,o=r?r(a):a;return Qe(o)?o:""}transitionise(e){const{config:r}=this;let a=e;if(r.withoutTransition)a=e.interrupt();else if(r.transition||!this.owner.params.noTransition)try{a=e.transition(r.transition)}catch(o){}return a}}var Fy=Object.defineProperty,By=(t,e,r)=>e in t?Fy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ga=(t,e,r)=>By(t,typeof e!="symbol"?e+"":e,r);class Uy{constructor(e={}){Ga(this,"helper"),Ga(this,"config"),Ga(this,"params"),Ga(this,"g"),Ga(this,"generatedTicks");const r={innerTickSize:6,outerTickSize:e.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:e.noTransition};r.tickLength=Math.max(r.innerTickSize,0)+r.tickPadding,this.config=r,this.params=e,this.helper=new Ly(this)}create(e){const r=this,{config:a,helper:o,params:i}=r,{scale:s}=o,{orient:l}=a,c=this.splitTickText.bind(r),f=/^(left|right)$/.test(l),g=/^(top|bottom)$/.test(l),p=o.getTickTransformSetter(g?"x":"y"),m=p===o.axisX?"y":"x",E=/^(top|left)$/.test(l)?-1:1,w=i.tickTextRotate;this.config.range=s.rangeExtent?s.rangeExtent():o.scaleExtent((i.orgXScale||s).range());const{innerTickSize:U,tickLength:N,range:D}=a,Y=i.id,J=Y&&/^(x|y|y2)$/.test(Y)?i.config[`axis_${Y}_tick_text_position`]:{x:0,y:0},K=Y==="subX"?"subchart_axis_x":`axis_${Y}`,nt=i.config[`${K}_show`],Q={tick:nt?i.config[`${K}_tick_show`]:!1,text:nt?i.config[`${K}_tick_text_show`]:!1},ot=i.config.axis_evalTextSize;let pt;e.each(function(){const Tt=it(this);let yt=this.__chart__||s,lt=o.copyScale();pt=Tt,this.__chart__=lt,a.tickOffset=i.isCategory?(lt(1)-lt(0))/2:0;const jt=Tt.selectAll(".domain").data([0]);if(jt.enter().append("path").attr("class","domain").merge(jt).attr("d",()=>{const vt=a.outerTickSize*E;return g?`M${D[0]},${vt}V0H${D[1]}V${vt}`:`M${vt},${D[0]}H0V${D[1]}H${vt}`}),Q.tick||Q.text){const vt=a.tickValues||o.generateTicks(lt,f||i.config.axis_rotated);r.generatedTicks=vt;let tt=Tt.selectAll(".tick").data(vt,lt);const St=tt.enter().insert("g",".domain").attr("class","tick"),ct=tt.exit().remove();tt=St.merge(tt),Q.tick&&St.append("line"),Q.text&&St.append("text");const At=tt.select("text"),Wt=[];let Dt={w:0,h:0};he(ot)&&(Dt=ot.bind(r.params.owner.api)(At.node(),Y),this.classList.contains(Se.dummy)&&(this.sizeFor1Char=Dt)),(!Dt||Dt.w===0||Dt.h===0)&&(Dt=r.helper.getSizeFor1Char(l,At,!!ot));let Zt=At.selectAll("tspan").data((Ie,Ce)=>{const Pe=i.tickMultiline?c(Ie,lt,vt,f,Dt.w):Ge(o.textFormatted(Ie))?o.textFormatted(Ie).concat():[o.textFormatted(Ie)];return Wt[Ce]=Pe.length,Pe.map(Ye=>({index:Ce,splitted:Ye}))});Zt.exit().remove(),Zt=Zt.enter().append("tspan").merge(Zt).text(Ie=>Ie.splitted),Zt.attr("x",g?0:N*E).attr("dx",(()=>{let Ie=0;return/(top|bottom)/.test(l)&&w&&(Ie=8*Math.sin(Math.PI*(w/180))*(l==="top"?-1:1)),Ie+(J.x||0)})()).attr("dy",(Ie,Ce)=>{const Pe=".71em";let Ye=0;return l!=="top"&&(Ye=Dt.h,Ce===0&&(Ye=f?-((Wt[Ie.index]-1)*(Dt.h/2)-3):J.y===0?Pe:0)),pe(Ye)&&J.y?Ye+J.y:Ye||Pe});const re=tt.select("line"),ce=tt.select("text");if(St.select("line").attr(`${m}2`,U*E),St.select("text").attr(m,N*E),r.setTickLineTextPosition(re,ce,Dt),i.tickTitle){const Ie=ce.select("title");(Ie.empty()?ce.append("title"):Ie).text(Ce=>i.tickTitle[Ce])}if(lt.bandwidth){const Ie=lt,Ce=Ie.bandwidth()/2;yt=Pe=>Ie(Pe)+Ce,lt=yt}else yt.bandwidth?yt=lt:p(ct,lt);tt=i.owner.state.flowing?o.transitionise(tt):i.owner.$T(tt),p(St,yt),p(tt.style("opacity",null),lt)}}),this.g=pt}getGeneratedTicks(e){var r;const a=((r=this.generatedTicks)==null?void 0:r.length)-1;let o=this.generatedTicks;if(a>e){const i=Math.round(a/e+.1);o=this.generatedTicks.map((s,l)=>l%i===0?s:null).filter(s=>s!==null).splice(0,e)}return o}getTickXY(){const{config:e}=this,r={x:0,y:0};return this.params.isCategory&&(r.x=e.tickCentered?0:e.tickOffset,r.y=e.tickCentered?e.tickOffset:0),r}getTickSize(e){const{scale:r}=this.helper,{config:a}=this,{innerTickSize:o,range:i}=a,s=r(e)+(a.tickCentered?0:a.tickOffset);return i[0]<s&&s<i[1]?o:0}setTickLineTextPosition(e,r,a){const o=this.getTickXY(),{innerTickSize:i,orient:s,tickLength:l,tickOffset:c}=this.config,f=this.params.id,g=this.params.tickTextRotate,p=6,m=a.h/2-p,E=J=>{const K=["start","end"];return s==="top"&&K.reverse(),J?K[J>0?0:1]:"middle"},w=J=>J?`rotate(${J})`:null,U=J=>{const K=J/(s==="bottom"?15:23);return J?11.5-2.5*K*(J>0?1:-1):l},{config:{axis_rotated:N,axis_x_tick_text_inner:D}}=this.params.owner,Y=this.params.config[`axis_${f}_tick_inner`];switch(s){case"bottom":e.attr("x1",o.x).attr("x2",o.x).attr("y2",J=>this.getTickSize.bind(this)(J)*(Y?-1:1)),r.attr("x",0).attr("y",U(g)).style("text-anchor",E(g)).style("text-anchor",(J,K,{length:nt})=>!N&&K===0&&(D===!0||D.first)?"start":!N&&K===nt-1&&(D===!0||D.last)?"end":E(g)).attr("transform",w(g));break;case"top":e.attr("x2",0).attr("y2",Y?i:-i),r.attr("x",0).attr("y",-(U(g)+m+p)).style("text-anchor",E(g)).attr("transform",w(g));break;case"left":e.attr("x2",Y?i:-i).attr("y1",o.y).attr("y2",o.y),r.attr("x",-l).attr("y",c+(N?m/4:m)).style("text-anchor","end");break;case"right":e.attr("x2",Y?-i:i).attr("y2",0),r.attr("x",l).attr("y",m).style("text-anchor","start")}}splitTickText(e,r,a,o,i){const{params:s}=this,l=this.helper.textFormatted(e),c=Ue(l)&&l.indexOf(`
|
|
55
|
+
</foreignObject></svg>`;return`data:image/svg+xml;base64,${wm(p)}`}function Nm(t,e){const{top:r,left:a}=e,{x:o,y:i}=na(t,!0),{a:s,b:l,c,d:f,e:g,f:p}=t.getScreenCTM(),{width:m,height:E}=mn(t,!0);return{x:s*o+c*i+g-a,y:l*o+f*i+p-r+(E-Math.round(E/4)),width:m,height:E}}function Lm(t){const{left:e,top:r}=mn(t),a=i=>i.textContent||i.childElementCount,o=[];return Lr(t.querySelectorAll("text")).filter(a).forEach(i=>{const s=l=>{const{fill:c,fontFamily:f,fontSize:g,textAnchor:p,transform:m}=Ze.getComputedStyle(l),{x:E,y:w,width:U,height:N}=Nm(l,{left:e,top:r});return{[l.textContent]:{x:E,y:w,width:U,height:N,fill:c,fontFamily:f,fontSize:g,textAnchor:p,transform:m}}};if(i.childElementCount>1){const l=[];return Lr(i.querySelectorAll("tspan")).filter(a).forEach(c=>{o.push(s(c))}),l}else o.push(s(i))}),o}function Fm(t,e){e.forEach(r=>{Object.keys(r).forEach(a=>{const{x:o,y:i,width:s,height:l,fill:c,fontFamily:f,fontSize:g,transform:p}=r[a];if(t.save(),t.font=`${g} ${f}`,t.fillStyle=c,p==="none")t.fillText(a,o,i);else{const m=p.replace(/(matrix|\(|\))/g,"").split(",");m.splice(4).every(E=>+E==0)?(m.push(o+s-s/4),m.push(i-l+l/3)):(m.push(o),m.push(i)),t.transform(...m),t.fillText(a,0,0)}t.restore()})})}var Bm={export(t,e){const r=this.internal,{state:a,$el:{chart:o,svg:i}}=r,{width:s,height:l}=a.current,c=ra(Object.create(null),{width:s,height:l,preserveAspectRatio:!0,preserveFontStyle:!1,mimeType:"image/png"},t),f=Dm(o.node(),c,{width:s,height:l}),g=c.preserveFontStyle?Lm(i.node()):[];if(e&&he(e)){const p=new Image;p.crossOrigin="Anonymous",p.onload=()=>{const m=pn.createElement("canvas"),E=m.getContext("2d");m.width=c.width||s,m.height=c.height||l,E.drawImage(p,0,0),g.length&&(Fm(E,g),g.length=0),e.bind(this)(m.toDataURL(c.mimeType))},p.src=f}return f}},Um={focus(t){const e=this.internal,{state:r}=e,a=e.mapToTargetIds(t),o=e.$el.svg.selectAll(e.selectorTargets(a.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),o.classed(qe.focused,!0).classed(qe.defocused,!1),e.hasArcType()&&!r.hasRadar&&(e.expandArc(a),e.hasType("gauge")&&e.markOverlapped(t,e,`.${jn.gaugeValue}`)),e.toggleFocusLegend(a,!0),r.focusedTargetIds=a,r.defocusedTargetIds=r.defocusedTargetIds.filter(i=>a.indexOf(i)<0)},defocus(t){const e=this.internal,{state:r}=e,a=e.mapToTargetIds(t);e.$el.svg.selectAll(e.selectorTargets(a.filter(e.isTargetToShow,e))).classed(qe.focused,!1).classed(qe.defocused,!0),e.hasArcType(null,["polar"])&&(e.unexpandArc(a),e.hasType("gauge")&&e.undoMarkOverlapped(e,`.${jn.gaugeValue}`)),e.toggleFocusLegend(a,!1),r.focusedTargetIds=r.focusedTargetIds.filter(i=>a.indexOf(i)<0),r.defocusedTargetIds=a},revert(t){const e=this.internal,{config:r,state:a,$el:o}=e,i=e.mapToTargetIds(t);o.svg.selectAll(e.selectorTargets(i)).classed(qe.focused,!1).classed(qe.defocused,!1),e.hasArcType(null,["polar"])&&e.unexpandArc(i),r.legend_show&&(e.showLegend(i.filter(e.isLegendToShow.bind(e))),o.legend.selectAll(e.selectorLegends(i)).filter(function(){return it(this).classed(qe.legendItemFocused)}).classed(qe.legendItemFocused,!1)),a.focusedTargetIds=[],a.defocusedTargetIds=[]}},zm={legend:{show:function(t){const e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},hide:function(t){const e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})}}},jm={load(t){const e=this.internal,{config:r}=e;t.xs&&e.addXs(t.xs),"names"in t&&this.data.names(t.names),"classes"in t&&Object.keys(t.classes).forEach(a=>{r.data_classes[a]=t.classes[a]}),"categories"in t&&e.axis.isCategorized()&&(r.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(a=>{r.data_axes[a]=t.axes[a]}),"colors"in t&&Object.keys(t.colors).forEach(a=>{r.data_colors[a]=t.colors[a]}),"unload"in t&&t.unload!==!1?e.unload(e.mapToTargetIds(t.unload===!0?null:t.unload),()=>{Vl(()=>e.loadFromArgs(t))}):e.loadFromArgs(t)},unload(t){const e=this.internal;let r=t||{};Yn(r)&&this.tooltip.hide(),Ge(r)?r={ids:r}:Ue(r)&&(r={ids:[r]});const a=e.mapToTargetIds(r.ids);e.unload(a,()=>{e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.cache.remove(a),hc.call(e,r.done,r.resizeAfter)})}};function fu(t,e,r){const a=this.internal,o=a.mapToTargetIds(e),i=a.state.hiddenTargetIds.map(c=>o.indexOf(c)>-1&&c).filter(Boolean);a.state.toggling=!0,a[`${t?"remove":"add"}HiddenTargetIds`](o);const s=a.$el.svg.selectAll(a.selectorTargets(o)),l=t?null:"0";t&&i.length&&(s.style("display",null),_e(a.config.data_onshown,this,i)),a.$T(s).style("opacity",l,"important").call(bo,()=>{var c;!t&&i.length===0&&(s.style("display","none"),_e((c=a.config)==null?void 0:c.data_onhidden,this,o)),s.style("opacity",l)}),r.withLegend&&a[`${t?"show":"hide"}Legend`](o),a.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.state.toggling=!1}var Gm={show(t,e={}){fu.call(this,!0,t,e)},hide(t,e={}){fu.call(this,!1,t,e)},toggle(t,e={}){const r=this.internal,a={show:[],hide:[]};r.mapToTargetIds(t).forEach(o=>a[r.isTargetToShow(o)?"hide":"show"].push(o)),a.show.length&&this.show(a.show,e),a.hide.length&&setTimeout(()=>this.hide(a.hide,e),0)}},Vm={tooltip:{show:function(t){var e,r,a;const o=this.internal,{$el:i,config:s,state:{eventReceiver:l,hasFunnel:c,hasTreemap:f,inputType:g}}=o;let p,m;if(t.mouse&&(m=t.mouse),t.data){const{data:E}=t,w=(e=o.getYScaleById(E.id))==null?void 0:e(E.value);if((c||f)&&E.id){const U=o.selectorTarget(E.id,void 0,`.${sn.shape}`);l.rect=i.main.select(U)}else o.isMultipleX()?m=[o.xx(E),w]:(s.tooltip_grouped||(m=[0,w]),p=(a=E.index)!=null?a:o.hasArcType()&&E.id?(r=o.getArcElementByIdOrIndex(E.id))==null?void 0:r.datum().index:o.getIndexByX(E.x))}else Qe(t.x)?p=o.getIndexByX(t.x):Qe(t.index)&&(p=t.index);(g==="mouse"?["mouseover","mousemove"]:["touchstart"]).forEach(E=>{o.dispatchEvent(E,p,m)})},hide:function(){var t,e,r;const a=this.internal,{state:{inputType:o},$el:{tooltip:i}}=a,s=i==null?void 0:i.datum();if(s){const{index:l}=JSON.parse(s.current)[0];(o==="mouse"?["mouseout"]:["touchend"]).forEach(c=>{a.dispatchEvent(c,l)})}o==="touch"&&a.callOverOutForTouch(),a.hideTooltip(!0),(t=a.hideGridFocus)==null||t.call(a),(e=a.unexpandCircles)==null||e.call(a),(r=a.expandBarTypeShapes)==null||r.call(a,!1)}}},Xm=Object.defineProperty,Hm=(t,e,r)=>e in t?Xm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,du=(t,e,r)=>Hm(t,typeof e!="symbol"?e+"":e,r);class br{constructor(e){du(this,"plugins",[]),du(this,"internal");const r=new Vr(this);this.internal=r,(function a(o,i,s){Object.keys(o).forEach(l=>{const c=he(o[l]),f=i!==s,g=cn(o[l]),p=g&&Object.keys(o[l]).length>0;c&&(!f&&p||f)?i[l]=o[l].bind(s):g&&!c?i[l]={}:i[l]=o[l],p&&a(o[l],i[l],s)})})(br.prototype,this,this),Om.call(r,e),r.beforeInit(),r.init()}}Sn(br.prototype,[Cm,Pm,Mm,Bm,Um,zm,jm,Gm,Vm]);function hu(t=!1,e,r,a){const o=this,{config:i,$el:{main:s}}=o,l=i.data_selection_grouped,c=i.data_selection_isselectable.bind(o.api);i.data_selection_enabled&&s.selectAll(`.${sn.shapes}`).selectAll(`.${sn.shape}`).each(function(f){const g=it(this),{id:p,index:m}=f.data?f.data:f,E=o.getToggle(this,f).bind(o),w=l||!e||e.indexOf(p)>=0,U=!r||r.indexOf(m)>=0,N=g.classed(tn.SELECTED);g.classed(dr.line)||g.classed(no.area)||(t?w&&U&&c(f)&&!N?E(!0,g.classed(tn.SELECTED,!0),f,m):Qe(a)&&a&&N&&E(!1,g.classed(tn.SELECTED,!1),f,m):w&&U&&c(f)&&N&&E(!1,g.classed(tn.SELECTED,!1),f,m))})}var Wm={selected(t){const e=this.internal,r=[];return e.$el.main.selectAll(`.${sn.shapes+e.getTargetSelectorSuffix(t)}`).selectAll(`.${sn.shape}`).filter(function(){return it(this).classed(tn.SELECTED)}).each(a=>r.push(a)),r},select(t,e,r){const a=this.internal;hu.bind(a)(!0,t,e,r)},unselect(t,e){const r=this.internal;hu.bind(r)(!1,t,e)}};const vu=function(t){var e;const r=this.internal,{axis:a,brush:o,config:i,scale:{x:s,subX:l},state:c}=r;let f;return i.subchart_show&&(f=t,Array.isArray(f)?(a.isTimeSeries()&&(f=f.map(p=>Zn.bind(r)(p))),r.withinRange(f,r.getZoomDomain("subX",!0),r.getZoomDomain("subX"))&&(c.domain=f,o.move(o.getSelection(),f.map(l)))):f=(e=c.domain)!=null?e:s.orgDomain()),f};Sn(vu,{show(){var t,e;const r=this.internal,{$el:{subchart:a},config:o}=r,i=o.subchart_show;if(!i){r.unbindZoomEvent(),o.subchart_show=!i,!a.main&&r.initSubchart();let s=a.main.selectAll(`.${Se.target}`);r.data.targets.length!==s.size()&&(r.updateSizes(),r.updateTargetsForSubchart(r.data.targets),s=(t=a.main)==null?void 0:t.selectAll(`.${Se.target}`)),s==null||s.style("opacity",null),(e=a.main)==null||e.style("display",null),this.resize()}},hide(){const t=this.internal,{$el:{subchart:{main:e}},config:r}=t;r.subchart_show&&(e==null?void 0:e.style("display"))!=="none"&&(r.subchart_show=!1,e.style("display","none"),this.resize())},toggle(){const t=this.internal,{config:e}=t;this.subchart[e.subchart_show?"hide":"show"]()},reset(){const t=this.internal,{brush:e}=t;e.clear(e.getSelection())}});var Ym={subchart:vu},Km=1e-12;function gu(t){return((t=Math.exp(t))+1/t)/2}function Zm(t){return((t=Math.exp(t))-1/t)/2}function Jm(t){return((t=Math.exp(2*t))-1)/(t+1)}var Qm=(function t(e,r,a){function o(i,s){var l=i[0],c=i[1],f=i[2],g=s[0],p=s[1],m=s[2],E=g-l,w=p-c,U=E*E+w*w,N,D;if(U<Km)D=Math.log(m/f)/e,N=function(ot){return[l+ot*E,c+ot*w,f*Math.exp(e*ot*D)]};else{var Y=Math.sqrt(U),J=(m*m-f*f+a*U)/(2*f*r*Y),K=(m*m-f*f-a*U)/(2*m*r*Y),nt=Math.log(Math.sqrt(J*J+1)-J),Q=Math.log(Math.sqrt(K*K+1)-K);D=(Q-nt)/e,N=function(ot){var pt=ot*D,Tt=gu(nt),yt=f/(r*Y)*(Tt*Jm(e*pt+nt)-Zm(nt));return[l+yt*E,c+yt*w,f*Tt/gu(e*pt+nt)]}}return N.duration=D*1e3*e/Math.SQRT2,N}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,c=l*l;return t(s,l,c)},o})(Math.SQRT2,2,4),Ho=(t=>()=>t);function km(t,{sourceEvent:e,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function pr(t,e,r){this.k=t,this.x=e,this.y=r}pr.prototype={constructor:pr,scale:function(t){return t===1?this:new pr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new pr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ir=new pr(1,0,0);ms.prototype=pr.prototype;function ms(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ir;return t.__zoom}function ys(t){t.stopImmediatePropagation()}function za(t){t.preventDefault(),t.stopImmediatePropagation()}function qm(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function _m(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function pu(){return this.__zoom||ir}function ty(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ey(){return navigator.maxTouchPoints||"ontouchstart"in this}function ny(t,e,r){var a=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],s=t.invertY(e[1][1])-r[1][1];return t.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ry(){var t=qm,e=_m,r=ny,a=ty,o=ey,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Qm,f=oo("start","zoom","end"),g,p,m,E=500,w=150,U=0,N=10;function D(tt){tt.property("__zoom",pu).on("wheel.zoom",pt,{passive:!1}).on("mousedown.zoom",Tt).on("dblclick.zoom",yt).filter(o).on("touchstart.zoom",lt).on("touchmove.zoom",jt).on("touchend.zoom touchcancel.zoom",vt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(tt,St,ct,At){var Wt=tt.selection?tt.selection():tt;Wt.property("__zoom",pu),tt!==Wt?nt(tt,St,ct,At):Wt.interrupt().each(function(){Q(this,arguments).event(At).start().zoom(null,typeof St=="function"?St.apply(this,arguments):St).end()})},D.scaleBy=function(tt,St,ct,At){D.scaleTo(tt,function(){var Wt=this.__zoom.k,Dt=typeof St=="function"?St.apply(this,arguments):St;return Wt*Dt},ct,At)},D.scaleTo=function(tt,St,ct,At){D.transform(tt,function(){var Wt=e.apply(this,arguments),Dt=this.__zoom,Zt=ct==null?K(Wt):typeof ct=="function"?ct.apply(this,arguments):ct,re=Dt.invert(Zt),ce=typeof St=="function"?St.apply(this,arguments):St;return r(J(Y(Dt,ce),Zt,re),Wt,s)},ct,At)},D.translateBy=function(tt,St,ct,At){D.transform(tt,function(){return r(this.__zoom.translate(typeof St=="function"?St.apply(this,arguments):St,typeof ct=="function"?ct.apply(this,arguments):ct),e.apply(this,arguments),s)},null,At)},D.translateTo=function(tt,St,ct,At,Wt){D.transform(tt,function(){var Dt=e.apply(this,arguments),Zt=this.__zoom,re=At==null?K(Dt):typeof At=="function"?At.apply(this,arguments):At;return r(ir.translate(re[0],re[1]).scale(Zt.k).translate(typeof St=="function"?-St.apply(this,arguments):-St,typeof ct=="function"?-ct.apply(this,arguments):-ct),Dt,s)},At,Wt)};function Y(tt,St){return St=Math.max(i[0],Math.min(i[1],St)),St===tt.k?tt:new pr(St,tt.x,tt.y)}function J(tt,St,ct){var At=St[0]-ct[0]*tt.k,Wt=St[1]-ct[1]*tt.k;return At===tt.x&&Wt===tt.y?tt:new pr(tt.k,At,Wt)}function K(tt){return[(+tt[0][0]+ +tt[1][0])/2,(+tt[0][1]+ +tt[1][1])/2]}function nt(tt,St,ct,At){tt.on("start.zoom",function(){Q(this,arguments).event(At).start()}).on("interrupt.zoom end.zoom",function(){Q(this,arguments).event(At).end()}).tween("zoom",function(){var Wt=this,Dt=arguments,Zt=Q(Wt,Dt).event(At),re=e.apply(Wt,Dt),ce=ct==null?K(re):typeof ct=="function"?ct.apply(Wt,Dt):ct,Ie=Math.max(re[1][0]-re[0][0],re[1][1]-re[0][1]),Ce=Wt.__zoom,Pe=typeof St=="function"?St.apply(Wt,Dt):St,Ye=c(Ce.invert(ce).concat(Ie/Ce.k),Pe.invert(ce).concat(Ie/Pe.k));return function(Be){if(Be===1)Be=Pe;else{var dn=Ye(Be),kt=Ie/dn[2];Be=new pr(kt,ce[0]-dn[0]*kt,ce[1]-dn[1]*kt)}Zt.zoom(null,Be)}})}function Q(tt,St,ct){return!ct&&tt.__zooming||new ot(tt,St)}function ot(tt,St){this.that=tt,this.args=St,this.active=0,this.sourceEvent=null,this.extent=e.apply(tt,St),this.taps=0}ot.prototype={event:function(tt){return tt&&(this.sourceEvent=tt),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(tt,St){return this.mouse&&tt!=="mouse"&&(this.mouse[1]=St.invert(this.mouse[0])),this.touch0&&tt!=="touch"&&(this.touch0[1]=St.invert(this.touch0[0])),this.touch1&&tt!=="touch"&&(this.touch1[1]=St.invert(this.touch1[0])),this.that.__zoom=St,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(tt){var St=it(this.that).datum();f.call(tt,this.that,new km(tt,{sourceEvent:this.sourceEvent,target:D,type:tt,transform:this.that.__zoom,dispatch:f}),St)}};function pt(tt,...St){if(!t.apply(this,arguments))return;var ct=Q(this,St).event(tt),At=this.__zoom,Wt=Math.max(i[0],Math.min(i[1],At.k*Math.pow(2,a.apply(this,arguments)))),Dt=Wn(tt);if(ct.wheel)(ct.mouse[0][0]!==Dt[0]||ct.mouse[0][1]!==Dt[1])&&(ct.mouse[1]=At.invert(ct.mouse[0]=Dt)),clearTimeout(ct.wheel);else{if(At.k===Wt)return;ct.mouse=[Dt,At.invert(Dt)],_r(this),ct.start()}za(tt),ct.wheel=setTimeout(Zt,w),ct.zoom("mouse",r(J(Y(At,Wt),ct.mouse[0],ct.mouse[1]),ct.extent,s));function Zt(){ct.wheel=null,ct.end()}}function Tt(tt,...St){if(m||!t.apply(this,arguments))return;var ct=tt.currentTarget,At=Q(this,St,!0).event(tt),Wt=it(tt.view).on("mousemove.zoom",ce,!0).on("mouseup.zoom",Ie,!0),Dt=Wn(tt,ct),Zt=tt.clientX,re=tt.clientY;di(tt.view),ys(tt),At.mouse=[Dt,this.__zoom.invert(Dt)],_r(this),At.start();function ce(Ce){if(za(Ce),!At.moved){var Pe=Ce.clientX-Zt,Ye=Ce.clientY-re;At.moved=Pe*Pe+Ye*Ye>U}At.event(Ce).zoom("mouse",r(J(At.that.__zoom,At.mouse[0]=Wn(Ce,ct),At.mouse[1]),At.extent,s))}function Ie(Ce){Wt.on("mousemove.zoom mouseup.zoom",null),hi(Ce.view,At.moved),za(Ce),At.event(Ce).end()}}function yt(tt,...St){if(t.apply(this,arguments)){var ct=this.__zoom,At=Wn(tt.changedTouches?tt.changedTouches[0]:tt,this),Wt=ct.invert(At),Dt=ct.k*(tt.shiftKey?.5:2),Zt=r(J(Y(ct,Dt),At,Wt),e.apply(this,St),s);za(tt),l>0?it(this).transition().duration(l).call(nt,Zt,At,tt):it(this).call(D.transform,Zt,At,tt)}}function lt(tt,...St){if(t.apply(this,arguments)){var ct=tt.touches,At=ct.length,Wt=Q(this,St,tt.changedTouches.length===At).event(tt),Dt,Zt,re,ce;for(ys(tt),Zt=0;Zt<At;++Zt)re=ct[Zt],ce=Wn(re,this),ce=[ce,this.__zoom.invert(ce),re.identifier],Wt.touch0?!Wt.touch1&&Wt.touch0[2]!==ce[2]&&(Wt.touch1=ce,Wt.taps=0):(Wt.touch0=ce,Dt=!0,Wt.taps=1+!!g);g&&(g=clearTimeout(g)),Dt&&(Wt.taps<2&&(p=ce[0],g=setTimeout(function(){g=null},E)),_r(this),Wt.start())}}function jt(tt,...St){if(this.__zooming){var ct=Q(this,St).event(tt),At=tt.changedTouches,Wt=At.length,Dt,Zt,re,ce;for(za(tt),Dt=0;Dt<Wt;++Dt)Zt=At[Dt],re=Wn(Zt,this),ct.touch0&&ct.touch0[2]===Zt.identifier?ct.touch0[0]=re:ct.touch1&&ct.touch1[2]===Zt.identifier&&(ct.touch1[0]=re);if(Zt=ct.that.__zoom,ct.touch1){var Ie=ct.touch0[0],Ce=ct.touch0[1],Pe=ct.touch1[0],Ye=ct.touch1[1],Be=(Be=Pe[0]-Ie[0])*Be+(Be=Pe[1]-Ie[1])*Be,dn=(dn=Ye[0]-Ce[0])*dn+(dn=Ye[1]-Ce[1])*dn;Zt=Y(Zt,Math.sqrt(Be/dn)),re=[(Ie[0]+Pe[0])/2,(Ie[1]+Pe[1])/2],ce=[(Ce[0]+Ye[0])/2,(Ce[1]+Ye[1])/2]}else if(ct.touch0)re=ct.touch0[0],ce=ct.touch0[1];else return;ct.zoom("touch",r(J(Zt,re,ce),ct.extent,s))}}function vt(tt,...St){if(this.__zooming){var ct=Q(this,St).event(tt),At=tt.changedTouches,Wt=At.length,Dt,Zt;for(ys(tt),m&&clearTimeout(m),m=setTimeout(function(){m=null},E),Dt=0;Dt<Wt;++Dt)Zt=At[Dt],ct.touch0&&ct.touch0[2]===Zt.identifier?delete ct.touch0:ct.touch1&&ct.touch1[2]===Zt.identifier&&delete ct.touch1;if(ct.touch1&&!ct.touch0&&(ct.touch0=ct.touch1,delete ct.touch1),ct.touch0)ct.touch0[1]=this.__zoom.invert(ct.touch0[0]);else if(ct.end(),ct.taps===2&&(Zt=Wn(Zt,this),Math.hypot(p[0]-Zt[0],p[1]-Zt[1])<N)){var re=it(this).on("dblclick.zoom");re&&re.apply(this,arguments)}}}return D.wheelDelta=function(tt){return arguments.length?(a=typeof tt=="function"?tt:Ho(+tt),D):a},D.filter=function(tt){return arguments.length?(t=typeof tt=="function"?tt:Ho(!!tt),D):t},D.touchable=function(tt){return arguments.length?(o=typeof tt=="function"?tt:Ho(!!tt),D):o},D.extent=function(tt){return arguments.length?(e=typeof tt=="function"?tt:Ho([[+tt[0][0],+tt[0][1]],[+tt[1][0],+tt[1][1]]]),D):e},D.scaleExtent=function(tt){return arguments.length?(i[0]=+tt[0],i[1]=+tt[1],D):[i[0],i[1]]},D.translateExtent=function(tt){return arguments.length?(s[0][0]=+tt[0][0],s[1][0]=+tt[1][0],s[0][1]=+tt[0][1],s[1][1]=+tt[1][1],D):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},D.constrain=function(tt){return arguments.length?(r=tt,D):r},D.duration=function(tt){return arguments.length?(l=+tt,D):l},D.interpolate=function(tt){return arguments.length?(c=tt,D):c},D.on=function(){var tt=f.on.apply(f,arguments);return tt===f?D:tt},D.clickDistance=function(tt){return arguments.length?(U=(tt=+tt)*tt,D):Math.sqrt(U)},D.tapDistance=function(tt){return arguments.length?(N=+tt,D):N},D}const mu=function(t){var e;const r=this.internal,{axis:a,config:o,org:i,scale:s,state:l}=r,c=a.isCategorized();let f;if(o.zoom_enabled)if(f=t,Array.isArray(f)){if(a.isTimeSeries()&&(f=f.map(p=>Zn.bind(r)(p))),r.withinRange(f,r.getZoomDomain("zoom",!0),r.getZoomDomain("zoom"))){if(l.domain=f,f=r.getZoomDomainValue(f),r.api.tooltip.hide(),o.subchart_show){const p=s.zoom||s.x;r.brush.getSelection().call(r.brush.move,f.map(p))}else{const p=c?s.x.orgScale():i.xScale||s.x;r.updateCurrentZoomTransform(p,f)}r.setZoomResetButton()}}else f=r.zoom.getDomain();return(e=l.domain)!=null?e:f};Sn(mu,{enable(t){const e=this.internal,{config:r}=e;/^(drag|wheel)$/.test(t)&&(r.zoom_type=t),r.zoom_enabled=!!t,e.zoom?t===!1&&e.bindZoomEvent(!1):(e.initZoom(),e.bindZoomEvent()),e.updateAndRedraw()},max(t){const e=this.internal,{config:r,org:{xDomain:a}}=e;return(t===0||t)&&(r.zoom_x_max=tr("max",[a[1],t])),r.zoom_x_max},min(t){const e=this.internal,{config:r,org:{xDomain:a}}=e;return(t===0||t)&&(r.zoom_x_min=tr("min",[a[0],t])),r.zoom_x_min},range(t){const e=this.zoom;if(ze(t)){const{min:r,max:a}=t;Qe(r)&&e.min(r),Qe(a)&&e.max(a)}return{min:e.min(),max:e.max()}}});var ay={zoom:mu,unzoom(){const t=this.internal,{config:e,$el:{eventRect:r,zoomResetBtn:a},scale:{zoom:o},state:i}=t;o&&(e.subchart_show?t.brush.getSelection().call(t.brush.move,null):t.zoom.updateTransformScale(ir),t.updateZoom(!0),a==null||a.style("display","none"),ms(r.node())!==ir&&t.zoom.transform(r,ir),i.domain=void 0)}},oy={initBrush(){const t=this,{config:e,scale:r,$el:{subchart:a},state:o}=t,i=e.axis_rotated,s=e.subchart_size_height;let l,c,f;t.brush=(i?Jv():Zv()).handleSize(5),t.brush.on("start brush end",g=>{const{selection:p,sourceEvent:m,target:E,type:w}=g;w==="start"&&(t.state.inputType==="touch"&&t.hideTooltip(),c=m?p:null),/(start|brush)/.test(w)&&(w==="brush"&&m&&o.domain&&(c==null||c.forEach((U,N)=>{U!==p[N]&&(o.domain[N]=r.x.orgDomain()[N])})),t.redrawForBrush(w!=="start")),w==="end"&&(l=r.x.orgDomain()),E!=null&&E.handle&&(p===null?t.brush.handle.attr("display","none"):t.brush.handle.attr("display",null).attr("transform",(U,N)=>{const D=[p[N],s/2];return`translate(${i?D.reverse():D})`}))}),t.brush.updateResize=function(){f&&clearTimeout(f),f=setTimeout(()=>{const g=this.getSelection();l&&Gl(g.node())&&this.move(g,l.map(r.subX.orgScale()))},0)},t.brush.update=function(){var g;return this.extent()()[1].filter(m=>isNaN(m)).length===0&&((g=a.main)==null||g.select(`.${je.brush}`).call(this)),this},t.brush.scale=function(g){const p=e.subchart_size_height;let m=t.axis.getExtent();!m&&g.range?m=[[0,0],[g.range()[1],p]]:Ge(m)&&(m=m.map((E,w)=>[E,w>0?p:w])),i&&m[1].reverse(),this.extent(m),this.update()},t.brush.getSelection=()=>a.main?a.main.select(`.${je.brush}`):it([])},initSubchart(){const t=this,{config:e,state:{clip:r,hasAxis:a},$el:{defs:o,svg:i,subchart:s,axis:l}}=t;if(!a)return;const c=e.subchart_show?null:"hidden",f=`${r.id}-subchart`,g=t.getClipPath(f);r.idSubchart=f,t.appendClip(o,f),t.initBrush(),s.main=i.append("g").classed(je.subchart,!0).attr("transform",t.getTranslate("context"));const{main:p}=s;p.style("visibility",c),p.append("g").attr("clip-path",g).attr("class",je.chart),["bar","line","bubble","candlestick","scatter"].forEach(E=>{const w=In(/^(bubble|scatter)$/.test(E)?"circle":E);if(t.hasType(E)||t.hasTypeOf(w)){const U=p.select(`.${je.chart}`),N=je[`chart${w}s`];U.select(`.${N}`).empty()&&U.append("g").attr("class",N)}});const m=p.append("g").attr("clip-path",g).attr("class",je.brush).call(t.brush);e.subchart_showHandle&&t.addBrushHandle(m),l.subX=p.append("g").attr("class",je.axisX).attr("transform",t.getTranslate("subX")).attr("clip-path",e.axis_rotated?"":r.pathXAxis).style("visibility",e.subchart_axis_x_show?c:"hidden")},addBrushHandle(t){const e=this,{config:r}=e,a=r.axis_rotated,o=r.subchart_init_range,i="handle--custom",s=a?["M8.5 0 a6 6 0 0 0 -6 -6.5 H-2.5 a 6 6 0 0 0 -6 6.5 z m-5 -2 H-3.5 m7 -2 H-3.5z","M8.5 0 a6 -6 0 0 1 -6 6.5 H-2.5 a 6 -6 0 0 1 -6 -6.5z m-5 2 H-3.5 m7 2 H-3.5z"]:["M0 -8.5 A6 6 0 0 0 -6.5 -3.5 V2.5 A6 6 0 0 0 0 8.5 Z M-2 -3.5 V3.5 M-4 -3.5 V3.5z","M0 -8.5 A6 6 0 0 1 6.5 -3.5 V2.5 A6 6 0 0 1 0 8.5 Z M2 -3.5 V3.5 M4 -3.5 V3.5z"];e.brush.handle=t.selectAll(`.${i}`).data(a?[{type:"n"},{type:"s"}]:[{type:"w"},{type:"e"}]).enter().append("path").attr("class",i).attr("cursor",`${a?"ns":"ew"}-resize`).attr("d",l=>s[+/[se]/.test(l.type)]).attr("display",o?null:"none")},updateTargetsForSubchart(t){const e=this,{config:r,state:a,$el:{subchart:{main:o}}}=e;r.subchart_show&&(["bar","line","bubble","candlestick","scatter"].filter(i=>e.hasType(i)||e.hasTypeOf(In(i))).forEach(i=>{const s=/^(bubble|scatter)$/.test(i),l=In(s?"circle":i),c=e.getChartClass(l,!0),f=e.getClass(s?"circles":`${i}s`,!0),g=o.select(`.${je[`chart${`${l}s`}`]}`);if(s){const p=g.selectAll(`.${je.circles}`).data(t.filter(e[`is${In(i)}Type`].bind(e))).attr("class",f);p.exit().remove(),p.enter().append("g").attr("class",f)}else{const p=g.selectAll(`.${je[`chart${l}`]}`).attr("class",c).data(t.filter(e[`is${l}Type`].bind(e))),m=p.enter().append("g").style("opacity","0").attr("class",c).append("g").attr("class",f);p.exit().remove(),i==="line"&&e.hasTypeOf("Area")&&m.append("g").attr("class",e.getClass("areas",!0))}}),o.selectAll(`.${je.brush} rect`).attr(r.axis_rotated?"width":"height",r.axis_rotated?a.width2:a.height2))},redrawSubchart(t,e,r){var a;const o=this,{config:i,$el:{subchart:{main:s}},state:l}=o,c=!!e;if(s.style("visibility",i.subchart_show?null:"hidden"),i.subchart_show&&(((a=l.event)==null?void 0:a.type)==="zoom"&&o.brush.update(),t)){const f=i.subchart_init_range;if(!Ql(o)&&o.brush.update(),Object.keys(r.type).forEach(g=>{const p=In(g),m=o[`generateDraw${p}`](r.indices[g],!0);o[`update${p}`](c,!0),o[`redraw${p}`](m,c,!0)}),o.hasType("bubble")||o.hasType("scatter")){const{cx:g}=r.pos,p=o.updateCircleY(!0);o.updateCircle(!0),o.redrawCircle(g,p,c,void 0,!0)}!l.rendered&&f&&(l.domain=f,o.brush.move(o.brush.getSelection(),f.map(o.scale.x)))}},redrawForBrush(t=!0){var e;const r=this,{config:{subchart_onbrush:a,zoom_rescale:o},scale:i,state:s}=r;r.redraw({withTransition:!1,withY:o,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),t&&s.rendered&&a.bind(r.api)((e=s.domain)!=null?e:i.x.orgDomain())},transformContext(t,e){const r=this,{$el:{subchart:a},$T:o}=r,i=e!=null&&e.axisSubX?e.axisSubX:o(a.main.select(`.${je.axisX}`),t);a.main.attr("transform",r.getTranslate("context")),i.attr("transform",r.getTranslate("subX"))}},iy={initZoom(){const t=this;t.scale.zoom=null,t.generateZoom(),t.config.zoom_type==="drag"&&t.initZoomBehaviour()},bindZoomEvent(t=!0){const e=this,{config:r}=e;r.zoom_enabled&&t?!r.subchart_show&&e.bindZoomOnEventRect():t===!1&&(e.api.unzoom(),e.unbindZoomEvent())},generateZoom(){const t=this,{config:e,org:r,scale:a}=t,o=ry().duration(0).on("start",t.onZoomStart.bind(t)).on("zoom",t.onZoom.bind(t)).on("end",t.onZoomEnd.bind(t));o.orgScaleExtent=()=>{const i=e.zoom_extent||[1,10];return[i[0],Math.max(t.getMaxDataCount()/i[1],i[1])]},o.updateScaleExtent=function(){const i=Nr(t.scale.x.orgDomain())/Nr(t.getZoomDomain()),s=this.orgScaleExtent();return this.scaleExtent([s[0]*i,s[1]*i]),this},o.updateTransformScale=(i,s)=>{var l;const c=e.axis_rotated;(l=r.xScale)==null||l.range(a.x.range());const f=i[c?"rescaleY":"rescaleX"](r.xScale||a.x);if(f.domain().some(m=>/(Invalid Date|NaN)/.test(m.toString())))return;const g=t.trimXDomain(f.domain()),p=e.zoom_rescale;if(f.domain(g,r.xDomain),s){const m=f(a.x.domain()[0]),E=c?i.x:m,w=c?m:i.y;t.$el.eventRect.property("__zoom",ir.translate(E,w).scale(i.k))}t.state.xTickOffset||(t.state.xTickOffset=t.axis.x.tickOffset()),a.zoom=t.getCustomizedXScale(f),t.axis.x.scale(a.zoom),p?(!r.xScale&&(r.xScale=a.x.copy()),a.x.domain(g)):r.xScale&&(a.x.domain(r.xScale.domain()),r.xScale=null)},o.getDomain=()=>{const i=a[a.zoom?"zoom":"subX"].domain();return t.axis.isCategorized()&&(i[1]-=2),i},t.zoom=o},onZoomStart(t){const e=this,{sourceEvent:r}=t;r&&(e.zoom.startEvent=r,e.state.zooming=!0,_e(e.config.zoom_onzoomstart,e.api,t))},onZoom(t){var e;const r=this,{config:a,scale:o,state:i,org:s}=r,{sourceEvent:l}=t,c=(t==null?void 0:t.transform)===ir;if(!a.zoom_enabled||r.filterTargetsToShow(r.data.targets).length===0||!o.zoom&&(l==null?void 0:l.type.indexOf("touch"))>-1&&(l==null?void 0:l.touches.length)===1)return;t.sourceEvent&&(i.zooming=!0,i.domain=void 0);const f=(l==null?void 0:l.type)==="mousemove",g=(l==null?void 0:l.wheelDelta)<0,{transform:p}=t;!f&&g&&o.x.domain().every((E,w)=>E!==s.xDomain[w])&&o.x.domain(s.xDomain),r.zoom.updateTransformScale(p,a.zoom_type==="wheel"&&l);const m=a.transition_duration>0&&!a.subchart_show&&(i.dragging||c||!t.sourceEvent);r.redraw({withTransition:m,withY:a.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),r.state.cancelClick=f,!c&&_e(a.zoom_onzoom,r.api,(e=r.state.domain)!=null?e:r.zoom.getDomain())},onZoomEnd(t){var e,r;const a=this,{config:o,state:i}=a;let{startEvent:s}=a.zoom,l=t==null?void 0:t.sourceEvent;const c=(t==null?void 0:t.transform)===ir;(s==null?void 0:s.type.indexOf("touch"))>-1&&(s=s.changedTouches[0],l=(e=l==null?void 0:l.changedTouches)==null?void 0:e[0]),!(o.zoom_type==="drag"&&l&&s.clientX===l.clientX&&s.clientY===l.clientY)&&(i.zooming=!1,a.redrawEventRect(),a.updateZoom(),!c&&(l||i.dragging)&&_e(o.zoom_onzoomend,a.api,(r=a.state.domain)!=null?r:a.zoom.getDomain()))},updateZoom(t){const e=this,{subX:r,x:a,zoom:o}=e.scale;if(o){const i=o.domain(),s=r.domain(),l=.015,c=e.config.axis_x_inverted?(i[0]>=s[0]||i[0]+l>=s[0])&&(s[1]>=i[1]||s[1]>=i[1]+l):(i[0]<=s[0]||i[0]-l<=s[0])&&(s[1]<=i[1]||s[1]<=i[1]-l);(t||c)&&(e.axis.x.scale(r),a.domain(r.orgDomain()),e.scale.zoom=null)}},updateCurrentZoomTransform(t,e){const r=this,{$el:{eventRect:a},config:o}=r,i=o.axis_rotated,s=[-t(e[0]),0],l=ir.scale(t.range()[1]/(t(e[1])-t(e[0]))).translate(...i?s.reverse():s);a.call(r.zoom.transform,l)},bindZoomOnEventRect(){var t;const e=this,{config:r,$el:{eventRect:a,svg:o}}=e,i=r.zoom_type==="drag"?e.zoomBehaviour:e.zoom;Ze.GestureEvent&&/^((?!chrome|android|mobile).)*safari/i.test((t=Ze.navigator)==null?void 0:t.userAgent)&&o.on("wheel",()=>{}),a==null||a.call(i).on("dblclick.zoom",null)},initZoomBehaviour(){const t=this,{config:e,state:r}=t,a=e.axis_rotated;let o=0,i=0,s,l;const c={axis:a?"y":"x",attr:a?"height":"width",index:a?1:0};t.zoomBehaviour=vc().clickDistance(4).on("start",function(f){l=t.scale.zoom?null:t.axis.getExtent(),r.event=f,t.setDragStatus(!0),t.unselectRect(),s||(s=t.$el.main.append("rect").attr("clip-path",r.clip.path).attr("class",ui.zoomBrush).attr("width",a?r.width:0).attr("height",a?0:r.height)),o=Kn(f,this)[c.index],l&&(o<l[0]?o=l[0]:o>l[1]&&(o=l[1])),i=o,s.attr(c.axis,o).attr(c.attr,0),t.onZoomStart(f)}).on("drag",function(f){i=Kn(f,this)[c.index],l&&(i>l[1]?i=l[1]:i<l[0]&&(i=l[0])),s.attr(c.axis,Math.min(o,i)).attr(c.attr,Math.abs(i-o))}).on("end",f=>{const g=t.scale.zoom||t.scale.x;r.event=f,s.attr(c.axis,0).attr(c.attr,0),o>i&&([o,i]=[i,o]),o<0&&(i+=Math.abs(o),o=0),o!==i&&t.api.zoom([o,i].map(p=>g.invert(p))),t.setDragStatus(!1)})},setZoomResetButton(){const t=this,{config:e,$el:r}=t,a=e.zoom_resetButton;a&&e.zoom_type==="drag"&&(r.zoomResetBtn?r.zoomResetBtn.style("display",null):r.zoomResetBtn=t.$el.chart.append("div").classed(Se.button,!0).append("span").on("click",function(){he(a.onclick)&&a.onclick.bind(t.api)(this),t.api.unzoom()}).classed(ui.buttonZoomReset,!0).text(a.text||"Reset Zoom"))},getZoomTransform(){const t=this,{$el:{eventRect:e}}=t;return e!=null&&e.node()?ms(e.node()):{k:1}}},sy={drag(t){const e=this,{config:r,state:a,$el:{main:o}}=e,i=r.data_selection_grouped,s=r.interaction_enabled&&r.data_selection_isselectable;if(e.hasArcType()||!r.data_selection_enabled||r.zoom_enabled&&!e.zoom.altDomain||!r.data_selection_multiple)return;const[l,c]=a.dragStart||[0,0],[f,g]=t,p=Math.min(l,f),m=Math.max(l,f),E=i?a.margin.top:Math.min(c,g),w=i?a.height:Math.max(c,g);o.select(`.${Cr.dragarea}`).attr("x",p).attr("y",E).attr("width",m-p).attr("height",w-E),o.selectAll(`.${sn.shapes}`).selectAll(`.${sn.shape}`).filter(U=>s==null?void 0:s.bind(e.api)(U)).each(function(U,N){const D=it(this),Y=D.classed(tn.SELECTED),J=D.classed(Cr.INCLUDED);let K=!1,nt;if(D.classed(An.circle)){const Q=+D.attr("cx")*1,ot=+D.attr("cy")*1;nt=e.togglePoint,K=p<Q&&Q<m&&E<ot&&ot<w}else if(D.classed(zn.bar)){const{x:Q,y:ot,width:pt,height:Tt}=Kl(this);nt=e.togglePath,K=!(m<Q||Q+pt<p)&&!(w<ot||ot+Tt<E)}else return;K^J&&(D.classed(Cr.INCLUDED,!J),D.classed(tn.SELECTED,!Y),nt.call(e,!Y,D,U,N))})},dragstart(t){const e=this,{config:r,state:a,$el:{main:o}}=e;e.hasArcType()||!r.data_selection_enabled||(a.dragStart=t,o.select(`.${Se.chart}`).append("rect").attr("class",Cr.dragarea).style("opacity","0.1"),e.setDragStatus(!0))},dragend(){const t=this,{config:e,$el:{main:r},$T:a}=t;t.hasArcType()||!e.data_selection_enabled||(a(r.select(`.${Cr.dragarea}`)).style("opacity","0").remove(),r.selectAll(`.${sn.shape}`).classed(Cr.INCLUDED,!1),t.setDragStatus(!1))}},ly=Object.defineProperty,cy=Object.defineProperties,uy=Object.getOwnPropertyDescriptors,yu=Object.getOwnPropertySymbols,fy=Object.prototype.hasOwnProperty,dy=Object.prototype.propertyIsEnumerable,xu=(t,e,r)=>e in t?ly(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hy=(t,e)=>{for(var r in e||(e={}))fy.call(e,r)&&xu(t,r,e[r]);if(yu)for(var r of yu(e))dy.call(e,r)&&xu(t,r,e[r]);return t},vy=(t,e)=>cy(t,uy(e)),gy=vy(hy({},sy),{selectPoint(t,e,r){const a=this,{config:o,$el:{main:i},$T:s}=a,l=o.axis_rotated,c=(l?a.circleY:a.circleX).bind(a),f=(l?a.circleX:a.circleY).bind(a),g=a.pointSelectR.bind(a);_e(o.data_onselected,a.api,e,t.node()),s(i.select(`.${tn.selectedCircles}${a.getTargetSelectorSuffix(e.id)}`).selectAll(`.${tn.selectedCircle}-${r}`).data([e]).enter().append("circle").attr("class",()=>a.generateClass(tn.selectedCircle,r)).attr("cx",c).attr("cy",f).attr("stroke",a.color).attr("r",p=>a.pointSelectR(p)*1.4)).attr("r",g)},unselectPoint(t,e,r){const a=this,{config:o,$el:{main:i},$T:s}=a;_e(o.data_onunselected,a.api,e,t==null?void 0:t.node()),s(i.select(`.${tn.selectedCircles}${a.getTargetSelectorSuffix(e.id)}`).selectAll(`.${tn.selectedCircle}-${r}`)).attr("r",0).remove()},togglePoint(t,e,r,a){this[`${t?"":"un"}selectPoint`](e,r,a)},selectPath(t,e){const r=this,{config:a}=r;_e(a.data_onselected,r.api,e,t.node()),a.interaction_brighten&&t.style("filter","brightness(1.25)")},unselectPath(t,e){const r=this,{config:a}=r;_e(a.data_onunselected,r.api,e,t.node()),a.interaction_brighten&&t.style("filter",null)},togglePath(t,e,r,a){this[`${t?"":"un"}selectPath`](e,r,a)},getToggle(t,e){const r=this;return t.nodeName==="path"?r.togglePath:r.isStepType(e)?()=>{}:r.togglePoint},toggleShape(t,e,r){var a;const o=this,{config:i,$el:{main:s}}=o;if(i.data_selection_enabled&&i.data_selection_isselectable.bind(o.api)(e)){const l=it(t),c=l.classed(tn.SELECTED),f=o.getToggle(t,e).bind(o);let g;if(!i.data_selection_multiple){const p=(a=o.isPointFocusOnly)==null?void 0:a.call(o);let m=`.${p?tn.selectedCircles:sn.shapes}`;i.data_selection_grouped&&(m+=o.getTargetSelectorSuffix(e.id)),s.selectAll(m).selectAll(p?`.${tn.selectedCircle}`:`.${sn.shape}.${tn.SELECTED}`).classed(tn.SELECTED,!1).each(function(E){const w=it(this);g=w,f(!1,w,E,E.index)})}(!g||g.node()!==l.node())&&(l.classed(tn.SELECTED,!c),f(!c,l,e,r))}}}),py={data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:()=>!0,data_selection_multiple:!0,data_selection_draggable:!1,data_onselected:()=>{},data_onunselected:()=>{}},my={subchart_show:!1,subchart_showHandle:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_axis_x_tick_show:!0,subchart_axis_x_tick_format:void 0,subchart_axis_x_tick_text_show:!0,subchart_init_range:void 0,subchart_onbrush:()=>{}},yy={zoom_enabled:!1,zoom_type:"wheel",zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:void 0,zoom_onzoomstart:void 0,zoom_onzoomend:void 0,zoom_resetButton:!0,zoom_x_min:void 0,zoom_x_max:void 0};let Tu=()=>(Sn(Vr.prototype,gy),Sn(br.prototype,Wm),Fr.setOptions([py]),(Tu=()=>!0)()),Su=()=>(Sn(Vr.prototype,oy),Sn(br.prototype,Ym),Fr.setOptions([my]),(Su=()=>!0)()),$u=()=>(Sn(Vr.prototype,iy),Sn(br.prototype,ay),Fr.setOptions([yy]),($u=()=>!0)());function Au(t,e,r){const{config:a}=t,o=(i,s)=>{const l=pe(s)?s:s===!1?void 0:null;l!==null&&(a[`axis_${i}_${e}`]=l)};Qe(r)&&(rr(r)?Object.keys(r).forEach(i=>{o(i,r[i])}):(pe(r)||r===!1)&&["y","y2"].forEach(i=>{o(i,r)}),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function Eu(t,e){const{config:r}=t;return{x:r[`axis_x_${e}`],y:r[`axis_y_${e}`],y2:r[`axis_y2_${e}`]}}var xy={axis:{labels:function(t){const e=this.internal;let r;return t&&(Object.keys(t).forEach(a=>{e.axis.setLabelText(a,t[a])}),e.axis.updateLabels()),["x","y","y2"].forEach(a=>{const o=e.axis.getLabelText(a);o&&(!r&&(r={}),r[a]=o)}),r},min:function(t){const e=this.internal;return De(t)||t===!1?Au(e,"min",t):Eu(e,"min")},max:function(t){const e=this.internal;return De(t)||t===!1?Au(e,"max",t):Eu(e,"max")},range:function(t){const{axis:e}=this;if(arguments.length){const{min:r,max:a}=t;Qe(a)&&e.max(a),Qe(r)&&e.min(r)}else return{max:e.max(),min:e.min()}}}},Ty={category(t,e){const r=this.internal,{config:a}=r;return arguments.length>1&&(a.axis_x_categories[t]=e,r.redraw()),a.axis_x_categories[t]},categories(t){const e=this.internal,{config:r}=e;if(!t||!Array.isArray(t)){const a=r.axis_x_categories;return Yn(a)?Object.values(e.data.xs)[0]:a}return r.axis_x_categories=t,e.redraw(),r.axis_x_categories}},Sy={flow(t){const e=this.internal;let r;(t.json||t.rows||t.columns)&&e.convertData(t,o=>{r=o,a()});function a(){let o,i=0,s=0,l,c;if(e.state.redrawing||!r||!La())return;const f=[],g=e.getMaxDataCount(),p=e.convertDataToTargets(r,!0),m=e.axis.isTimeSeries();e.data.targets.forEach(U=>{let N=!1;for(let D=0;D<p.length;D++)if(U.id===p[D].id){N=!0,U.values[U.values.length-1]&&(s=U.values[U.values.length-1].index+1),i=p[D].values.length;for(let Y=0;Y<i;Y++)p[D].values[Y].index=s+Y,m||(p[D].values[Y].x=s+Y);U.values=U.values.concat(p[D].values),p.splice(D,1);break}!N&&f.push(U.id)}),e.data.targets.forEach(U=>{for(let N=0;N<f.length;N++)if(U.id===f[N]){s=U.values[U.values.length-1].index+1;for(let D=0;D<i;D++)U.values.push({id:U.id,index:s+D,x:m?e.getOtherTargetX(s+D):s+D,value:null})}}),e.data.targets.length&&p.forEach(U=>{const N=[];for(let D=e.data.targets[0].values[0].index;D<s;D++)N.push({id:U.id,index:D,x:m?e.getOtherTargetX(D):D,value:null});U.values.forEach(D=>{D.index+=s,m||(D.x+=s)}),U.values=N.concat(U.values)}),e.data.targets=e.data.targets.concat(p);const E=e.data.targets[0],w=E.values[0];Qe(t.to)?(i=0,c=m?Zn.call(e,t.to):t.to,E.values.forEach(U=>{U.x<c&&i++})):Qe(t.length)&&(i=t.length),g?g===1&&m&&(l=(E.values[E.values.length-1].x-w.x)/2,o=[new Date(+w.x-l),new Date(+w.x+l)]):(m?l=E.values.length>1?E.values[E.values.length-1].x-w.x:w.x-e.getXDomain(e.data.targets)[0]:l=1,o=[w.x-l,w.x]),o&&e.updateXDomain(null,!0,!0,!1,o),e.updateTargets(e.data.targets),e.redraw({flow:{index:w.index,length:i,duration:De(t.duration)?t.duration:e.config.transition_duration,done:t.done,orgDataCount:g},withLegend:!0,withTransition:g>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}};function xs(t,e){const r=this.internal,{config:a}=r,o=a.transition_duration&&La(),i=`grid_${e}_lines`;return t&&(a[i]=t,r.updateGrid(),r.redrawGrid(o)),a[i]}function bu(t,e){const r=`grid_${e}_lines`;return xs.bind(this)(this.internal.config[r].concat(t||[]),e)}function Iu(t,e){this.internal.removeGridLines(t,e)}const Ru=function(t){return xs.bind(this)(t,"x")};Sn(Ru,{add(t){return bu.bind(this)(t,"x")},remove(t){return Iu.bind(this)(t,!0)}});const Ou=function(t){return xs.bind(this)(t,"y")};Sn(Ou,{add(t){return bu.bind(this)(t,"y")},remove(t){return Iu.bind(this)(t,!1)}});var $y={xgrids:Ru,ygrids:Ou},Ay={groups(t){const e=this.internal,{config:r}=e;return ln(t)||(r.data_groups=t,e.redraw()),r.data_groups}};function Cu(t,e=!1){const r=this.internal,{config:a}=r,o=a.transition_duration&&La();return t?(a.regions=e?a.regions.concat(t):t,r.updateRegion(),r.redrawRegion(o),e?a.regions:t):a.regions}const Pu=function(t){return Cu.bind(this)(t)};Sn(Pu,{add:function(t){return Cu.bind(this)(t,!0)},remove:function(t){const e=this.internal,{config:r,$T:a}=e,o=t||{},i=$r(o,"classes",[Aa.region]);let s=e.$el.main.select(`.${Aa.regions}`).selectAll(i.map(l=>`.${l}`));return a(s).style("opacity","0").remove(),s=r.regions,Object.keys(o).length?(s=s.filter(l=>{let c=!1;return l.class?(l.class.split(" ").forEach(f=>{i.indexOf(f)>=0&&(c=!0)}),!c):!0}),r.regions=s):r.regions=[],s}});var Ey={regions:Pu},by={x(t){const e=this.internal,{axis:r,data:a}=e,o=r.isCustomX()&&r.isCategorized();return Ge(t)&&(o?this.categories(t):(e.updateTargetX(a.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),o?this.categories():a.xs},xs(t){const e=this.internal;return ze(t)&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}};function Iy(t){return t}var Wo=1,Yo=2,Ts=3,ja=4,Mu=1e-6;function Ry(t){return"translate("+t+",0)"}function Oy(t){return"translate(0,"+t+")"}function Cy(t){return e=>+t(e)}function Py(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function My(){return!this.__axis}function Ko(t,e){var r=[],a=null,o=null,i=6,s=6,l=3,c=typeof window!="undefined"&&window.devicePixelRatio>1?0:.5,f=t===Wo||t===ja?-1:1,g=t===ja||t===Yo?"x":"y",p=t===Wo||t===Ts?Ry:Oy;function m(E){var w=a==null?e.ticks?e.ticks.apply(e,r):e.domain():a,U=o==null?e.tickFormat?e.tickFormat.apply(e,r):Iy:o,N=Math.max(i,0)+l,D=e.range(),Y=+D[0]+c,J=+D[D.length-1]+c,K=(e.bandwidth?Py:Cy)(e.copy(),c),nt=E.selection?E.selection():E,Q=nt.selectAll(".domain").data([null]),ot=nt.selectAll(".tick").data(w,e).order(),pt=ot.exit(),Tt=ot.enter().append("g").attr("class","tick"),yt=ot.select("line"),lt=ot.select("text");Q=Q.merge(Q.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),ot=ot.merge(Tt),yt=yt.merge(Tt.append("line").attr("stroke","currentColor").attr(g+"2",f*i)),lt=lt.merge(Tt.append("text").attr("fill","currentColor").attr(g,f*N).attr("dy",t===Wo?"0em":t===Ts?"0.71em":"0.32em")),E!==nt&&(Q=Q.transition(E),ot=ot.transition(E),yt=yt.transition(E),lt=lt.transition(E),pt=pt.transition(E).attr("opacity",Mu).attr("transform",function(jt){return isFinite(jt=K(jt))?p(jt+c):this.getAttribute("transform")}),Tt.attr("opacity",Mu).attr("transform",function(jt){var vt=this.parentNode.__axis;return p((vt&&isFinite(vt=vt(jt))?vt:K(jt))+c)})),pt.remove(),Q.attr("d",t===ja||t===Yo?s?"M"+f*s+","+Y+"H"+c+"V"+J+"H"+f*s:"M"+c+","+Y+"V"+J:s?"M"+Y+","+f*s+"V"+c+"H"+J+"V"+f*s:"M"+Y+","+c+"H"+J),ot.attr("opacity",1).attr("transform",function(jt){return p(K(jt)+c)}),yt.attr(g+"2",f*i),lt.attr(g,f*N).text(U),nt.filter(My).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Yo?"start":t===ja?"end":"middle"),nt.each(function(){this.__axis=K})}return m.scale=function(E){return arguments.length?(e=E,m):e},m.ticks=function(){return r=Array.from(arguments),m},m.tickArguments=function(E){return arguments.length?(r=E==null?[]:Array.from(E),m):r.slice()},m.tickValues=function(E){return arguments.length?(a=E==null?null:Array.from(E),m):a&&a.slice()},m.tickFormat=function(E){return arguments.length?(o=E,m):o},m.tickSize=function(E){return arguments.length?(i=s=+E,m):i},m.tickSizeInner=function(E){return arguments.length?(i=+E,m):i},m.tickSizeOuter=function(E){return arguments.length?(s=+E,m):s},m.tickPadding=function(E){return arguments.length?(l=+E,m):l},m.offset=function(E){return arguments.length?(c=+E,m):c},m}function wy(t){return Ko(Wo,t)}function Dy(t){return Ko(Yo,t)}function wu(t){return Ko(Ts,t)}function Du(t){return Ko(ja,t)}var Ny=Object.defineProperty,Ly=(t,e,r)=>e in t?Ny(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zo=(t,e,r)=>Ly(t,typeof e!="symbol"?e+"":e,r);class Fy{constructor(e){Zo(this,"owner"),Zo(this,"config"),Zo(this,"scale"),Zo(this,"charSize",{});const r=jr(),{config:a,params:o}=e;this.owner=e,this.config=a,this.scale=r,(a.noTransition||!o.config.transition_duration)&&(a.withoutTransition=!0),a.range=this.scaleExtent((o.orgXScale||r).range())}getSizeFor1Char(e,r,a=!0){const o={w:5.5,h:11.5};return this.charSize[e]&&a?this.charSize[e]:(!r.empty()&&r.text("0").call(i=>{try{const{width:s,height:l}=na(i.node(),!0);s&&l&&(o.w=s,o.h=l)}finally{i.text("")}}),this.charSize[e]=o,o)}getTickTransformSetter(e){const{config:r}=this,a=e==="x"?o=>`translate(${o+r.tickOffset},0)`:o=>`translate(0,${o})`;return(o,i)=>{o.attr("transform",s=>{const l=i(s);return De(s)?a(l):null})}}scaleExtent(e){const r=e[0],a=e[e.length-1];return r<a?[r,a]:[a,r]}generateTicks(e,r){const{tickStepSize:a}=this.owner.params,[o,i]=e.domain();let s=[];if(r&&a){let l=Math.round(o);for(;l<=i;)s.push(l),l+=a}else if(e.ticks){const{tickArguments:l}=this.config;if(e.type==="log"&&!l){const c=jr("_log").domain([o>0?o:1,i]).range(e.range());s=c.ticks();for(let f=i.toFixed().length;s.length>15;f--)s=c.ticks(f);s.splice(0,1,o),s.splice(s.length-1,1,i)}else s=e.ticks(...this.config.tickArguments||[]);s=s.map(c=>Ue(c)&&pe(c)&&!isNaN(c)&&Math.round(c*10)/10||c)}return s}copyScale(){const e=this.scale.copy();return e.domain().length||e.domain(this.scale.domain()),e.type=this.scale.type,e}textFormatted(e){const r=this.config.tickFormat,a=/\d+\.\d+0{5,}\d$/.test(e)?+String(e).replace(/0+\d$/,""):e,o=r?r(a):a;return Qe(o)?o:""}transitionise(e){const{config:r}=this;let a=e;if(r.withoutTransition)a=e.interrupt();else if(r.transition||!this.owner.params.noTransition)try{a=e.transition(r.transition)}catch(o){}return a}}var By=Object.defineProperty,Uy=(t,e,r)=>e in t?By(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ga=(t,e,r)=>Uy(t,typeof e!="symbol"?e+"":e,r);class zy{constructor(e={}){Ga(this,"helper"),Ga(this,"config"),Ga(this,"params"),Ga(this,"g"),Ga(this,"generatedTicks");const r={innerTickSize:6,outerTickSize:e.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:e.noTransition};r.tickLength=Math.max(r.innerTickSize,0)+r.tickPadding,this.config=r,this.params=e,this.helper=new Fy(this)}create(e){const r=this,{config:a,helper:o,params:i}=r,{scale:s}=o,{orient:l}=a,c=this.splitTickText.bind(r),f=/^(left|right)$/.test(l),g=/^(top|bottom)$/.test(l),p=o.getTickTransformSetter(g?"x":"y"),m=p===o.axisX?"y":"x",E=/^(top|left)$/.test(l)?-1:1,w=i.tickTextRotate;this.config.range=s.rangeExtent?s.rangeExtent():o.scaleExtent((i.orgXScale||s).range());const{innerTickSize:U,tickLength:N,range:D}=a,Y=i.id,J=Y&&/^(x|y|y2)$/.test(Y)?i.config[`axis_${Y}_tick_text_position`]:{x:0,y:0},K=Y==="subX"?"subchart_axis_x":`axis_${Y}`,nt=i.config[`${K}_show`],Q={tick:nt?i.config[`${K}_tick_show`]:!1,text:nt?i.config[`${K}_tick_text_show`]:!1},ot=i.config.axis_evalTextSize;let pt;e.each(function(){const Tt=it(this);let yt=this.__chart__||s,lt=o.copyScale();pt=Tt,this.__chart__=lt,a.tickOffset=i.isCategory?(lt(1)-lt(0))/2:0;const jt=Tt.selectAll(".domain").data([0]);if(jt.enter().append("path").attr("class","domain").merge(jt).attr("d",()=>{const vt=a.outerTickSize*E;return g?`M${D[0]},${vt}V0H${D[1]}V${vt}`:`M${vt},${D[0]}H0V${D[1]}H${vt}`}),Q.tick||Q.text){const vt=a.tickValues||o.generateTicks(lt,f||i.config.axis_rotated);r.generatedTicks=vt;let tt=Tt.selectAll(".tick").data(vt,lt);const St=tt.enter().insert("g",".domain").attr("class","tick"),ct=tt.exit().remove();tt=St.merge(tt),Q.tick&&St.append("line"),Q.text&&St.append("text");const At=tt.select("text"),Wt=[];let Dt={w:0,h:0};he(ot)&&(Dt=ot.bind(r.params.owner.api)(At.node(),Y),this.classList.contains(Se.dummy)&&(this.sizeFor1Char=Dt)),(!Dt||Dt.w===0||Dt.h===0)&&(Dt=r.helper.getSizeFor1Char(l,At,!!ot));let Zt=At.selectAll("tspan").data((Ie,Ce)=>{const Pe=i.tickMultiline?c(Ie,lt,vt,f,Dt.w):Ge(o.textFormatted(Ie))?o.textFormatted(Ie).concat():[o.textFormatted(Ie)];return Wt[Ce]=Pe.length,Pe.map(Ye=>({index:Ce,splitted:Ye}))});Zt.exit().remove(),Zt=Zt.enter().append("tspan").merge(Zt).text(Ie=>Ie.splitted),Zt.attr("x",g?0:N*E).attr("dx",(()=>{let Ie=0;return/(top|bottom)/.test(l)&&w&&(Ie=8*Math.sin(Math.PI*(w/180))*(l==="top"?-1:1)),Ie+(J.x||0)})()).attr("dy",(Ie,Ce)=>{const Pe=".71em";let Ye=0;return l!=="top"&&(Ye=Dt.h,Ce===0&&(Ye=f?-((Wt[Ie.index]-1)*(Dt.h/2)-3):J.y===0?Pe:0)),pe(Ye)&&J.y?Ye+J.y:Ye||Pe});const re=tt.select("line"),ce=tt.select("text");if(St.select("line").attr(`${m}2`,U*E),St.select("text").attr(m,N*E),r.setTickLineTextPosition(re,ce,Dt),i.tickTitle){const Ie=ce.select("title");(Ie.empty()?ce.append("title"):Ie).text(Ce=>i.tickTitle[Ce])}if(lt.bandwidth){const Ie=lt,Ce=Ie.bandwidth()/2;yt=Pe=>Ie(Pe)+Ce,lt=yt}else yt.bandwidth?yt=lt:p(ct,lt);tt=i.owner.state.flowing?o.transitionise(tt):i.owner.$T(tt),p(St,yt),p(tt.style("opacity",null),lt)}}),this.g=pt}getGeneratedTicks(e){var r;const a=((r=this.generatedTicks)==null?void 0:r.length)-1;let o=this.generatedTicks;if(a>e){const i=Math.round(a/e+.1);o=this.generatedTicks.map((s,l)=>l%i===0?s:null).filter(s=>s!==null).splice(0,e)}return o}getTickXY(){const{config:e}=this,r={x:0,y:0};return this.params.isCategory&&(r.x=e.tickCentered?0:e.tickOffset,r.y=e.tickCentered?e.tickOffset:0),r}getTickSize(e){const{scale:r}=this.helper,{config:a}=this,{innerTickSize:o,range:i}=a,s=r(e)+(a.tickCentered?0:a.tickOffset);return i[0]<s&&s<i[1]?o:0}setTickLineTextPosition(e,r,a){const o=this.getTickXY(),{innerTickSize:i,orient:s,tickLength:l,tickOffset:c}=this.config,f=this.params.id,g=this.params.tickTextRotate,p=6,m=a.h/2-p,E=J=>{const K=["start","end"];return s==="top"&&K.reverse(),J?K[J>0?0:1]:"middle"},w=J=>J?`rotate(${J})`:null,U=J=>{const K=J/(s==="bottom"?15:23);return J?11.5-2.5*K*(J>0?1:-1):l},{config:{axis_rotated:N,axis_x_tick_text_inner:D}}=this.params.owner,Y=this.params.config[`axis_${f}_tick_inner`];switch(s){case"bottom":e.attr("x1",o.x).attr("x2",o.x).attr("y2",J=>this.getTickSize.bind(this)(J)*(Y?-1:1)),r.attr("x",0).attr("y",U(g)).style("text-anchor",E(g)).style("text-anchor",(J,K,{length:nt})=>!N&&K===0&&(D===!0||D.first)?"start":!N&&K===nt-1&&(D===!0||D.last)?"end":E(g)).attr("transform",w(g));break;case"top":e.attr("x2",0).attr("y2",Y?i:-i),r.attr("x",0).attr("y",-(U(g)+m+p)).style("text-anchor",E(g)).attr("transform",w(g));break;case"left":e.attr("x2",Y?i:-i).attr("y1",o.y).attr("y2",o.y),r.attr("x",-l).attr("y",c+(N?m/4:m)).style("text-anchor","end");break;case"right":e.attr("x2",Y?-i:i).attr("y2",0),r.attr("x",l).attr("y",m).style("text-anchor","start")}}splitTickText(e,r,a,o,i){const{params:s}=this,l=this.helper.textFormatted(e),c=Ue(l)&&l.indexOf(`
|
|
56
56
|
`)>-1?l.split(`
|
|
57
|
-
`):[];if(c.length)return c;if(Ge(l))return l;let f=s.tickWidth;(!f||f<=0)&&(f=o?95:s.isCategory?(s.isInverted?r(a[0])-r(a[1]):r(a[1])-r(a[0]))-12:110);function g(p,m){let E,w,U;for(let N=1;N<m.length;N++)if(m.charAt(N)===" "&&(w=N),E=m.substr(0,N+1),U=i*E.length,f<U)return g(p.concat(m.substr(0,w||N)),m.slice(w?w+1:N));return p.concat(m)}return g(c,String(l))}scale(e){return arguments.length?(this.helper.scale=e,this):this.helper.scale}orient(e){return arguments.length?(this.config.orient=e in{top:1,right:1,bottom:1,left:1}?String(e):"bottom",this):this.config.orient}tickFormat(e){const{config:r}=this;return arguments.length?(r.tickFormat=e,this):r.tickFormat}tickCentered(e){const{config:r}=this;return arguments.length?(r.tickCentered=e,this):r.tickCentered}tickOffset(){return this.config.tickOffset}tickInterval(e){var r;const{outerTickSize:a,tickOffset:o,tickValues:i}=this.config;let s;if(this.params.isCategory)s=o*2;else{const l=(r=this.params.owner.scale.zoom)!=null?r:this.helper.scale;s=(this.g.select("path.domain").node().getTotalLength()-a*2)/(e||this.g.selectAll("line").size());const f=i?i.map((g,p,m)=>{const E=p+1;return E<m.length?l(m[E])-l(g):null}).filter(Boolean):[];s=Math.min(...f,s)}return s===1/0?0:s}ticks(...e){const{config:r}=this;return e.length?(r.tickArguments=Lr(e),this):r.tickArguments}tickCulling(e){const{config:r}=this;return arguments.length?(r.tickCulling=e,this):r.tickCulling}tickValues(e){const{config:r}=this;if(he(e))r.tickValues=()=>e(this.helper.scale.domain());else{if(!arguments.length)return r.tickValues;r.tickValues=e}return this}setTransition(e){return this.config.transition=e,this}}var zy=Object.defineProperty,jy=(t,e,r)=>e in t?zy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mr=(t,e,r)=>jy(t,typeof e!="symbol"?e+"":e,r),Gy={getAxisInstance:function(){return this.axis||new Vy(this)}};class Vy{constructor(e){mr(this,"owner"),mr(this,"x"),mr(this,"subX"),mr(this,"y"),mr(this,"y2"),mr(this,"axesList",{}),mr(this,"tick",{x:null,y:null,y2:null}),mr(this,"xs",[]),mr(this,"orient",{x:"bottom",y:"left",y2:"right",subX:"bottom"}),this.owner=e,this.setOrient()}getAxisClassName(e){return`${vn.axis} ${vn[`axis${In(e)}`]}`}isHorizontal(e,r){const a=e.config.axis_rotated;return r?a:!a}isCategorized(){const{config:e,state:r}=this.owner;return e.axis_x_type.indexOf("category")>=0||r.hasRadar}isCustomX(){const{config:e}=this.owner;return!this.isTimeSeries()&&(e.data_x||cn(e.data_xs))}isTimeSeries(e="x"){return this.owner.config[`axis_${e}_type`]==="timeseries"}isLog(e="x"){return this.owner.config[`axis_${e}_type`]==="log"}isTimeSeriesY(){return this.isTimeSeries("y")}getAxisType(e="x"){let r="linear";return this.isTimeSeries(e)?r=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(e)&&(r="log"),r}getExtent(){const e=this.owner,{config:r,scale:a}=e;let o=r.axis_x_extent;if(o){if(he(o))o=o.bind(e.api)(e.getXDomain(e.data.targets),a.subX);else if(this.isTimeSeries()&&o.every(isNaN)){const i=Kn.bind(e);o=o.map(s=>a.subX(i(s)))}}return o}init(){const e=this.owner,{config:r,$el:{main:a,axis:o},state:{clip:i}}=e,s=["x","y"];r.axis_y2_show&&s.push("y2"),s.forEach(l=>{const c=this.getAxisClassName(l);o[l]=a.append("g").attr("class",c).attr("clip-path",()=>{let f=null;return l==="x"?f=i.pathXAxis:l==="y"&&(f=i.pathYAxis),f}).attr("transform",e.getTranslate(l)).style("visibility",r[`axis_${l}_show`]?null:"hidden"),this.generateAxes(l)})}setOrient(){const e=this.owner,{axis_rotated:r,axis_y_inner:a,axis_y2_inner:o}=e.config;this.orient={x:r?"left":"bottom",y:r?a?"top":"bottom":a?"right":"left",y2:r?o?"bottom":"top":o?"left":"right",subX:r?"left":"bottom"}}generateAxes(e){const r=this.owner,{config:a}=r,o=[],i=a[`axis_${e}_axes`],s=a.axis_rotated;let l;e==="x"?l=s?Du:wu:e==="y"?l=s?wu:Du:e==="y2"&&(l=s?My:wy),i.length&&i.forEach(c=>{const f=c.tick||{},g=r.scale[e].copy();c.domain&&g.domain(c.domain),o.push(l(g).ticks(f.count).tickFormat(he(f.format)?f.format.bind(r.api):(p=>p)).tickValues(f.values).tickSizeOuter(f.outer===!1?0:6))}),this.axesList[e]=o}updateAxes(){const e=this.owner,{config:r,$el:{main:a},$T:o}=e;Object.keys(this.axesList).forEach(i=>{const s=r[`axis_${i}_axes`],l=e.scale[i].copy(),c=l.range();this.axesList[i].forEach((f,g)=>{const p=f.scale().range();c.every((w,U)=>w===p[U])||f.scale().range(c);const m=`${this.getAxisClassName(i)}-${g+1}`;let E=a.select(`.${m.replace(/\s/,".")}`);E.empty()?E=a.append("g").attr("class",m).style("visibility",r[`axis_${i}_show`]?null:"hidden").call(f):(s[g].domain&&l.domain(s[g].domain),o(E).call(f.scale(l))),E.attr("transform",e.getTranslate(i,g+1))})})}setAxis(e,r,a,o){const i=this.owner;e!=="subX"&&(this.tick[e]=this.getTickValues(e)),this[e]=this.getAxis(e,r,a,e==="x"&&(i.scale.zoom||i.config.subchart_show||i.state.resizing)?!0:o)}getAxis(e,r,a,o,i){const s=this.owner,{config:l}=s,c=/^(x|subX)$/.test(e),f=c?"x":e,g=c&&this.isCategorized(),p=this.orient[e],m=i?0:s.getAxisTickRotate(f);let E;if(c)E=e==="subX"?s.format.subXAxisTick:s.format.xAxisTick;else{const Y=l[`axis_${e}_tick_format`];he(Y)&&(E=Y.bind(s.api))}let w=this.tick[f];const U=ra({outerTick:a,noTransition:o,config:l,id:e,tickTextRotate:m,owner:s},c&&{isCategory:g,isInverted:l.axis_x_inverted,tickMultiline:l.axis_x_tick_multiline,tickWidth:l.axis_x_tick_width,tickTitle:g&&l.axis_x_tick_tooltip&&s.api.categories(),orgXScale:s.scale.x});c||(U.tickStepSize=l[`axis_${f}_tick_stepSize`]);const N=new Uy(U).scale(c&&s.scale.zoom||r).orient(p);if(c&&this.isTimeSeries()&&w&&!he(w)){const Y=Kn.bind(s);w=w.map(J=>Y(J))}else!c&&this.isTimeSeriesY()&&(N.ticks(l.axis_y_tick_time_value),w=null);w&&N.tickValues(w),N.tickFormat(E||!c&&s.isStackNormalized()&&(Y=>`${Y}%`)),g&&(N.tickCentered(l.axis_x_tick_centered),_n(l.axis_x_tick_culling)&&(l.axis_x_tick_culling=!1));const D=l[`axis_${f}_tick_count`];return D&&N.ticks(D),N}updateXAxisTickValues(e,r){var a;const o=this.owner,{config:i}=o,s=i.axis_x_tick_fit;let l=i.axis_x_tick_count,c;return(s||l&&s)&&(c=o.mapTargetsToUniqueXs(e),this.isCategorized()&&l>c.length&&(l=c.length),c=this.generateTickValues(c,l,this.isTimeSeries())),r?r.tickValues(c):this.x&&(this.x.tickValues(c),(a=this.subX)==null||a.tickValues(c)),c}getId(e){const{config:r,scale:a}=this.owner;let o=r.data_axes[e];return(!o||!a[o])&&(o="y"),o}getXAxisTickFormat(e){const r=this.owner,{config:a,format:o}=r,i=e&&a.subchart_axis_x_tick_format||a.axis_x_tick_format,s=this.isTimeSeries(),l=this.isCategorized();let c;return i?he(i)?c=i.bind(r.api):s&&(c=f=>f?o.axisTime(i)(f):""):c=s?o.defaultAxisTime:l?r.categoryName:f=>f<0?f.toFixed(0):f,he(c)?f=>c.apply(r,l?[f,r.categoryName(f)]:[f]):c}getTickValues(e){const r=this.owner,a=r.config[`axis_${e}_tick_values`],o=r[`${e}Axis`];return(he(a)?a.call(r.api):a)||(o?o.tickValues():void 0)}getLabelOptionByAxisId(e){return this.owner.config[`axis_${e}_label`]}getLabelText(e){const r=this.getLabelOptionByAxisId(e);return Ue(r)?r:r?r.text:null}setLabelText(e,r){const a=this.owner,{config:o}=a,i=this.getLabelOptionByAxisId(e);Ue(i)?o[`axis_${e}_label`]=r:i&&(i.text=r)}getLabelPosition(e,r){const a=this.owner.config.axis_rotated,o=this.getLabelOptionByAxisId(e),i=rr(o)&&o.position?o.position:r[+!a],s=l=>!!~i.indexOf(l);return{isInner:s("inner"),isOuter:s("outer"),isLeft:s("left"),isCenter:s("center"),isRight:s("right"),isTop:s("top"),isMiddle:s("middle"),isBottom:s("bottom")}}getAxisLabelPosition(e){return this.getLabelPosition(e,e==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])}getLabelPositionById(e){return this.getAxisLabelPosition(e)}xForAxisLabel(e){const r=this.owner,{state:{width:a,height:o}}=r,i=this.getAxisLabelPosition(e);let s=i.isMiddle?-o/2:0;return this.isHorizontal(r,e!=="x")?s=i.isLeft?0:i.isCenter?a/2:a:i.isBottom&&(s=-o),s}textAnchorForAxisLabel(e){const r=this.owner,a=this.getAxisLabelPosition(e);let o=a.isMiddle?"middle":"end";return this.isHorizontal(r,e!=="x")?o=a.isLeft?"start":a.isCenter?"middle":"end":a.isBottom&&(o="start"),o}dxForAxisLabel(e){const r=this.owner,a=this.getAxisLabelPosition(e);let o=a.isBottom?"0.5em":"0";return this.isHorizontal(r,e!=="x")?o=a.isLeft?"0.5em":a.isRight?"-0.5em":"0":a.isTop&&(o="-0.5em"),o}dyForAxisLabel(e){const r=this.owner,{config:a}=r,o=a.axis_rotated,i=this.getAxisLabelPosition(e).isInner,s=a[`axis_${e}_tick_rotate`]?r.getHorizontalAxisHeight(e):0,{width:l}=this.getMaxTickSize(e);let c;if(e==="x"){const f=a.axis_x_height;o?c=i?"1.2em":-25-l:i?c="-0.5em":f?c=f-10:s?c=s-10:c="3em"}else c={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[e],o?i?c=c[0]:s?c=s*(e==="y2"?-1:1)-c[1]:c=c[2]:c=i?c[3]:(c[4]+(a[`axis_${e}_inner`]?0:l+c[4]))*(e==="y"?-1:1);return c}getMaxTickSize(e,r){const a=this.owner,{config:o,state:{current:i,resizing:s},$el:{svg:l,chart:c}}=a,f=i.maxTickSize[e],g=`axis_${e}`,p={width:0,height:0};if(s||r||!o[`${g}_show`]||f.width>0&&a.filterTargetsToShow().length===0)return f;if(l){const m=/^y2?$/.test(e),E=a.filterTargetsToShow(a.data.targets),w=a.scale[e].copy().domain(a[`get${m?"Y":"X"}Domain`](E,e)),U=w.domain(),N=U[0]===U[1]&&U.every(Tt=>Tt>0),D=Ge(f.domain)&&f.domain[0]===f.domain[1]&&f.domain.every(Tt=>Tt>0);if(N||D)return f.size;f.domain=U,m||f.ticks.splice(0);const Y=this.getAxis(e,w,!1,!1,!0),J=o[`${g}_tick_rotate`],K=o[`${g}_tick_count`];!o[`${g}_tick_values`]&&K&&Y.tickValues(this.generateTickValues(U,K,m?this.isTimeSeriesY():this.isTimeSeries())),!m&&this.updateXAxisTickValues(E,Y);const Q=c.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0"),ot=Q.append("g").attr("class",`${vn[`axis${In(e)}`]} ${Se.dummy}`);Y.create(ot);const{sizeFor1Char:pt}=ot.node();Q.selectAll("text").attr("transform",pe(J)?`rotate(${J})`:null).each(function(Tt,yt){const{width:lt,height:jt}=pt?{width:this.textContent.length*pt.w,height:pt.h}:mn(this,!0);p.width=Math.max(p.width,lt),p.height=Math.max(p.height,jt),m||(f.ticks[yt]=lt)}),Q.remove()}return Object.keys(p).forEach(m=>{p[m]>0&&(f[m]=p[m])}),f}getXAxisTickTextY2Overflow(e){const r=this.owner,{axis:a,config:o,state:{current:i,isLegendRight:s,legendItemWidth:l}}=r,c=r.getAxisTickRotate("x"),f=c>0&&c<90;if((a.isCategorized()||a.isTimeSeries())&&o.axis_x_tick_fit&&(!o.axis_x_tick_culling||_n(o.axis_x_tick_culling))&&!o.axis_x_tick_multiline&&f){const g=o.axis_y2_show&&i.maxTickSize.y2.width||0,p=s&&l||0,m=i.width-r.getCurrentPaddingByDirection("left"),E=this.getXAxisTickMaxOverflow(c,m-e)-g-p,w=Math.max(0,E)+e;return Math.min(w,m/2)}return 0}getXAxisTickMaxOverflow(e,r){const a=this.owner,{axis:o,config:i,state:s}=a,l=o.isTimeSeries(),c=s.current.maxTickSize.x.ticks,f=c.length,{left:g,right:p}=s.axis.x.padding;let m=0;const E=f-(l&&i.axis_x_tick_fit?.5:0);for(let N=0;N<f;N++){const D=N+1,Y=Math.cos(Math.PI*e/180)*c[N],J=D-(l?1:.5)+g;if(J<=0)continue;const nt=(r-Y)/J,Q=E-D,ot=p*nt,pt=Q*nt+ot,Tt=Y-nt/2-pt;m=Math.max(m,Tt)}const w=a.filterTargetsToShow(a.data.targets);let U=0;if(!l&&i.axis_x_tick_count<=w.length&&w[0].values.length){const N=jr(a.axis.getAxisType("x"),0,r-m).domain([g*-1,a.getXDomainMax(a.data.targets)+1+p]);U=(N(1)-N(0))/2}return m+U}updateLabels(e){const r=this.owner,{config:a,$el:{main:o},$T:i}=r,s=a.axis_rotated;["x","y","y2"].forEach(l=>{const c=this.getLabelText(l),f=`axis${In(l)}`,g=vn[`${f}Label`];if(c){let p=o.select(`text.${g}`);p.empty()&&(p=o.select(`g.${vn[f]}`).insert("text",":first-child").attr("class",g).attr("transform",["rotate(-90)",null][l==="x"?+!s:+s]).style("text-anchor",()=>this.textAnchorForAxisLabel(l))),i(p,e).attr("x",()=>this.xForAxisLabel(l)).attr("dx",()=>this.dxForAxisLabel(l)).attr("dy",()=>this.dyForAxisLabel(l)).text(c)}})}getPadding(e,r,a,o){const i=pe(e)?e:e[r];return De(i)?this.owner.convertPixelToScale(/(bottom|top)/.test(r)?"y":"x",i,o):a}generateTickValues(e,r,a){let o=e;if(r){const i=he(r)?r():r;if(i===1)o=[e[0]];else if(i===2)o=[e[0],e[e.length-1]];else if(i>2){const s=this.isCategorized(),l=i-2,c=e[0],f=e[e.length-1],g=(f-c)/(l+1);let p;o=[c];for(let m=0;m<l;m++)p=+c+g*(m+1),o.push(a?new Date(p):s?Math.round(p):p);o.push(f)}}return a||(o=o.sort((i,s)=>i-s)),o}generateTransitions(e){const r=this.owner,{$el:{axis:a},$T:o}=r,[i,s,l,c]=["x","y","y2","subX"].map(f=>o(a[f],e));return{axisX:i,axisY:s,axisY2:l,axisSubX:c}}redraw(e,r,a){const o=this.owner,{config:i,state:s,$el:l}=o,c=r?"0":null;["x","y","y2","subX"].forEach(f=>{const g=this[f],p=l.axis[f];g&&p&&(!a&&!i.transition_duration&&(g.config.withoutTransition=!0),p.style("opacity",c),g.create(e[`axis${In(f)}`]))}),this.updateAxes(),!s.rendered&&i.axis_tooltip&&this.setAxisTooltip()}redrawAxis(e,r,a,o,i){var s,l,c;const f=this.owner,{config:g,scale:p,$el:m}=f,E=!!p.zoom;let w;!E&&this.isCategorized()&&e.length===0&&p.x.domain([0,m.axis.x.selectAll(".tick").size()]),p.x&&e.length?(!E&&f.updateXDomain(e,r.UpdateXDomain,r.UpdateOrgXDomain,r.TrimXDomain),g.axis_x_tick_values||this.updateXAxisTickValues(e)):this.x&&(this.x.tickValues([]),(s=this.subX)==null||s.tickValues([])),g.zoom_rescale&&!o&&(w=p.x.orgDomain()),["y","y2"].forEach(U=>{const N=`axis_${U}_`,D=p[U];if(D){const Y=g[`${N}tick_values`],J=g[`${N}tick_count`];if(D.domain(f.getYDomain(e,U,w)),!Y&&J){const K=f.axis[U],nt=D.domain();K.tickValues(this.generateTickValues(nt,nt.every(Q=>Q===0)?1:J,this.isTimeSeriesY()))}}}),this.redraw(a,f.hasArcType(),i),this.updateLabels(r.Transition),(r.UpdateXDomain||r.UpdateXAxis||r.Y)&&e.length&&this.setCulling(),r.Y&&((l=p.subY)==null||l.domain(f.getYDomain(e,"y")),(c=p.subY2)==null||c.domain(f.getYDomain(e,"y2")))}setCulling(){const e=this.owner,{config:r,state:{clip:a,current:o},$el:i}=e;["subX","x","y","y2"].forEach(s=>{const l=i.axis[s],f=`axis_${s==="subX"?"x":s}_tick_culling`,g=r[f];if(l&&g){const p=l.selectAll(".tick"),m=aa(p.data(),!r[`${f}_reverse`]),E=m.length,w=r[`${f}_max`],U=r[`${f}_lines`];let N;if(E){for(let D=1;D<E;D++)if(E/D<w){N=D;break}p.each(function(D){const Y=U?this.querySelector("text"):this;Y&&(Y.style.display=m.indexOf(D)%N?"none":null)})}else p.style("display",null);if(s==="x"){const D=o.maxTickSize.x.clipPath?a.pathXAxisTickTexts:null;i.svg.selectAll(`.${vn.axisX} .tick text`).attr("clip-path",D)}}})}setAxisTooltip(){var e;const r=this.owner,{config:{axis_rotated:a,axis_tooltip:o},$el:{axis:i,axisTooltip:s}}=r,l=(e=o.backgroundColor)!=null?e:"black";r.generateTextBGColorFilter(l,{x:-.15,y:-.2,width:1.3,height:1.3}),["x","y","y2"].forEach(c=>{var f,g,p;if(Ue(l)||l[c])if(s[c]=(f=i[c])==null?void 0:f.append("text").classed(vn[`axis${c.toUpperCase()}Tooltip`],!0).attr("filter",r.updateTextBGColor({id:c},l)),a){const m=c==="x"?"x":"y",E=c==="y"?"1.15em":c==="x"?"-0.3em":"-0.4em";(g=s[c])==null||g.attr(m,E).attr(`d${c==="x"?"y":"x"}`,c==="x"?"0.4em":"-1.3em").style("text-anchor",c==="x"?"end":null)}else{const m=c==="x"?"y":"x",E=c==="x"?"1.15em":`${c==="y"?"-":""}0.4em`;(p=s[c])==null||p.attr(m,E).attr(`d${c==="x"?"x":"y"}`,c==="x"?"-1em":"0.3em").style("text-anchor",c==="y"?"end":null)}})}}var Xy={initEventRect(){this.$el.main.select(`.${Se.chart}`).append("g").attr("class",Jn.eventRects).style("fill-opacity","0")},redrawEventRect(){var t;const e=this,{config:r,state:a,$el:o}=e,i=e.isMultipleX(),s=r.axis_x_inverted;if(o.eventRect)e.updateEventRect(o.eventRect,!0);else if(e.data.targets.length){const c=e.$el.main.select(`.${Jn.eventRects}`).style("cursor",r.zoom_enabled&&r.zoom_type!=="drag"?r.axis_rotated?"ns-resize":"ew-resize":null).classed(Jn.eventRectsMultiple,i).classed(Jn.eventRectsSingle,!i).selectAll(`.${Jn.eventRect}`).data([0]).enter().append("rect");e.updateEventRect(c),e.updateEventType(c),c.call(e.getDraggableSelection()),o.eventRect=c,e.state.inputType==="touch"&&!o.svg.on("touchstart.eventRect")&&!e.hasArcType()&&e.bindTouchOnEventRect(),a.rendered&&e.updateEventRect(o.eventRect,!0)}if(!i){const l=e.getMaxDataCountTarget();(!r.data_xSort||s)&&l.sort((c,f)=>s?f.x-c.x:c.x-f.x),e.updateDataIndexByX(l),e.updateXs(l),(t=e.updatePointClass)==null||t.call(e,!0),a.eventReceiver.data=l}e.updateEventRectData()},bindTouchOnEventRect(){const t=this,{config:e,state:r,$el:{eventRect:a,svg:o}}=t,i=m=>{if(t.isMultipleX())t.selectRectForMultipleXs(m);else{const E=t.getDataIndexFromEvent(r.event);t.callOverOutForTouch(E),E===-1?t.unselectRect():t.selectRectForSingle(m,E)}},s=()=>{t.unselectRect(),t.callOverOutForTouch()},l=e.interaction_inputType_touch.preventDefault,c=Mi(l)&&l||!1,f=!isNaN(l)&&l||null;let g;const p=m=>{const E=m.type,U=m.changedTouches[0][`client${e.axis_rotated?"Y":"X"}`];E==="touchstart"?c?m.preventDefault():f!==null&&(g=U):E==="touchmove"&&(c||g===!0||f!==null&&Math.abs(g-U)>=f)&&(g=!0,m.preventDefault())};a.on("touchstart",m=>{r.event=m,t.updateEventRect()}).on("touchstart.eventRect touchmove.eventRect",m=>{if(r.event=m,!a.empty()&&a.classed(Jn.eventRect)){if(r.dragging||r.flowing||t.hasArcType()||m.touches.length>1)return;p(m),i(a.node())}else s()},!0).on("touchend.eventRect",m=>{r.event=m,!a.empty()&&a.classed(Jn.eventRect)&&(t.hasArcType()||!t.toggleShape||r.cancelClick)&&r.cancelClick&&(r.cancelClick=!1)},!0),o.on("touchstart",m=>{r.event=m;const{target:E}=m;E&&E!==a.node()&&s()})},updateEventRect(t,e=!1){const r=this,{state:a,$el:o}=r,{eventReceiver:i,width:s,height:l,rendered:c,resizing:f}=a,g=t||o.eventRect,p=()=>{if(i){const m=kl(o.chart.node());i.rect=mn(g.node(),!0).toJSON(),i.rect.top+=m.y,i.rect.left+=m.x}};(!c||f||e)&&(g.attr("x",0).attr("y",0).attr("width",s).attr("height",l),(!c||e)&&g.classed(Jn.eventRect,!0)),p()},updateEventType(t){const e=this,r=Mi(t),a=r?e.$el.eventRect:t,o=r?t!==(a==null?void 0:a.datum().multipleX):!1;a&&(o&&(a==null||a.on("mouseover mousemove mouseout click",null)),e.isMultipleX()?e.generateEventRectsForMultipleXs(a):e.generateEventRectsForSingleX(a))},updateEventRectData(){const t=this,{config:e,scale:r,state:a}=t,o=r.zoom||r.x,i=e.axis_rotated,s=t.isMultipleX();let l,c,f,g;if(t.updateEventType(s),s)l=0,c=0,f=a.width,g=a.height;else{let E,w;if(t.axis.isCategorized())E=t.getEventRectWidth(),w=U=>o(U.x)-E/2;else{const U=({index:N})=>({prev:t.getPrevX(N),next:t.getNextX(N)});E=N=>{const D=U(N),Y=o.domain();let J;return D.prev===null&&D.next===null?J=i?a.height:a.width:D.prev===null?J=(o(D.next)+o(N.x))/2:D.next===null?J=o(Y[1])-(o(D.prev)+o(N.x))/2:(Object.keys(D).forEach((K,nt)=>{var Q;D[K]=(Q=D[K])!=null?Q:Y[nt]}),J=Math.max(0,(o(D.next)-o(D.prev))/2)),J},w=N=>{const D=U(N);let Y;return D.prev===null&&D.next===null?Y=0:D.prev===null?Y=o(o.domain()[0]):Y=(o(N.x)+o(D.prev))/2,Y}}l=i?0:w,c=i?w:0,f=i?a.width:E,g=i?E:a.height}const{eventReceiver:p}=a,m=(E,w)=>he(E)?E(w):E;p.coords.splice(p.data.length),p.data.forEach((E,w)=>{p.coords[w]={x:m(l,E),y:m(c,E),w:m(f,E),h:m(g,E)}})},selectRectForSingle(t,e){var r,a;const o=this,{config:i,$el:{main:s,circle:l}}=o,c=i.data_selection_enabled,f=i.data_selection_grouped,g=i.data_selection_isselectable,p=i.tooltip_grouped,m=o.getAllValuesOnIndex(e);if(p&&(o.showTooltip(m,t),(r=o.showGridFocus)==null||r.call(o,m),!c||f))return;!l&&s.selectAll(`.${Se.EXPANDED}:not(.${sn.shape}-${e})`).classed(Se.EXPANDED,!1);const E=s.selectAll(`.${sn.shape}-${e}`).classed(Se.EXPANDED,!0).style("cursor",g?"pointer":null).filter(function(w){return o.isWithinShape(this,w)});E.empty()&&!p&&i.interaction_onout&&((a=o.hideGridFocus)==null||a.call(o),o.hideTooltip(),!f&&o.setExpand(e)),E.call(w=>{var U,N;const D=w.data();c&&(f||g!=null&&g.bind(o.api)(D))&&(t.style.cursor="pointer"),p||(o.showTooltip(D,t),(U=o.showGridFocus)==null||U.call(o,D),(N=o.unexpandCircles)==null||N.call(o),w.each(Y=>o.setExpand(e,Y.id)))})},selectRectForMultipleXs(t,e=!0){const r=this,{config:a,state:o}=r,i=r.filterTargetsToShow(r.data.targets);if(o.dragging||r.hasArcType(i))return;const s=Yn(o.event,t),l=r.findClosestFromTargets(i,s);if(e&&o.mouseover&&(!l||l.id!==o.mouseover.id)&&(a.data_onout.call(r.api,o.mouseover),o.mouseover=void 0),!l){r.unselectRect();return}const f=(r.isBubbleType(l)||r.isScatterType(l)||!a.tooltip_grouped?[l]:r.filterByX(i,l.x)).map(p=>r.addName(p));r.showTooltip(f,t),r.setExpand(l.index,l.id,!0),r.showGridFocus(f);const g=r.dist(l,s);(r.isBarType(l.id)||g<r.getPointSensitivity(l))&&(r.$el.svg.select(`.${Jn.eventRect}`).style("cursor","pointer"),e&&!o.mouseover&&(a.data_onover.call(r.api,l),o.mouseover=l))},unselectRect(){const t=this,{$el:{circle:e,tooltip:r}}=t;t.$el.svg.select(`.${Jn.eventRect}`).style("cursor",null),t.hideGridFocus(),r&&(t.hideTooltip(),t._handleLinkedCharts(!1)),e&&!t.isPointFocusOnly()&&t.unexpandCircles(),t.expandBarTypeShapes(!1)},generateEventRectsForSingleX(t){const e=this,{config:r,state:a}=e,{eventReceiver:o}=a,i=t.style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("click",function(s){a.event=s;const{currentIdx:l,data:c}=o,f=c[l===-1?e.getDataIndexFromEvent(s):l];e.clickHandlerForSingleX.bind(this)(f,e)}).datum({multipleX:!1});if(a.inputType==="mouse"){const s=l=>{const c=l?e.getDataIndexFromEvent(l):o.currentIdx;return c>-1?o.data[c]:null};i.on("mouseover",l=>{a.event=l,e.updateEventRect(),Object.values(e.$el.axisTooltip).forEach(c=>c==null?void 0:c.style("display",null))}).on("mousemove",function(l){const c=s(l);if(a.event=l,!c)return;let{index:f}=c;const g=r.line_step_type;if(r.line_step_tooltipMatch&&e.hasType("step")&&/^step\-(before|after)$/.test(g)){const m=e.scale.zoom||e.scale.x,E=e.axis.xs[f],w=m.invert(Yn(l,this)[0]);g==="step-after"&&w<E?f-=1:g==="step-before"&&w>E&&(f+=1)}e.showAxisGridFocus();const p=r.tooltip_grouped&&f===o.currentIdx;if(a.dragging||a.flowing||e.hasArcType()||p){r.tooltip_show&&p&&e.setTooltipPosition();return}f!==o.currentIdx&&(e.setOverOut(!1,o.currentIdx),o.currentIdx=f),f===-1?e.unselectRect():e.selectRectForSingle(this,f),e.setOverOut(f!==-1,f)}).on("mouseout",l=>{a.event=l,!(!r||e.hasArcType()||o.currentIdx===-1||!r.interaction_onout)&&(e.hideAxisGridFocus(),e.unselectRect(),e.setOverOut(!1,o.currentIdx),o.currentIdx=-1)})}return i},clickHandlerForSingleX(t,e){const r=e,{config:a,state:o,$el:{main:i}}=r;if(!t||r.hasArcType()||o.cancelClick){o.cancelClick&&(o.cancelClick=!1);return}const{index:s}=t;i.selectAll(`.${sn.shape}-${s}`).each(function(l){var c;(a.data_selection_grouped||r.isWithinShape(this,l))&&((c=r.toggleShape)==null||c.call(r,this,l,s),a.data_onclick.bind(r.api)(l,this))})},generateEventRectsForMultipleXs(t){const e=this,{config:r,state:a}=e;t.on("click",function(o){a.event=o,e.clickHandlerForMultipleXS.bind(this)(e)}).datum({multipleX:!0}),a.inputType==="mouse"&&t.on("mouseover mousemove",function(o){a.event=o,e.selectRectForMultipleXs(this)}).on("mouseout",o=>{a.event=o,!(!e.config||e.hasArcType()||!r.interaction_onout)&&e.unselectRect()})},clickHandlerForMultipleXS(t){const e=t,{config:r,state:a}=e,o=e.filterTargetsToShow(e.data.targets);if(e.hasArcType(o))return;const i=Yn(a.event,this),s=e.findClosestFromTargets(o,i),l=e.getPointSensitivity(s);s&&(e.isBarType(s.id)||e.dist(s,i)<l)&&e.$el.main.selectAll(`.${sn.shapes}${e.getTargetSelectorSuffix(s.id)}`).selectAll(`.${sn.shape}-${s.index}`).each(function(){var c;(r.data_selection_grouped||e.isWithinShape(this,s))&&((c=e.toggleShape)==null||c.call(e,this,s,s.index),r.data_onclick.bind(e.api)(s,this))})}};const Hy=t=>+t;var Wy={generateFlow(t){const e=this,{data:r,state:a,$el:o}=e;return function(){const i=t.flow.length;a.flowing=!0,r.targets.forEach(l=>{l.values.splice(0,i)}),e.updateXGrid&&e.updateXGrid(!0);const s={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(l=>{const c=l.split(".");let f=o[c[0]];f&&c.length>1&&(f=f[c[1]]),f!=null&&f.size()&&(s[l]=f)}),e.hideGridFocus(),e.setFlowList(s,t)}},setFlowList(t,e){const r=this,{flow:a,targets:o}=e,{duration:i=e.duration,index:s,length:l,orgDataCount:c}=a,f=r.getFlowTransform(o,c,s,l),g=oc();let p;g.add(Object.keys(t).map(m=>(p=t[m].transition().ease(Hy).duration(i),m==="axis.x"?p=p.call(E=>{r.axis.x.setTransition(E).create(E)}):m==="region.list"?p=p.filter(r.isRegionOnX).attr("transform",f):p=p.attr("transform",f),p))),p.call(g,()=>{r.cleanUpFlow(t,e)})},cleanUpFlow(t,e){const r=this,{config:a,state:o,$el:{svg:i}}=r,s=a.axis_rotated,{flow:l,shape:c,xv:f}=e,{cx:g,cy:p,xForText:m,yForText:E}=c.pos,{done:w=()=>{},length:U}=l;U&&(["circle","text","shape","eventRect"].forEach(N=>{const D=[];for(let Y=0;Y<U;Y++)D.push(`.${je[N]}-${Y}`);i.selectAll(`.${je[`${N}s`]}`).selectAll(D).remove()}),i.select(`.${je.xgrid}`).remove()),Object.keys(t).forEach(N=>{const D=t[N];if(N!=="axis.x"&&D.attr("transform",null),N==="grid.x")D.attr(o.xgridAttr);else if(N==="gridLines.x")D.attr("x1",s?0:f).attr("x2",s?o.width:f),D.select("text").attr("x",s?o.width:0).attr("y",f);else if(/^(area|bar|line)$/.test(N))D.attr("d",c.type[N]);else if(N==="text")D.attr("x",m).attr("y",E).style("fill-opacity",r.opacityForText.bind(r));else if(N==="circle")if(r.isCirclePoint())D.attr("cx",g).attr("cy",p);else{const Y=K=>g(K)-a.point_r,J=K=>p(K)-a.point_r;D.attr("x",Y).attr("y",J)}else N==="region.list"&&D.select("rect").filter(r.isRegionOnX).attr("x",r.regionX.bind(r)).attr("width",r.regionWidth.bind(r))}),a.interaction_enabled&&r.redrawEventRect(),w.call(r.api),o.flowing=!1},getFlowTransform(t,e,r,a){const o=this,{data:i,scale:{x:s}}=o,l=i.targets[0].values;let c=o.getValueOnIndex(l,r),f=o.getValueOnIndex(l,r+a),g;const p=s.domain(),m=o.updateXDomain(t,!0,!0);e?e===1||(c==null?void 0:c.x)===(f==null?void 0:f.x)?g=s(p[0])-s(m[0]):g=o.axis.isTimeSeries()?s(p[0])-s(m[0]):s((c==null?void 0:c.x)||0)-s(f.x):l.length!==1?g=s(p[0])-s(m[0]):o.axis.isTimeSeries()?(c=o.getValueOnIndex(l,0),f=o.getValueOnIndex(l,l.length-1),g=s(c.x)-s(f.x)):g=Nr(m)/2;const E=Nr(p)/Nr(m);return`translate(${g},0) scale(${E},1)`}},Yy={initClip(){const t=this,{clip:e,datetimeId:r}=t.state;e.id=`${r}-clip`,e.idXAxis=`${e.id}-xaxis`,e.idYAxis=`${e.id}-yaxis`,e.idGrid=`${e.id}-grid`,e.path=t.getClipPath(e.id),e.pathXAxis=t.getClipPath(e.idXAxis),e.pathYAxis=t.getClipPath(e.idYAxis),e.pathGrid=t.getClipPath(e.idGrid)},getClipPath(t){const e=this,{config:r}=e;return!r.clipPath&&/-clip$/.test(t)||!r.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!r.axis_y_clipPath&&/-clip-yaxis$/.test(t)?null:`url(#${t})`},appendClip(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath(t){const e=this,{config:r,state:{margin:a,width:o,height:i}}=e,s=r.axis_rotated,l=Math.max(30,a.left)-(s?0:20),c=(s?a.top+i+10:a.bottom)+20,f=s?-(1+l):-(l-1),g=-15,p=s?a.left+20:o+10+l;t.attr("x",f).attr("y",g).attr("width",p).attr("height",c)},setYAxisClipPath(t){const e=this,{config:r,state:{margin:a,width:o,height:i}}=e,s=r.axis_rotated,l=Math.max(30,a.left)-(s?20:0),c=r.axis_y_inner,f=c&&!s?r.axis_y_label.text?-20:-1:s?-(1+l):-(l-1),g=-(s?20:a.top),p=(s?o+15+l:a.left+20)+(c?20:0),m=(s?a.bottom+10:a.top+i)+10;t.attr("x",f).attr("y",g).attr("width",p).attr("height",m)},updateXAxisTickClip(){const t=this,{config:e,state:{clip:r,xAxisHeight:a},$el:{defs:o}}=t,i=t.getHorizontalAxisHeight("x");if(o&&!r.idXAxisTickTexts){const s=`${r.id}-xaxisticktexts`;t.appendClip(o,s),r.pathXAxisTickTexts=t.getClipPath(r.idXAxisTickTexts),r.idXAxisTickTexts=s}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&i!==a&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=i},setXAxisTickClipWidth(){const t=this,{config:e,state:{current:{maxTickSize:r}}}=t,a=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&a){const o=Math.sin(Math.PI/180*Math.abs(a));r.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/o}else r.x.clipPath=null},setXAxisTickTextClipPathWidth(){const t=this,{state:{clip:e,current:r},$el:{svg:a}}=t;a&&a.select(`#${e.idXAxisTickTexts} rect`).attr("width",r.maxTickSize.x.clipPath).attr("height",30)}};const Ky=t=>De(t.position)||"end",Zy=t=>t.position==="start"?4:t.position==="middle"?0:-4;function Nu(t,e,r){return a=>{let o=t?0:e;return a.position==="start"?o=t?-r:0:a.position==="middle"&&(o=(t?-r:e)/2),o}}function Lu(t,e){e==="grid"&&t.each(function(){const r=it(this);["x1","x2","y1","y2"].forEach(a=>r.attr(a,+r.attr(a)))})}var Jy={hasGrid(){const{config:t}=this;return["x","y"].some(e=>t[`grid_${e}_show`]||t[`grid_${e}_lines`].length)},initGrid(){const t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines(){const t=this,{config:e,state:{clip:r},$el:a}=t;(e.grid_x_lines.length||e.grid_y_lines.length)&&(a.gridLines.main=a.main.insert("g",`.${Se.chart}${e.grid_lines_front?" + *":""}`).attr("clip-path",r.pathGrid).attr("class",`${on.grid} ${on.gridLines}`),a.gridLines.main.append("g").attr("class",on.xgridLines),a.gridLines.main.append("g").attr("class",on.ygridLines),a.gridLines.x=Vc([]))},updateXGrid(t){const e=this,{config:r,scale:a,state:o,$el:{main:i,grid:s}}=e,l=r.axis_rotated,c=e.generateGridData(r.grid_x_type,a.x),f=e.axis.isCategorized()?e.axis.x.tickOffset():0,g=p=>(a.zoom||a.x)(p)+f*(l?-1:1);o.xgridAttr=l?{x1:0,x2:o.width,y1:g,y2:g}:{x1:g,x2:g,y1:0,y2:o.height},s.x=i.select(`.${on.xgrids}`).selectAll(`.${on.xgrid}`).data(c),s.x.exit().remove(),s.x=s.x.enter().append("line").attr("class",on.xgrid).merge(s.x),t||s.x.each(function(){const p=it(this);Object.keys(o.xgridAttr).forEach(m=>{p.attr(m,o.xgridAttr[m]).style("opacity",()=>p.attr(l?"y1":"x1")===(l?o.height:0)?"0":null)})})},updateYGrid(){const t=this,{axis:e,config:r,scale:a,state:o,$el:{grid:i,main:s}}=t,l=r.axis_rotated,c=g=>a.y(g),f=e.y.getGeneratedTicks(r.grid_y_ticks)||t.scale.y.ticks(r.grid_y_ticks);i.y=s.select(`.${on.ygrids}`).selectAll(`.${on.ygrid}`).data(f),i.y.exit().remove(),i.y=i.y.enter().append("line").attr("class",on.ygrid).merge(i.y),i.y.attr("x1",l?c:0).attr("x2",l?c:o.width).attr("y1",l?0:c).attr("y2",l?o.height:c),Lu(i.y,"grid")},updateGrid(){const t=this,{$el:{grid:e,gridLines:r}}=t;!r.main&&t.initGridLines(),e.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateGridLines("x"),t.updateGridLines("y")},updateGridLines(t){const e=this,{config:r,$el:{gridLines:a,main:o},$T:i}=e,s=r.axis_rotated,l=t==="x";r[`grid_${t}_show`]&&e[`update${t.toUpperCase()}Grid`]();let c=o.select(`.${on[`${t}gridLines`]}`).selectAll(`.${on[`${t}gridLine`]}`).data(r[`grid_${t}_lines`]);i(c.exit()).style("opacity","0").remove();const f=c.enter().append("g");f.append("line").style("opacity","0"),c=f.merge(c),c.each(function(g){const p=it(this);p.select("text").empty()&&g.text&&p.append("text").style("opacity","0")}),i(c.attr("class",g=>`${on[`${t}gridLine`]} ${g.class||""}`.trim()).select("text").attr("text-anchor",Ky).attr("transform",()=>l?s?null:"rotate(-90)":s?"rotate(-90)":null).attr("dx",Zy).attr("dy",-5)).text(function(g){var p;return(p=g.text)!=null?p:this.remove()}),a[t]=c},redrawGrid(t){const e=this,{config:{axis_rotated:r},state:{width:a,height:o},$el:{gridLines:i},$T:s}=e,l=e.xv.bind(e),c=e.yv.bind(e);let f=i.x.select("line"),g=i.x.select("text"),p=i.y.select("line"),m=i.y.select("text");return f=s(f,t).attr("x1",r?0:l).attr("x2",r?a:l).attr("y1",r?l:0).attr("y2",r?l:o),g=s(g,t).attr("x",Nu(!r,a,o)).attr("y",l),p=s(p,t).attr("x1",r?c:0).attr("x2",r?c:a).attr("y1",r?0:c).attr("y2",r?o:c),m=s(m,t).attr("x",Nu(r,a,o)).attr("y",c),[f.style("opacity",null),g.style("opacity",null),p.style("opacity",null),m.style("opacity",null)]},initFocusGrid(){const t=this,{config:e,state:{clip:r},$el:a}=t,o=e.grid_front,i=`.${o&&a.gridLines.main?on.gridLines:Se.chart}${o?" + *":""}`,s=a.main.insert("g",i).attr("clip-path",r.pathGrid).attr("class",on.grid);if(a.grid.main=s,e.grid_x_show&&s.append("g").attr("class",on.xgrids),e.grid_y_show&&s.append("g").attr("class",on.ygrids),e.axis_tooltip){const l=s.append("g").attr("class","bb-axis-tooltip");l.append("line").attr("class","bb-axis-tooltip-x"),l.append("line").attr("class","bb-axis-tooltip-y")}e.interaction_enabled&&e.grid_focus_show&&!e.axis_tooltip&&(s.append("g").attr("class",qe.xgridFocus).append("line").attr("class",qe.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&s.append("g").attr("class",qe.ygridFocus).append("line").attr("class",qe.ygridFocus))},showAxisGridFocus(){var t,e;const r=this,{config:a,format:o,state:{event:i,width:s,height:l}}=r,c=a.axis_rotated,[f,g]=Yn(i,(t=r.$el.eventRect)==null?void 0:t.node()),p={x:f,y:g};for(const[m,E]of Object.entries(r.$el.axisTooltip)){const w=m==="x"&&!c||m!=="x"&&c?"x":"y",U=p[w];let N=(e=r.scale[m])==null?void 0:e.invert(U);N&&(N=m==="x"&&r.axis.isTimeSeries()?o.xAxisTick(N):N==null?void 0:N.toFixed(2),E==null||E.attr(w,U).text(N))}r.$el.main.selectAll("line.bb-axis-tooltip-x, line.bb-axis-tooltip-y").style("visibility",null).each(function(m,E){const w=it(this);E===0?w.attr("x1",f).attr("x2",f).attr("y1",E?0:l).attr("y2",E?l:0):w.attr("x1",E?0:s).attr("x2",E?s:0).attr("y1",g).attr("y2",g)})},hideAxisGridFocus(){const t=this;t.$el.main.selectAll(`line.${vn.axisTooltipX}, line.${vn.axisTooltipY}`).style("visibility","hidden"),Object.values(t.$el.axisTooltip).forEach(e=>e==null?void 0:e.style("display","none"))},showGridFocus(t){var e;const r=this,{config:a,state:{width:o,height:i}}=r,s=a.axis_rotated,l=r.$el.main.selectAll(`line.${qe.xgridFocus}, line.${qe.ygridFocus}`),c=(t||[l.datum()]).filter(p=>p&&De(r.getBaseValue(p)));if(!a.tooltip_show||c.length===0||!a.axis_x_forceAsSingle&&r.hasType("bubble")||r.hasArcType())return;const f=a.grid_focus_edge&&!a.tooltip_grouped,g=r.xx.bind(r);l.style("visibility",null).data(c.concat(c)).each(function(p){const m=it(this),E={x:g(p),y:r.getYScaleById(p.id)(p.value)};let w;if(m.classed(qe.xgridFocus))w=s?[null,E.x,f?E.y:o,E.x]:[E.x,f?E.y:null,E.x,i];else{const U=r.axis.getId(p.id)==="y2";w=s?[E.y,f&&!U?E.x:null,E.y,f&&U?E.x:i]:[f&&U?E.x:null,E.y,f&&!U?E.x:o,E.y]}["x1","y1","x2","y2"].forEach((U,N)=>m.attr(U,w[N]))}),Lu(l,"grid"),(e=r.showCircleFocus)==null||e.call(r,t)},hideGridFocus(){var t;const e=this,{state:{inputType:r,resizing:a},$el:{main:o}}=e;(r==="mouse"||!a)&&(o.selectAll(`line.${qe.xgridFocus}, line.${qe.ygridFocus}`).style("visibility","hidden"),(t=e.hideCircleFocus)==null||t.call(e))},updateGridFocus(){var t;const e=this,{state:{inputType:r,width:a,height:o,resizing:i},$el:{grid:s}}=e,l=s.main.select(`line.${qe.xgridFocus}`);if(r==="touch")l.empty()?i&&((t=e.showCircleFocus)==null||t.call(e)):e.showGridFocus();else{const c=e.config.axis_rotated;l.attr("x1",c?0:-10).attr("x2",c?a:-10).attr("y1",c?-10:0).attr("y2",c?-10:o)}return!0},generateGridData(t,e){const r=this,a=r.$el.main.select(`.${vn.axisX}`).selectAll(".tick").size();let o=[];if(t==="year"){const i=r.getXDomain(),[s,l]=i.map(c=>c.getFullYear());for(let c=s;c<=l;c++)o.push(new Date(`${c}-01-01 00:00:00`))}else o=e.ticks(10),o.length>a&&(o=o.filter(i=>String(i).indexOf(".")<0));return o},getGridFilterToRemove(t){return t?e=>{let r=!1;return(Ge(t)?t.concat():[t]).forEach(a=>{("value"in a&&e.value===a.value||"class"in a&&e.class===a.class)&&(r=!0)}),r}:()=>!0},removeGridLines(t,e){const r=this,{config:a,$T:o}=r,i=r.getGridFilterToRemove(t),s=g=>!i(g),l=e?on.xgridLines:on.ygridLines,c=e?on.xgridLine:on.ygridLine;o(r.$el.main.select(`.${l}`).selectAll(`.${c}`).filter(i)).style("opacity","0").remove();const f=`grid_${e?"x":"y"}_lines`;a[f]=a[f].filter(s)}},Qy={initRegion(){const t=this,{$el:e}=t;e.region.main=e.main.insert("g",":first-child").attr("clip-path",t.state.clip.path).attr("class",Aa.regions)},updateRegion(){const t=this,{config:e,$el:{region:r},$T:a}=t;r.main||t.initRegion(),r.main.style("visibility",t.hasArcType()?"hidden":null);const o=r.main.selectAll(`.${Aa.region}`).data(e.regions);a(o.exit()).style("opacity","0").remove();const i=o.enter().append("g");i.append("rect").style("fill-opacity","0"),r.list=i.merge(o).attr("class",t.classRegion.bind(t)),r.list.each(function(s){var l;it(this).select("text").empty()&&((l=s.label)!=null&&l.text)&&it(this).append("text").style("opacity","0")})},redrawRegion(t){const e=this,{$el:{region:r},$T:a}=e,o=e.regionX.bind(e),i=e.regionY.bind(e),s=["width","height"];let l=r.list.select("rect"),c=r.list.selectAll("text");return l=a(l,t).attr("x",o).attr("y",i).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)),c=a(c,t).text(f=>{var g;return(g=f.label)==null?void 0:g.text}).attr("transform",({label:f})=>f.rotated?" rotate(-90)":null).attr("transform",function(f){var g;const{x:p=0,y:m=0,center:E=!1,rotated:w=!1}=(g=f.label)!=null?g:{},U=this.previousElementSibling,N={x:0,y:0};return Ue(E)&&["x","y"].forEach((D,Y)=>{E.indexOf(D)>-1&&(N[D]=(+U.getAttribute(s[Y])-mn(this)[s[Y]])/2)}),`translate(${o(f)+N.x+p}, ${i(f)+N.y+m})${w?" rotate(-90)":""}`}).attr("text-anchor",({label:f})=>f!=null&&f.rotated?"end":null).attr("dy","1em").style("fill",({label:f})=>{var g;return(g=f==null?void 0:f.color)!=null?g:null}),[l.style("fill-opacity",f=>De(f.opacity)?f.opacity:null).on("end",function(){it(this.parentNode).selectAll("rect:not([x])").remove()}),c.style("opacity",null)]},regionX(t){return this.getRegionSize("x",t)},regionY(t){return this.getRegionSize("y",t)},regionWidth(t){return this.getRegionSize("width",t)},regionHeight(t){return this.getRegionSize("height",t)},getRegionSize(t,e){const r=this,{config:a,scale:o,state:i}=r,s=a.axis_rotated,l=/(x|y|y2)/.test(t),c=l?t==="x":t==="width",f=!l&&r[c?"regionX":"regionY"](e);let g=l?"start":"end",p=l?0:i[t],m;if(e.axis==="y"||e.axis==="y2"?(!l&&!c?g="start":l&&!c&&(g="end"),(c?s:!s)&&g in e&&(m=o[e.axis])):(c?!s:s)&&g in e&&(m=o.zoom||o.x),m){let E=0;p=e[g],r.axis.isTimeSeries(e.axis)?p=Kn.call(r,p):/(x|width)/.test(t)&&r.axis.isCategorized()&&isNaN(p)&&(p=a.axis_x_categories.indexOf(p),E=r.axis.x.tickOffset()*(g==="start"?-1:1)),p=m(p)+E}return l?p:p<f?0:p-f},isRegionOnX(t){return!t.axis||t.axis==="x"}},ky={getAxisSize(t){const e=this,r=e.config.axis_rotated;return r&&t==="x"||!r&&/y2?/.test(t)?e.getAxisWidthByAxisId(t,!0):e.getHorizontalAxisHeight(t)},getAxisWidthByAxisId(t,e){var r,a;const o=this;if(o.axis){const i=(r=o.axis)==null?void 0:r.getLabelPositionById(t),{width:s}=o.axis.getMaxTickSize(t,e),l=s===0?.5:0;return s+(((a=o.config.padding)==null?void 0:a.mode)==="fit"?i.isInner?10+l:10:i.isInner?20+l:40)}else return 40},getHorizontalAxisHeight(t){var e,r;const a=this,{config:o,state:i}=a,{rotatedPadding:s,isLegendRight:l,isLegendInset:c}=i,f=o.axis_rotated,g=((e=o.padding)==null?void 0:e.mode)==="fit",p=o[`axis_${t}_inner`],m=o[`axis_${t}_label`].text,E=13;let w=((r=o.padding)==null?void 0:r.mode)==="fit"?p&&!m?t==="y"?1:0:20:30;if(t==="x"&&!o.axis_x_show)return 8;if(t==="x"&&pe(o.axis_x_height))return o.axis_x_height;if(t==="y"&&!o.axis_y_show)return o.legend_show&&!l&&!c?10:1;if(t==="y2"&&!o.axis_y2_show)return g?0:s.top;const U=a.axis.getMaxTickSize(t),N=Math.abs(o.axis_x_tick_rotate)>0&&(!o.axis_x_tick_autorotate||a.needToRotateXAxisTickTexts());return(o.axis_x_tick_multiline||N)&&U.height>E&&(w+=U.height-E),w+(a.axis.getLabelPositionById(t).isInner?0:10)+(t==="y2"&&!f?-10:0)},getEventRectWidth(){const t=this,{config:e,axis:r}=t,a=e.axis_x_inverted,o=r.x.tickInterval();return Math.max(0,a?Math.abs(o):o)},getAxisTickRotate(t){const e=this,{axis:r,config:a,state:o,$el:i}=e;let s=a[`axis_${t}_tick_rotate`];if(t==="x"){const l=r.isCategorized()||r.isTimeSeries();if(a.axis_x_tick_fit&&l){const c=a.axis_x_tick_count,f=o.current.maxTickSize.x.ticks.length;let g=0;if(c?g=c>f?f:c:f&&(g=f),g!==o.axis.x.tickCount){const{targets:p}=e.data;o.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(p,"min"),e.getXDomainMinMax(p,"max")],g)}o.axis.x.tickCount=g}i.svg&&a.axis_x_tick_autorotate&&a.axis_x_tick_fit&&!a.axis_x_tick_multiline&&!a.axis_x_tick_culling&&l&&(s=e.needToRotateXAxisTickTexts()?a.axis_x_tick_rotate:0)}return s},needToRotateXAxisTickTexts(){const t=this,{state:{axis:e,current:r,isLegendRight:a,legendItemWidth:o}}=t,i=a&&o,s=r.width-i-t.getCurrentPaddingByDirection("left")-t.getCurrentPaddingByDirection("right"),l=e.x.tickCount+e.x.padding.left+e.x.padding.right,{width:c}=t.axis.getMaxTickSize("x"),f=l?s/l:0;return c>f}},qy={axis_x_clipPath:!0,axis_x_show:!0,axis_x_forceAsSingle:!1,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_culling_lines:!0,axis_x_tick_culling_reverse:!1,axis_x_tick_count:void 0,axis_x_tick_inner:!1,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_inner:!1,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_autorotate:!1,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_inverted:!1,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[]},_y={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_culling_reverse:!1,axis_y_tick_inner:!1,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},tx={axis_y2_show:!1,axis_y2_type:"indexed",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_culling_reverse:!1,axis_y2_tick_inner:!1,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]},ex=Object.defineProperty,Fu=Object.getOwnPropertySymbols,nx=Object.prototype.hasOwnProperty,rx=Object.prototype.propertyIsEnumerable,Bu=(t,e,r)=>e in t?ex(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ss=(t,e)=>{for(var r in e||(e={}))nx.call(e,r)&&Bu(t,r,e[r]);if(Fu)for(var r of Fu(e))rx.call(e,r)&&Bu(t,r,e[r]);return t},ax=Ss(Ss(Ss({axis_evalTextSize:!0,axis_rotated:!1,axis_tooltip:!1},qy),_y),tx),ox={grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:void 0,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0},ix={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1};const sx=[yy,xy,Ty,Sy,$y,Ay,Ey],Uu={axis:Gy,clip:Yy,eventrect:Xy,flow:Wy,grid:Jy,region:Qy,sizeAxis:ky},zu={optDataAxis:ix,optAxis:ax,optGrid:ox};var Y1=Array.prototype.slice;function $s(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Le(t){return function(){return t}}function lx(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function cx(t){return t}function ux(){var t=cx,e=lx,r=null,a=Le(0),o=Le(Go),i=Le(0);function s(l){var c,f=(l=$s(l)).length,g,p,m=0,E=new Array(f),w=new Array(f),U=+a.apply(this,arguments),N=Math.min(Go,Math.max(-Go,o.apply(this,arguments)-U)),D,Y=Math.min(Math.abs(N)/f,i.apply(this,arguments)),J=Y*(N<0?-1:1),K;for(c=0;c<f;++c)(K=w[E[c]=c]=+t(l[c],c,l))>0&&(m+=K);for(e!=null?E.sort(function(nt,Q){return e(w[nt],w[Q])}):r!=null&&E.sort(function(nt,Q){return r(l[nt],l[Q])}),c=0,p=m?(N-f*J)/m:0;c<f;++c,U=D)g=E[c],K=w[g],D=U+(K>0?K*p:0)+J,w[g]={data:l[g],index:c,value:K,startAngle:U,endAngle:D,padAngle:Y};return w}return s.value=function(l){return arguments.length?(t=typeof l=="function"?l:Le(+l),s):t},s.sortValues=function(l){return arguments.length?(e=l,r=null,s):e},s.sort=function(l){return arguments.length?(r=l,e=null,s):r},s.startAngle=function(l){return arguments.length?(a=typeof l=="function"?l:Le(+l),s):a},s.endAngle=function(l){return arguments.length?(o=typeof l=="function"?l:Le(+l),s):o},s.padAngle=function(l){return arguments.length?(i=typeof l=="function"?l:Le(+l),s):i},s}var fx=Math.pow;const As=Math.PI,Es=2*As,Xr=1e-6,dx=Es-Xr;function ju(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function hx(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ju;const r=fx(10,e);return function(a){this._+=a[0];for(let o=1,i=a.length;o<i;++o)this._+=Math.round(arguments[o]*r)/r+a[o]}}class Jo{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ju:hx(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,a,o){this._append`Q${+e},${+r},${this._x1=+a},${this._y1=+o}`}bezierCurveTo(e,r,a,o,i,s){this._append`C${+e},${+r},${+a},${+o},${this._x1=+i},${this._y1=+s}`}arcTo(e,r,a,o,i){if(e=+e,r=+r,a=+a,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,l=this._y1,c=a-e,f=o-r,g=s-e,p=l-r,m=g*g+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(m>Xr)if(!(Math.abs(p*c-f*g)>Xr)||!i)this._append`L${this._x1=e},${this._y1=r}`;else{let E=a-s,w=o-l,U=c*c+f*f,N=E*E+w*w,D=Math.sqrt(U),Y=Math.sqrt(m),J=i*Math.tan((As-Math.acos((U+m-N)/(2*D*Y)))/2),K=J/Y,nt=J/D;Math.abs(K-1)>Xr&&this._append`L${e+K*g},${r+K*p}`,this._append`A${i},${i},0,0,${+(p*E>g*w)},${this._x1=e+nt*c},${this._y1=r+nt*f}`}}arc(e,r,a,o,i,s){if(e=+e,r=+r,a=+a,s=!!s,a<0)throw new Error(`negative radius: ${a}`);let l=a*Math.cos(o),c=a*Math.sin(o),f=e+l,g=r+c,p=1^s,m=s?o-i:i-o;this._x1===null?this._append`M${f},${g}`:(Math.abs(this._x1-f)>Xr||Math.abs(this._y1-g)>Xr)&&this._append`L${f},${g}`,a&&(m<0&&(m=m%Es+Es),m>dx?this._append`A${a},${a},0,1,${p},${e-l},${r-c}A${a},${a},0,1,${p},${this._x1=f},${this._y1=g}`:m>Xr&&this._append`A${a},${a},0,${+(m>=As)},${p},${this._x1=e+a*Math.cos(i)},${this._y1=r+a*Math.sin(i)}`)}rect(e,r,a,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${a=+a}v${+o}h${-a}Z`}toString(){return this._}}function vx(){return new Jo}vx.prototype=Jo.prototype;function K1(t=3){return new Jo(+t)}function bs(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const a=Math.floor(r);if(!(a>=0))throw new RangeError(`invalid digits: ${r}`);e=a}return t},()=>new Jo(e)}function gx(t){return t.innerRadius}function px(t){return t.outerRadius}function mx(t){return t.startAngle}function yx(t){return t.endAngle}function xx(t){return t&&t.padAngle}function Tx(t,e,r,a,o,i,s,l){var c=r-t,f=a-e,g=s-o,p=l-i,m=p*c-g*f;if(!(m*m<On))return m=(g*(e-i)-p*(t-o))/m,[t+m*c,e+m*f]}function Qo(t,e,r,a,o,i,s){var l=t-r,c=e-a,f=(s?i:-i)/la(l*l+c*c),g=f*c,p=-f*l,m=t+g,E=e+p,w=r+g,U=a+p,N=(m+w)/2,D=(E+U)/2,Y=w-m,J=U-E,K=Y*Y+J*J,nt=o-i,Q=m*U-w*E,ot=(J<0?-1:1)*la(fm(0,nt*nt*K-Q*Q)),pt=(Q*J-Y*ot)/K,Tt=(-Q*Y-J*ot)/K,yt=(Q*J+Y*ot)/K,lt=(-Q*Y+J*ot)/K,jt=pt-N,vt=Tt-D,tt=yt-N,St=lt-D;return jt*jt+vt*vt>tt*tt+St*St&&(pt=yt,Tt=lt),{cx:pt,cy:Tt,x01:-g,y01:-p,x11:pt*(o/nt-1),y11:Tt*(o/nt-1)}}function Gu(){var t=gx,e=px,r=Le(0),a=null,o=mx,i=yx,s=xx,l=null,c=bs(f);function f(){var g,p,m=+t.apply(this,arguments),E=+e.apply(this,arguments),w=o.apply(this,arguments)-jo,U=i.apply(this,arguments)-jo,N=Qc(U-w),D=U>w;if(l||(l=g=c()),E<m&&(p=E,E=m,m=p),!(E>On))l.moveTo(0,0);else if(N>Go-On)l.moveTo(E*Gr(w),E*or(w)),l.arc(0,0,E,w,U,!D),m>On&&(l.moveTo(m*Gr(U),m*or(U)),l.arc(0,0,m,U,w,D));else{var Y=w,J=U,K=w,nt=U,Q=N,ot=N,pt=s.apply(this,arguments)/2,Tt=pt>On&&(a?+a.apply(this,arguments):la(m*m+E*E)),yt=hs(Qc(E-m)/2,+r.apply(this,arguments)),lt=yt,jt=yt,vt,tt;if(Tt>On){var St=kc(Tt/m*or(pt)),ct=kc(Tt/E*or(pt));(Q-=St*2)>On?(St*=D?1:-1,K+=St,nt-=St):(Q=0,K=nt=(w+U)/2),(ot-=ct*2)>On?(ct*=D?1:-1,Y+=ct,J-=ct):(ot=0,Y=J=(w+U)/2)}var At=E*Gr(Y),Wt=E*or(Y),Dt=m*Gr(nt),Zt=m*or(nt);if(yt>On){var re=E*Gr(J),ce=E*or(J),Ie=m*Gr(K),Ce=m*or(K),Pe;if(N<Ua)if(Pe=Tx(At,Wt,Ie,Ce,re,ce,Dt,Zt)){var Ye=At-Pe[0],Be=Wt-Pe[1],dn=re-Pe[0],kt=ce-Pe[1],Te=1/or(dm((Ye*dn+Be*kt)/(la(Ye*Ye+Be*Be)*la(dn*dn+kt*kt)))/2),Re=la(Pe[0]*Pe[0]+Pe[1]*Pe[1]);lt=hs(yt,(m-Re)/(Te-1)),jt=hs(yt,(E-Re)/(Te+1))}else lt=jt=0}ot>On?jt>On?(vt=Qo(Ie,Ce,At,Wt,E,jt,D),tt=Qo(re,ce,Dt,Zt,E,jt,D),l.moveTo(vt.cx+vt.x01,vt.cy+vt.y01),jt<yt?l.arc(vt.cx,vt.cy,jt,Rn(vt.y01,vt.x01),Rn(tt.y01,tt.x01),!D):(l.arc(vt.cx,vt.cy,jt,Rn(vt.y01,vt.x01),Rn(vt.y11,vt.x11),!D),l.arc(0,0,E,Rn(vt.cy+vt.y11,vt.cx+vt.x11),Rn(tt.cy+tt.y11,tt.cx+tt.x11),!D),l.arc(tt.cx,tt.cy,jt,Rn(tt.y11,tt.x11),Rn(tt.y01,tt.x01),!D))):(l.moveTo(At,Wt),l.arc(0,0,E,Y,J,!D)):l.moveTo(At,Wt),!(m>On)||!(Q>On)?l.lineTo(Dt,Zt):lt>On?(vt=Qo(Dt,Zt,re,ce,m,-lt,D),tt=Qo(At,Wt,Ie,Ce,m,-lt,D),l.lineTo(vt.cx+vt.x01,vt.cy+vt.y01),lt<yt?l.arc(vt.cx,vt.cy,lt,Rn(vt.y01,vt.x01),Rn(tt.y01,tt.x01),!D):(l.arc(vt.cx,vt.cy,lt,Rn(vt.y01,vt.x01),Rn(vt.y11,vt.x11),!D),l.arc(0,0,m,Rn(vt.cy+vt.y11,vt.cx+vt.x11),Rn(tt.cy+tt.y11,tt.cx+tt.x11),D),l.arc(tt.cx,tt.cy,lt,Rn(tt.y11,tt.x11),Rn(tt.y01,tt.x01),!D))):l.arc(0,0,m,nt,K,D)}if(l.closePath(),g)return l=null,g+""||null}return f.centroid=function(){var g=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,p=(+o.apply(this,arguments)+ +i.apply(this,arguments))/2-Ua/2;return[Gr(p)*g,or(p)*g]},f.innerRadius=function(g){return arguments.length?(t=typeof g=="function"?g:Le(+g),f):t},f.outerRadius=function(g){return arguments.length?(e=typeof g=="function"?g:Le(+g),f):e},f.cornerRadius=function(g){return arguments.length?(r=typeof g=="function"?g:Le(+g),f):r},f.padRadius=function(g){return arguments.length?(a=g==null?null:typeof g=="function"?g:Le(+g),f):a},f.startAngle=function(g){return arguments.length?(o=typeof g=="function"?g:Le(+g),f):o},f.endAngle=function(g){return arguments.length?(i=typeof g=="function"?g:Le(+g),f):i},f.padAngle=function(g){return arguments.length?(s=typeof g=="function"?g:Le(+g),f):s},f.context=function(g){return arguments.length?(l=g==null?null:g,f):l},f}var Sx=Object.defineProperty,$x=Object.defineProperties,Ax=Object.getOwnPropertyDescriptors,Vu=Object.getOwnPropertySymbols,Ex=Object.prototype.hasOwnProperty,bx=Object.prototype.propertyIsEnumerable,Xu=(t,e,r)=>e in t?Sx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ix=(t,e)=>{for(var r in e||(e={}))Ex.call(e,r)&&Xu(t,r,e[r]);if(Vu)for(var r of Vu(e))bx.call(e,r)&&Xu(t,r,e[r]);return t},Rx=(t,e)=>$x(t,Ax(e));function Hu(t=0){const e=this,{config:r,state:a}=e,o=e.hasMultiArcGauge(),i=a.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,s=t?Math.min(a.radiusExpanded*t-a.radius,i*.8-(1-t)*100):0;return{inner(l){const{innerRadius:c}=e.getRadius(l);return o?a.radius-i*(l.index+1):pe(c)?c:0},outer(l){const{outerRadius:c}=e.getRadius(l);let f;if(o)f=a.radius-i*l.index+s;else if(e.hasType("polar")&&!t)f=e.getPolarOuterRadius(l,c);else if(f=c,t){let{radiusExpanded:g}=a;a.radius!==c&&(g-=Math.abs(a.radius-c)),f=g*t}return f},corner(l,c){const{arc_cornerRadius_ratio:f=0,arc_cornerRadius:g=0}=r,{data:{id:p},value:m}=l;let E=0;return f?E=f*c:E=pe(g)?g:g.call(e.api,p,m,c),E}}}function Is(t){return function(e){const r=({startAngle:o=0,endAngle:i=0,padAngle:s=0})=>({startAngle:o,endAngle:i,padAngle:s}),a=kr(r(this._current),r(e));return this._current=e,function(o){const i=a(o),{data:s,index:l,value:c}=e;return t(Rx(Ix({},i),{data:s,index:l,value:c}))}}}var Ox={initPie(){const t=this,{config:e}=t,r=e.data_type,a=e[`${r}_padding`],o=e[`${r}_startingAngle`]||0,i=(a?a*.01:e[`${r}_padAngle`])||0;t.pie=ux().startAngle(o).endAngle(o+2*Math.PI).padAngle(i).value(s=>{var l,c;return(c=(l=s.values)==null?void 0:l.reduce((f,g)=>f+g.value,0))!=null?c:s}).sort(t.getSortCompareFn.bind(t)(!0))},updateRadius(){const t=this,{config:e,state:r}=t,a=e.data_type,o=e[`${a}_padding`],i=e.gauge_width||e.donut_width,s=t.filterTargetsToShow(t.data.targets).length*e.gauge_arcs_minWidth;r.radiusExpanded=Math.min(r.arcWidth,r.arcHeight)/2*(t.hasMultiArcGauge()&&e.gauge_label_show?.85:1),r.radius=r.radiusExpanded*.95,r.innerRadiusRatio=i?(r.radius-i)/r.radius:.6,r.gaugeArcWidth=i||(s<=r.radius-r.innerRadius?r.radius-r.innerRadius:s<=r.radius?s:r.radius);const l=e.pie_innerRadius||(o?o*(r.innerRadiusRatio+.1):0);r.outerRadius=e.pie_outerRadius,r.innerRadius=t.hasType("donut")||t.hasType("gauge")?r.radius*r.innerRadiusRatio:l},getRadius(t){const e=this,r=t==null?void 0:t.data;let{innerRadius:a,outerRadius:o}=e.state;return!pe(a)&&r&&(a=a[r.id]||0),ze(o)&&r&&r.id in o?o=o[r.id]:pe(o)||(o=e.state.radius),{innerRadius:a,outerRadius:o}},updateArc(){const t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength(){const t=this,{config:e}=t,r=e.gauge_arcLength*3.6;let a=2*(r/360);return r<-360?a=-2:r>360&&(a=2),a*Math.PI},getStartingAngle(){const t=this,{config:e}=t,r=e.data_type,a=t.hasType("gauge")?e.gauge_fullCircle:!1,o=-1*Math.PI/2,i=Math.PI/2;let s=e[`${r}_startingAngle`]||0;return!a&&s<=o?s=o:!a&&s>=i?s=i:(s>Math.PI||s<-1*Math.PI)&&(s=Math.PI),s},updateAngle(t,e=!1){var r;const a=this,{config:o,state:i}=a,s=e&&a.hasType("gauge");let{pie:l}=a,c=t,f=!1;if(!o)return null;const g=a.getStartingAngle(),p=o.gauge_fullCircle||e&&!s?a.getArcLength():g*-2;if(c.data&&a.isGaugeType(c.data)&&!a.hasMultiArcGauge()){const{gauge_min:m,gauge_max:E}=o,w=a.getTotalDataSum(i.rendered),U=p*((w-m)/(E-m));l=l.startAngle(g).endAngle(U+g)}if(e===!1&&l(a.filterTargetsToShow()).forEach((m,E)=>{var w;!f&&m.data.id===((w=c.data)==null?void 0:w.id)&&(f=!0,c=m,c.index=E)}),isNaN(c.startAngle)&&(c.startAngle=0),isNaN(c.endAngle)&&(c.endAngle=c.startAngle),e||c.data&&(o.gauge_enforceMinMax||a.hasMultiArcGauge())){const{gauge_min:m,gauge_max:E}=o,w=e&&!s?a.getTotalDataSum(i.rendered):E,U=p/(w-m),N=(r=c.value)!=null?r:0,D=N<m?0:N<w?N-m:w-m;c.startAngle=g,c.endAngle=g+U*D}return f||e?c:null},getSvgArc(){const t=this,{inner:e,outer:r,corner:a}=Hu.call(t),o=Gu().innerRadius(e).outerRadius(r),i=function(s,l){var c;let f="M 0 0";if(s.value||s.data){const g=l?s:(c=t.updateAngle(s))!=null?c:null;g&&(f=o.cornerRadius(a(g,r(g)))(g))}return f};return i.centroid=o.centroid,i},getSvgArcExpanded(t=1){const e=this,{inner:r,outer:a,corner:o}=Hu.call(e,t),i=Gu().innerRadius(r).outerRadius(a);return s=>{const l=e.updateAngle(s),c=a(l);let f=0;return l&&(f=o(l,c)),l?i.cornerRadius(f)(l):"M 0 0"}},getArc(t,e,r){return r||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},redrawArcRangeText(){const t=this,{config:e,$el:{arcs:r},state:a,$T:o}=t,i=e.arc_rangeText_format,s=t.hasType("gauge")&&e.arc_rangeText_fixed;let l=e.arc_rangeText_values;if(l!=null&&l.length){const c=e.arc_rangeText_unit==="%",f=t.getTotalDataSum(a.rendered);c&&(l=l.map(m=>f/100*m));const g=t.pie(l).map((m,E)=>(m.index=E,m));let p=r.selectAll(`.${Ve.arcRange}`).data(l);p.exit(),p=o(p.enter().append("text").attr("class",Ve.arcRange).style("text-anchor","middle").style("pointer-events","none").style("opacity","0").text(m=>{const E=c?m/f*100:m;return he(i)?i(E):`${E}${c?"%":""}`}).merge(p)),(!a.rendered||a.rendered&&!s)&&f>0&&p.attr("transform",function(m,E){return t.transformForArcLabel(this,g[E],!0)}),p.style("opacity",m=>!s&&(m>f||f===0)?"0":null)}},transformForArcLabel(t,e,r=!1){var a,o,i;const s=this,{config:l,state:{radiusExpanded:c}}=s,f=s.updateAngle(e,r),g={x:0,y:0};let p="",m=1;if(f){if(r||s.hasMultiArcGauge()){const E=Math.sin(f.endAngle-Math.PI/2),w=l.arc_rangeText_position;if(g.x=Math.cos(f.endAngle-Math.PI/2)*(c+(r?5:25)),g.y=E*(c+15-Math.abs(E*10))+3,r&&w){const U=l.arc_rangeText_values,N=he(w)?w(U[e.index]):w;g.x+=(a=N==null?void 0:N.x)!=null?a:0,g.y+=(o=N==null?void 0:N.y)!=null?o:0}}else if(!s.hasType("gauge")||s.data.targets.length>1){let{outerRadius:E}=s.getRadius(e);s.hasType("polar")&&(E=s.getPolarOuterRadius(e,E));const w=this.svgArc.centroid(f),[U,N]=w.map(Y=>isNaN(Y)?0:Y),D=Math.sqrt(U*U+N*N);g.x=U,g.y=N,m=(i=["donut","gauge","pie","polar"].filter(s.hasType.bind(s)).map(Y=>l[`${Y}_label_ratio`]))==null?void 0:i[0],m?m=he(m)?m.bind(s.api)(e,E,D):m:m=E&&(D?(36/E>.375?1.175-36/E:.8)*E/D:0)}Wc.call(s,t,g),p=`translate(${g.x*m},${g.y*m})`}return p},convertToArcData(t){return this.addName({id:"data"in t?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel(t){const e=this,r=e.hasType("gauge");e.shouldShowArcLabel()&&t.style("fill",e.updateTextColor.bind(e)).attr("filter",a=>e.updateTextBGColor.bind(e)(a,e.config.data_labels_backgroundColors)).each(function(a){var o;const i=it(this),s=e.updateAngle(a),l=e.getRatio("arc",s);if(cs.call(e,l,(o=["donut","gauge","pie","polar"].filter(e.hasType.bind(e)))==null?void 0:o[0])){const{value:f}=s||a,g=(e.getArcLabelConfig("format")||e.defaultArcValueFormat)(f,l,a.data.id).toString();Da(i,g,[-1,1],r)}else i.text("")})},expandArc(t){const e=this,{state:{transiting:r},$el:a}=e;if(r){const i=setInterval(()=>{r||(clearInterval(i),a.legend.selectAll(`.${qe.legendItemFocused}`).size()>0&&e.expandArc(t))},10);return}const o=e.mapToTargetIds(t);a.svg.selectAll(e.selectorTargets(o,`.${Ve.chartArc}`)).each(function(i){if(!e.shouldExpand(i.data.id))return;const s=e.getExpandConfig(i.data.id,"duration"),l=e.getSvgArcExpanded(e.getExpandConfig(i.data.id,"rate"));it(this).selectAll("path").transition().duration(s).attrTween("d",Is(e.svgArcExpanded.bind(e))).transition().duration(s*2).attrTween("d",Is(l.bind(e)))})},unexpandArc(t){const e=this,{state:{transiting:r},$el:{svg:a}}=e;if(r)return;const o=e.mapToTargetIds(t);a.selectAll(e.selectorTargets(o,`.${Ve.chartArc}`)).selectAll("path").transition().duration(i=>e.getExpandConfig(i.data.id,"duration")).attrTween("d",Is(e.svgArc.bind(e))),a.selectAll(`${Ve.arc}`).style("opacity",null)},getExpandConfig(t,e){const r=this,{config:a}=r,o={duration:50,rate:.98};let i;return r.isDonutType(t)?i="donut":r.isGaugeType(t)?i="gauge":r.isPieType(t)&&(i="pie"),i?a[`${i}_expand_${e}`]:o[e]},shouldExpand(t){const e=this,{config:r}=e;return e.isDonutType(t)&&r.donut_expand||e.isGaugeType(t)&&r.gauge_expand||e.isPieType(t)&&r.pie_expand},shouldShowArcLabel(){const t=this,{config:e}=t;return["donut","gauge","pie","polar"].some(r=>t.hasType(r)&&e[`${r}_label_show`])},getArcLabelConfig(t="format"){const e=this,{config:r}=e;let a=o=>o;return["donut","gauge","pie","polar"].filter(e.hasType.bind(e)).forEach(o=>{a=r[`${o}_label_${t}`]}),t==="format"&&he(a)?a.bind(e.api):a},updateTargetsForArc(t){const e=this,{$el:r}=e,a=e.hasType("gauge"),o=e.getChartClass("Arc"),i=e.getClass("arcs",!0),s=e.classFocus.bind(e),l=r.main.select(`.${Ve.chartArcs}`),c=l.selectAll(`.${Ve.chartArc}`).data(e.pie(t)).attr("class",g=>o(g)+s(g.data)),f=c.enter().append("g").attr("class",o).call(this.setCssRule(!1,`.${Ve.chartArcs} text`,["pointer-events:none","text-anchor:middle"]));f.append("g").attr("class",i).merge(c),f.append("text").attr("dy",a&&!e.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor",e.getStylePropValue("middle")).style("pointer-events",e.getStylePropValue("none")),r.text=l.selectAll(`.${Se.target} text`)},initArc(){const t=this,{$el:e}=t;e.arcs=e.main.select(`.${Se.chart}`).append("g").attr("class",Ve.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle(t){const e=this,r=t||e.getArcTitle(),a=e.hasType("gauge");if(r){const o=a?jn.chartArcsGaugeTitle:Ve.chartArcsTitle;let i=e.$el.arcs.select(`.${o}`);i.empty()&&(i=e.$el.arcs.append("text").attr("class",o).style("text-anchor","middle")),a&&i.attr("dy","-0.3em"),Da(i,r,a?void 0:[-.6,1.35],!0)}},getArcTitle(){const t=this,e=t.hasType("donut")&&"donut"||t.hasType("gauge")&&"gauge";return e?t.config[`${e}_title`]:""},getArcTitleWithNeedleValue(){const t=this,{config:e,state:r}=t,a=t.getArcTitle();if(a&&t.config.arc_needle_show&&/{=[A-Z_]+}/.test(a)){let o=r.current.needle;return pe(o)||(o=e.arc_needle_value),Na(a,{NEEDLE_VALUE:~~o})}return!1},redrawArc(t,e,r){const a=this,{config:o,state:i,$el:{main:s}}=a,l=o.interaction_enabled,c=l&&o.data_selection_isselectable;let f=s.selectAll(`.${Ve.arcs}`).selectAll(`.${Ve.arc}`).data(a.arcData.bind(a));f.exit().transition().duration(e).style("opacity","0").remove(),f=f.enter().append("path").attr("class",a.getClass("arc",!0)).style("fill",g=>a.color(g.data)).style("cursor",g=>{var p;return(p=c==null?void 0:c.bind)!=null&&p.call(c,a.api)(g)?"pointer":null}).style("opacity","0").each(function(g){a.isGaugeType(g.data)&&(g.startAngle=o.gauge_startingAngle,g.endAngle=o.gauge_startingAngle),this._current=g}).merge(f),a.hasType("gauge")&&(a.updateGaugeMax(),a.hasMultiArcGauge()&&a.redrawArcGaugeLine()),f.attr("transform",g=>!a.isGaugeType(g.data)&&r?"scale(0)":"").style("opacity",function(g){return g===this._current?"0":null}).each(()=>{i.transiting=!0}).transition().duration(t).attrTween("d",function(g){const p=a.updateAngle(g);if(!p)return()=>"M 0 0";isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);const m=kr(this._current,p);return this._current=m(0),function(E){const w=m(E);return w.data=g.data,a.getArc(w,!0)}}).attr("transform",r?"scale(1)":"").style("fill",g=>{let p;return a.levelColor?(p=a.levelColor(g.data.values[0].value),o.data_colors[g.data.id]=p):p=a.color(g.data),p}).style("opacity",null).call(bo,function(){if(a.levelColor){const g=it(this),p=g.datum(this._current);a.updateLegendItemColor(p.data.id,g.style("fill"))}i.transiting=!1,_e(o.onrendered,a.api)}),l&&a.bindArcEvent(f),a.hasType("polar")&&a.redrawPolar(),a.hasType("gauge")&&a.redrawBackgroundArcs(),o.arc_needle_show&&a.redrawNeedle(),a.redrawArcText(t),a.redrawArcRangeText()},redrawNeedle(){const t=this,{$el:e,config:r,state:{hiddenTargetIds:a,radius:o}}=t,i=(o-1)/100*r.arc_needle_length,s=a.length!==t.data.targets.length;let l=t.$el.arcs.select(`.${Ve.needle}`);const c=r.arc_needle_path,f=r.arc_needle_bottom_width/2,g=r.arc_needle_top_width/2,p=r.arc_needle_top_rx,m=r.arc_needle_top_ry,E=r.arc_needle_bottom_len,w=r.arc_needle_bottom_rx,U=r.arc_needle_bottom_ry,N=t.getNeedleAngle(),D=()=>{const Y=t.getArcTitleWithNeedleValue();Y&&t.setArcTitle(Y)};if(D(),l.empty()&&(l=e.arcs.append("path").classed(Ve.needle,!0),e.needle=l,e.needle.updateHelper=(Y,J=!1)=>{e.needle.style("display")!=="none"&&t.$T(e.needle).style("transform",`rotate(${t.getNeedleAngle(Y)}deg)`).call(bo,()=>{J&&(r.arc_needle_value=Y),D()})}),s){const Y=he(c)?c.call(t,i):`M-${f} ${E} A${w} ${U} 0 0 0 ${f} ${E} L${g} -${i} A${p} ${m} 0 0 0 -${g} -${i} L-${f} ${E} Z`;t.$T(l).attr("d",Y).style("fill",r.arc_needle_color).style("display",null).style("transform",`rotate(${N}deg)`)}else l.style("display","none")},getNeedleAngle(t){const e=this,{config:r,state:a}=e,o=e.getArcLength(),i=e.hasType("gauge"),s=e.getTotalDataSum(!0);let l=Qe(t)?t:r.arc_needle_value,c=r[`${r.data_type}_startingAngle`]||0,f=0;if(pe(l)||(l=i&&e.data.targets.length===1?s:0),a.current.needle=l,i){c=e.getStartingAngle();const g=r.gauge_fullCircle?o:c*-2,{gauge_min:p,gauge_max:m}=r;f=g*((l-p)/(m-p))}else f=o*(l/s);return(c+f)*(180/Math.PI)},redrawBackgroundArcs(){const t=this,{config:e,state:r}=t,a=t.hasMultiArcGauge(),o=e.gauge_fullCircle,i=t.filterTargetsToShow(t.data.targets).length===0&&!!e.data_empty_label_text,s=t.getStartingAngle(),l=o?s+t.getArcLength():s*-1;let c=t.$el.arcs.select(`${a?"g":""}.${Ve.chartArcsBackground}`);if(a){let f=0;c=c.selectAll(`path.${Ve.chartArcsBackground}`).data(t.data.targets),c.enter().append("path").attr("class",(g,p)=>`${Ve.chartArcsBackground} ${Ve.chartArcsBackground}-${p}`).merge(c).style("fill",e.gauge_background||null).attr("d",({id:g})=>{if(i||r.hiddenTargetIds.indexOf(g)>=0)return"M 0 0";const p={data:[{value:e.gauge_max}],startAngle:s,endAngle:l,index:f++};return t.getArc(p,!0,!0)}),c.exit().remove()}else c.attr("d",i?"M 0 0":()=>{const f={data:[{value:e.gauge_max}],startAngle:s,endAngle:l};return t.getArc(f,!0,!0)})},bindArcEvent(t){const e=this,{config:r,state:a}=e,o=a.inputType==="touch",i=a.inputType==="mouse";function s(c,f,g){e.expandArc(g),e.api.focus(g),e.toggleFocusLegend(g,!0),e.showTooltip([f],c)}function l(c){const f=(c==null?void 0:c.id)||void 0;e.unexpandArc(f),e.api.revert(),e.revertLegend(),e.hideTooltip()}if(t.on("click",function(c,f,g){var p;const m=e.updateAngle(f);let E;m&&(E=e.convertToArcData(m),(p=e.toggleShape)==null||p.call(e,this,E,g),r.data_onclick.bind(e.api)(E,this))}),i&&t.on("mouseover",function(c,f){if(a.transiting)return;a.event=c;const g=e.updateAngle(f),p=g?e.convertToArcData(g):null,m=(p==null?void 0:p.id)||void 0;s(this,p,m),e.setOverOut(!0,p)}).on("mouseout",(c,f)=>{if(a.transiting||!r.interaction_onout)return;a.event=c;const g=e.updateAngle(f),p=g?e.convertToArcData(g):null;l(),e.setOverOut(!1,p)}).on("mousemove",function(c,f){const g=e.updateAngle(f),p=g?e.convertToArcData(g):null;a.event=c,e.showTooltip([p],this)}),o&&e.hasArcType()&&!e.radars){const c=f=>{var g,p;const{clientX:m,clientY:E}=(p=(g=f.changedTouches)==null?void 0:g[0])!=null?p:{clientX:0,clientY:0};return it(pn.elementFromPoint(m,E))};e.$el.svg.on("touchstart touchmove",function(f){if(a.transiting)return;a.event=f;const p=c(f).datum(),m=p!=null&&p.data&&p.data.id?e.updateAngle(p):null,E=m?e.convertToArcData(m):null,w=(E==null?void 0:E.id)||void 0;e.callOverOutForTouch(E),ln(w)?l():s(this,E,w)})}},redrawArcText(t){const e=this,{config:r,state:a,$el:{main:o,arcs:i}}=e,s=e.hasType("gauge"),l=e.hasMultiArcGauge();let c;if(s&&e.data.targets.length===1&&r.gauge_title||(c=o.selectAll(`.${Ve.chartArc}`).select("text").style("opacity","0").attr("class",f=>e.isGaugeType(f.data)?jn.gaugeValue:null).call(e.textForArcLabel.bind(e)).style("font-size",f=>e.isGaugeType(f.data)&&e.data.targets.length===1&&!l?`${Math.round(a.radius/5)}px`:null),Hc.call(e),c.attr("transform",function(f){return e.transformForArcLabel.bind(e)(this,f)}).transition().duration(t).style("opacity",f=>e.isTargetToShow(f.data.id)&&e.isArcType(f.data)?null:"0"),l&&c.attr("dy","-.1em")),o.select(`.${Ve.chartArcsTitle}`).style("opacity",e.hasType("donut")||s?null:"0"),s){const f=r.gauge_fullCircle;f&&(c==null||c.attr("dy",`${l?0:Math.round(a.radius/14)}`)),r.gauge_label_show&&(i.select(`.${jn.chartArcsGaugeUnit}`).attr("dy",`${f?1.5:.75}em`).text(r.gauge_units),i.select(`.${jn.chartArcsGaugeMin}`).attr("dx",`${-1*(a.innerRadius+(a.radius-a.innerRadius)/(f?1:2))}px`).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_min,!1)),!f&&i.select(`.${jn.chartArcsGaugeMax}`).attr("dx",`${a.innerRadius+(a.radius-a.innerRadius)/2}px`).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_max,!0)))}},getArcElementByIdOrIndex(t){const e=this,{$el:{arcs:r}}=e,a=pe(t)?o=>o.index===t:o=>o.data.id===t;return r==null?void 0:r.selectAll(`.${Se.target} path`).filter(a)}};function Wu(t){return t[0]}function Yu(t){return t[1]}function Ku(t,e){var r=Le(!0),a=null,o=ps,i=null,s=bs(l);t=typeof t=="function"?t:t===void 0?Wu:Le(t),e=typeof e=="function"?e:e===void 0?Yu:Le(e);function l(c){var f,g=(c=$s(c)).length,p,m=!1,E;for(a==null&&(i=o(E=s())),f=0;f<=g;++f)!(f<g&&r(p=c[f],f,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+t(p,f,c),+e(p,f,c));if(E)return i=null,E+""||null}return l.x=function(c){return arguments.length?(t=typeof c=="function"?c:Le(+c),l):t},l.y=function(c){return arguments.length?(e=typeof c=="function"?c:Le(+c),l):e},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Le(!!c),l):r},l.curve=function(c){return arguments.length?(o=c,a!=null&&(i=o(a)),l):o},l.context=function(c){return arguments.length?(c==null?a=i=null:i=o(a=c),l):a},l}function Cx(t,e,r){var a=null,o=Le(!0),i=null,s=ps,l=null,c=bs(f);t=typeof t=="function"?t:t===void 0?Wu:Le(+t),e=typeof e=="function"?e:Le(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?Yu:Le(+r);function f(p){var m,E,w,U=(p=$s(p)).length,N,D=!1,Y,J=new Array(U),K=new Array(U);for(i==null&&(l=s(Y=c())),m=0;m<=U;++m){if(!(m<U&&o(N=p[m],m,p))===D)if(D=!D)E=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),w=m-1;w>=E;--w)l.point(J[w],K[w]);l.lineEnd(),l.areaEnd()}D&&(J[m]=+t(N,m,p),K[m]=+e(N,m,p),l.point(a?+a(N,m,p):J[m],r?+r(N,m,p):K[m]))}if(Y)return l=null,Y+""||null}function g(){return Ku().defined(o).curve(s).context(i)}return f.x=function(p){return arguments.length?(t=typeof p=="function"?p:Le(+p),a=null,f):t},f.x0=function(p){return arguments.length?(t=typeof p=="function"?p:Le(+p),f):t},f.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:Le(+p),f):a},f.y=function(p){return arguments.length?(e=typeof p=="function"?p:Le(+p),r=null,f):e},f.y0=function(p){return arguments.length?(e=typeof p=="function"?p:Le(+p),f):e},f.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Le(+p),f):r},f.lineX0=f.lineY0=function(){return g().x(t).y(e)},f.lineY1=function(){return g().x(t).y(r)},f.lineX1=function(){return g().x(a).y(e)},f.defined=function(p){return arguments.length?(o=typeof p=="function"?p:Le(!!p),f):o},f.curve=function(p){return arguments.length?(s=p,i!=null&&(l=s(i)),f):s},f.context=function(p){return arguments.length?(p==null?i=l=null:l=s(i=p),f):i},f}var ca={initArea(t){const e=this,{config:r}=e;t.insert("g",`.${r.area_front?An.circles:dr.lines}`).attr("class",e.getClass("areas",!0))},updateAreaColor(t){const e=this;return e.config.area_linearGradient?e.getGradienColortUrl(t.id):e.color(t)},updateArea(t,e=!1){const r=this,{config:a,state:o,$el:i,$T:s}=r,l=e?i.subchart:i;a.area_linearGradient&&r.updateLinearGradient();const c=l.main.selectAll(`.${no.areas}`).selectAll(`.${no.area}`).data(r.lineData.bind(r));s(c.exit(),t).style("opacity","0").remove(),l.area=c.enter().append("path").attr("class",r.getClass("area",!0)).style("fill",r.updateAreaColor.bind(r)).style("opacity",function(){return o.orgAreaOpacity=it(this).style("opacity"),"0"}).merge(c),c.style("opacity",o.orgAreaOpacity),r.setRatioForGroupedData(l.area.data())},redrawArea(t,e,r=!1){const a=this,{area:o}=r?this.$el.subchart:this.$el,{orgAreaOpacity:i}=a.state;return[a.$T(o,e,ar()).attr("d",t).style("fill",a.updateAreaColor.bind(a)).style("opacity",s=>String(a.isAreaRangeType(s)?i/1.75:i))]},generateDrawArea(t,e){const r=this,{config:a}=r,o=a.line_connectNull,i=a.axis_rotated,s=r.generateGetAreaPoints(t,e),l=r.getYScaleById.bind(r),c=p=>(e?r.subxx:r.xx).call(r,p),f=(p,m)=>r.isGrouped(p.id)?s(p,m)[0][1]:l(p.id,e)(r.isAreaRangeType(p)?r.getRangedData(p,"high"):r.getShapeYMin(p.id)),g=(p,m)=>r.isGrouped(p.id)?s(p,m)[1][1]:l(p.id,e)(r.isAreaRangeType(p)?r.getRangedData(p,"low"):p.value);return p=>{let m=o?r.filterRemoveNull(p.values):p.values,E=0,w=0,U;if(r.isAreaType(p)){let N=Cx();N=i?N.y(c).x0(f).x1(g):N.x(c).y0(a.area_above?0:a.area_below?r.state.height:f).y1(g),o||(N=N.defined(D=>r.getBaseValue(D)!==null)),r.isStepType(p)&&(m=r.convertValuesToStep(m)),U=N.curve(r.getCurve(p))(m)}else m[0]&&(E=r.scale.x(m[0].x),w=r.getYScaleById(p.id)(m[0].value)),U=i?`M ${w} ${E}`:`M ${E} ${w}`;return U||"M 0 0"}},generateGetAreaPoints(t,e){const r=this,{config:a}=r,o=r.getShapeX(0,t,e),i=r.getShapeY(!!e),s=r.getShapeOffset(r.isAreaType,t,e),l=r.getYScaleById.bind(r);return function(c,f){const g=l.call(r,c.id,e)(r.getShapeYMin(c.id)),p=s(c,f)||g,m=o(c),E=c.value;let w=i(c);return a.axis_rotated&&(E>0&&w<g||E<0&&g<w)&&(w=g),[[m,p],[m,w-(g-p)],[m,w-(g-p)],[m,p]]}}};function Rs(t){const e=this.config.bar_connectLine,r=(e==null?void 0:e[t])||e;return/^(start|end)\-(start|end)$/.test(r)?r:null}var Px={initBar(){const{$el:t,config:e,state:{clip:r}}=this;t.bar=t.main.select(`.${Se.chart}`),t.bar=e.bar_front?t.bar.append("g"):t.bar.insert("g",":first-child"),t.bar.attr("class",zn.chartBars).call(this.setCssRule(!1,`.${zn.chartBars}`,["pointer-events:none"])),e.clipPath===!1&&(e.bar_radius||e.bar_radius_ratio)&&t.bar.attr("clip-path",r.pathXAxis.replace(/#[^)]*/,`#${r.id}`))},updateTargetsForBar(t){const e=this,{config:r,$el:a}=e,o=e.getChartClass("Bar"),i=e.getClass("bars",!0),s=e.classFocus.bind(e),l=r.interaction_enabled&&r.data_selection_isselectable;a.bar||e.initBar(),a.main.select(`.${zn.chartBars}`).selectAll(`.${zn.chartBar}`).data(e.filterNullish(t)).attr("class",g=>o(g)+s(g)).enter().append("g").attr("class",o).style("opacity","0").style("pointer-events",e.getStylePropValue("none")).append("g").attr("class",i).style("cursor",g=>{var p;return(p=l==null?void 0:l.bind)!=null&&p.call(l,e.api)(g)?"pointer":null}).call(g=>{e.setCssRule(!0,` .${zn.bar}`,["fill"],e.color)(g),g.each(function(p){Rs.call(e,p.id)&&it(this).append("path").attr("class",zn.barConnectLine)})})},updateBar(t,e=!1){const r=this,{config:a,$el:o,$T:i}=r,s=e?o.subchart:o,l=r.getClass("bar",!0),c=r.initialOpacity.bind(r);a.bar_linearGradient&&r.updateLinearGradient();const f=s.main.selectAll(`.${zn.bars}`).selectAll(`.${zn.bar}`).data(r.labelishData.bind(r));i(f.exit(),t).style("opacity","0").remove(),s.bar=f.enter().append("path").attr("class",l).style("fill",r.updateBarColor.bind(r)).merge(f).style("opacity",c),r.setRatioForGroupedData(s.bar.data())},updateBarColor(t){const e=this,r=e.getStylePropValue(e.color);return e.config.bar_linearGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawBar(t,e,r=!1){const a=this,{bar:o}=r?a.$el.subchart:a.$el,i=[];return[a.$T(o,e,ar()).attr("d",function(s,l,c){const f=(pe(s.value)||a.isBarRangeType(s))&&t(s,l),g=Rs.call(a,s.id);if(f.length>1&&(i.push(f[1]),l===c.length-1)){const p=a.$T(it(this.parentNode.querySelector(`.${zn.barConnectLine}`)),e,ar());a.updateConnectLine(p,g,i),i.splice(0)}return f[0]}).style("fill",a.updateBarColor.bind(a)).style("clip-path",s=>s.clipPath).style("opacity",null)]},generateDrawBar(t,e){const r=this,{config:a}=r,o=r.generateGetBarPoints(t,e),i=a.axis_rotated,s=a.bar_radius,l=a.bar_radius_ratio,c=pe(s)&&s>0?()=>s:pe(l)?f=>f*l:null;return(f,g)=>{const p=o(f,g),m=+i,E=+!m,w=f.value<0,U=a[`axis_${r.axis.getId(f.id)}_inverted`],N=!U&&w||U&&!w,D=["",""],Y=r.isGrouped(f.id),J=c&&Y?r.isStackingRadiusData(f):!1,K=[p[0][m],p[0][E]];let nt=0;if(f.clipPath=null,c){const Tt=i?E:m,yt=p[2][Tt]-p[0][Tt];nt=!Y||J?c(yt):0;const lt=`a${nt} ${nt} ${N?"1 0 0":"0 0 1"} `;D[+!i]=`${lt}${nt},${nt}`,D[+i]=`${lt}${[-nt,nt][i?"sort":"reverse"]()}`,N&&D.reverse()}const Q=i?p[1][m]+(N?nt:-nt):p[1][E]+(N?-nt:nt);if(nt){let Tt="";i?N&&K[0]<Q?Tt=`0 ${Q-K[0]}px 0 0`:!N&&K[0]>Q&&(Tt=`0 0 0 ${K[0]-Q}px`):N&&K[1]>Q?Tt=`${K[1]-Q}px 0 0 0`:!N&&K[1]<Q&&(Tt=`0 0 ${Q-K[1]}px 0`),Tt&&(f.clipPath=`inset(${Tt})`)}const ot=i?`H${Q} ${D[0]}V${p[2][E]-nt} ${D[1]}H${p[3][m]}`:`V${Q} ${D[0]}H${p[2][m]-nt} ${D[1]}V${p[3][E]}`,pt=[`M${p[0][m]},${p[0][E]}${ot}z`];return Rs.call(r,f.id)&&pt.push(i?{x:p[0][m],y:p[0][E],width:p[0][m]-Q,height:p[2][E]-p[0][E]}:{x:p[0][m],y:Q,width:p[2][m]-p[0][m],height:p[3][E]-Q}),pt}},isStackingRadiusData(t){const e=this,{$el:r,config:a,data:o,state:i}=e,{id:s,index:l,value:c}=t;if(i.hiddenTargetIds.indexOf(s)>-1){const m=r.bar.filter(E=>E.id===s&&E.value===c);return!m.empty()&&/a\d+/i.test(m.attr("d"))}const f=a.data_groups.find(m=>m.indexOf(s)>-1),p=e.orderTargets(e.filterTargetsToShow(o.targets.filter(e.isBarType,e))).filter(m=>f.indexOf(m.id)>-1).map(m=>m.values.filter(E=>E.index===l&&(pe(c)&&c>0?E.value>0:E.value<0))[0]).filter(Boolean).map(m=>m.id);return c!==0&&p.indexOf(s)===p.length-1},generateGetBarPoints(t,e){const r=this,{config:a}=r,o=e?r.axis.subX:r.axis.x,i=r.getIndicesMax(t)+1,s=r.getBarW("bar",o,i),l=r.getShapeX(s,t,!!e),c=r.getShapeY(!!e),f=r.getShapeOffset(r.isBarType,t,!!e),g=r.getYScaleById.bind(r);return(p,m)=>{const{id:E}=p,w=g.call(r,E,e)(r.getShapeYMin(E)),U=f(p,m)||w,N=pe(s)?s:s[p.id]||s._$width,D=a[`axis_${r.axis.getId(E)}_inverted`],Y=p.value,J=l(p);let K=c(p);a.axis_rotated&&!D&&(Y>0&&K<w||Y<0&&w<K)&&(K=w),r.isBarRangeType(p)||(K-=w-U);const nt=J+N;return[[J,U],[J,K],[nt,K],[nt,U]]}},updateConnectLine(t,e,r){const a=r.map((o,i,s)=>{const l=this.config.axis_rotated,c=/^start-(start|end)$/.test(e),f=/^end-(start|end)$/.test(e),g=[],p=l?f?o.x-o.width:o.x:o.x+o.width,m=l||c?o.y+o.height:o.y;return i===0?g.push(`${p},${m}`):(g.push(l?`L${o.x-(/\w+-end$/.test(e)?o.width:0)},${o.y}`:`L${o.x},${o.y+(/\w+-start$/.test(e)?o.height:0)}`),i<s.length-1&&g.push(`M${p},${m}`)),g.join(" ")});t.attr("d",`M${a.join("")}z`)}},Mx={initBubble(){const t=this,{config:e}=t;t.hasType("bubble")&&(e.point_show=!0,e.point_type="circle")},getBaseLength(){const t=this,{width:e,height:r}=t.state,a=Mn.bubbleBaseLength;let o=t.cache.get(a);return o||t.cache.add(a,o=tr("min",[e,r])),o},getBubbleR(t){const e=this;let r=e.config.bubble_maxR;he(r)?r=r.bind(e.api)(t):pe(r)||(r=e.getBaseLength()/(e.getMaxDataCount()*2)+12);const a=tr("max",e.getMinMaxData().max.map(s=>e.isBubbleZType(s)?e.getBubbleZData(s.value,"y"):ze(s.value)?s.value.mid:s.value)),o=r*r*Math.PI,i=(e.isBubbleZType(t)?e.getBubbleZData(t.value,"z"):t.value)*(o/a);return Math.sqrt(i/Math.PI)},getBubbleZData(t,e){return ze(t)?t[e]:t[e==="y"?0:1]}},wx=Object.defineProperty,Zu=Object.getOwnPropertySymbols,Dx=Object.prototype.hasOwnProperty,Nx=Object.prototype.propertyIsEnumerable,Ju=(t,e,r)=>e in t?wx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Lx=(t,e)=>{for(var r in e||(e={}))Dx.call(e,r)&&Ju(t,r,e[r]);if(Zu)for(var r of Zu(e))Nx.call(e,r)&&Ju(t,r,e[r]);return t},Fx={initCandlestick(){const{$el:t}=this;t.candlestick=t.main.select(`.${Se.chart}`).append("g").attr("class",fr.chartCandlesticks)},updateTargetsForCandlestick(t){const e=this,{$el:r}=e,a=e.getChartClass("Candlestick");r.candlestick||e.initCandlestick(),e.$el.main.select(`.${fr.chartCandlesticks}`).selectAll(`.${fr.chartCandlestick}`).data(e.filterNullish(t)).enter().append("g").attr("class",a).style("pointer-events","none")},updateCandlestick(t,e=!1){const r=this,{$el:a,$T:o}=r,i=e?a.subchart:a,s=r.getClass("candlestick",!0),l=r.initialOpacity.bind(r),c=i.main.selectAll(`.${fr.chartCandlestick}`).selectAll(`.${fr.candlestick}`).data(r.labelishData.bind(r));o(c.exit(),t).style("opacity","0").remove();const f=c.enter().filter(g=>g.value).append("g").attr("class",s);f.append("line"),f.append("path"),i.candlestick=c.merge(f).style("opacity",l)},generateDrawCandlestick(t,e){const r=this,{config:a}=r,o=r.generateGetCandlestickPoints(t,e),i=a.axis_rotated,s=a.candlestick_color_down;return(l,c,f)=>{const g=o(l,c),p=r.getCandlestickData(l),m=p==null?void 0:p._isUp,E=+i,w=+!E;f.classed&&f.classed(fr[m?"valueUp":"valueDown"],!0);const U=i?`H${g[1][1]} V${g[1][0]} H${g[0][1]}`:`V${g[1][1]} H${g[1][0]} V${g[0][1]}`;f.select("path").attr("d",`M${g[0][E]},${g[0][w]}${U}z`).style("fill",Y=>(m?r.color(Y):ze(s)?s[Y.id]:s)||r.color(Y));const N=f.select("line"),D=i?{x1:g[2][1],x2:g[2][2],y1:g[2][0],y2:g[2][0]}:{x1:g[2][0],x2:g[2][0],y1:g[2][1],y2:g[2][2]};for(const Y in D)N.attr(Y,D[Y])}},generateGetCandlestickPoints(t,e=!1){const r=this,a=e?r.axis.subX:r.axis.x,o=r.getIndicesMax(t)+1,i=r.getBarW("candlestick",a,o),s=r.getShapeX(i,t,!!e),l=r.getShapeY(!!e),c=r.getShapeOffset(r.isBarType,t,!!e),f=r.getYScaleById.bind(r);return(g,p)=>{const m=f.call(r,g.id,e)(r.getShapeYMin(g.id)),E=c(g,p)||m,w=pe(i)?i:i[g.id]||i._$width,U=r.getCandlestickData(g);let N;if(U&&pe(U.open)&&pe(U.close)){const D={start:s(g),end:0};D.end=D.start+w;const Y={start:l(U.open),end:l(U.close)},J={x:D.start+w/2,high:l(U.high),low:l(U.low)};Y.start-=m-E,N=[[D.start,Y.start],[D.end,Y.end],[J.x,J.low,J.high]]}else N=[[0,0],[0,0],[0,0,0]];return N}},redrawCandlestick(t,e,r=!1){const a=this,{$el:o,$T:i}=a,{candlestick:s}=r?o.subchart:o,l=ar(!0);return[s.each(function(c,f){const g=i(it(this),e,l);t(c,f,g)}).style("opacity",null)]},getCandlestickData({value:t}){let e;if(Ge(t)){const[r,a,o,i,s=!1]=t;e={open:r,high:a,low:o,close:i},s!==!1&&(e.volume=s)}else ze(t)&&(e=Lx({},t));return e&&(e._isUp=e.close>=e.open),e||null}},Bx=Object.defineProperty,Qu=Object.getOwnPropertySymbols,Ux=Object.prototype.hasOwnProperty,zx=Object.prototype.propertyIsEnumerable,ku=(t,e,r)=>e in t?Bx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jx=(t,e)=>{for(var r in e||(e={}))Ux.call(e,r)&&ku(t,r,e[r]);if(Qu)for(var r of Qu(e))zx.call(e,r)&&ku(t,r,e[r]);return t};function ko(t=!1){const e=this,{config:r,state:{current:{width:a,height:o}}}=e,i=e.getCurrentPadding(),s=jx({width:a-(i.left+i.right),height:o-(r.legend_show?e.getLegendHeight()+10:0)-(i.top+i.bottom)},i);if(t){const{width:l,height:c}=qu.call(e,{width:s.width,height:s.height});s.width<l&&(s.width=l),s.height<c&&(s.height=c)}return s}function qu(t){const e=this,{config:r}=e;let a=r.funnel_neck_width,o=r.funnel_neck_height;return[a,o]=[a,o].map((i,s)=>{let l=i;return ze(i)&&(l=t[s?"height":"width"]*i.ratio),l}),{width:a,height:o}}function Gx(t){const e=this,{top:r,left:a,width:o}=ko.call(e,!0),i=[];return t.forEach((s,l)=>{const{ratio:c}=s,f=l>0?i[l-1][2][1]:r;i.push(s.coords=[[a,f],[a+o,f],[a+o,l>0?c+f:c+r],[a,l>0?c+f:c+r],[a,f]])}),i}function _u(t=!1){const e=this,{width:r,height:a,top:o,left:i}=ko.call(e,!0),s=qu.call(e,{width:r,height:a}),l=(r-s.width)/2,c=(r+s.width)/2,f=a-s.height,g=[[0,0],[r,0],[c,f],[c,a],[l,a],[l,f],[0,0]];return t&&g.forEach(p=>{p[0]+=i,p[1]+=o}),`M${g.join("L")}z`}function Vx(t){const e=this,{config:r}=e,a=t.map(o=>({id:o.id,value:o.values.reduce((i,s)=>i+s.value,0)}));return r.data_order&&a.sort(e.getSortCompareFn.bind(e)(!0)),tf.call(e,a)}function tf(t){const e=this,{height:r}=ko.call(e),a=e.getTotalDataSum(!0);return t.forEach(o=>{o.ratio=o.value/a*r}),t}var Xx={initFunnel(){const t=this,{$el:e}=t;e.funnel=e.main.select(`.${Se.chart}`).append("g").classed($a.chartFunnels,!0),e.funnel.background=e.funnel.append("path").classed($a.funnelBackground,!0),t.bindFunnelEvent()},bindFunnelEvent(){const t=this,{$el:{funnel:e},config:r,state:a}=t,o=i=>{var s;const l=i.isTrusted?i.target:(s=a.eventReceiver.rect)==null?void 0:s.node();let c;return/^path$/i.test(l.tagName)&&(a.event=i,c=it(l).datum()),c};if(r.interaction_enabled){const i=a.inputType==="touch";e.on(i?"touchstart":"mouseover mousemove",s=>{const l=o(s);l&&(t.showTooltip([l],s.target),/^(touchstart|mouseover)$/.test(s.type)&&t.setOverOut(!0,l))}).on(i?"touchend":"mouseout",s=>{const l=o(s);r.interaction_onout&&(t.hideTooltip(),t.setOverOut(!1,l))})}},updateTargetsForFunnel(t){const e=this,{$el:{funnel:r}}=e,a=e.getChartClass("Funnel"),o=e.getClass("funnel",!0);r||e.initFunnel();const i=Vx.call(e,t.filter(e.isFunnelType.bind(e))),s=r.selectAll(`.${$a.chartFunnel}`).data(e.filterNullish(i));s.exit().remove();const l=s.enter().insert("g",`.${$a.funnelBackground}`);l.append("path"),r.path=l.merge(s).attr("class",c=>a(c)).select("path").attr("class",o).style("opacity","0").style("fill",e.color)},updateFunnel(t){const e=this,{$el:{funnel:r}}=e,a=t.map(({id:o})=>o);r.path=r.path.filter(o=>a.indexOf(o.id)>=0)},generateGetFunnelPoints(){const t=this,{$el:{funnel:e}}=t,r=t.filterTargetsToShow(e.path),{top:a,left:o,right:i}=ko.call(t),s=(o-i)/2,l={};let c=a!=null?a:0;return r.each((f,g)=>{var p;l[f.id]=[[s,c],[s,c+=((p=r==null?void 0:r[g])!=null?p:f).ratio]]}),f=>l[f.id]},redrawFunnel(){const t=this,{$T:e,$el:{funnel:r}}=t,a=t.filterTargetsToShow(r.path),o=Gx.call(t,tf.call(t,a.data()));r.attr("clip-path",`path('${_u.bind(t)()}')`),r.background.attr("d",_u.call(t,!0)),e(a).attr("d",(i,s)=>`M${o[s].join("L")}z`).style("opacity","1"),r.selectAll("g").style("opacity",null)}},Hx={initGauge(){const t=this,{config:e,$el:{arcs:r}}=t,a=(o=null,i="")=>{r.append("text").attr("class",o).style("text-anchor","middle").style("pointer-events","none").text(i)};if(t.hasType("gauge")){const o=t.hasMultiArcGauge();r.append(o?"g":"path").attr("class",Ve.chartArcsBackground).style("fill",!o&&e.gauge_background||null),e.gauge_units&&a(jn.chartArcsGaugeUnit),e.gauge_label_show&&(a(jn.chartArcsGaugeMin),!e.gauge_fullCircle&&a(jn.chartArcsGaugeMax))}},updateGaugeMax(){const t=this,{config:e,state:r}=t,o=t.hasMultiArcGauge()?t.getMinMaxData().max[0].value:t.getTotalDataSum(r.rendered);!e.gauge_enforceMinMax&&o+e.gauge_min*(e.gauge_min>0?-1:1)>e.gauge_max&&(e.gauge_max=o-e.gauge_min)},redrawArcGaugeLine(){const t=this,{config:e,state:r,$el:a}=t,{hiddenTargetIds:o}=t.state,i=a.main.selectAll(`.${Ve.arcs}`).selectAll(`.${Ve.arcLabelLine}`).data(t.arcData.bind(t));i.enter().append("rect").attr("class",l=>`${Ve.arcLabelLine} ${Se.target} ${Se.target}-${l.data.id}`).merge(i).style("fill",l=>t.levelColor?t.levelColor(l.data.values[0].value):t.color(l.data)).style("display",e.gauge_label_show?null:"none").each(function(l){let c=0;const f=2;let g=0,p=0,m="";if(o.indexOf(l.data.id)<0){const E=t.updateAngle(l),w=r.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length*(E.index+1),U=E.endAngle-Math.PI/2,N=r.radius-w,D=U-(N===0?0:1/N);c=r.radiusExpanded-r.radius+w,g=Math.cos(D)*N,p=Math.sin(D)*N,m=`rotate(${U*180/Math.PI}, ${g}, ${p})`}it(this).attr("x",g).attr("y",p).attr("width",c).attr("height",f).attr("transform",m).style("stroke-dasharray",`0, ${c+f}, 0`)})},textForGaugeMinMax(t,e){const r=this,{config:a}=r,o=a.gauge_label_extents;return he(o)?o.bind(r.api)(t,e):t},getGaugeLabelHeight(){const{config:t}=this;return this.config.gauge_label_show&&!t.gauge_fullCircle?20:0},getPaddingBottomForGauge(){const t=this;return t.getGaugeLabelHeight()*(t.config.gauge_label_show?2:2.5)}},Wx=Object.defineProperty,Yx=Object.defineProperties,Kx=Object.getOwnPropertyDescriptors,ef=Object.getOwnPropertySymbols,Zx=Object.prototype.hasOwnProperty,Jx=Object.prototype.propertyIsEnumerable,nf=(t,e,r)=>e in t?Wx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qx=(t,e)=>{for(var r in e||(e={}))Zx.call(e,r)&&nf(t,r,e[r]);if(ef)for(var r of ef(e))Jx.call(e,r)&&nf(t,r,e[r]);return t},kx=(t,e)=>Yx(t,Kx(e));function qx(t,e,r,a=!1){const o=t?[t,0]:r;for(let i=t||r.reduce((s,l)=>s+l);i<=e;)r.forEach(s=>{i+s<=e&&o.push(s),i+=s});return o.length%2!==0&&o.push(a?r[1]:0),{dash:o.join(" "),length:o.reduce((i,s)=>i+s,0)}}function _x(t,e,r){const a=this,o=[],i="2 2";if(Qe(e)){const s=(l,c)=>ln(l)?c:r?Kn.call(a,l):l;for(let l=0,c;c=e[l];l++){const f=s(c.start,t[0].x),g=s(c.end,t[t.length-1].x),p=c.style||{dasharray:i};o[l]={start:f,end:g,style:p}}}return o}var t0={initLine(){const{$el:t}=this;t.line=t.main.select(`.${Se.chart}`).append("g").attr("class",dr.chartLines).call(this.setCssRule(!1,`.${dr.chartLines}`,["pointer-events:none"]))},updateTargetsForLine(t){const e=this,{$el:{area:r,line:a,main:o}}=e,i=e.getChartClass("Line"),s=e.getClass("lines",!0),l=e.classFocus.bind(e);a||e.initLine();const c=t.filter(p=>!(e.isScatterType(p)||e.isBubbleType(p))),f=o.select(`.${dr.chartLines}`).selectAll(`.${dr.chartLine}`).data(e.filterNullish(c)).attr("class",p=>i(p)+l(p)),g=f.enter().append("g").attr("class",i).style("opacity","0").style("pointer-events",e.getStylePropValue("none"));if(g.append("g").attr("class",s),e.hasTypeOf("Area")){const p=(!r&&g.empty()?f:g).filter(e.isAreaType.bind(e));e.initArea(p)}e.updateTargetForCircle(c,g)},updateLine(t,e=!1){const r=this,{format:{extraLineClasses:a},$el:o,$T:i}=r,s=e?o.subchart:o,l=s.main.selectAll(`.${dr.lines}`).selectAll(`.${dr.line}`).data(r.lineData.bind(r));i(l.exit(),t).style("opacity","0").remove(),s.line=l.enter().append("path").attr("class",c=>`${r.getClass("line",!0)(c)} ${a(c)||""}`).style("stroke",r.color).merge(l).style("opacity",r.initialOpacity.bind(r)).attr("transform",null)},redrawLine(t,e,r=!1){const a=this,{$el:o,$T:i}=a,{line:s}=r?o.subchart:o;return[i(s,e,ar()).attr("d",t).style("stroke",this.color).style("opacity",null)]},getCurve(t){const e=this;return e.config.axis_rotated&&e.isStepType(t)?a=>{const o=e.getInterpolate(t)(a);return o.orgPoint=o.point,o.pointRotated=function(i,s){this._point===1&&(this._point=2);const l=this._y*(1-this._t)+s*this._t;this._context.lineTo(this._x,l),this._context.lineTo(i,l),this._x=i,this._y=s},o.point=function(i,s){this._point===0?this.orgPoint(i,s):this.pointRotated(i,s)},o}:e.getInterpolate(t)},generateDrawLine(t,e){const r=this,{config:a,scale:o}=r,i=a.line_connectNull,s=a.axis_rotated,l=r.generateGetLinePoints(t,e),c=r.getYScaleById.bind(r),f=E=>(e?r.subxx:r.xx).call(r,E),g=(E,w)=>r.isGrouped(E.id)?l(E,w)[0][1]:c(E.id,e)(r.getBaseValue(E));let p=Ku();p=s?p.x(g).y(f):p.x(f).y(g),i||(p=p.defined(E=>r.getBaseValue(E)!==null));const m=e?o.subX:o.x;return E=>{const w=c(E.id,e);let U=i?r.filterRemoveNull(E.values):E.values,N=0,D=0,Y;if(r.isLineType(E)){const J=a.data_regions[E.id];J?(r.isAreaRangeType(E)&&(U=U.map(K=>kx(Qx({},K),{value:r.getRangedData(K,"mid")}))),Y=r.lineWithRegions(U,o.zoom||m,w,J)):(r.isStepType(E)&&(U=r.convertValuesToStep(U)),Y=p.curve(r.getCurve(E))(U))}else U[0]&&(N=m(U[0].x),D=w(U[0].value)),Y=s?`M ${D} ${N}`:`M ${N} ${D}`;return Y||"M 0 0"}},lineWithRegions(t,e,r,a){const o=this,{config:i}=o,s=i.axis_rotated,l=o.axis.isTimeSeries(),c="2 2",f=_x.bind(o)(t,a,l),g=o.hasNullDataValue(t);let p,m,E,w;const U=s?yt=>r(yt.value):yt=>e(yt.x),N=s?yt=>e(yt.x):yt=>r(yt.value),D=yt=>`M${yt[0][0]},${yt[0][1]}L${yt[1][0]},${yt[1][1]}`,Y=l?(yt,lt,jt,vt)=>{const tt=yt.x.getTime(),St=lt.x-yt.x,ct=new Date(tt+St*jt),At=new Date(tt+St*(jt+vt)),Wt=s?[[r(m(jt)),e(ct)],[r(m(jt+E)),e(At)]]:[[e(ct),r(m(jt))],[e(At),r(m(jt+E))]];return D(Wt)}:(yt,lt,jt,vt)=>{const tt=e(lt.x,!s),St=r(lt.value,s),ct=jt+vt,At=e(p(jt),!s),Wt=r(m(jt),s);let Dt=e(p(ct),!s),Zt=r(m(ct),s);Dt>tt&&(Dt=tt),yt.value>lt.value&&(s?Zt<St:Zt>St)&&(Zt=St);const re=[[At,Wt],[Dt,Zt]];return s&&re.forEach(ce=>ce.reverse()),D(re)},J={x:o.axis.getAxisType("x"),y:o.axis.getAxisType("y")};let K="";const nt=o.$el.line.filter(({id:yt})=>yt===t[0].id),Q=nt.clone().style("display","none"),ot=(yt,lt)=>yt.attr("d",lt).node().getTotalLength(),pt={dash:[],lastLength:0};let Tt=!1;for(let yt=0,lt;lt=t[yt];yt++){const jt=t[yt-1],vt=jt&&De(jt.value);let tt=o.isWithinRegions(lt.x,f);if(De(lt.value)){if(ln(f)||!tt||!vt)K+=`${yt&&vt?"L":"M"}${U(lt)},${N(lt)}`;else if(vt)if(tt=((tt==null?void 0:tt.dasharray)||c).split(" ").map(Number),p=jr(J.x,jt.x,lt.x),m=jr(J.y,jt.value,lt.value),g){const St=e(lt.x)-e(jt.x),ct=r(lt.value)-r(jt.value),At=Math.sqrt(Math.pow(St,2)+Math.pow(ct,2));E=tt[0]/At,w=E*tt[1];for(let Wt=E;Wt<=1;Wt+=w)K+=Y(jt,lt,Wt,E),Wt+w>=1&&(K+=Y(jt,lt,1,0))}else{let St=[];if(Tt=lt.x===t[t.length-1].x,l){const Dt=+jt.x,Zt=new Date(Dt),re=new Date(Dt+(+lt.x-Dt));St=[[e(Zt),r(m(0))],[e(re),r(m(1))]]}else St=[[e(p(0)),r(m(0))],[e(p(1)),r(m(1))]];s&&St.forEach(Dt=>Dt.reverse());const ct=ot(Q,K),At=ot(Q,K+=`L${St[1].join(",")}`),Wt=qx(ct-pt.lastLength,At-pt.lastLength,tt,Tt);pt.lastLength+=Wt.length,pt.dash.push(Wt.dash)}}}return pt.dash.length&&(!Tt&&pt.dash.push(ot(Q,K)),Q.remove(),nt.attr("stroke-dasharray",pt.dash.join(" "))),K},isWithinRegions(t,e){for(let r=0,a;a=e[r];r++)if(a.start<t&&t<=a.end)return a.style;return!1},isWithinStep(t,e){return Math.abs(e-Yn(this.state.event,t)[1])<30},shouldDrawPointsForLine(t){const e=this.config.line_point;return e===!0||Ge(e)&&e.indexOf(t.id)!==-1}};const ua=()=>ar();var qo={initialOpacityForCircle(t){const{config:e,state:{withoutFadeIn:r}}=this;let a=e.point_opacity;return ln(a)&&(a=this.getBaseValue(t)!==null&&r[t.id]?this.opacityForCircle(t):"0"),a},opacityForCircle(t){var e;const{config:r}=this;let a=r.point_opacity;return ln(a)&&(a=r.point_show&&!((e=this.isPointFocusOnly)!=null&&e.call(this))?null:"0",a=De(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":a:"0"),a},initCircle(){const t=this,{$el:{main:e}}=t;!t.point&&(t.point=t.generatePoint()),(t.hasType("bubble")||t.hasType("scatter"))&&e.select(`.${Se.chart} > .${An.chartCircles}`).empty()&&e.select(`.${Se.chart}`).append("g").attr("class",An.chartCircles)},updateTargetForCircle(t,e){const r=this,{config:a,data:o,$el:i}=r,s=a.interaction_enabled&&a.data_selection_enabled,l=s&&a.data_selection_isselectable,c=r.getClass("circles",!0);if(!a.point_show)return;r.initCircle();let f=t,g=e;if(!f){f=r.filterNullish(o.targets).filter(m=>this.isScatterType(m)||this.isBubbleType(m));const p=i.main.select(`.${An.chartCircles}`).style("pointer-events","none").selectAll(`.${An.circles}`).data(f);p.exit().remove(),g=p.enter()}s&&g.append("g").attr("class",p=>r.generateClass(tn.selectedCircles,p.id)),g.append("g").attr("class",c).call(p=>{r.setCssRule(!0,`.${An.circles}`,["cursor:pointer"],l)(p),r.setCssRule(!0,` .${An.circle}`,["fill","stroke"],r.color)(p)}).style("opacity",function(){return it(this.parentNode).attr("class").indexOf(An.chartCircles)>-1?"0":null}),s&&f.forEach(p=>{i.main.selectAll(`.${tn.selectedCircles}${r.getTargetSelectorSuffix(p.id)}`).selectAll(`${tn.selectedCircle}`).each(m=>{m.value=p.values[m.index].value})})},updateCircle(t=!1){const e=this,{config:r,state:a,$el:o}=e,i=e.isPointFocusOnly(),s=t?o.subchart:o;if(r.point_show&&!a.toggling){r.point_radialGradient&&e.updateLinearGradient();const l=s.main.selectAll(`.${An.circles}`).selectAll(`.${An.circle}`).data(c=>{const f=e.isLineType(c)&&e.shouldDrawPointsForLine(c)||e.isBubbleType(c)||e.isRadarType(c)||e.isScatterType(c)?i?[c.values[0]]:c.values:[];return e.filterNullish(f)});l.exit().remove(),l.enter().filter(Boolean).append(e.point("create",this,e.pointR.bind(e),e.updateCircleColor.bind(e))),s.circle=s.main.selectAll(`.${An.circles} .${An.circle}`).style("stroke",e.getStylePropValue(e.color)).style("opacity",e.initialOpacityForCircle.bind(e))}},updateCircleColor(t){const e=this,r=e.getStylePropValue(e.color);return e.config.point_radialGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawCircle(t,e,r,a,o=!1){const i=this,{state:{rendered:s},$el:l,$T:c}=i,f=o?l.subchart:l,g=f.main.selectAll(`.${tn.selectedCircle}`);if(!i.config.point_show)return[];const p=i.point("update",i,t,e,i.updateCircleColor.bind(i),r,a,g),m=i.isCirclePoint()?"c":"",E=ar(),w=i.opacityForCircle.bind(i),U=[];return f.circle.each(function(N){let D=p.bind(this)(N);D=c(D,r||!s,E).style("opacity",w),U.push(D)}),[U,c(g,r).attr(`${m}x`,t).attr(`${m}y`,e)]},showCircleFocus(t){const e=this,{state:{hasRadar:r,resizing:a,toggling:o,transiting:i},$el:s}=e;let{circle:l}=s;if(i===!1&&l&&e.isPointFocusOnly()){const c=(r?e.radarCircleX:e.circleX).bind(e),f=(r?e.radarCircleY:e.circleY).bind(e),g=o||ln(t),p=e.point("update",e,c,f,e.getStylePropValue(e.color),a?!1:g);t&&(l=l.filter(function(m){var E;const w=(E=t.filter)==null?void 0:E.call(t,U=>U.id===m.id);return w.length?it(this).datum(w[0]):!1})),l.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(m){const{id:E,index:w,value:U}=m;let N="hidden";De(U)&&(p.bind(this)(m),e.expandCircles(w,E),N=""),this.style.visibility=N})}},hideCircleFocus(){const t=this,{$el:{circle:e}}=t;t.isPointFocusOnly()&&e&&(t.unexpandCircles(),e.style("visibility","hidden"))},circleX(t){return this.xx(t)},updateCircleY(t=!1){const e=this,r=e.generateGetLinePoints(e.getShapeIndices(e.isLineType),t);return(a,o)=>{const i=a.id;return e.isGrouped(i)?r(a,o)[0][1]:e.getYScaleById(i,t)(e.getBaseValue(a))}},expandCircles(t,e,r){const a=this,o=a.pointExpandedR.bind(a);r&&a.unexpandCircles();const i=a.getShapeByIndex("circle",t,e).classed(Se.EXPANDED,!0),s=o(i)/a.config.point_r,l=1-s;a.isCirclePoint()?i.attr("r",o):i.each(function(){const c=it(this);if(this.tagName==="circle")c.attr("r",o);else{const{width:f,height:g}=na(this),p=l*(+c.attr("x")+f/2),m=l*(+c.attr("y")+g/2);c.attr("transform",`translate(${p} ${m}) scale(${s})`)}})},unexpandCircles(t){const e=this,r=e.pointR.bind(e),a=e.getShapeByIndex("circle",t).filter(function(){return it(this).classed(Se.EXPANDED)}).classed(Se.EXPANDED,!1);if(a.attr("r",r),!e.isCirclePoint()){const o=r(a)/e.config.point_r;a.attr("transform",o!==1?`scale(${o})`:null)}},pointR(t){const e=this,{config:r}=e,a=r.point_r;let o=a;return e.isBubbleType(t)?o=e.getBubbleR(t):he(a)&&(o=a.bind(e.api)(t)),t.r=o,o},pointExpandedR(t){const e=this,{config:r}=e,a=e.isBubbleType(t)?1.15:1.75;return r.point_focus_expand_enabled?r.point_focus_expand_r||e.pointR(t)*a:e.pointR(t)},pointSelectR(t){const e=this,r=e.config.point_select_r;return he(r)?r(t):r||e.pointR(t)*4},isPointFocusOnly(){const t=this;return t.config.point_focus_only&&!t.hasType("bubble")&&!t.hasType("scatter")&&!t.hasArcType(null,["radar"])},isWithinCircle(t,e){const{state:r}=this,a=Yn(r.event,t),o=it(t),i=this.isCirclePoint(t)?"c":"",s=this.getPointSensitivity(o==null?void 0:o.datum());let l=+o.attr(`${i}x`),c=+o.attr(`${i}y`);if(!(l||c)&&t.nodeType===1){const{x:f,y:g}=mn(t);l=f,c=g}return Math.sqrt(Math.pow(l-a[0],2)+Math.pow(c-a[1],2))<(e||s)},getPointSensitivity(t){const e=this;let r=e.config.point_sensitivity;if(t)he(r)?r=r.call(e.api,t):r==="radius"&&(r=t.r);else return r;return r},updatePointClass(t){const e=this,{circle:r}=e.$el;let a=!1;return(ze(t)||r)&&(a=t===!0?r.each(function(o){let i=e.getClass("circle",!0)(o);this.getAttribute("class").indexOf(Se.EXPANDED)>-1&&(i+=` ${Se.EXPANDED}`),this.setAttribute("class",i)}):e.getClass("circle",!0)(t)),a},generateGetLinePoints(t,e){const r=this,{config:a}=r,o=r.getShapeX(0,t,e),i=r.getShapeY(e),s=r.getShapeOffset(r.isLineType,t,e),l=r.getYScaleById.bind(r);return(c,f)=>{const g=l.call(r,c.id,e)(r.getShapeYMin(c.id)),p=s(c,f)||g,m=o(c);let E=i(c);a.axis_rotated&&(c.value>0&&E<g||c.value<0&&g<E)&&(E=g);const w=[m,E-(g-p)];return[w,w,w,w]}},custom:{create(t,e,r){return t.append("use").attr("xlink:href",`#${e}`).attr("class",this.updatePointClass.bind(this)).style("fill",r).node()},update(t,e,r,a,o,i,s){const l=this,{width:c,height:f}=na(t.node()),g=E=>De(E.value)?e(E)-c/2:0,p=E=>De(E.value)?r(E)-f/2:0;let m=t;return o&&(i&&m.attr("x",g),m=l.$T(m,o,ua()),s&&l.$T(s,o,ua())),m.attr("x",g).attr("y",p).style("fill",a)}},circle:{create(t,e,r){return t.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",e).style("fill",r).node()},update(t,e,r,a,o,i,s){const l=this;let c=t;return l.hasType("bubble")&&c.attr("r",l.pointR.bind(l)),o&&(i&&c.attr("cx",e),c.attr("cx")&&(c=l.$T(c,o,ua())),s&&l.$T(c,o,ua())),c.attr("cx",e).attr("cy",r).style("fill",a)}},rectangle:{create(t,e,r){const a=o=>e(o)*2;return t.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",a).attr("height",a).style("fill",r).node()},update(t,e,r,a,o,i,s){const l=this,c=l.config.point_r,f=m=>e(m)-c,g=m=>r(m)-c;let p=t;return o&&(i&&p.attr("x",f),p=l.$T(p,o,ua()),s&&l.$T(s,o,ua())),p.attr("x",f).attr("y",g).style("fill",a)}}};function e0(t){return rr(t)&&he(t.create)&&he(t.update)}function n0(t,e){var r;const a=this,o=(c,f)=>{const g=c.attributes;for(let p=0,m;m=g[p];p++)m=m.name,f.setAttribute(m,c.getAttribute(m))},s=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,l=pn.createElementNS(te.svg,s.nodeName.toLowerCase());if(l.id=e,l.style.fill="inherit",l.style.stroke="inherit",o(s,l),(r=s.childNodes)!=null&&r.length){const c=it(l);"innerHTML"in l?c.html(s.innerHTML):Lr(s.childNodes).forEach(f=>{o(f,c.append(f.tagName).node())})}a.$el.defs.node().appendChild(l)}var fa={hasValidPointType(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasLegendDefsPoint(){var t;const{config:e}=this;return e.legend_show&&((t=e.point_pattern)==null?void 0:t.length)&&e.legend_usePoint},getDefsPointId(t){const{state:{datetimeId:e}}=this;return`${e}-point${t}`},generatePoint(){const t=this,{$el:e,config:r}=t,a=[],o=cn(r.point_pattern)?r.point_pattern:[r.point_type];return function(i,s,...l){return function(c){var f,g,p,m;const E=t.getTargetSelectorSuffix(c.id||((f=c.data)==null?void 0:f.id)||c),w=it(this);a.indexOf(E)<0&&a.push(E);let U=o[a.indexOf(E)%o.length];if(t.hasValidPointType(U))U=t[U];else if(!e0(U||r.point_type)){const N=t.getDefsPointId(E);if(e.defs.select(`#${N}`).size()<1&&n0.bind(t)(U,N),i==="create")return(g=t.custom)==null?void 0:g.create.bind(s)(w,N,...l);if(i==="update")return(p=t.custom)==null?void 0:p.update.bind(s)(w,...l)}return(m=U[i])==null?void 0:m.bind(s)(w,...l)}}}};function rf(t){const e=t.config.polar_level_max;let r=t.getMinMaxData().max[0].value;return e&&e>r&&(r=e),r}var r0={initPolar(){const t=this,{$el:{arcs:e},config:r}=t,a=r.polar_level_text_show,o=r.polar_level_text_backgroundColor;e.levels=e.append("g").attr("class",Sr.levels),a&&o&&t.generateTextBGColorFilter(o)},getPolarOuterRadius(t,e){var r;const a=rf(this);return((r=t==null?void 0:t.data.values[0].value)!=null?r:0)/a*e},updateTargetsForPolar(t){this.updateTargetsForArc(t)},redrawPolar(){const t=this,{config:e}=t;e.polar_level_show&&t.updatePolarLevel()},updatePolarLevel(){const t=this,{config:e,state:r,$el:{arcs:{levels:a}}}=t,o=e.polar_level_depth,i=rf(t),s=Ro(0,o),l=r.radius,c=s.map(m=>l*((m+1)/o)),f=(e.polar_level_text_format||function(){}).bind(t.api),g=a.selectAll(`.${Sr.level}`).data(s);g.exit().remove();const p=g.enter().append("g").attr("class",(m,E)=>`${Sr.level} ${Sr.level}-${E}`);if(p.append("circle"),p.merge(g).selectAll("circle").style("visibility",e.polar_level_show?null:"hidden").attr("cx",0).attr("cy",0).attr("r",m=>c[m]),e.polar_level_text_show){const m=e.polar_level_text_backgroundColor,E=`#${r.datetimeId}-labels-bg${t.getTargetSelectorSuffix(m)}`;p.append("text").style("text-anchor","middle"),p.merge(g).selectAll("text").attr("dy",w=>-c[w]+5).attr("filter",m?`url(${E})`:null).text(w=>f(i/s.length*(w+1)))}}};function a0(t,e,r,a,o,i){const s=t&&a>0?r-a:a,l=2*Math.PI;return o*(1-i*(e==="x"?Math.sin:Math.cos)(s*l/r))}const da=Mn.radarPoints,af=Mn.radarTextWidth;var o0={initRadar(){const t=this,{config:e,state:{current:r},$el:a}=t;t.hasType("radar")&&(a.radar=a.main.select(`.${Se.chart}`).append("g").attr("class",qs.chartRadars),a.radar.levels=a.radar.append("g").attr("class",Sr.levels),a.radar.axes=a.radar.append("g").attr("class",vn.axis),a.radar.shapes=a.radar.append("g").attr("class",sn.shapes),r.dataMax=e.radar_axis_max||t.getMinMaxData().max[0].value,e.radar_axis_text_show&&(e.interaction_enabled&&t.bindRadarEvent(),t.updateRadarLevel(),t.updateRadarAxes()))},getRadarSize(){const t=this,{config:e,state:{arcWidth:r,arcHeight:a}}=t,o=e.axis_x_categories.length<4?-20:10,i=(Math.min(r,a)-o)/2;return[i,i]},updateTargetsForRadar(t){const e=this,{config:r}=e;_n(r.axis_x_categories)&&(r.axis_x_categories=Ro(0,tr("max",t.map(a=>a.values.length)))),e.generateRadarPoints()},getRadarPosition(t,e,r,a){const o=this,{config:i}=o,[s,l]=o.getRadarSize(),c=i.axis_x_categories.length,f=i.radar_direction_clockwise,g=Lr(t).map(p=>a0(f,p,c,e,Qe(r)?r:t==="x"?s:l,pe(a)?a:i.radar_size_ratio));return g.length===1?g[0]:g},generateRadarPoints(){const t=this,e=t.data.targets,[r,a]=t.getRadarSize(),o=t.cache.get(da)||{},i=o._size;(!i||i.width!==r&&i.height!==a)&&(e.forEach(s=>{o[s.id]=s.values.map((l,c)=>t.getRadarPosition(["x","y"],c,void 0,t.getRatio("radar",l)))}),o._size={width:r,height:a},t.cache.add(da,o))},redrawRadar(){const t=this,{radar:e,main:r}=t.$el,a=t.getTranslate("radar");a&&(e.attr("transform",a),r.select(`.${gn.chartTexts}`).attr("transform",a),t.generateRadarPoints(),t.updateRadarLevel(),t.updateRadarAxes(),t.updateRadarShape())},generateGetRadarPoints(){const t=this.cache.get(da);return(e,r)=>{const a=t[e.id][r];return[a,a,a,a]}},updateRadarLevel(){const t=this,{config:e,state:r,$el:{radar:a}}=t,[o,i]=t.getRadarSize(),s=e.radar_level_depth,l=e.axis_x_categories.length,c=e.radar_level_text_show,f=a.levels,g=Ro(0,s),p=e.radar_size_ratio*Math.min(o,i),m=g.map(D=>p*((D+1)/s)),E=(e.radar_level_text_format||function(){}).bind(t.api),w=g.map(D=>{const Y=m[D];return Ro(0,l).map(K=>t.getRadarPosition(["x","y"],K,Y,1).join(",")).join(" ")}),U=f.selectAll(`.${Sr.level}`).data(g);U.exit().remove();const N=U.enter().append("g").attr("class",(D,Y)=>`${Sr.level} ${Sr.level}-${Y}`);N.append("polygon").style("visibility",e.radar_level_show?null:"hidden"),c&&(f.select("text").empty()&&f.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(()=>E(0)),N.append("text").attr("dx","-.5em").style("text-anchor","end").text(D=>E(r.current.dataMax/g.length*(D+1)))),N.merge(U).attr("transform",D=>`translate(${o-m[D]}, ${i-m[D]})`).selectAll("polygon").attr("points",D=>w[D]),c&&f.selectAll("text").attr("x",D=>ln(D)?o:w[D].split(",")[0]).attr("y",D=>ln(D)?i:0)},updateRadarAxes(){const t=this,{config:e,$el:{radar:r}}=t,[a,o]=t.getRadarSize(),i=e.axis_x_categories;let s=r.axes.selectAll("g").data(i);s.exit().remove();const l=s.enter().append("g").attr("class",(c,f)=>`${vn.axis}-${f}`);if(e.radar_axis_line_show&&l.append("line"),e.radar_axis_text_show&&l.append("text"),s=l.merge(s),e.radar_axis_line_show&&s.select("line").attr("x1",a).attr("y1",o).attr("x2",(c,f)=>t.getRadarPosition("x",f)).attr("y2",(c,f)=>t.getRadarPosition("y",f)),e.radar_axis_text_show){const{x:c=0,y:f=0}=e.radar_axis_text_position,g=t.cache.get(af)||0;if(s.select("text").style("text-anchor","middle").attr("dy",".5em").call(p=>{p.each(function(m){Da(it(this),String(m),[-.6,1.2])})}).datum((p,m)=>({index:m})).attr("transform",function(p){ln(this.width)&&(this.width=mn(this,!0).width/2);let m=t.getRadarPosition("x",p.index,void 0,1),E=Math.round(t.getRadarPosition("y",p.index,void 0,1));return m>a?m+=this.width+c:Math.round(m)<a&&(m-=this.width+c),E>o?(E/2===o&&this.firstChild.tagName==="tspan"&&this.firstChild.setAttribute("dy","0em"),E+=f):E<o&&(E-=f),`translate(${m} ${E})`}),!g){const p=[r.axes,r.levels].map(m=>Kl(m.node()).width);p.every(m=>m>0)&&t.cache.add(af,p[0]-p[1])}}},bindRadarEvent(){const t=this,{config:e,state:r,$el:{radar:a,svg:o}}=t,i=t.isPointFocusOnly(),{inputType:s,transiting:l}=r,c=s==="mouse",f=g=>{if(r.event=g,!e.interaction_onout)return;const p=t.getDataIndexFromEvent(g),m=ln(p);(c||m)&&(t.hideTooltip(),i?t.hideCircleFocus():t.unexpandCircles(),c?t.setOverOut(!1,p):m&&t.callOverOutForTouch())};a.axes.on(c?"mouseover ":"touchstart",g=>{if(l)return;r.event=g;const p=t.getDataIndexFromEvent(g);t.selectRectForSingle(o.node(),p),c?t.setOverOut(!0,p):t.callOverOutForTouch(p)}).on("mouseout",c?f:null),c||o.on("touchstart",f)},updateRadarShape(){const t=this,e=t.data.targets.filter(i=>t.isRadarType(i)),r=t.cache.get(da),a=t.$el.radar.shapes.selectAll("polygon").data(t.filterNullish(e)),o=a.enter().append("g").attr("class",t.getChartClass("Radar"));t.$T(a.exit()).remove(),o.append("polygon").merge(a).style("fill",t.color).style("stroke",t.color).attr("points",i=>r[i.id].join(" ")),t.updateTargetForCircle(e,o)},radarCircleX(t){return this.cache.get(da)[t.id][t.index][0]},radarCircleY(t){return this.cache.get(da)[t.id][t.index][1]}};function i0(t){var e=0,r=t.children,a=r&&r.length;if(!a)e=1;else for(;--a>=0;)e+=r[a].value;t.value=e}function s0(){return this.eachAfter(i0)}function l0(t,e){let r=-1;for(const a of this)t.call(e,a,++r,this);return this}function c0(t,e){for(var r=this,a=[r],o,i,s=-1;r=a.pop();)if(t.call(e,r,++s,this),o=r.children)for(i=o.length-1;i>=0;--i)a.push(o[i]);return this}function u0(t,e){for(var r=this,a=[r],o=[],i,s,l,c=-1;r=a.pop();)if(o.push(r),i=r.children)for(s=0,l=i.length;s<l;++s)a.push(i[s]);for(;r=o.pop();)t.call(e,r,++c,this);return this}function f0(t,e){let r=-1;for(const a of this)if(t.call(e,a,++r,this))return a}function d0(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,a=e.children,o=a&&a.length;--o>=0;)r+=a[o].value;e.value=r})}function h0(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function v0(t){for(var e=this,r=g0(e,t),a=[e];e!==r;)e=e.parent,a.push(e);for(var o=a.length;t!==r;)a.splice(o,0,t),t=t.parent;return a}function g0(t,e){if(t===e)return t;var r=t.ancestors(),a=e.ancestors(),o=null;for(t=r.pop(),e=a.pop();t===e;)o=t,t=r.pop(),e=a.pop();return o}function p0(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function m0(){return Array.from(this)}function y0(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function x0(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*T0(){var t=this,e,r=[t],a,o,i;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,a=t.children)for(o=0,i=a.length;o<i;++o)r.push(a[o]);while(r.length)}function Os(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=A0)):e===void 0&&(e=$0);for(var r=new _o(t),a,o=[r],i,s,l,c;a=o.pop();)if((s=e(a.data))&&(c=(s=Array.from(s)).length))for(a.children=s,l=c-1;l>=0;--l)o.push(i=s[l]=new _o(s[l])),i.parent=a,i.depth=a.depth+1;return r.eachBefore(b0)}function S0(){return Os(this).eachBefore(E0)}function $0(t){return t.children}function A0(t){return Array.isArray(t)?t[1]:null}function E0(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function b0(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function _o(t){this.data=t,this.depth=this.height=0,this.parent=null}_o.prototype=Os.prototype={constructor:_o,count:s0,each:l0,eachAfter:u0,eachBefore:c0,find:f0,sum:d0,sort:h0,path:v0,ancestors:p0,descendants:m0,leaves:y0,links:x0,copy:S0,[Symbol.iterator]:T0};function I0(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function ti(t,e,r,a,o){for(var i=t.children,s,l=-1,c=i.length,f=t.value&&(a-e)/t.value;++l<c;)s=i[l],s.y0=r,s.y1=o,s.x0=e,s.x1=e+=s.value*f}function ei(t,e,r,a,o){for(var i=t.children,s,l=-1,c=i.length,f=t.value&&(o-r)/t.value;++l<c;)s=i[l],s.x0=e,s.x1=a,s.y0=r,s.y1=r+=s.value*f}var of=(1+Math.sqrt(5))/2;function sf(t,e,r,a,o,i){for(var s=[],l=e.children,c,f,g=0,p=0,m=l.length,E,w,U=e.value,N,D,Y,J,K,nt,Q;g<m;){E=o-r,w=i-a;do N=l[p++].value;while(!N&&p<m);for(D=Y=N,nt=Math.max(w/E,E/w)/(U*t),Q=N*N*nt,K=Math.max(Y/Q,Q/D);p<m;++p){if(N+=f=l[p].value,f<D&&(D=f),f>Y&&(Y=f),Q=N*N*nt,J=Math.max(Y/Q,Q/D),J>K){N-=f;break}K=J}s.push(c={value:N,dice:E<w,children:l.slice(g,p)}),c.dice?ti(c,r,a,o,U?a+=w*N/U:i):ei(c,r,a,U?r+=E*N/U:o,i),U-=N,g=p}return s}var lf=(function t(e){function r(a,o,i,s,l){sf(e,a,o,i,s,l)}return r.ratio=function(a){return t((a=+a)>1?a:1)},r})(of);function Z1(t){return t==null?null:cf(t)}function cf(t){if(typeof t!="function")throw new Error;return t}function Va(){return 0}function Xa(t){return function(){return t}}function R0(){var t=lf,e=!1,r=1,a=1,o=[0],i=Va,s=Va,l=Va,c=Va,f=Va;function g(m){return m.x0=m.y0=0,m.x1=r,m.y1=a,m.eachBefore(p),o=[0],e&&m.eachBefore(I0),m}function p(m){var E=o[m.depth],w=m.x0+E,U=m.y0+E,N=m.x1-E,D=m.y1-E;N<w&&(w=N=(w+N)/2),D<U&&(U=D=(U+D)/2),m.x0=w,m.y0=U,m.x1=N,m.y1=D,m.children&&(E=o[m.depth+1]=i(m)/2,w+=f(m)-E,U+=s(m)-E,N-=l(m)-E,D-=c(m)-E,N<w&&(w=N=(w+N)/2),D<U&&(U=D=(U+D)/2),t(m,w,U,N,D))}return g.round=function(m){return arguments.length?(e=!!m,g):e},g.size=function(m){return arguments.length?(r=+m[0],a=+m[1],g):[r,a]},g.tile=function(m){return arguments.length?(t=cf(m),g):t},g.padding=function(m){return arguments.length?g.paddingInner(m).paddingOuter(m):g.paddingInner()},g.paddingInner=function(m){return arguments.length?(i=typeof m=="function"?m:Xa(+m),g):i},g.paddingOuter=function(m){return arguments.length?g.paddingTop(m).paddingRight(m).paddingBottom(m).paddingLeft(m):g.paddingTop()},g.paddingTop=function(m){return arguments.length?(s=typeof m=="function"?m:Xa(+m),g):s},g.paddingRight=function(m){return arguments.length?(l=typeof m=="function"?m:Xa(+m),g):l},g.paddingBottom=function(m){return arguments.length?(c=typeof m=="function"?m:Xa(+m),g):c},g.paddingLeft=function(m){return arguments.length?(f=typeof m=="function"?m:Xa(+m),g):f},g}function uf(t,e,r,a,o){var i=t.children,s,l=i.length,c,f=new Array(l+1);for(f[0]=c=s=0;s<l;++s)f[s+1]=c+=i[s].value;g(0,l,t.value,e,r,a,o);function g(p,m,E,w,U,N,D){if(p>=m-1){var Y=i[p];Y.x0=w,Y.y0=U,Y.x1=N,Y.y1=D;return}for(var J=f[p],K=E/2+J,nt=p+1,Q=m-1;nt<Q;){var ot=nt+Q>>>1;f[ot]<K?nt=ot+1:Q=ot}K-f[nt-1]<f[nt]-K&&p+1<nt&&--nt;var pt=f[nt]-J,Tt=E-pt;if(N-w>D-U){var yt=E?(w*Tt+N*pt)/E:N;g(p,nt,pt,w,U,yt,D),g(nt,m,Tt,yt,U,N,D)}else{var lt=E?(U*Tt+D*pt)/E:D;g(p,nt,pt,w,U,N,lt),g(nt,m,Tt,w,lt,N,D)}}}function O0(t,e,r,a,o){(t.depth&1?ei:ti)(t,e,r,a,o)}var C0=(function t(e){function r(a,o,i,s,l){if((c=a._squarify)&&c.ratio===e)for(var c,f,g,p,m=-1,E,w=c.length,U=a.value;++m<w;){for(f=c[m],g=f.children,p=f.value=0,E=g.length;p<E;++p)f.value+=g[p].value;f.dice?ti(f,o,i,s,U?i+=(l-i)*f.value/U:l):ei(f,o,i,U?o+=(s-o)*f.value/U:s,l),U-=f.value}else a._squarify=c=sf(e,a,o,i,s,l),c.ratio=e}return r.ratio=function(a){return t((a=+a)>1?a:1)},r})(of);function P0(t,e){const r=this,{scale:{x:a,y:o},state:{width:i}}=r;t.selectAll("g").attr("transform",s=>`translate(${s===e?"0,0":`${a(s.x0)},${o(s.y0)}`})`).select("rect").attr("width",s=>s===e?i:a(s.x1)-a(s.x0)).attr("height",s=>s===e?0:o(s.y1)-o(s.y0))}function M0(t){const e=this;return t.map(r=>{const{id:a,values:o}=r,{value:i}=o[0];return{name:a,id:a,value:i,ratio:e.getRatio("treemap",o[0])}})}function w0(t){const e=this,r=Os(t).sum(o=>o.value),a=e.getSortCompareFn(!0);return[e.treemap(a?r.sort(a):r)]}var D0={initTreemap(){const t=this,{$el:e,state:{current:{width:r,height:a},clip:o,datetimeId:i}}=t;o.id=`${i}-clip`,t.treemap=R0().tile(t.getTreemapTile()),e.defs.append("clipPath").attr("id",o.id).append("rect").attr("width",r).attr("height",a),e.treemap=e.main.select(`.${Se.chart}`).attr("clip-path",`url(#${o.id})`).append("g").classed(tl.chartTreemaps,!0),t.bindTreemapEvent()},bindTreemapEvent(){const t=this,{$el:e,config:r,state:a}=t,o=i=>{var s;const l=i.isTrusted?i.target:(s=a.eventReceiver.rect)==null?void 0:s.node();let c;return/^rect$/i.test(l.tagName)&&(a.event=i,c=it(l).datum()),c==null?void 0:c.data};if(r.interaction_enabled){const i=a.inputType==="touch";e.treemap.on(i?"touchstart":"mouseover mousemove",s=>{const l=o(s);l&&(t.showTooltip([l],s.currentTarget),/^(touchstart|mouseover)$/.test(s.type)&&t.setOverOut(!0,l))}).on(i?"touchend":"mouseout",s=>{const l=o(s);r.interaction_onout&&(t.hideTooltip(),t.setOverOut(!1,l))})}},getTreemapTile(){var t,e;const r=this,{config:a,state:{current:{width:o,height:i}}}=r,s=(e={binary:uf,dice:ti,slice:ei,sliceDice:O0,squarify:lf,resquarify:C0}[(t=a.treemap_tile)!=null?t:"binary"])!=null?e:uf;return(l,c,f,g,p)=>{s(l,0,0,o,i);for(const m of l.children)m.x0=c+m.x0/o*(g-c),m.x1=c+m.x1/o*(g-c),m.y0=f+m.y0/i*(p-f),m.y1=f+m.y1/i*(p-f)}},getTreemapData(t){const e=this;return{name:"root",children:M0.bind(e)(e.filterTargetsToShow(t.filter(e.isTreemapType,e)))}},updateTargetsForTreemap(t){const e=this,{$el:{treemap:r}}=e,a=w0.call(e,e.getTreemapData(t!=null?t:e.data.targets));r.data(e.filterNullish(a))},updateTreemap(t){const e=this,{$el:r,$T:a}=e,o=r.treemap.datum(),i=e.getChartClass("Treemap"),s=e.getClass("treemap",!0),l=r.treemap.selectAll("g").data(o.children);a(l.exit(),t).style("opacity","0").remove(),l.enter().append("g").append("rect"),r.treemap.selectAll("g").attr("class",i).select("rect").attr("class",s).attr("fill",c=>e.color(c.data.name))},generateGetTreemapPoints(){const t=this,{$el:e,scale:{x:r,y:a}}=t,o={};return e.treemap.selectAll("g").each(i=>{o[i.data.name]=[[r(i.x0),a(i.y0)],[r(i.x1),a(i.y1)]]}),i=>o[i.id]},redrawTreemap(t){const e=this,{$el:r,state:{current:{width:a,height:o}}}=e;return r.defs.select("rect").attr("width",a).attr("height",o),[e.$T(r.treemap,t,ar()).call(P0.bind(e),r.treemap.datum())]},treemapDataLabelFormat(t){const e=this,{config:r}=e,{id:a,value:o}=t,i=r.treemap_label_format,s=e.getRatio("treemap",t),l=(s*100).toFixed(2),c=r.treemap_label_show&&cs.call(e,s,"treemap")?null:"0";return function(f){return f.style("opacity",c),he(i)?i.bind(e.api)(o,s,a):`${a}
|
|
58
|
-
${l}%`}}},Hr={point_show:!0,point_r:2.5,point_radialGradient:!1,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},ha={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},
|
|
57
|
+
`):[];if(c.length)return c;if(Ge(l))return l;let f=s.tickWidth;(!f||f<=0)&&(f=o?95:s.isCategory?(s.isInverted?r(a[0])-r(a[1]):r(a[1])-r(a[0]))-12:110);function g(p,m){let E,w,U;for(let N=1;N<m.length;N++)if(m.charAt(N)===" "&&(w=N),E=m.substr(0,N+1),U=i*E.length,f<U)return g(p.concat(m.substr(0,w||N)),m.slice(w?w+1:N));return p.concat(m)}return g(c,String(l))}scale(e){return arguments.length?(this.helper.scale=e,this):this.helper.scale}orient(e){return arguments.length?(this.config.orient=e in{top:1,right:1,bottom:1,left:1}?String(e):"bottom",this):this.config.orient}tickFormat(e){const{config:r}=this;return arguments.length?(r.tickFormat=e,this):r.tickFormat}tickCentered(e){const{config:r}=this;return arguments.length?(r.tickCentered=e,this):r.tickCentered}tickOffset(){return this.config.tickOffset}tickInterval(e){var r;const{outerTickSize:a,tickOffset:o,tickValues:i}=this.config;let s;if(this.params.isCategory)s=o*2;else{const l=(r=this.params.owner.scale.zoom)!=null?r:this.helper.scale;s=(this.g.select("path.domain").node().getTotalLength()-a*2)/(e||this.g.selectAll("line").size());const f=i?i.map((g,p,m)=>{const E=p+1;return E<m.length?l(m[E])-l(g):null}).filter(Boolean):[];s=Math.min(...f,s)}return s===1/0?0:s}ticks(...e){const{config:r}=this;return e.length?(r.tickArguments=Lr(e),this):r.tickArguments}tickCulling(e){const{config:r}=this;return arguments.length?(r.tickCulling=e,this):r.tickCulling}tickValues(e){const{config:r}=this;if(he(e))r.tickValues=()=>e(this.helper.scale.domain());else{if(!arguments.length)return r.tickValues;r.tickValues=e}return this}setTransition(e){return this.config.transition=e,this}}var jy=Object.defineProperty,Gy=(t,e,r)=>e in t?jy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mr=(t,e,r)=>Gy(t,typeof e!="symbol"?e+"":e,r),Vy={getAxisInstance:function(){return this.axis||new Xy(this)}};class Xy{constructor(e){mr(this,"owner"),mr(this,"x"),mr(this,"subX"),mr(this,"y"),mr(this,"y2"),mr(this,"axesList",{}),mr(this,"tick",{x:null,y:null,y2:null}),mr(this,"xs",[]),mr(this,"orient",{x:"bottom",y:"left",y2:"right",subX:"bottom"}),this.owner=e,this.setOrient()}getAxisClassName(e){return`${vn.axis} ${vn[`axis${In(e)}`]}`}isHorizontal(e,r){const a=e.config.axis_rotated;return r?a:!a}isCategorized(){const{config:e,state:r}=this.owner;return e.axis_x_type.indexOf("category")>=0||r.hasRadar}isCustomX(){const{config:e}=this.owner;return!this.isTimeSeries()&&(e.data_x||cn(e.data_xs))}isTimeSeries(e="x"){return this.owner.config[`axis_${e}_type`]==="timeseries"}isLog(e="x"){return this.owner.config[`axis_${e}_type`]==="log"}isTimeSeriesY(){return this.isTimeSeries("y")}getAxisType(e="x"){let r="linear";return this.isTimeSeries(e)?r=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(e)&&(r="log"),r}getExtent(){const e=this.owner,{config:r,scale:a}=e;let o=r.axis_x_extent;if(o){if(he(o))o=o.bind(e.api)(e.getXDomain(e.data.targets),a.subX);else if(this.isTimeSeries()&&o.every(isNaN)){const i=Zn.bind(e);o=o.map(s=>a.subX(i(s)))}}return o}init(){const e=this.owner,{config:r,$el:{main:a,axis:o},state:{clip:i}}=e,s=["x","y"];r.axis_y2_show&&s.push("y2"),s.forEach(l=>{const c=this.getAxisClassName(l);o[l]=a.append("g").attr("class",c).attr("clip-path",()=>{let f=null;return l==="x"?f=i.pathXAxis:l==="y"&&(f=i.pathYAxis),f}).attr("transform",e.getTranslate(l)).style("visibility",r[`axis_${l}_show`]?null:"hidden"),this.generateAxes(l)})}setOrient(){const e=this.owner,{axis_rotated:r,axis_y_inner:a,axis_y2_inner:o}=e.config;this.orient={x:r?"left":"bottom",y:r?a?"top":"bottom":a?"right":"left",y2:r?o?"bottom":"top":o?"left":"right",subX:r?"left":"bottom"}}generateAxes(e){const r=this.owner,{config:a}=r,o=[],i=a[`axis_${e}_axes`],s=a.axis_rotated;let l;e==="x"?l=s?Du:wu:e==="y"?l=s?wu:Du:e==="y2"&&(l=s?wy:Dy),i.length&&i.forEach(c=>{const f=c.tick||{},g=r.scale[e].copy();c.domain&&g.domain(c.domain),o.push(l(g).ticks(f.count).tickFormat(he(f.format)?f.format.bind(r.api):(p=>p)).tickValues(f.values).tickSizeOuter(f.outer===!1?0:6))}),this.axesList[e]=o}updateAxes(){const e=this.owner,{config:r,$el:{main:a},$T:o}=e;Object.keys(this.axesList).forEach(i=>{const s=r[`axis_${i}_axes`],l=e.scale[i].copy(),c=l.range();this.axesList[i].forEach((f,g)=>{const p=f.scale().range();c.every((w,U)=>w===p[U])||f.scale().range(c);const m=`${this.getAxisClassName(i)}-${g+1}`;let E=a.select(`.${m.replace(/\s/,".")}`);E.empty()?E=a.append("g").attr("class",m).style("visibility",r[`axis_${i}_show`]?null:"hidden").call(f):(s[g].domain&&l.domain(s[g].domain),o(E).call(f.scale(l))),E.attr("transform",e.getTranslate(i,g+1))})})}setAxis(e,r,a,o){const i=this.owner;e!=="subX"&&(this.tick[e]=this.getTickValues(e)),this[e]=this.getAxis(e,r,a,e==="x"&&(i.scale.zoom||i.config.subchart_show||i.state.resizing)?!0:o)}getAxis(e,r,a,o,i){const s=this.owner,{config:l}=s,c=/^(x|subX)$/.test(e),f=c?"x":e,g=c&&this.isCategorized(),p=this.orient[e],m=i?0:s.getAxisTickRotate(f);let E;if(c)E=e==="subX"?s.format.subXAxisTick:s.format.xAxisTick;else{const Y=l[`axis_${e}_tick_format`];he(Y)&&(E=Y.bind(s.api))}let w=this.tick[f];const U=ra({outerTick:a,noTransition:o,config:l,id:e,tickTextRotate:m,owner:s},c&&{isCategory:g,isInverted:l.axis_x_inverted,tickMultiline:l.axis_x_tick_multiline,tickWidth:l.axis_x_tick_width,tickTitle:g&&l.axis_x_tick_tooltip&&s.api.categories(),orgXScale:s.scale.x});c||(U.tickStepSize=l[`axis_${f}_tick_stepSize`]);const N=new zy(U).scale(c&&s.scale.zoom||r).orient(p);if(c&&this.isTimeSeries()&&w&&!he(w)){const Y=Zn.bind(s);w=w.map(J=>Y(J))}else!c&&this.isTimeSeriesY()&&(N.ticks(l.axis_y_tick_time_value),w=null);w&&N.tickValues(w),N.tickFormat(E||!c&&s.isStackNormalized()&&(Y=>`${Y}%`)),g&&(N.tickCentered(l.axis_x_tick_centered),Yn(l.axis_x_tick_culling)&&(l.axis_x_tick_culling=!1));const D=l[`axis_${f}_tick_count`];return D&&N.ticks(D),N}updateXAxisTickValues(e,r){var a;const o=this.owner,{config:i}=o,s=i.axis_x_tick_fit;let l=i.axis_x_tick_count,c;return(s||l&&s)&&(c=o.mapTargetsToUniqueXs(e),this.isCategorized()&&l>c.length&&(l=c.length),c=this.generateTickValues(c,l,this.isTimeSeries())),r?r.tickValues(c):this.x&&(this.x.tickValues(c),(a=this.subX)==null||a.tickValues(c)),c}getId(e){const{config:r,scale:a}=this.owner;let o=r.data_axes[e];return(!o||!a[o])&&(o="y"),o}getXAxisTickFormat(e){const r=this.owner,{config:a,format:o}=r,i=e&&a.subchart_axis_x_tick_format||a.axis_x_tick_format,s=this.isTimeSeries(),l=this.isCategorized();let c;return i?he(i)?c=i.bind(r.api):s&&(c=f=>f?o.axisTime(i)(f):""):c=s?o.defaultAxisTime:l?r.categoryName:f=>f<0?f.toFixed(0):f,he(c)?f=>c.apply(r,l?[f,r.categoryName(f)]:[f]):c}getTickValues(e){const r=this.owner,a=r.config[`axis_${e}_tick_values`],o=r[`${e}Axis`];return(he(a)?a.call(r.api):a)||(o?o.tickValues():void 0)}getLabelOptionByAxisId(e){return this.owner.config[`axis_${e}_label`]}getLabelText(e){const r=this.getLabelOptionByAxisId(e);return Ue(r)?r:r?r.text:null}setLabelText(e,r){const a=this.owner,{config:o}=a,i=this.getLabelOptionByAxisId(e);Ue(i)?o[`axis_${e}_label`]=r:i&&(i.text=r)}getLabelPosition(e,r){const a=this.owner.config.axis_rotated,o=this.getLabelOptionByAxisId(e),i=rr(o)&&o.position?o.position:r[+!a],s=l=>!!~i.indexOf(l);return{isInner:s("inner"),isOuter:s("outer"),isLeft:s("left"),isCenter:s("center"),isRight:s("right"),isTop:s("top"),isMiddle:s("middle"),isBottom:s("bottom")}}getAxisLabelPosition(e){return this.getLabelPosition(e,e==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])}getLabelPositionById(e){return this.getAxisLabelPosition(e)}xForAxisLabel(e){const r=this.owner,{state:{width:a,height:o}}=r,i=this.getAxisLabelPosition(e);let s=i.isMiddle?-o/2:0;return this.isHorizontal(r,e!=="x")?s=i.isLeft?0:i.isCenter?a/2:a:i.isBottom&&(s=-o),s}textAnchorForAxisLabel(e){const r=this.owner,a=this.getAxisLabelPosition(e);let o=a.isMiddle?"middle":"end";return this.isHorizontal(r,e!=="x")?o=a.isLeft?"start":a.isCenter?"middle":"end":a.isBottom&&(o="start"),o}dxForAxisLabel(e){const r=this.owner,a=this.getAxisLabelPosition(e);let o=a.isBottom?"0.5em":"0";return this.isHorizontal(r,e!=="x")?o=a.isLeft?"0.5em":a.isRight?"-0.5em":"0":a.isTop&&(o="-0.5em"),o}dyForAxisLabel(e){const r=this.owner,{config:a}=r,o=a.axis_rotated,i=this.getAxisLabelPosition(e).isInner,s=a[`axis_${e}_tick_rotate`]?r.getHorizontalAxisHeight(e):0,{width:l}=this.getMaxTickSize(e);let c;if(e==="x"){const f=a.axis_x_height;o?c=i?"1.2em":-25-l:i?c="-0.5em":f?c=f-10:s?c=s-10:c="3em"}else c={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[e],o?i?c=c[0]:s?c=s*(e==="y2"?-1:1)-c[1]:c=c[2]:c=i?c[3]:(c[4]+(a[`axis_${e}_inner`]?0:l+c[4]))*(e==="y"?-1:1);return c}getMaxTickSize(e,r){const a=this.owner,{config:o,state:{current:i,resizing:s},$el:{svg:l,chart:c}}=a,f=i.maxTickSize[e],g=`axis_${e}`,p={width:0,height:0};if(s||r||!o[`${g}_show`]||f.width>0&&a.filterTargetsToShow().length===0)return f;if(l){const m=/^y2?$/.test(e),E=a.filterTargetsToShow(a.data.targets),w=a.scale[e].copy().domain(a[`get${m?"Y":"X"}Domain`](E,e)),U=w.domain(),N=U[0]===U[1]&&U.every(Tt=>Tt>0),D=Ge(f.domain)&&f.domain[0]===f.domain[1]&&f.domain.every(Tt=>Tt>0);if(N||D)return f.size;f.domain=U,m||f.ticks.splice(0);const Y=this.getAxis(e,w,!1,!1,!0),J=o[`${g}_tick_rotate`],K=o[`${g}_tick_count`];!o[`${g}_tick_values`]&&K&&Y.tickValues(this.generateTickValues(U,K,m?this.isTimeSeriesY():this.isTimeSeries())),!m&&this.updateXAxisTickValues(E,Y);const Q=c.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0"),ot=Q.append("g").attr("class",`${vn[`axis${In(e)}`]} ${Se.dummy}`);Y.create(ot);const{sizeFor1Char:pt}=ot.node();Q.selectAll("text").attr("transform",pe(J)?`rotate(${J})`:null).each(function(Tt,yt){const{width:lt,height:jt}=pt?{width:this.textContent.length*pt.w,height:pt.h}:mn(this,!0);p.width=Math.max(p.width,lt),p.height=Math.max(p.height,jt),m||(f.ticks[yt]=lt)}),Q.remove()}return Object.keys(p).forEach(m=>{p[m]>0&&(f[m]=p[m])}),f}getXAxisTickTextY2Overflow(e){const r=this.owner,{axis:a,config:o,state:{current:i,isLegendRight:s,legendItemWidth:l}}=r,c=r.getAxisTickRotate("x"),f=c>0&&c<90;if((a.isCategorized()||a.isTimeSeries())&&o.axis_x_tick_fit&&(!o.axis_x_tick_culling||Yn(o.axis_x_tick_culling))&&!o.axis_x_tick_multiline&&f){const g=o.axis_y2_show&&i.maxTickSize.y2.width||0,p=s&&l||0,m=i.width-r.getCurrentPaddingByDirection("left"),E=this.getXAxisTickMaxOverflow(c,m-e)-g-p,w=Math.max(0,E)+e;return Math.min(w,m/2)}return 0}getXAxisTickMaxOverflow(e,r){const a=this.owner,{axis:o,config:i,state:s}=a,l=o.isTimeSeries(),c=s.current.maxTickSize.x.ticks,f=c.length,{left:g,right:p}=s.axis.x.padding;let m=0;const E=f-(l&&i.axis_x_tick_fit?.5:0);for(let N=0;N<f;N++){const D=N+1,Y=Math.cos(Math.PI*e/180)*c[N],J=D-(l?1:.5)+g;if(J<=0)continue;const nt=(r-Y)/J,Q=E-D,ot=p*nt,pt=Q*nt+ot,Tt=Y-nt/2-pt;m=Math.max(m,Tt)}const w=a.filterTargetsToShow(a.data.targets);let U=0;if(!l&&i.axis_x_tick_count<=w.length&&w[0].values.length){const N=jr(a.axis.getAxisType("x"),0,r-m).domain([g*-1,a.getXDomainMax(a.data.targets)+1+p]);U=(N(1)-N(0))/2}return m+U}updateLabels(e){const r=this.owner,{config:a,$el:{main:o},$T:i}=r,s=a.axis_rotated;["x","y","y2"].forEach(l=>{const c=this.getLabelText(l),f=`axis${In(l)}`,g=vn[`${f}Label`];if(c){let p=o.select(`text.${g}`);p.empty()&&(p=o.select(`g.${vn[f]}`).insert("text",":first-child").attr("class",g).attr("transform",["rotate(-90)",null][l==="x"?+!s:+s]).style("text-anchor",()=>this.textAnchorForAxisLabel(l))),i(p,e).attr("x",()=>this.xForAxisLabel(l)).attr("dx",()=>this.dxForAxisLabel(l)).attr("dy",()=>this.dyForAxisLabel(l)).text(c)}})}getPadding(e,r,a,o){const i=pe(e)?e:e[r];return De(i)?this.owner.convertPixelToScale(/(bottom|top)/.test(r)?"y":"x",i,o):a}generateTickValues(e,r,a){let o=e;if(r){const i=he(r)?r():r;if(i===1)o=[e[0]];else if(i===2)o=[e[0],e[e.length-1]];else if(i>2){const s=this.isCategorized(),l=i-2,c=e[0],f=e[e.length-1],g=(f-c)/(l+1);let p;o=[c];for(let m=0;m<l;m++)p=+c+g*(m+1),o.push(a?new Date(p):s?Math.round(p):p);o.push(f)}}return a||(o=o.sort((i,s)=>i-s)),o}generateTransitions(e){const r=this.owner,{$el:{axis:a},$T:o}=r,[i,s,l,c]=["x","y","y2","subX"].map(f=>o(a[f],e));return{axisX:i,axisY:s,axisY2:l,axisSubX:c}}redraw(e,r,a){const o=this.owner,{config:i,state:s,$el:l}=o,c=r?"0":null;["x","y","y2","subX"].forEach(f=>{const g=this[f],p=l.axis[f];g&&p&&(!a&&!i.transition_duration&&(g.config.withoutTransition=!0),p.style("opacity",c),g.create(e[`axis${In(f)}`]))}),this.updateAxes(),!s.rendered&&i.axis_tooltip&&this.setAxisTooltip()}redrawAxis(e,r,a,o,i){var s,l,c;const f=this.owner,{config:g,scale:p,$el:m}=f,E=!!p.zoom;let w;!E&&this.isCategorized()&&e.length===0&&p.x.domain([0,m.axis.x.selectAll(".tick").size()]),p.x&&e.length?(!E&&f.updateXDomain(e,r.UpdateXDomain,r.UpdateOrgXDomain,r.TrimXDomain),g.axis_x_tick_values||this.updateXAxisTickValues(e)):this.x&&(this.x.tickValues([]),(s=this.subX)==null||s.tickValues([])),g.zoom_rescale&&!o&&(w=p.x.orgDomain()),["y","y2"].forEach(U=>{const N=`axis_${U}_`,D=p[U];if(D){const Y=g[`${N}tick_values`],J=g[`${N}tick_count`];if(D.domain(f.getYDomain(e,U,w)),!Y&&J){const K=f.axis[U],nt=D.domain();K.tickValues(this.generateTickValues(nt,nt.every(Q=>Q===0)?1:J,this.isTimeSeriesY()))}}}),this.redraw(a,f.hasArcType(),i),this.updateLabels(r.Transition),(r.UpdateXDomain||r.UpdateXAxis||r.Y)&&e.length&&this.setCulling(),r.Y&&((l=p.subY)==null||l.domain(f.getYDomain(e,"y")),(c=p.subY2)==null||c.domain(f.getYDomain(e,"y2")))}setCulling(){const e=this.owner,{config:r,state:{clip:a,current:o},$el:i}=e;["subX","x","y","y2"].forEach(s=>{const l=i.axis[s],f=`axis_${s==="subX"?"x":s}_tick_culling`,g=r[f];if(l&&g){const p=l.selectAll(".tick"),m=aa(p.data(),!r[`${f}_reverse`]),E=m.length,w=r[`${f}_max`],U=r[`${f}_lines`];let N;if(E){for(let D=1;D<E;D++)if(E/D<w){N=D;break}p.each(function(D){const Y=U?this.querySelector("text"):this;Y&&(Y.style.display=m.indexOf(D)%N?"none":null)})}else p.style("display",null);if(s==="x"){const D=o.maxTickSize.x.clipPath?a.pathXAxisTickTexts:null;i.svg.selectAll(`.${vn.axisX} .tick text`).attr("clip-path",D)}}})}setAxisTooltip(){var e;const r=this.owner,{config:{axis_rotated:a,axis_tooltip:o},$el:{axis:i,axisTooltip:s}}=r,l=(e=o.backgroundColor)!=null?e:"black";r.generateTextBGColorFilter(l,{x:-.15,y:-.2,width:1.3,height:1.3}),["x","y","y2"].forEach(c=>{var f,g,p;if(Ue(l)||l[c])if(s[c]=(f=i[c])==null?void 0:f.append("text").classed(vn[`axis${c.toUpperCase()}Tooltip`],!0).attr("filter",r.updateTextBGColor({id:c},l)),a){const m=c==="x"?"x":"y",E=c==="y"?"1.15em":c==="x"?"-0.3em":"-0.4em";(g=s[c])==null||g.attr(m,E).attr(`d${c==="x"?"y":"x"}`,c==="x"?"0.4em":"-1.3em").style("text-anchor",c==="x"?"end":null)}else{const m=c==="x"?"y":"x",E=c==="x"?"1.15em":`${c==="y"?"-":""}0.4em`;(p=s[c])==null||p.attr(m,E).attr(`d${c==="x"?"x":"y"}`,c==="x"?"-1em":"0.3em").style("text-anchor",c==="y"?"end":null)}})}}var Hy={initEventRect(){this.$el.main.select(`.${Se.chart}`).append("g").attr("class",Qn.eventRects).style("fill-opacity","0")},redrawEventRect(){var t;const e=this,{config:r,state:a,$el:o}=e,i=e.isMultipleX(),s=r.axis_x_inverted;if(o.eventRect)e.updateEventRect(o.eventRect,!0);else if(e.data.targets.length){const c=e.$el.main.select(`.${Qn.eventRects}`).style("cursor",r.zoom_enabled&&r.zoom_type!=="drag"?r.axis_rotated?"ns-resize":"ew-resize":null).classed(Qn.eventRectsMultiple,i).classed(Qn.eventRectsSingle,!i).selectAll(`.${Qn.eventRect}`).data([0]).enter().append("rect");e.updateEventRect(c),e.updateEventType(c),c.call(e.getDraggableSelection()),o.eventRect=c,e.state.inputType==="touch"&&!o.svg.on("touchstart.eventRect")&&!e.hasArcType()&&e.bindTouchOnEventRect(),a.rendered&&e.updateEventRect(o.eventRect,!0)}if(!i){const l=e.getMaxDataCountTarget();(!r.data_xSort||s)&&l.sort((c,f)=>s?f.x-c.x:c.x-f.x),e.updateDataIndexByX(l),e.updateXs(l),(t=e.updatePointClass)==null||t.call(e,!0),a.eventReceiver.data=l}e.updateEventRectData()},bindTouchOnEventRect(){const t=this,{config:e,state:r,$el:{eventRect:a,svg:o}}=t,i=m=>{if(t.isMultipleX())t.selectRectForMultipleXs(m);else{const E=t.getDataIndexFromEvent(r.event);t.callOverOutForTouch(E),E===-1?t.unselectRect():t.selectRectForSingle(m,E)}},s=()=>{t.unselectRect(),t.callOverOutForTouch()},l=e.interaction_inputType_touch.preventDefault,c=Mi(l)&&l||!1,f=!isNaN(l)&&l||null;let g;const p=m=>{const E=m.type,U=m.changedTouches[0][`client${e.axis_rotated?"Y":"X"}`];E==="touchstart"?c?m.preventDefault():f!==null&&(g=U):E==="touchmove"&&(c||g===!0||f!==null&&Math.abs(g-U)>=f)&&(g=!0,m.preventDefault())};a.on("touchstart",m=>{r.event=m,t.updateEventRect()}).on("touchstart.eventRect touchmove.eventRect",m=>{if(r.event=m,!a.empty()&&a.classed(Qn.eventRect)){if(r.dragging||r.flowing||t.hasArcType()||m.touches.length>1)return;p(m),i(a.node())}else s()},!0).on("touchend.eventRect",m=>{r.event=m,!a.empty()&&a.classed(Qn.eventRect)&&(t.hasArcType()||!t.toggleShape||r.cancelClick)&&r.cancelClick&&(r.cancelClick=!1)},!0),o.on("touchstart",m=>{r.event=m;const{target:E}=m;E&&E!==a.node()&&s()})},updateEventRect(t,e=!1){const r=this,{state:a,$el:o}=r,{eventReceiver:i,width:s,height:l,rendered:c,resizing:f}=a,g=t||o.eventRect,p=()=>{if(i){const m=kl(o.chart.node());i.rect=mn(g.node(),!0).toJSON(),i.rect.top+=m.y,i.rect.left+=m.x}};(!c||f||e)&&(g.attr("x",0).attr("y",0).attr("width",s).attr("height",l),(!c||e)&&g.classed(Qn.eventRect,!0)),p()},updateEventType(t){const e=this,r=Mi(t),a=r?e.$el.eventRect:t,o=r?t!==(a==null?void 0:a.datum().multipleX):!1;a&&(o&&(a==null||a.on("mouseover mousemove mouseout click",null)),e.isMultipleX()?e.generateEventRectsForMultipleXs(a):e.generateEventRectsForSingleX(a))},updateEventRectData(){const t=this,{config:e,scale:r,state:a}=t,o=r.zoom||r.x,i=e.axis_rotated,s=t.isMultipleX();let l,c,f,g;if(t.updateEventType(s),s)l=0,c=0,f=a.width,g=a.height;else{let E,w;if(t.axis.isCategorized())E=t.getEventRectWidth(),w=U=>o(U.x)-E/2;else{const U=({index:N})=>({prev:t.getPrevX(N),next:t.getNextX(N)});E=N=>{const D=U(N),Y=o.domain();let J;return D.prev===null&&D.next===null?J=i?a.height:a.width:D.prev===null?J=(o(D.next)+o(N.x))/2:D.next===null?J=o(Y[1])-(o(D.prev)+o(N.x))/2:(Object.keys(D).forEach((K,nt)=>{var Q;D[K]=(Q=D[K])!=null?Q:Y[nt]}),J=Math.max(0,(o(D.next)-o(D.prev))/2)),J},w=N=>{const D=U(N);let Y;return D.prev===null&&D.next===null?Y=0:D.prev===null?Y=o(o.domain()[0]):Y=(o(N.x)+o(D.prev))/2,Y}}l=i?0:w,c=i?w:0,f=i?a.width:E,g=i?E:a.height}const{eventReceiver:p}=a,m=(E,w)=>he(E)?E(w):E;p.coords.splice(p.data.length),p.data.forEach((E,w)=>{p.coords[w]={x:m(l,E),y:m(c,E),w:m(f,E),h:m(g,E)}})},selectRectForSingle(t,e){var r,a;const o=this,{config:i,$el:{main:s,circle:l}}=o,c=i.data_selection_enabled,f=i.data_selection_grouped,g=i.data_selection_isselectable,p=i.tooltip_grouped,m=o.getAllValuesOnIndex(e);if(p&&(o.showTooltip(m,t),(r=o.showGridFocus)==null||r.call(o,m),!c||f))return;!l&&s.selectAll(`.${Se.EXPANDED}:not(.${sn.shape}-${e})`).classed(Se.EXPANDED,!1);const E=s.selectAll(`.${sn.shape}-${e}`).classed(Se.EXPANDED,!0).style("cursor",g?"pointer":null).filter(function(w){return o.isWithinShape(this,w)});E.empty()&&!p&&i.interaction_onout&&((a=o.hideGridFocus)==null||a.call(o),o.hideTooltip(),!f&&o.setExpand(e)),E.call(w=>{var U,N;const D=w.data();c&&(f||g!=null&&g.bind(o.api)(D))&&(t.style.cursor="pointer"),p||(o.showTooltip(D,t),(U=o.showGridFocus)==null||U.call(o,D),(N=o.unexpandCircles)==null||N.call(o),w.each(Y=>o.setExpand(e,Y.id)))})},selectRectForMultipleXs(t,e=!0){const r=this,{config:a,state:o}=r,i=r.filterTargetsToShow(r.data.targets);if(o.dragging||r.hasArcType(i))return;const s=Kn(o.event,t),l=r.findClosestFromTargets(i,s);if(e&&o.mouseover&&(!l||l.id!==o.mouseover.id)&&(a.data_onout.call(r.api,o.mouseover),o.mouseover=void 0),!l){r.unselectRect();return}const f=(r.isBubbleType(l)||r.isScatterType(l)||!a.tooltip_grouped?[l]:r.filterByX(i,l.x)).map(p=>r.addName(p));r.showTooltip(f,t),r.setExpand(l.index,l.id,!0),r.showGridFocus(f);const g=r.dist(l,s);(r.isBarType(l.id)||g<r.getPointSensitivity(l))&&(r.$el.svg.select(`.${Qn.eventRect}`).style("cursor","pointer"),e&&!o.mouseover&&(a.data_onover.call(r.api,l),o.mouseover=l))},unselectRect(){const t=this,{$el:{circle:e,tooltip:r}}=t;t.$el.svg.select(`.${Qn.eventRect}`).style("cursor",null),t.hideGridFocus(),r&&(t.hideTooltip(),t._handleLinkedCharts(!1)),e&&!t.isPointFocusOnly()&&t.unexpandCircles(),t.expandBarTypeShapes(!1)},generateEventRectsForSingleX(t){const e=this,{config:r,state:a}=e,{eventReceiver:o}=a,i=t.style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("click",function(s){a.event=s;const{currentIdx:l,data:c}=o,f=c[l===-1?e.getDataIndexFromEvent(s):l];e.clickHandlerForSingleX.bind(this)(f,e)}).datum({multipleX:!1});if(a.inputType==="mouse"){const s=l=>{const c=l?e.getDataIndexFromEvent(l):o.currentIdx;return c>-1?o.data[c]:null};i.on("mouseover",l=>{a.event=l,e.updateEventRect(),Object.values(e.$el.axisTooltip).forEach(c=>c==null?void 0:c.style("display",null))}).on("mousemove",function(l){const c=s(l);if(a.event=l,!c)return;let{index:f}=c;const g=r.line_step_type;if(r.line_step_tooltipMatch&&e.hasType("step")&&/^step\-(before|after)$/.test(g)){const m=e.scale.zoom||e.scale.x,E=e.axis.xs[f],w=m.invert(Kn(l,this)[0]);g==="step-after"&&w<E?f-=1:g==="step-before"&&w>E&&(f+=1)}e.showAxisGridFocus();const p=r.tooltip_grouped&&f===o.currentIdx;if(a.dragging||a.flowing||e.hasArcType()||p){r.tooltip_show&&p&&e.setTooltipPosition();return}f!==o.currentIdx&&(e.setOverOut(!1,o.currentIdx),o.currentIdx=f),f===-1?e.unselectRect():e.selectRectForSingle(this,f),e.setOverOut(f!==-1,f)}).on("mouseout",l=>{a.event=l,!(!r||e.hasArcType()||o.currentIdx===-1||!r.interaction_onout)&&(e.hideAxisGridFocus(),e.unselectRect(),e.setOverOut(!1,o.currentIdx),o.currentIdx=-1)})}return i},clickHandlerForSingleX(t,e){const r=e,{config:a,state:o,$el:{main:i}}=r;if(!t||r.hasArcType()||o.cancelClick){o.cancelClick&&(o.cancelClick=!1);return}const{index:s}=t;i.selectAll(`.${sn.shape}-${s}`).each(function(l){var c;(a.data_selection_grouped||r.isWithinShape(this,l))&&((c=r.toggleShape)==null||c.call(r,this,l,s),a.data_onclick.bind(r.api)(l,this))})},generateEventRectsForMultipleXs(t){const e=this,{config:r,state:a}=e;t.on("click",function(o){a.event=o,e.clickHandlerForMultipleXS.bind(this)(e)}).datum({multipleX:!0}),a.inputType==="mouse"&&t.on("mouseover mousemove",function(o){a.event=o,e.selectRectForMultipleXs(this)}).on("mouseout",o=>{a.event=o,!(!e.config||e.hasArcType()||!r.interaction_onout)&&e.unselectRect()})},clickHandlerForMultipleXS(t){const e=t,{config:r,state:a}=e,o=e.filterTargetsToShow(e.data.targets);if(e.hasArcType(o))return;const i=Kn(a.event,this),s=e.findClosestFromTargets(o,i),l=e.getPointSensitivity(s);s&&(e.isBarType(s.id)||e.dist(s,i)<l)&&e.$el.main.selectAll(`.${sn.shapes}${e.getTargetSelectorSuffix(s.id)}`).selectAll(`.${sn.shape}-${s.index}`).each(function(){var c;(r.data_selection_grouped||e.isWithinShape(this,s))&&((c=e.toggleShape)==null||c.call(e,this,s,s.index),r.data_onclick.bind(e.api)(s,this))})}};const Wy=t=>+t;var Yy={generateFlow(t){const e=this,{data:r,state:a,$el:o}=e;return function(){const i=t.flow.length;a.flowing=!0,r.targets.forEach(l=>{l.values.splice(0,i)}),e.updateXGrid&&e.updateXGrid(!0);const s={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(l=>{const c=l.split(".");let f=o[c[0]];f&&c.length>1&&(f=f[c[1]]),f!=null&&f.size()&&(s[l]=f)}),e.hideGridFocus(),e.setFlowList(s,t)}},setFlowList(t,e){const r=this,{flow:a,targets:o}=e,{duration:i=e.duration,index:s,length:l,orgDataCount:c}=a,f=r.getFlowTransform(o,c,s,l),g=oc();let p;g.add(Object.keys(t).map(m=>(p=t[m].transition().ease(Wy).duration(i),m==="axis.x"?p=p.call(E=>{r.axis.x.setTransition(E).create(E)}):m==="region.list"?p=p.filter(r.isRegionOnX).attr("transform",f):p=p.attr("transform",f),p))),p.call(g,()=>{r.cleanUpFlow(t,e)})},cleanUpFlow(t,e){const r=this,{config:a,state:o,$el:{svg:i}}=r,s=a.axis_rotated,{flow:l,shape:c,xv:f}=e,{cx:g,cy:p,xForText:m,yForText:E}=c.pos,{done:w=()=>{},length:U}=l;U&&(["circle","text","shape","eventRect"].forEach(N=>{const D=[];for(let Y=0;Y<U;Y++)D.push(`.${je[N]}-${Y}`);i.selectAll(`.${je[`${N}s`]}`).selectAll(D).remove()}),i.select(`.${je.xgrid}`).remove()),Object.keys(t).forEach(N=>{const D=t[N];if(N!=="axis.x"&&D.attr("transform",null),N==="grid.x")D.attr(o.xgridAttr);else if(N==="gridLines.x")D.attr("x1",s?0:f).attr("x2",s?o.width:f),D.select("text").attr("x",s?o.width:0).attr("y",f);else if(/^(area|bar|line)$/.test(N))D.attr("d",c.type[N]);else if(N==="text")D.attr("x",m).attr("y",E).style("fill-opacity",r.opacityForText.bind(r));else if(N==="circle")if(r.isCirclePoint())D.attr("cx",g).attr("cy",p);else{const Y=K=>g(K)-a.point_r,J=K=>p(K)-a.point_r;D.attr("x",Y).attr("y",J)}else N==="region.list"&&D.select("rect").filter(r.isRegionOnX).attr("x",r.regionX.bind(r)).attr("width",r.regionWidth.bind(r))}),a.interaction_enabled&&r.redrawEventRect(),w.call(r.api),o.flowing=!1},getFlowTransform(t,e,r,a){const o=this,{data:i,scale:{x:s}}=o,l=i.targets[0].values;let c=o.getValueOnIndex(l,r),f=o.getValueOnIndex(l,r+a),g;const p=s.domain(),m=o.updateXDomain(t,!0,!0);e?e===1||(c==null?void 0:c.x)===(f==null?void 0:f.x)?g=s(p[0])-s(m[0]):g=o.axis.isTimeSeries()?s(p[0])-s(m[0]):s((c==null?void 0:c.x)||0)-s(f.x):l.length!==1?g=s(p[0])-s(m[0]):o.axis.isTimeSeries()?(c=o.getValueOnIndex(l,0),f=o.getValueOnIndex(l,l.length-1),g=s(c.x)-s(f.x)):g=Nr(m)/2;const E=Nr(p)/Nr(m);return`translate(${g},0) scale(${E},1)`}},Ky={initClip(){const t=this,{clip:e,datetimeId:r}=t.state;e.id=`${r}-clip`,e.idXAxis=`${e.id}-xaxis`,e.idYAxis=`${e.id}-yaxis`,e.idGrid=`${e.id}-grid`,e.path=t.getClipPath(e.id),e.pathXAxis=t.getClipPath(e.idXAxis),e.pathYAxis=t.getClipPath(e.idYAxis),e.pathGrid=t.getClipPath(e.idGrid)},getClipPath(t){const e=this,{config:r}=e;return!r.clipPath&&/-clip$/.test(t)||!r.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!r.axis_y_clipPath&&/-clip-yaxis$/.test(t)?null:`url(#${t})`},appendClip(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath(t){const e=this,{config:r,state:{margin:a,width:o,height:i}}=e,s=r.axis_rotated,l=Math.max(30,a.left)-(s?0:20),c=(s?a.top+i+10:a.bottom)+20,f=s?-(1+l):-(l-1),g=-15,p=s?a.left+20:o+10+l;t.attr("x",f).attr("y",g).attr("width",p).attr("height",c)},setYAxisClipPath(t){const e=this,{config:r,state:{margin:a,width:o,height:i}}=e,s=r.axis_rotated,l=Math.max(30,a.left)-(s?20:0),c=r.axis_y_inner,f=c&&!s?r.axis_y_label.text?-20:-1:s?-(1+l):-(l-1),g=-(s?20:a.top),p=(s?o+15+l:a.left+20)+(c?20:0),m=(s?a.bottom+10:a.top+i)+10;t.attr("x",f).attr("y",g).attr("width",p).attr("height",m)},updateXAxisTickClip(){const t=this,{config:e,state:{clip:r,xAxisHeight:a},$el:{defs:o}}=t,i=t.getHorizontalAxisHeight("x");if(o&&!r.idXAxisTickTexts){const s=`${r.id}-xaxisticktexts`;t.appendClip(o,s),r.pathXAxisTickTexts=t.getClipPath(r.idXAxisTickTexts),r.idXAxisTickTexts=s}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&i!==a&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=i},setXAxisTickClipWidth(){const t=this,{config:e,state:{current:{maxTickSize:r}}}=t,a=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&a){const o=Math.sin(Math.PI/180*Math.abs(a));r.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/o}else r.x.clipPath=null},setXAxisTickTextClipPathWidth(){const t=this,{state:{clip:e,current:r},$el:{svg:a}}=t;a&&a.select(`#${e.idXAxisTickTexts} rect`).attr("width",r.maxTickSize.x.clipPath).attr("height",30)}};const Zy=t=>De(t.position)||"end",Jy=t=>t.position==="start"?4:t.position==="middle"?0:-4;function Nu(t,e,r){return a=>{let o=t?0:e;return a.position==="start"?o=t?-r:0:a.position==="middle"&&(o=(t?-r:e)/2),o}}function Lu(t,e){e==="grid"&&t.each(function(){const r=it(this);["x1","x2","y1","y2"].forEach(a=>r.attr(a,+r.attr(a)))})}var Qy={hasGrid(){const{config:t}=this;return["x","y"].some(e=>t[`grid_${e}_show`]||t[`grid_${e}_lines`].length)},initGrid(){const t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines(){const t=this,{config:e,state:{clip:r},$el:a}=t;(e.grid_x_lines.length||e.grid_y_lines.length)&&(a.gridLines.main=a.main.insert("g",`.${Se.chart}${e.grid_lines_front?" + *":""}`).attr("clip-path",r.pathGrid).attr("class",`${on.grid} ${on.gridLines}`),a.gridLines.main.append("g").attr("class",on.xgridLines),a.gridLines.main.append("g").attr("class",on.ygridLines),a.gridLines.x=Vc([]))},updateXGrid(t){const e=this,{config:r,scale:a,state:o,$el:{main:i,grid:s}}=e,l=r.axis_rotated,c=e.generateGridData(r.grid_x_type,a.x),f=e.axis.isCategorized()?e.axis.x.tickOffset():0,g=p=>(a.zoom||a.x)(p)+f*(l?-1:1);o.xgridAttr=l?{x1:0,x2:o.width,y1:g,y2:g}:{x1:g,x2:g,y1:0,y2:o.height},s.x=i.select(`.${on.xgrids}`).selectAll(`.${on.xgrid}`).data(c),s.x.exit().remove(),s.x=s.x.enter().append("line").attr("class",on.xgrid).merge(s.x),t||s.x.each(function(){const p=it(this);Object.keys(o.xgridAttr).forEach(m=>{p.attr(m,o.xgridAttr[m]).style("opacity",()=>p.attr(l?"y1":"x1")===(l?o.height:0)?"0":null)})})},updateYGrid(){const t=this,{axis:e,config:r,scale:a,state:o,$el:{grid:i,main:s}}=t,l=r.axis_rotated,c=g=>a.y(g),f=e.y.getGeneratedTicks(r.grid_y_ticks)||t.scale.y.ticks(r.grid_y_ticks);i.y=s.select(`.${on.ygrids}`).selectAll(`.${on.ygrid}`).data(f),i.y.exit().remove(),i.y=i.y.enter().append("line").attr("class",on.ygrid).merge(i.y),i.y.attr("x1",l?c:0).attr("x2",l?c:o.width).attr("y1",l?0:c).attr("y2",l?o.height:c),Lu(i.y,"grid")},updateGrid(){const t=this,{$el:{grid:e,gridLines:r}}=t;!r.main&&t.initGridLines(),e.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateGridLines("x"),t.updateGridLines("y")},updateGridLines(t){const e=this,{config:r,$el:{gridLines:a,main:o},$T:i}=e,s=r.axis_rotated,l=t==="x";r[`grid_${t}_show`]&&e[`update${t.toUpperCase()}Grid`]();let c=o.select(`.${on[`${t}gridLines`]}`).selectAll(`.${on[`${t}gridLine`]}`).data(r[`grid_${t}_lines`]);i(c.exit()).style("opacity","0").remove();const f=c.enter().append("g");f.append("line").style("opacity","0"),c=f.merge(c),c.each(function(g){const p=it(this);p.select("text").empty()&&g.text&&p.append("text").style("opacity","0")}),i(c.attr("class",g=>`${on[`${t}gridLine`]} ${g.class||""}`.trim()).select("text").attr("text-anchor",Zy).attr("transform",()=>l?s?null:"rotate(-90)":s?"rotate(-90)":null).attr("dx",Jy).attr("dy",-5)).text(function(g){var p;return(p=g.text)!=null?p:this.remove()}),a[t]=c},redrawGrid(t){const e=this,{config:{axis_rotated:r},state:{width:a,height:o},$el:{gridLines:i},$T:s}=e,l=e.xv.bind(e),c=e.yv.bind(e);let f=i.x.select("line"),g=i.x.select("text"),p=i.y.select("line"),m=i.y.select("text");return f=s(f,t).attr("x1",r?0:l).attr("x2",r?a:l).attr("y1",r?l:0).attr("y2",r?l:o),g=s(g,t).attr("x",Nu(!r,a,o)).attr("y",l),p=s(p,t).attr("x1",r?c:0).attr("x2",r?c:a).attr("y1",r?0:c).attr("y2",r?o:c),m=s(m,t).attr("x",Nu(r,a,o)).attr("y",c),[f.style("opacity",null),g.style("opacity",null),p.style("opacity",null),m.style("opacity",null)]},initFocusGrid(){const t=this,{config:e,state:{clip:r},$el:a}=t,o=e.grid_front,i=`.${o&&a.gridLines.main?on.gridLines:Se.chart}${o?" + *":""}`,s=a.main.insert("g",i).attr("clip-path",r.pathGrid).attr("class",on.grid);if(a.grid.main=s,e.grid_x_show&&s.append("g").attr("class",on.xgrids),e.grid_y_show&&s.append("g").attr("class",on.ygrids),e.axis_tooltip){const l=s.append("g").attr("class","bb-axis-tooltip");l.append("line").attr("class","bb-axis-tooltip-x"),l.append("line").attr("class","bb-axis-tooltip-y")}e.interaction_enabled&&e.grid_focus_show&&!e.axis_tooltip&&(s.append("g").attr("class",qe.xgridFocus).append("line").attr("class",qe.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&s.append("g").attr("class",qe.ygridFocus).append("line").attr("class",qe.ygridFocus))},showAxisGridFocus(){var t,e;const r=this,{config:a,format:o,state:{event:i,width:s,height:l}}=r,c=a.axis_rotated,[f,g]=Kn(i,(t=r.$el.eventRect)==null?void 0:t.node()),p={x:f,y:g};for(const[m,E]of Object.entries(r.$el.axisTooltip)){const w=m==="x"&&!c||m!=="x"&&c?"x":"y",U=p[w];let N=(e=r.scale[m])==null?void 0:e.invert(U);N&&(N=m==="x"&&r.axis.isTimeSeries()?o.xAxisTick(N):N==null?void 0:N.toFixed(2),E==null||E.attr(w,U).text(N))}r.$el.main.selectAll("line.bb-axis-tooltip-x, line.bb-axis-tooltip-y").style("visibility",null).each(function(m,E){const w=it(this);E===0?w.attr("x1",f).attr("x2",f).attr("y1",E?0:l).attr("y2",E?l:0):w.attr("x1",E?0:s).attr("x2",E?s:0).attr("y1",g).attr("y2",g)})},hideAxisGridFocus(){const t=this;t.$el.main.selectAll(`line.${vn.axisTooltipX}, line.${vn.axisTooltipY}`).style("visibility","hidden"),Object.values(t.$el.axisTooltip).forEach(e=>e==null?void 0:e.style("display","none"))},showGridFocus(t){var e;const r=this,{config:a,state:{width:o,height:i}}=r,s=a.axis_rotated,l=r.$el.main.selectAll(`line.${qe.xgridFocus}, line.${qe.ygridFocus}`),c=(t||[l.datum()]).filter(p=>p&&De(r.getBaseValue(p)));if(!a.tooltip_show||c.length===0||!a.axis_x_forceAsSingle&&r.hasType("bubble")||r.hasArcType())return;const f=a.grid_focus_edge&&!a.tooltip_grouped,g=r.xx.bind(r);l.style("visibility",null).data(c.concat(c)).each(function(p){const m=it(this),E={x:g(p),y:r.getYScaleById(p.id)(p.value)};let w;if(m.classed(qe.xgridFocus))w=s?[null,E.x,f?E.y:o,E.x]:[E.x,f?E.y:null,E.x,i];else{const U=r.axis.getId(p.id)==="y2";w=s?[E.y,f&&!U?E.x:null,E.y,f&&U?E.x:i]:[f&&U?E.x:null,E.y,f&&!U?E.x:o,E.y]}["x1","y1","x2","y2"].forEach((U,N)=>m.attr(U,w[N]))}),Lu(l,"grid"),(e=r.showCircleFocus)==null||e.call(r,t)},hideGridFocus(){var t;const e=this,{state:{inputType:r,resizing:a},$el:{main:o}}=e;(r==="mouse"||!a)&&(o.selectAll(`line.${qe.xgridFocus}, line.${qe.ygridFocus}`).style("visibility","hidden"),(t=e.hideCircleFocus)==null||t.call(e))},updateGridFocus(){var t;const e=this,{state:{inputType:r,width:a,height:o,resizing:i},$el:{grid:s}}=e,l=s.main.select(`line.${qe.xgridFocus}`);if(r==="touch")l.empty()?i&&((t=e.showCircleFocus)==null||t.call(e)):e.showGridFocus();else{const c=e.config.axis_rotated;l.attr("x1",c?0:-10).attr("x2",c?a:-10).attr("y1",c?-10:0).attr("y2",c?-10:o)}return!0},generateGridData(t,e){const r=this,a=r.$el.main.select(`.${vn.axisX}`).selectAll(".tick").size();let o=[];if(t==="year"){const i=r.getXDomain(),[s,l]=i.map(c=>c.getFullYear());for(let c=s;c<=l;c++)o.push(new Date(`${c}-01-01 00:00:00`))}else o=e.ticks(10),o.length>a&&(o=o.filter(i=>String(i).indexOf(".")<0));return o},getGridFilterToRemove(t){return t?e=>{let r=!1;return(Ge(t)?t.concat():[t]).forEach(a=>{("value"in a&&e.value===a.value||"class"in a&&e.class===a.class)&&(r=!0)}),r}:()=>!0},removeGridLines(t,e){const r=this,{config:a,$T:o}=r,i=r.getGridFilterToRemove(t),s=g=>!i(g),l=e?on.xgridLines:on.ygridLines,c=e?on.xgridLine:on.ygridLine;o(r.$el.main.select(`.${l}`).selectAll(`.${c}`).filter(i)).style("opacity","0").remove();const f=`grid_${e?"x":"y"}_lines`;a[f]=a[f].filter(s)}},ky={initRegion(){const t=this,{$el:e}=t;e.region.main=e.main.insert("g",":first-child").attr("clip-path",t.state.clip.path).attr("class",Aa.regions)},updateRegion(){const t=this,{config:e,$el:{region:r},$T:a}=t;r.main||t.initRegion(),r.main.style("visibility",t.hasArcType()?"hidden":null);const o=r.main.selectAll(`.${Aa.region}`).data(e.regions);a(o.exit()).style("opacity","0").remove();const i=o.enter().append("g");i.append("rect").style("fill-opacity","0"),r.list=i.merge(o).attr("class",t.classRegion.bind(t)),r.list.each(function(s){var l;it(this).select("text").empty()&&((l=s.label)!=null&&l.text)&&it(this).append("text").style("opacity","0")})},redrawRegion(t){const e=this,{$el:{region:r},$T:a}=e,o=e.regionX.bind(e),i=e.regionY.bind(e),s=["width","height"];let l=r.list.select("rect"),c=r.list.selectAll("text");return l=a(l,t).attr("x",o).attr("y",i).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)),c=a(c,t).text(f=>{var g;return(g=f.label)==null?void 0:g.text}).attr("transform",({label:f})=>f.rotated?" rotate(-90)":null).attr("transform",function(f){var g;const{x:p=0,y:m=0,center:E=!1,rotated:w=!1}=(g=f.label)!=null?g:{},U=this.previousElementSibling,N={x:0,y:0};return Ue(E)&&["x","y"].forEach((D,Y)=>{E.indexOf(D)>-1&&(N[D]=(+U.getAttribute(s[Y])-mn(this)[s[Y]])/2)}),`translate(${o(f)+N.x+p}, ${i(f)+N.y+m})${w?" rotate(-90)":""}`}).attr("text-anchor",({label:f})=>f!=null&&f.rotated?"end":null).attr("dy","1em").style("fill",({label:f})=>{var g;return(g=f==null?void 0:f.color)!=null?g:null}),[l.style("fill-opacity",f=>De(f.opacity)?f.opacity:null).on("end",function(){it(this.parentNode).selectAll("rect:not([x])").remove()}),c.style("opacity",null)]},regionX(t){return this.getRegionSize("x",t)},regionY(t){return this.getRegionSize("y",t)},regionWidth(t){return this.getRegionSize("width",t)},regionHeight(t){return this.getRegionSize("height",t)},getRegionSize(t,e){const r=this,{config:a,scale:o,state:i}=r,s=a.axis_rotated,l=/(x|y|y2)/.test(t),c=l?t==="x":t==="width",f=!l&&r[c?"regionX":"regionY"](e);let g=l?"start":"end",p=l?0:i[t],m;if(e.axis==="y"||e.axis==="y2"?(!l&&!c?g="start":l&&!c&&(g="end"),(c?s:!s)&&g in e&&(m=o[e.axis])):(c?!s:s)&&g in e&&(m=o.zoom||o.x),m){let E=0;p=e[g],r.axis.isTimeSeries(e.axis)?p=Zn.call(r,p):/(x|width)/.test(t)&&r.axis.isCategorized()&&isNaN(p)&&(p=a.axis_x_categories.indexOf(p),E=r.axis.x.tickOffset()*(g==="start"?-1:1)),p=m(p)+E}return l?p:p<f?0:p-f},isRegionOnX(t){return!t.axis||t.axis==="x"}},qy={getAxisSize(t){const e=this,r=e.config.axis_rotated;return r&&t==="x"||!r&&/y2?/.test(t)?e.getAxisWidthByAxisId(t,!0):e.getHorizontalAxisHeight(t)},getAxisWidthByAxisId(t,e){var r,a;const o=this;if(o.axis){const i=(r=o.axis)==null?void 0:r.getLabelPositionById(t),{width:s}=o.axis.getMaxTickSize(t,e),l=s===0?.5:0;return s+(((a=o.config.padding)==null?void 0:a.mode)==="fit"?i.isInner?10+l:10:i.isInner?20+l:40)}else return 40},getHorizontalAxisHeight(t){var e,r;const a=this,{config:o,state:i}=a,{rotatedPadding:s,isLegendRight:l,isLegendInset:c}=i,f=o.axis_rotated,g=((e=o.padding)==null?void 0:e.mode)==="fit",p=o[`axis_${t}_inner`],m=o[`axis_${t}_label`].text,E=13;let w=((r=o.padding)==null?void 0:r.mode)==="fit"?p&&!m?t==="y"?1:0:20:30;if(t==="x"&&!o.axis_x_show)return 8;if(t==="x"&&pe(o.axis_x_height))return o.axis_x_height;if(t==="y"&&!o.axis_y_show)return o.legend_show&&!l&&!c?10:1;if(t==="y2"&&!o.axis_y2_show)return g?0:s.top;const U=a.axis.getMaxTickSize(t),N=Math.abs(o.axis_x_tick_rotate)>0&&(!o.axis_x_tick_autorotate||a.needToRotateXAxisTickTexts());return(o.axis_x_tick_multiline||N)&&U.height>E&&(w+=U.height-E),w+(a.axis.getLabelPositionById(t).isInner?0:10)+(t==="y2"&&!f?-10:0)},getEventRectWidth(){const t=this,{config:e,axis:r}=t,a=e.axis_x_inverted,o=r.x.tickInterval();return Math.max(0,a?Math.abs(o):o)},getAxisTickRotate(t){const e=this,{axis:r,config:a,state:o,$el:i}=e;let s=a[`axis_${t}_tick_rotate`];if(t==="x"){const l=r.isCategorized()||r.isTimeSeries();if(a.axis_x_tick_fit&&l){const c=a.axis_x_tick_count,f=o.current.maxTickSize.x.ticks.length;let g=0;if(c?g=c>f?f:c:f&&(g=f),g!==o.axis.x.tickCount){const{targets:p}=e.data;o.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(p,"min"),e.getXDomainMinMax(p,"max")],g)}o.axis.x.tickCount=g}i.svg&&a.axis_x_tick_autorotate&&a.axis_x_tick_fit&&!a.axis_x_tick_multiline&&!a.axis_x_tick_culling&&l&&(s=e.needToRotateXAxisTickTexts()?a.axis_x_tick_rotate:0)}return s},needToRotateXAxisTickTexts(){const t=this,{state:{axis:e,current:r,isLegendRight:a,legendItemWidth:o}}=t,i=a&&o,s=r.width-i-t.getCurrentPaddingByDirection("left")-t.getCurrentPaddingByDirection("right"),l=e.x.tickCount+e.x.padding.left+e.x.padding.right,{width:c}=t.axis.getMaxTickSize("x"),f=l?s/l:0;return c>f}},_y={axis_x_clipPath:!0,axis_x_show:!0,axis_x_forceAsSingle:!1,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_culling_lines:!0,axis_x_tick_culling_reverse:!1,axis_x_tick_count:void 0,axis_x_tick_inner:!1,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_inner:!1,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_autorotate:!1,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_inverted:!1,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[]},tx={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_culling_reverse:!1,axis_y_tick_inner:!1,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},ex={axis_y2_show:!1,axis_y2_type:"indexed",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_culling_reverse:!1,axis_y2_tick_inner:!1,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]},nx=Object.defineProperty,Fu=Object.getOwnPropertySymbols,rx=Object.prototype.hasOwnProperty,ax=Object.prototype.propertyIsEnumerable,Bu=(t,e,r)=>e in t?nx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ss=(t,e)=>{for(var r in e||(e={}))rx.call(e,r)&&Bu(t,r,e[r]);if(Fu)for(var r of Fu(e))ax.call(e,r)&&Bu(t,r,e[r]);return t},ox=Ss(Ss(Ss({axis_evalTextSize:!0,axis_rotated:!1,axis_tooltip:!1},_y),tx),ex),ix={grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:void 0,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0},sx={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1};const lx=[xy,Ty,Sy,$y,Ay,Ey,by],Uu={axis:Vy,clip:Ky,eventrect:Hy,flow:Yy,grid:Qy,region:ky,sizeAxis:qy},zu={optDataAxis:sx,optAxis:ox,optGrid:ix};var K1=Array.prototype.slice;function $s(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Le(t){return function(){return t}}function cx(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function ux(t){return t}function fx(){var t=ux,e=cx,r=null,a=Le(0),o=Le(Go),i=Le(0);function s(l){var c,f=(l=$s(l)).length,g,p,m=0,E=new Array(f),w=new Array(f),U=+a.apply(this,arguments),N=Math.min(Go,Math.max(-Go,o.apply(this,arguments)-U)),D,Y=Math.min(Math.abs(N)/f,i.apply(this,arguments)),J=Y*(N<0?-1:1),K;for(c=0;c<f;++c)(K=w[E[c]=c]=+t(l[c],c,l))>0&&(m+=K);for(e!=null?E.sort(function(nt,Q){return e(w[nt],w[Q])}):r!=null&&E.sort(function(nt,Q){return r(l[nt],l[Q])}),c=0,p=m?(N-f*J)/m:0;c<f;++c,U=D)g=E[c],K=w[g],D=U+(K>0?K*p:0)+J,w[g]={data:l[g],index:c,value:K,startAngle:U,endAngle:D,padAngle:Y};return w}return s.value=function(l){return arguments.length?(t=typeof l=="function"?l:Le(+l),s):t},s.sortValues=function(l){return arguments.length?(e=l,r=null,s):e},s.sort=function(l){return arguments.length?(r=l,e=null,s):r},s.startAngle=function(l){return arguments.length?(a=typeof l=="function"?l:Le(+l),s):a},s.endAngle=function(l){return arguments.length?(o=typeof l=="function"?l:Le(+l),s):o},s.padAngle=function(l){return arguments.length?(i=typeof l=="function"?l:Le(+l),s):i},s}var dx=Math.pow;const As=Math.PI,Es=2*As,Xr=1e-6,hx=Es-Xr;function ju(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function vx(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ju;const r=dx(10,e);return function(a){this._+=a[0];for(let o=1,i=a.length;o<i;++o)this._+=Math.round(arguments[o]*r)/r+a[o]}}class Jo{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ju:vx(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,a,o){this._append`Q${+e},${+r},${this._x1=+a},${this._y1=+o}`}bezierCurveTo(e,r,a,o,i,s){this._append`C${+e},${+r},${+a},${+o},${this._x1=+i},${this._y1=+s}`}arcTo(e,r,a,o,i){if(e=+e,r=+r,a=+a,o=+o,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,l=this._y1,c=a-e,f=o-r,g=s-e,p=l-r,m=g*g+p*p;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(m>Xr)if(!(Math.abs(p*c-f*g)>Xr)||!i)this._append`L${this._x1=e},${this._y1=r}`;else{let E=a-s,w=o-l,U=c*c+f*f,N=E*E+w*w,D=Math.sqrt(U),Y=Math.sqrt(m),J=i*Math.tan((As-Math.acos((U+m-N)/(2*D*Y)))/2),K=J/Y,nt=J/D;Math.abs(K-1)>Xr&&this._append`L${e+K*g},${r+K*p}`,this._append`A${i},${i},0,0,${+(p*E>g*w)},${this._x1=e+nt*c},${this._y1=r+nt*f}`}}arc(e,r,a,o,i,s){if(e=+e,r=+r,a=+a,s=!!s,a<0)throw new Error(`negative radius: ${a}`);let l=a*Math.cos(o),c=a*Math.sin(o),f=e+l,g=r+c,p=1^s,m=s?o-i:i-o;this._x1===null?this._append`M${f},${g}`:(Math.abs(this._x1-f)>Xr||Math.abs(this._y1-g)>Xr)&&this._append`L${f},${g}`,a&&(m<0&&(m=m%Es+Es),m>hx?this._append`A${a},${a},0,1,${p},${e-l},${r-c}A${a},${a},0,1,${p},${this._x1=f},${this._y1=g}`:m>Xr&&this._append`A${a},${a},0,${+(m>=As)},${p},${this._x1=e+a*Math.cos(i)},${this._y1=r+a*Math.sin(i)}`)}rect(e,r,a,o){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${a=+a}v${+o}h${-a}Z`}toString(){return this._}}function gx(){return new Jo}gx.prototype=Jo.prototype;function Z1(t=3){return new Jo(+t)}function bs(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const a=Math.floor(r);if(!(a>=0))throw new RangeError(`invalid digits: ${r}`);e=a}return t},()=>new Jo(e)}function px(t){return t.innerRadius}function mx(t){return t.outerRadius}function yx(t){return t.startAngle}function xx(t){return t.endAngle}function Tx(t){return t&&t.padAngle}function Sx(t,e,r,a,o,i,s,l){var c=r-t,f=a-e,g=s-o,p=l-i,m=p*c-g*f;if(!(m*m<On))return m=(g*(e-i)-p*(t-o))/m,[t+m*c,e+m*f]}function Qo(t,e,r,a,o,i,s){var l=t-r,c=e-a,f=(s?i:-i)/la(l*l+c*c),g=f*c,p=-f*l,m=t+g,E=e+p,w=r+g,U=a+p,N=(m+w)/2,D=(E+U)/2,Y=w-m,J=U-E,K=Y*Y+J*J,nt=o-i,Q=m*U-w*E,ot=(J<0?-1:1)*la(dm(0,nt*nt*K-Q*Q)),pt=(Q*J-Y*ot)/K,Tt=(-Q*Y-J*ot)/K,yt=(Q*J+Y*ot)/K,lt=(-Q*Y+J*ot)/K,jt=pt-N,vt=Tt-D,tt=yt-N,St=lt-D;return jt*jt+vt*vt>tt*tt+St*St&&(pt=yt,Tt=lt),{cx:pt,cy:Tt,x01:-g,y01:-p,x11:pt*(o/nt-1),y11:Tt*(o/nt-1)}}function Gu(){var t=px,e=mx,r=Le(0),a=null,o=yx,i=xx,s=Tx,l=null,c=bs(f);function f(){var g,p,m=+t.apply(this,arguments),E=+e.apply(this,arguments),w=o.apply(this,arguments)-jo,U=i.apply(this,arguments)-jo,N=Qc(U-w),D=U>w;if(l||(l=g=c()),E<m&&(p=E,E=m,m=p),!(E>On))l.moveTo(0,0);else if(N>Go-On)l.moveTo(E*Gr(w),E*or(w)),l.arc(0,0,E,w,U,!D),m>On&&(l.moveTo(m*Gr(U),m*or(U)),l.arc(0,0,m,U,w,D));else{var Y=w,J=U,K=w,nt=U,Q=N,ot=N,pt=s.apply(this,arguments)/2,Tt=pt>On&&(a?+a.apply(this,arguments):la(m*m+E*E)),yt=hs(Qc(E-m)/2,+r.apply(this,arguments)),lt=yt,jt=yt,vt,tt;if(Tt>On){var St=kc(Tt/m*or(pt)),ct=kc(Tt/E*or(pt));(Q-=St*2)>On?(St*=D?1:-1,K+=St,nt-=St):(Q=0,K=nt=(w+U)/2),(ot-=ct*2)>On?(ct*=D?1:-1,Y+=ct,J-=ct):(ot=0,Y=J=(w+U)/2)}var At=E*Gr(Y),Wt=E*or(Y),Dt=m*Gr(nt),Zt=m*or(nt);if(yt>On){var re=E*Gr(J),ce=E*or(J),Ie=m*Gr(K),Ce=m*or(K),Pe;if(N<Ua)if(Pe=Sx(At,Wt,Ie,Ce,re,ce,Dt,Zt)){var Ye=At-Pe[0],Be=Wt-Pe[1],dn=re-Pe[0],kt=ce-Pe[1],Te=1/or(hm((Ye*dn+Be*kt)/(la(Ye*Ye+Be*Be)*la(dn*dn+kt*kt)))/2),Re=la(Pe[0]*Pe[0]+Pe[1]*Pe[1]);lt=hs(yt,(m-Re)/(Te-1)),jt=hs(yt,(E-Re)/(Te+1))}else lt=jt=0}ot>On?jt>On?(vt=Qo(Ie,Ce,At,Wt,E,jt,D),tt=Qo(re,ce,Dt,Zt,E,jt,D),l.moveTo(vt.cx+vt.x01,vt.cy+vt.y01),jt<yt?l.arc(vt.cx,vt.cy,jt,Rn(vt.y01,vt.x01),Rn(tt.y01,tt.x01),!D):(l.arc(vt.cx,vt.cy,jt,Rn(vt.y01,vt.x01),Rn(vt.y11,vt.x11),!D),l.arc(0,0,E,Rn(vt.cy+vt.y11,vt.cx+vt.x11),Rn(tt.cy+tt.y11,tt.cx+tt.x11),!D),l.arc(tt.cx,tt.cy,jt,Rn(tt.y11,tt.x11),Rn(tt.y01,tt.x01),!D))):(l.moveTo(At,Wt),l.arc(0,0,E,Y,J,!D)):l.moveTo(At,Wt),!(m>On)||!(Q>On)?l.lineTo(Dt,Zt):lt>On?(vt=Qo(Dt,Zt,re,ce,m,-lt,D),tt=Qo(At,Wt,Ie,Ce,m,-lt,D),l.lineTo(vt.cx+vt.x01,vt.cy+vt.y01),lt<yt?l.arc(vt.cx,vt.cy,lt,Rn(vt.y01,vt.x01),Rn(tt.y01,tt.x01),!D):(l.arc(vt.cx,vt.cy,lt,Rn(vt.y01,vt.x01),Rn(vt.y11,vt.x11),!D),l.arc(0,0,m,Rn(vt.cy+vt.y11,vt.cx+vt.x11),Rn(tt.cy+tt.y11,tt.cx+tt.x11),D),l.arc(tt.cx,tt.cy,lt,Rn(tt.y11,tt.x11),Rn(tt.y01,tt.x01),!D))):l.arc(0,0,m,nt,K,D)}if(l.closePath(),g)return l=null,g+""||null}return f.centroid=function(){var g=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,p=(+o.apply(this,arguments)+ +i.apply(this,arguments))/2-Ua/2;return[Gr(p)*g,or(p)*g]},f.innerRadius=function(g){return arguments.length?(t=typeof g=="function"?g:Le(+g),f):t},f.outerRadius=function(g){return arguments.length?(e=typeof g=="function"?g:Le(+g),f):e},f.cornerRadius=function(g){return arguments.length?(r=typeof g=="function"?g:Le(+g),f):r},f.padRadius=function(g){return arguments.length?(a=g==null?null:typeof g=="function"?g:Le(+g),f):a},f.startAngle=function(g){return arguments.length?(o=typeof g=="function"?g:Le(+g),f):o},f.endAngle=function(g){return arguments.length?(i=typeof g=="function"?g:Le(+g),f):i},f.padAngle=function(g){return arguments.length?(s=typeof g=="function"?g:Le(+g),f):s},f.context=function(g){return arguments.length?(l=g==null?null:g,f):l},f}var $x=Object.defineProperty,Ax=Object.defineProperties,Ex=Object.getOwnPropertyDescriptors,Vu=Object.getOwnPropertySymbols,bx=Object.prototype.hasOwnProperty,Ix=Object.prototype.propertyIsEnumerable,Xu=(t,e,r)=>e in t?$x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rx=(t,e)=>{for(var r in e||(e={}))bx.call(e,r)&&Xu(t,r,e[r]);if(Vu)for(var r of Vu(e))Ix.call(e,r)&&Xu(t,r,e[r]);return t},Ox=(t,e)=>Ax(t,Ex(e));function Hu(t=0){const e=this,{config:r,state:a}=e,o=e.hasMultiArcGauge(),i=a.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,s=t?Math.min(a.radiusExpanded*t-a.radius,i*.8-(1-t)*100):0;return{inner(l){const{innerRadius:c}=e.getRadius(l);return o?a.radius-i*(l.index+1):pe(c)?c:0},outer(l){const{outerRadius:c}=e.getRadius(l);let f;if(o)f=a.radius-i*l.index+s;else if(e.hasType("polar")&&!t)f=e.getPolarOuterRadius(l,c);else if(f=c,t){let{radiusExpanded:g}=a;a.radius!==c&&(g-=Math.abs(a.radius-c)),f=g*t}return f},corner(l,c){const{arc_cornerRadius_ratio:f=0,arc_cornerRadius:g=0}=r,{data:{id:p},value:m}=l;let E=0;return f?E=f*c:E=pe(g)?g:g.call(e.api,p,m,c),E}}}function Is(t){return function(e){const r=({startAngle:o=0,endAngle:i=0,padAngle:s=0})=>({startAngle:o,endAngle:i,padAngle:s}),a=kr(r(this._current),r(e));return this._current=e,function(o){const i=a(o),{data:s,index:l,value:c}=e;return t(Ox(Rx({},i),{data:s,index:l,value:c}))}}}var Cx={initPie(){const t=this,{config:e}=t,r=e.data_type,a=e[`${r}_padding`],o=e[`${r}_startingAngle`]||0,i=(a?a*.01:e[`${r}_padAngle`])||0;t.pie=fx().startAngle(o).endAngle(o+2*Math.PI).padAngle(i).value(s=>{var l,c;return(c=(l=s.values)==null?void 0:l.reduce((f,g)=>f+g.value,0))!=null?c:s}).sort(t.getSortCompareFn.bind(t)(!0))},updateRadius(){const t=this,{config:e,state:r}=t,a=e.data_type,o=e[`${a}_padding`],i=e.gauge_width||e.donut_width,s=t.filterTargetsToShow(t.data.targets).length*e.gauge_arcs_minWidth;r.radiusExpanded=Math.min(r.arcWidth,r.arcHeight)/2*(t.hasMultiArcGauge()&&e.gauge_label_show?.85:1),r.radius=r.radiusExpanded*.95,r.innerRadiusRatio=i?(r.radius-i)/r.radius:.6,r.gaugeArcWidth=i||(s<=r.radius-r.innerRadius?r.radius-r.innerRadius:s<=r.radius?s:r.radius);const l=e.pie_innerRadius||(o?o*(r.innerRadiusRatio+.1):0);r.outerRadius=e.pie_outerRadius,r.innerRadius=t.hasType("donut")||t.hasType("gauge")?r.radius*r.innerRadiusRatio:l},getRadius(t){const e=this,r=t==null?void 0:t.data;let{innerRadius:a,outerRadius:o}=e.state;return!pe(a)&&r&&(a=a[r.id]||0),ze(o)&&r&&r.id in o?o=o[r.id]:pe(o)||(o=e.state.radius),{innerRadius:a,outerRadius:o}},updateArc(){const t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength(){const t=this,{config:e}=t,r=e.gauge_arcLength*3.6;let a=2*(r/360);return r<-360?a=-2:r>360&&(a=2),a*Math.PI},getStartingAngle(){const t=this,{config:e}=t,r=e.data_type,a=t.hasType("gauge")?e.gauge_fullCircle:!1,o=-1*Math.PI/2,i=Math.PI/2;let s=e[`${r}_startingAngle`]||0;return!a&&s<=o?s=o:!a&&s>=i?s=i:(s>Math.PI||s<-1*Math.PI)&&(s=Math.PI),s},updateAngle(t,e=!1){var r;const a=this,{config:o,state:i}=a,s=e&&a.hasType("gauge");let{pie:l}=a,c=t,f=!1;if(!o)return null;const g=a.getStartingAngle(),p=o.gauge_fullCircle||e&&!s?a.getArcLength():g*-2;if(c.data&&a.isGaugeType(c.data)&&!a.hasMultiArcGauge()){const{gauge_min:m,gauge_max:E}=o,w=a.getTotalDataSum(i.rendered),U=p*((w-m)/(E-m));l=l.startAngle(g).endAngle(U+g)}if(e===!1&&l(a.filterTargetsToShow()).forEach((m,E)=>{var w;!f&&m.data.id===((w=c.data)==null?void 0:w.id)&&(f=!0,c=m,c.index=E)}),isNaN(c.startAngle)&&(c.startAngle=0),isNaN(c.endAngle)&&(c.endAngle=c.startAngle),e||c.data&&(o.gauge_enforceMinMax||a.hasMultiArcGauge())){const{gauge_min:m,gauge_max:E}=o,w=e&&!s?a.getTotalDataSum(i.rendered):E,U=p/(w-m),N=(r=c.value)!=null?r:0,D=N<m?0:N<w?N-m:w-m;c.startAngle=g,c.endAngle=g+U*D}return f||e?c:null},getSvgArc(){const t=this,{inner:e,outer:r,corner:a}=Hu.call(t),o=Gu().innerRadius(e).outerRadius(r),i=function(s,l){var c;let f="M 0 0";if(s.value||s.data){const g=l?s:(c=t.updateAngle(s))!=null?c:null;g&&(f=o.cornerRadius(a(g,r(g)))(g))}return f};return i.centroid=o.centroid,i},getSvgArcExpanded(t=1){const e=this,{inner:r,outer:a,corner:o}=Hu.call(e,t),i=Gu().innerRadius(r).outerRadius(a);return s=>{const l=e.updateAngle(s),c=a(l);let f=0;return l&&(f=o(l,c)),l?i.cornerRadius(f)(l):"M 0 0"}},getArc(t,e,r){return r||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},redrawArcRangeText(){const t=this,{config:e,$el:{arcs:r},state:a,$T:o}=t,i=e.arc_rangeText_format,s=t.hasType("gauge")&&e.arc_rangeText_fixed;let l=e.arc_rangeText_values;if(l!=null&&l.length){const c=e.arc_rangeText_unit==="%",f=t.getTotalDataSum(a.rendered);c&&(l=l.map(m=>f/100*m));const g=t.pie(l).map((m,E)=>(m.index=E,m));let p=r.selectAll(`.${Ve.arcRange}`).data(l);p.exit(),p=o(p.enter().append("text").attr("class",Ve.arcRange).style("text-anchor","middle").style("pointer-events","none").style("opacity","0").text(m=>{const E=c?m/f*100:m;return he(i)?i(E):`${E}${c?"%":""}`}).merge(p)),(!a.rendered||a.rendered&&!s)&&f>0&&p.attr("transform",function(m,E){return t.transformForArcLabel(this,g[E],!0)}),p.style("opacity",m=>!s&&(m>f||f===0)?"0":null)}},transformForArcLabel(t,e,r=!1){var a,o,i;const s=this,{config:l,state:{radiusExpanded:c}}=s,f=s.updateAngle(e,r),g={x:0,y:0};let p="",m=1;if(f){if(r||s.hasMultiArcGauge()){const E=Math.sin(f.endAngle-Math.PI/2),w=l.arc_rangeText_position;if(g.x=Math.cos(f.endAngle-Math.PI/2)*(c+(r?5:25)),g.y=E*(c+15-Math.abs(E*10))+3,r&&w){const U=l.arc_rangeText_values,N=he(w)?w(U[e.index]):w;g.x+=(a=N==null?void 0:N.x)!=null?a:0,g.y+=(o=N==null?void 0:N.y)!=null?o:0}}else if(!s.hasType("gauge")||s.data.targets.length>1){let{outerRadius:E}=s.getRadius(e);s.hasType("polar")&&(E=s.getPolarOuterRadius(e,E));const w=this.svgArc.centroid(f),[U,N]=w.map(Y=>isNaN(Y)?0:Y),D=Math.sqrt(U*U+N*N);g.x=U,g.y=N,m=(i=["donut","gauge","pie","polar"].filter(s.hasType.bind(s)).map(Y=>l[`${Y}_label_ratio`]))==null?void 0:i[0],m?m=he(m)?m.bind(s.api)(e,E,D):m:m=E&&(D?(36/E>.375?1.175-36/E:.8)*E/D:0)}Wc.call(s,t,g),p=`translate(${g.x*m},${g.y*m})`}return p},convertToArcData(t){return this.addName({id:"data"in t?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel(t){const e=this,r=e.hasType("gauge");e.shouldShowArcLabel()&&t.style("fill",e.updateTextColor.bind(e)).attr("filter",a=>e.updateTextBGColor.bind(e)(a,e.config.data_labels_backgroundColors)).each(function(a){var o;const i=it(this),s=e.updateAngle(a),l=e.getRatio("arc",s);if(cs.call(e,l,(o=["donut","gauge","pie","polar"].filter(e.hasType.bind(e)))==null?void 0:o[0])){const{value:f}=s||a,g=(e.getArcLabelConfig("format")||e.defaultArcValueFormat)(f,l,a.data.id).toString();Da(i,g,[-1,1],r)}else i.text("")})},expandArc(t){const e=this,{state:{transiting:r},$el:a}=e;if(r){const i=setInterval(()=>{r||(clearInterval(i),a.legend.selectAll(`.${qe.legendItemFocused}`).size()>0&&e.expandArc(t))},10);return}const o=e.mapToTargetIds(t);a.svg.selectAll(e.selectorTargets(o,`.${Ve.chartArc}`)).each(function(i){if(!e.shouldExpand(i.data.id))return;const s=e.getExpandConfig(i.data.id,"duration"),l=e.getSvgArcExpanded(e.getExpandConfig(i.data.id,"rate"));it(this).selectAll("path").transition().duration(s).attrTween("d",Is(e.svgArcExpanded.bind(e))).transition().duration(s*2).attrTween("d",Is(l.bind(e)))})},unexpandArc(t){const e=this,{state:{transiting:r},$el:{svg:a}}=e;if(r)return;const o=e.mapToTargetIds(t);a.selectAll(e.selectorTargets(o,`.${Ve.chartArc}`)).selectAll("path").transition().duration(i=>e.getExpandConfig(i.data.id,"duration")).attrTween("d",Is(e.svgArc.bind(e))),a.selectAll(`${Ve.arc}`).style("opacity",null)},getExpandConfig(t,e){const r=this,{config:a}=r,o={duration:50,rate:.98};let i;return r.isDonutType(t)?i="donut":r.isGaugeType(t)?i="gauge":r.isPieType(t)&&(i="pie"),i?a[`${i}_expand_${e}`]:o[e]},shouldExpand(t){const e=this,{config:r}=e;return e.isDonutType(t)&&r.donut_expand||e.isGaugeType(t)&&r.gauge_expand||e.isPieType(t)&&r.pie_expand},shouldShowArcLabel(){const t=this,{config:e}=t;return["donut","gauge","pie","polar"].some(r=>t.hasType(r)&&e[`${r}_label_show`])},getArcLabelConfig(t="format"){const e=this,{config:r}=e;let a=o=>o;return["donut","gauge","pie","polar"].filter(e.hasType.bind(e)).forEach(o=>{a=r[`${o}_label_${t}`]}),t==="format"&&he(a)?a.bind(e.api):a},updateTargetsForArc(t){const e=this,{$el:r}=e,a=e.hasType("gauge"),o=e.getChartClass("Arc"),i=e.getClass("arcs",!0),s=e.classFocus.bind(e),l=r.main.select(`.${Ve.chartArcs}`),c=l.selectAll(`.${Ve.chartArc}`).data(e.pie(t)).attr("class",g=>o(g)+s(g.data)),f=c.enter().append("g").attr("class",o).call(this.setCssRule(!1,`.${Ve.chartArcs} text`,["pointer-events:none","text-anchor:middle"]));f.append("g").attr("class",i).merge(c),f.append("text").attr("dy",a&&!e.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor",e.getStylePropValue("middle")).style("pointer-events",e.getStylePropValue("none")),r.text=l.selectAll(`.${Se.target} text`)},initArc(){const t=this,{$el:e}=t;e.arcs=e.main.select(`.${Se.chart}`).append("g").attr("class",Ve.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle(t){const e=this,r=t||e.getArcTitle(),a=e.hasType("gauge");if(r){const o=a?jn.chartArcsGaugeTitle:Ve.chartArcsTitle;let i=e.$el.arcs.select(`.${o}`);i.empty()&&(i=e.$el.arcs.append("text").attr("class",o).style("text-anchor","middle")),a&&i.attr("dy","-0.3em"),Da(i,r,a?void 0:[-.6,1.35],!0)}},getArcTitle(){const t=this,e=t.hasType("donut")&&"donut"||t.hasType("gauge")&&"gauge";return e?t.config[`${e}_title`]:""},getArcTitleWithNeedleValue(){const t=this,{config:e,state:r}=t,a=t.getArcTitle();if(a&&t.config.arc_needle_show&&/{=[A-Z_]+}/.test(a)){let o=r.current.needle;return pe(o)||(o=e.arc_needle_value),Na(a,{NEEDLE_VALUE:~~o})}return!1},redrawArc(t,e,r){const a=this,{config:o,state:i,$el:{main:s}}=a,l=o.interaction_enabled,c=l&&o.data_selection_isselectable;let f=s.selectAll(`.${Ve.arcs}`).selectAll(`.${Ve.arc}`).data(a.arcData.bind(a));f.exit().transition().duration(e).style("opacity","0").remove(),f=f.enter().append("path").attr("class",a.getClass("arc",!0)).style("fill",g=>a.color(g.data)).style("cursor",g=>{var p;return(p=c==null?void 0:c.bind)!=null&&p.call(c,a.api)(g)?"pointer":null}).style("opacity","0").each(function(g){a.isGaugeType(g.data)&&(g.startAngle=o.gauge_startingAngle,g.endAngle=o.gauge_startingAngle),this._current=g}).merge(f),a.hasType("gauge")&&(a.updateGaugeMax(),a.hasMultiArcGauge()&&a.redrawArcGaugeLine()),f.attr("transform",g=>!a.isGaugeType(g.data)&&r?"scale(0)":"").style("opacity",function(g){return g===this._current?"0":null}).each(()=>{i.transiting=!0}).transition().duration(t).attrTween("d",function(g){const p=a.updateAngle(g);if(!p)return()=>"M 0 0";isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);const m=kr(this._current,p);return this._current=m(0),function(E){const w=m(E);return w.data=g.data,a.getArc(w,!0)}}).attr("transform",r?"scale(1)":"").style("fill",g=>{let p;return a.levelColor?(p=a.levelColor(g.data.values[0].value),o.data_colors[g.data.id]=p):p=a.color(g.data),p}).style("opacity",null).call(bo,function(){if(a.levelColor){const g=it(this),p=g.datum(this._current);a.updateLegendItemColor(p.data.id,g.style("fill"))}i.transiting=!1,_e(o.onrendered,a.api)}),l&&a.bindArcEvent(f),a.hasType("polar")&&a.redrawPolar(),a.hasType("gauge")&&a.redrawBackgroundArcs(),o.arc_needle_show&&a.redrawNeedle(),a.redrawArcText(t),a.redrawArcRangeText()},redrawNeedle(){const t=this,{$el:e,config:r,state:{hiddenTargetIds:a,radius:o}}=t,i=(o-1)/100*r.arc_needle_length,s=a.length!==t.data.targets.length;let l=t.$el.arcs.select(`.${Ve.needle}`);const c=r.arc_needle_path,f=r.arc_needle_bottom_width/2,g=r.arc_needle_top_width/2,p=r.arc_needle_top_rx,m=r.arc_needle_top_ry,E=r.arc_needle_bottom_len,w=r.arc_needle_bottom_rx,U=r.arc_needle_bottom_ry,N=t.getNeedleAngle(),D=()=>{const Y=t.getArcTitleWithNeedleValue();Y&&t.setArcTitle(Y)};if(D(),l.empty()&&(l=e.arcs.append("path").classed(Ve.needle,!0),e.needle=l,e.needle.updateHelper=(Y,J=!1)=>{e.needle.style("display")!=="none"&&t.$T(e.needle).style("transform",`rotate(${t.getNeedleAngle(Y)}deg)`).call(bo,()=>{J&&(r.arc_needle_value=Y),D()})}),s){const Y=he(c)?c.call(t,i):`M-${f} ${E} A${w} ${U} 0 0 0 ${f} ${E} L${g} -${i} A${p} ${m} 0 0 0 -${g} -${i} L-${f} ${E} Z`;t.$T(l).attr("d",Y).style("fill",r.arc_needle_color).style("display",null).style("transform",`rotate(${N}deg)`)}else l.style("display","none")},getNeedleAngle(t){const e=this,{config:r,state:a}=e,o=e.getArcLength(),i=e.hasType("gauge"),s=e.getTotalDataSum(!0);let l=Qe(t)?t:r.arc_needle_value,c=r[`${r.data_type}_startingAngle`]||0,f=0;if(pe(l)||(l=i&&e.data.targets.length===1?s:0),a.current.needle=l,i){c=e.getStartingAngle();const g=r.gauge_fullCircle?o:c*-2,{gauge_min:p,gauge_max:m}=r;f=g*((l-p)/(m-p))}else f=o*(l/s);return(c+f)*(180/Math.PI)},redrawBackgroundArcs(){const t=this,{config:e,state:r}=t,a=t.hasMultiArcGauge(),o=e.gauge_fullCircle,i=t.filterTargetsToShow(t.data.targets).length===0&&!!e.data_empty_label_text,s=t.getStartingAngle(),l=o?s+t.getArcLength():s*-1;let c=t.$el.arcs.select(`${a?"g":""}.${Ve.chartArcsBackground}`);if(a){let f=0;c=c.selectAll(`path.${Ve.chartArcsBackground}`).data(t.data.targets),c.enter().append("path").attr("class",(g,p)=>`${Ve.chartArcsBackground} ${Ve.chartArcsBackground}-${p}`).merge(c).style("fill",e.gauge_background||null).attr("d",({id:g})=>{if(i||r.hiddenTargetIds.indexOf(g)>=0)return"M 0 0";const p={data:[{value:e.gauge_max}],startAngle:s,endAngle:l,index:f++};return t.getArc(p,!0,!0)}),c.exit().remove()}else c.attr("d",i?"M 0 0":()=>{const f={data:[{value:e.gauge_max}],startAngle:s,endAngle:l};return t.getArc(f,!0,!0)})},bindArcEvent(t){const e=this,{config:r,state:a}=e,o=a.inputType==="touch",i=a.inputType==="mouse";function s(c,f,g){e.expandArc(g),e.api.focus(g),e.toggleFocusLegend(g,!0),e.showTooltip([f],c)}function l(c){const f=(c==null?void 0:c.id)||void 0;e.unexpandArc(f),e.api.revert(),e.revertLegend(),e.hideTooltip()}if(t.on("click",function(c,f,g){var p;const m=e.updateAngle(f);let E;m&&(E=e.convertToArcData(m),(p=e.toggleShape)==null||p.call(e,this,E,g),r.data_onclick.bind(e.api)(E,this))}),i&&t.on("mouseover",function(c,f){if(a.transiting)return;a.event=c;const g=e.updateAngle(f),p=g?e.convertToArcData(g):null,m=(p==null?void 0:p.id)||void 0;s(this,p,m),e.setOverOut(!0,p)}).on("mouseout",(c,f)=>{if(a.transiting||!r.interaction_onout)return;a.event=c;const g=e.updateAngle(f),p=g?e.convertToArcData(g):null;l(),e.setOverOut(!1,p)}).on("mousemove",function(c,f){const g=e.updateAngle(f),p=g?e.convertToArcData(g):null;a.event=c,e.showTooltip([p],this)}),o&&e.hasArcType()&&!e.radars){const c=f=>{var g,p;const{clientX:m,clientY:E}=(p=(g=f.changedTouches)==null?void 0:g[0])!=null?p:{clientX:0,clientY:0};return it(pn.elementFromPoint(m,E))};e.$el.svg.on("touchstart touchmove",function(f){if(a.transiting)return;a.event=f;const p=c(f).datum(),m=p!=null&&p.data&&p.data.id?e.updateAngle(p):null,E=m?e.convertToArcData(m):null,w=(E==null?void 0:E.id)||void 0;e.callOverOutForTouch(E),ln(w)?l():s(this,E,w)})}},redrawArcText(t){const e=this,{config:r,state:a,$el:{main:o,arcs:i}}=e,s=e.hasType("gauge"),l=e.hasMultiArcGauge();let c;if(s&&e.data.targets.length===1&&r.gauge_title||(c=o.selectAll(`.${Ve.chartArc}`).select("text").style("opacity","0").attr("class",f=>e.isGaugeType(f.data)?jn.gaugeValue:null).call(e.textForArcLabel.bind(e)).style("font-size",f=>e.isGaugeType(f.data)&&e.data.targets.length===1&&!l?`${Math.round(a.radius/5)}px`:null),Hc.call(e),c.attr("transform",function(f){return e.transformForArcLabel.bind(e)(this,f)}).transition().duration(t).style("opacity",f=>e.isTargetToShow(f.data.id)&&e.isArcType(f.data)?null:"0"),l&&c.attr("dy","-.1em")),o.select(`.${Ve.chartArcsTitle}`).style("opacity",e.hasType("donut")||s?null:"0"),s){const f=r.gauge_fullCircle;f&&(c==null||c.attr("dy",`${l?0:Math.round(a.radius/14)}`)),r.gauge_label_show&&(i.select(`.${jn.chartArcsGaugeUnit}`).attr("dy",`${f?1.5:.75}em`).text(r.gauge_units),i.select(`.${jn.chartArcsGaugeMin}`).attr("dx",`${-1*(a.innerRadius+(a.radius-a.innerRadius)/(f?1:2))}px`).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_min,!1)),!f&&i.select(`.${jn.chartArcsGaugeMax}`).attr("dx",`${a.innerRadius+(a.radius-a.innerRadius)/2}px`).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_max,!0)))}},getArcElementByIdOrIndex(t){const e=this,{$el:{arcs:r}}=e,a=pe(t)?o=>o.index===t:o=>o.data.id===t;return r==null?void 0:r.selectAll(`.${Se.target} path`).filter(a)}};function Wu(t){return t[0]}function Yu(t){return t[1]}function Ku(t,e){var r=Le(!0),a=null,o=ps,i=null,s=bs(l);t=typeof t=="function"?t:t===void 0?Wu:Le(t),e=typeof e=="function"?e:e===void 0?Yu:Le(e);function l(c){var f,g=(c=$s(c)).length,p,m=!1,E;for(a==null&&(i=o(E=s())),f=0;f<=g;++f)!(f<g&&r(p=c[f],f,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+t(p,f,c),+e(p,f,c));if(E)return i=null,E+""||null}return l.x=function(c){return arguments.length?(t=typeof c=="function"?c:Le(+c),l):t},l.y=function(c){return arguments.length?(e=typeof c=="function"?c:Le(+c),l):e},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Le(!!c),l):r},l.curve=function(c){return arguments.length?(o=c,a!=null&&(i=o(a)),l):o},l.context=function(c){return arguments.length?(c==null?a=i=null:i=o(a=c),l):a},l}function Px(t,e,r){var a=null,o=Le(!0),i=null,s=ps,l=null,c=bs(f);t=typeof t=="function"?t:t===void 0?Wu:Le(+t),e=typeof e=="function"?e:Le(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?Yu:Le(+r);function f(p){var m,E,w,U=(p=$s(p)).length,N,D=!1,Y,J=new Array(U),K=new Array(U);for(i==null&&(l=s(Y=c())),m=0;m<=U;++m){if(!(m<U&&o(N=p[m],m,p))===D)if(D=!D)E=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),w=m-1;w>=E;--w)l.point(J[w],K[w]);l.lineEnd(),l.areaEnd()}D&&(J[m]=+t(N,m,p),K[m]=+e(N,m,p),l.point(a?+a(N,m,p):J[m],r?+r(N,m,p):K[m]))}if(Y)return l=null,Y+""||null}function g(){return Ku().defined(o).curve(s).context(i)}return f.x=function(p){return arguments.length?(t=typeof p=="function"?p:Le(+p),a=null,f):t},f.x0=function(p){return arguments.length?(t=typeof p=="function"?p:Le(+p),f):t},f.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:Le(+p),f):a},f.y=function(p){return arguments.length?(e=typeof p=="function"?p:Le(+p),r=null,f):e},f.y0=function(p){return arguments.length?(e=typeof p=="function"?p:Le(+p),f):e},f.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Le(+p),f):r},f.lineX0=f.lineY0=function(){return g().x(t).y(e)},f.lineY1=function(){return g().x(t).y(r)},f.lineX1=function(){return g().x(a).y(e)},f.defined=function(p){return arguments.length?(o=typeof p=="function"?p:Le(!!p),f):o},f.curve=function(p){return arguments.length?(s=p,i!=null&&(l=s(i)),f):s},f.context=function(p){return arguments.length?(p==null?i=l=null:l=s(i=p),f):i},f}var ca={initArea(t){const e=this,{config:r}=e;t.insert("g",`.${r.area_front?An.circles:dr.lines}`).attr("class",e.getClass("areas",!0))},updateAreaColor(t){const e=this;return e.config.area_linearGradient?e.getGradienColortUrl(t.id):e.color(t)},updateArea(t,e=!1){const r=this,{config:a,state:o,$el:i,$T:s}=r,l=e?i.subchart:i;a.area_linearGradient&&r.updateLinearGradient();const c=l.main.selectAll(`.${no.areas}`).selectAll(`.${no.area}`).data(r.lineData.bind(r));s(c.exit(),t).style("opacity","0").remove(),l.area=c.enter().append("path").attr("class",r.getClass("area",!0)).style("fill",r.updateAreaColor.bind(r)).style("opacity",function(){return o.orgAreaOpacity=it(this).style("opacity"),"0"}).merge(c),c.style("opacity",o.orgAreaOpacity),r.setRatioForGroupedData(l.area.data())},redrawArea(t,e,r=!1){const a=this,{area:o}=r?this.$el.subchart:this.$el,{orgAreaOpacity:i}=a.state;return[a.$T(o,e,ar()).attr("d",t).style("fill",a.updateAreaColor.bind(a)).style("opacity",s=>String(a.isAreaRangeType(s)?i/1.75:i))]},generateDrawArea(t,e){const r=this,{config:a}=r,o=a.line_connectNull,i=a.axis_rotated,s=r.generateGetAreaPoints(t,e),l=r.getYScaleById.bind(r),c=p=>(e?r.subxx:r.xx).call(r,p),f=(p,m)=>r.isGrouped(p.id)?s(p,m)[0][1]:l(p.id,e)(r.isAreaRangeType(p)?r.getRangedData(p,"high"):r.getShapeYMin(p.id)),g=(p,m)=>r.isGrouped(p.id)?s(p,m)[1][1]:l(p.id,e)(r.isAreaRangeType(p)?r.getRangedData(p,"low"):p.value);return p=>{let m=o?r.filterRemoveNull(p.values):p.values,E=0,w=0,U;if(r.isAreaType(p)){let N=Px();N=i?N.y(c).x0(f).x1(g):N.x(c).y0(a.area_above?0:a.area_below?r.state.height:f).y1(g),o||(N=N.defined(D=>r.getBaseValue(D)!==null)),r.isStepType(p)&&(m=r.convertValuesToStep(m)),U=N.curve(r.getCurve(p))(m)}else m[0]&&(E=r.scale.x(m[0].x),w=r.getYScaleById(p.id)(m[0].value)),U=i?`M ${w} ${E}`:`M ${E} ${w}`;return U||"M 0 0"}},generateGetAreaPoints(t,e){const r=this,{config:a}=r,o=r.getShapeX(0,t,e),i=r.getShapeY(!!e),s=r.getShapeOffset(r.isAreaType,t,e),l=r.getYScaleById.bind(r);return function(c,f){const g=l.call(r,c.id,e)(r.getShapeYMin(c.id)),p=s(c,f)||g,m=o(c),E=c.value;let w=i(c);return a.axis_rotated&&(E>0&&w<g||E<0&&g<w)&&(w=g),[[m,p],[m,w-(g-p)],[m,w-(g-p)],[m,p]]}}};function Rs(t){const e=this.config.bar_connectLine,r=(e==null?void 0:e[t])||e;return/^(start|end)\-(start|end)$/.test(r)?r:null}var Mx={initBar(){const{$el:t,config:e,state:{clip:r}}=this;t.bar=t.main.select(`.${Se.chart}`),t.bar=e.bar_front?t.bar.append("g"):t.bar.insert("g",":first-child"),t.bar.attr("class",zn.chartBars).call(this.setCssRule(!1,`.${zn.chartBars}`,["pointer-events:none"])),e.clipPath===!1&&(e.bar_radius||e.bar_radius_ratio)&&t.bar.attr("clip-path",r.pathXAxis.replace(/#[^)]*/,`#${r.id}`))},updateTargetsForBar(t){const e=this,{config:r,$el:a}=e,o=e.getChartClass("Bar"),i=e.getClass("bars",!0),s=e.classFocus.bind(e),l=r.interaction_enabled&&r.data_selection_isselectable;a.bar||e.initBar(),a.main.select(`.${zn.chartBars}`).selectAll(`.${zn.chartBar}`).data(e.filterNullish(t)).attr("class",g=>o(g)+s(g)).enter().append("g").attr("class",o).style("opacity","0").style("pointer-events",e.getStylePropValue("none")).append("g").attr("class",i).style("cursor",g=>{var p;return(p=l==null?void 0:l.bind)!=null&&p.call(l,e.api)(g)?"pointer":null}).call(g=>{e.setCssRule(!0,` .${zn.bar}`,["fill"],e.color)(g),g.each(function(p){Rs.call(e,p.id)&&it(this).append("path").attr("class",zn.barConnectLine)})})},updateBar(t,e=!1){const r=this,{config:a,$el:o,$T:i}=r,s=e?o.subchart:o,l=r.getClass("bar",!0),c=r.initialOpacity.bind(r);a.bar_linearGradient&&r.updateLinearGradient();const f=s.main.selectAll(`.${zn.bars}`).selectAll(`.${zn.bar}`).data(r.labelishData.bind(r));i(f.exit(),t).style("opacity","0").remove(),s.bar=f.enter().append("path").attr("class",l).style("fill",r.updateBarColor.bind(r)).merge(f).style("opacity",c),r.setRatioForGroupedData(s.bar.data())},updateBarColor(t){const e=this,r=e.getStylePropValue(e.color);return e.config.bar_linearGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawBar(t,e,r=!1){const a=this,{bar:o}=r?a.$el.subchart:a.$el,i=[];return[a.$T(o,e,ar()).attr("d",function(s,l,c){const f=(pe(s.value)||a.isBarRangeType(s))&&t(s,l),g=Rs.call(a,s.id);if(f.length>1&&(i.push(f[1]),l===c.length-1)){const p=a.$T(it(this.parentNode.querySelector(`.${zn.barConnectLine}`)),e,ar());a.updateConnectLine(p,g,i),i.splice(0)}return f[0]}).style("fill",a.updateBarColor.bind(a)).style("clip-path",s=>s.clipPath).style("opacity",null)]},generateDrawBar(t,e){const r=this,{config:a}=r,o=r.generateGetBarPoints(t,e),i=a.axis_rotated,s=a.bar_radius,l=a.bar_radius_ratio,c=pe(s)&&s>0?()=>s:pe(l)?f=>f*l:null;return(f,g)=>{const p=o(f,g),m=+i,E=+!m,w=f.value<0,U=a[`axis_${r.axis.getId(f.id)}_inverted`],N=!U&&w||U&&!w,D=["",""],Y=r.isGrouped(f.id),J=c&&Y?r.isStackingRadiusData(f):!1,K=[p[0][m],p[0][E]];let nt=0;if(f.clipPath=null,c){const Tt=i?E:m,yt=p[2][Tt]-p[0][Tt];nt=!Y||J?c(yt):0;const lt=`a${nt} ${nt} ${N?"1 0 0":"0 0 1"} `;D[+!i]=`${lt}${nt},${nt}`,D[+i]=`${lt}${[-nt,nt][i?"sort":"reverse"]()}`,N&&D.reverse()}const Q=i?p[1][m]+(N?nt:-nt):p[1][E]+(N?-nt:nt);if(nt){let Tt="";i?N&&K[0]<Q?Tt=`0 ${Q-K[0]}px 0 0`:!N&&K[0]>Q&&(Tt=`0 0 0 ${K[0]-Q}px`):N&&K[1]>Q?Tt=`${K[1]-Q}px 0 0 0`:!N&&K[1]<Q&&(Tt=`0 0 ${Q-K[1]}px 0`),Tt&&(f.clipPath=`inset(${Tt})`)}const ot=i?`H${Q} ${D[0]}V${p[2][E]-nt} ${D[1]}H${p[3][m]}`:`V${Q} ${D[0]}H${p[2][m]-nt} ${D[1]}V${p[3][E]}`,pt=[`M${p[0][m]},${p[0][E]}${ot}z`];return Rs.call(r,f.id)&&pt.push(i?{x:p[0][m],y:p[0][E],width:p[0][m]-Q,height:p[2][E]-p[0][E]}:{x:p[0][m],y:Q,width:p[2][m]-p[0][m],height:p[3][E]-Q}),pt}},isStackingRadiusData(t){const e=this,{$el:r,config:a,data:o,state:i}=e,{id:s,index:l,value:c}=t;if(i.hiddenTargetIds.indexOf(s)>-1){const m=r.bar.filter(E=>E.id===s&&E.value===c);return!m.empty()&&/a\d+/i.test(m.attr("d"))}const f=a.data_groups.find(m=>m.indexOf(s)>-1),p=e.orderTargets(e.filterTargetsToShow(o.targets.filter(e.isBarType,e))).filter(m=>f.indexOf(m.id)>-1).map(m=>m.values.filter(E=>E.index===l&&(pe(c)&&c>0?E.value>0:E.value<0))[0]).filter(Boolean).map(m=>m.id);return c!==0&&p.indexOf(s)===p.length-1},generateGetBarPoints(t,e){const r=this,{config:a}=r,o=e?r.axis.subX:r.axis.x,i=r.getIndicesMax(t)+1,s=r.getBarW("bar",o,i),l=r.getShapeX(s,t,!!e),c=r.getShapeY(!!e),f=r.getShapeOffset(r.isBarType,t,!!e),g=r.getYScaleById.bind(r);return(p,m)=>{const{id:E}=p,w=g.call(r,E,e)(r.getShapeYMin(E)),U=f(p,m)||w,N=pe(s)?s:s[p.id]||s._$width,D=a[`axis_${r.axis.getId(E)}_inverted`],Y=p.value,J=l(p);let K=c(p);a.axis_rotated&&!D&&(Y>0&&K<w||Y<0&&w<K)&&(K=w),r.isBarRangeType(p)||(K-=w-U);const nt=J+N;return[[J,U],[J,K],[nt,K],[nt,U]]}},updateConnectLine(t,e,r){const a=r.map((o,i,s)=>{const l=this.config.axis_rotated,c=/^start-(start|end)$/.test(e),f=/^end-(start|end)$/.test(e),g=[],p=l?f?o.x-o.width:o.x:o.x+o.width,m=l||c?o.y+o.height:o.y;return i===0?g.push(`${p},${m}`):(g.push(l?`L${o.x-(/\w+-end$/.test(e)?o.width:0)},${o.y}`:`L${o.x},${o.y+(/\w+-start$/.test(e)?o.height:0)}`),i<s.length-1&&g.push(`M${p},${m}`)),g.join(" ")});t.attr("d",`M${a.join("")}z`)}},wx={initBubble(){const t=this,{config:e}=t;t.hasType("bubble")&&(e.point_show=!0,e.point_type="circle")},getBaseLength(){const t=this,{width:e,height:r}=t.state,a=Mn.bubbleBaseLength;let o=t.cache.get(a);return o||t.cache.add(a,o=tr("min",[e,r])),o},getBubbleR(t){const e=this;let r=e.config.bubble_maxR;he(r)?r=r.bind(e.api)(t):pe(r)||(r=e.getBaseLength()/(e.getMaxDataCount()*2)+12);const a=tr("max",e.getMinMaxData().max.map(s=>e.isBubbleZType(s)?e.getBubbleZData(s.value,"y"):ze(s.value)?s.value.mid:s.value)),o=r*r*Math.PI,i=(e.isBubbleZType(t)?e.getBubbleZData(t.value,"z"):t.value)*(o/a);return Math.sqrt(i/Math.PI)},getBubbleZData(t,e){return ze(t)?t[e]:t[e==="y"?0:1]}},Dx=Object.defineProperty,Zu=Object.getOwnPropertySymbols,Nx=Object.prototype.hasOwnProperty,Lx=Object.prototype.propertyIsEnumerable,Ju=(t,e,r)=>e in t?Dx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fx=(t,e)=>{for(var r in e||(e={}))Nx.call(e,r)&&Ju(t,r,e[r]);if(Zu)for(var r of Zu(e))Lx.call(e,r)&&Ju(t,r,e[r]);return t},Bx={initCandlestick(){const{$el:t}=this;t.candlestick=t.main.select(`.${Se.chart}`).append("g").attr("class",fr.chartCandlesticks)},updateTargetsForCandlestick(t){const e=this,{$el:r}=e,a=e.getChartClass("Candlestick");r.candlestick||e.initCandlestick(),e.$el.main.select(`.${fr.chartCandlesticks}`).selectAll(`.${fr.chartCandlestick}`).data(e.filterNullish(t)).enter().append("g").attr("class",a).style("pointer-events","none")},updateCandlestick(t,e=!1){const r=this,{$el:a,$T:o}=r,i=e?a.subchart:a,s=r.getClass("candlestick",!0),l=r.initialOpacity.bind(r),c=i.main.selectAll(`.${fr.chartCandlestick}`).selectAll(`.${fr.candlestick}`).data(r.labelishData.bind(r));o(c.exit(),t).style("opacity","0").remove();const f=c.enter().filter(g=>g.value).append("g").attr("class",s);f.append("line"),f.append("path"),i.candlestick=c.merge(f).style("opacity",l)},generateDrawCandlestick(t,e){const r=this,{config:a}=r,o=r.generateGetCandlestickPoints(t,e),i=a.axis_rotated,s=a.candlestick_color_down;return(l,c,f)=>{const g=o(l,c),p=r.getCandlestickData(l),m=p==null?void 0:p._isUp,E=+i,w=+!E;f.classed&&f.classed(fr[m?"valueUp":"valueDown"],!0);const U=i?`H${g[1][1]} V${g[1][0]} H${g[0][1]}`:`V${g[1][1]} H${g[1][0]} V${g[0][1]}`;f.select("path").attr("d",`M${g[0][E]},${g[0][w]}${U}z`).style("fill",Y=>(m?r.color(Y):ze(s)?s[Y.id]:s)||r.color(Y));const N=f.select("line"),D=i?{x1:g[2][1],x2:g[2][2],y1:g[2][0],y2:g[2][0]}:{x1:g[2][0],x2:g[2][0],y1:g[2][1],y2:g[2][2]};for(const Y in D)N.attr(Y,D[Y])}},generateGetCandlestickPoints(t,e=!1){const r=this,a=e?r.axis.subX:r.axis.x,o=r.getIndicesMax(t)+1,i=r.getBarW("candlestick",a,o),s=r.getShapeX(i,t,!!e),l=r.getShapeY(!!e),c=r.getShapeOffset(r.isBarType,t,!!e),f=r.getYScaleById.bind(r);return(g,p)=>{const m=f.call(r,g.id,e)(r.getShapeYMin(g.id)),E=c(g,p)||m,w=pe(i)?i:i[g.id]||i._$width,U=r.getCandlestickData(g);let N;if(U&&pe(U.open)&&pe(U.close)){const D={start:s(g),end:0};D.end=D.start+w;const Y={start:l(U.open),end:l(U.close)},J={x:D.start+w/2,high:l(U.high),low:l(U.low)};Y.start-=m-E,N=[[D.start,Y.start],[D.end,Y.end],[J.x,J.low,J.high]]}else N=[[0,0],[0,0],[0,0,0]];return N}},redrawCandlestick(t,e,r=!1){const a=this,{$el:o,$T:i}=a,{candlestick:s}=r?o.subchart:o,l=ar(!0);return[s.each(function(c,f){const g=i(it(this),e,l);t(c,f,g)}).style("opacity",null)]},getCandlestickData({value:t}){let e;if(Ge(t)){const[r,a,o,i,s=!1]=t;e={open:r,high:a,low:o,close:i},s!==!1&&(e.volume=s)}else ze(t)&&(e=Fx({},t));return e&&(e._isUp=e.close>=e.open),e||null}},Ux=Object.defineProperty,Qu=Object.getOwnPropertySymbols,zx=Object.prototype.hasOwnProperty,jx=Object.prototype.propertyIsEnumerable,ku=(t,e,r)=>e in t?Ux(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gx=(t,e)=>{for(var r in e||(e={}))zx.call(e,r)&&ku(t,r,e[r]);if(Qu)for(var r of Qu(e))jx.call(e,r)&&ku(t,r,e[r]);return t};function ko(t=!1){const e=this,{config:r,state:{current:{width:a,height:o}}}=e,i=e.getCurrentPadding(),s=Gx({width:a-(i.left+i.right),height:o-(r.legend_show?e.getLegendHeight()+10:0)-(i.top+i.bottom)},i);if(t){const{width:l,height:c}=qu.call(e,{width:s.width,height:s.height});s.width<l&&(s.width=l),s.height<c&&(s.height=c)}return s}function qu(t){const e=this,{config:r}=e;let a=r.funnel_neck_width,o=r.funnel_neck_height;return[a,o]=[a,o].map((i,s)=>{let l=i;return ze(i)&&(l=t[s?"height":"width"]*i.ratio),l}),{width:a,height:o}}function Vx(t){const e=this,{top:r,left:a,width:o}=ko.call(e,!0),i=[];return t.forEach((s,l)=>{const{ratio:c}=s,f=l>0?i[l-1][2][1]:r;i.push(s.coords=[[a,f],[a+o,f],[a+o,l>0?c+f:c+r],[a,l>0?c+f:c+r],[a,f]])}),i}function _u(t=!1){const e=this,{width:r,height:a,top:o,left:i}=ko.call(e,!0),s=qu.call(e,{width:r,height:a}),l=(r-s.width)/2,c=(r+s.width)/2,f=a-s.height,g=[[0,0],[r,0],[c,f],[c,a],[l,a],[l,f],[0,0]];return t&&g.forEach(p=>{p[0]+=i,p[1]+=o}),`M${g.join("L")}z`}function Xx(t){const e=this,{config:r}=e,a=t.map(o=>({id:o.id,value:o.values.reduce((i,s)=>i+s.value,0)}));return r.data_order&&a.sort(e.getSortCompareFn.bind(e)(!0)),tf.call(e,a)}function tf(t){const e=this,{height:r}=ko.call(e),a=e.getTotalDataSum(!0);return t.forEach(o=>{o.ratio=o.value/a*r}),t}var Hx={initFunnel(){const t=this,{$el:e}=t;e.funnel=e.main.select(`.${Se.chart}`).append("g").classed($a.chartFunnels,!0),e.funnel.background=e.funnel.append("path").classed($a.funnelBackground,!0),t.bindFunnelEvent()},bindFunnelEvent(){const t=this,{$el:{funnel:e},config:r,state:a}=t,o=i=>{var s;const l=i.isTrusted?i.target:(s=a.eventReceiver.rect)==null?void 0:s.node();let c;return/^path$/i.test(l.tagName)&&(a.event=i,c=it(l).datum()),c};if(r.interaction_enabled){const i=a.inputType==="touch";e.on(i?"touchstart":"mouseover mousemove",s=>{const l=o(s);l&&(t.showTooltip([l],s.target),/^(touchstart|mouseover)$/.test(s.type)&&t.setOverOut(!0,l))}).on(i?"touchend":"mouseout",s=>{const l=o(s);r.interaction_onout&&(t.hideTooltip(),t.setOverOut(!1,l))})}},updateTargetsForFunnel(t){const e=this,{$el:{funnel:r}}=e,a=e.getChartClass("Funnel"),o=e.getClass("funnel",!0);r||e.initFunnel();const i=Xx.call(e,t.filter(e.isFunnelType.bind(e))),s=r.selectAll(`.${$a.chartFunnel}`).data(e.filterNullish(i));s.exit().remove();const l=s.enter().insert("g",`.${$a.funnelBackground}`);l.append("path"),r.path=l.merge(s).attr("class",c=>a(c)).select("path").attr("class",o).style("opacity","0").style("fill",e.color)},updateFunnel(t){const e=this,{$el:{funnel:r}}=e,a=t.map(({id:o})=>o);r.path=r.path.filter(o=>a.indexOf(o.id)>=0)},generateGetFunnelPoints(){const t=this,{$el:{funnel:e}}=t,r=t.filterTargetsToShow(e.path),{top:a,left:o,right:i}=ko.call(t),s=(o-i)/2,l={};let c=a!=null?a:0;return r.each((f,g)=>{var p;l[f.id]=[[s,c],[s,c+=((p=r==null?void 0:r[g])!=null?p:f).ratio]]}),f=>l[f.id]},redrawFunnel(){const t=this,{$T:e,$el:{funnel:r}}=t,a=t.filterTargetsToShow(r.path),o=Vx.call(t,tf.call(t,a.data()));r.attr("clip-path",`path('${_u.bind(t)()}')`),r.background.attr("d",_u.call(t,!0)),e(a).attr("d",(i,s)=>`M${o[s].join("L")}z`).style("opacity","1"),r.selectAll("g").style("opacity",null)}},Wx={initGauge(){const t=this,{config:e,$el:{arcs:r}}=t,a=(o=null,i="")=>{r.append("text").attr("class",o).style("text-anchor","middle").style("pointer-events","none").text(i)};if(t.hasType("gauge")){const o=t.hasMultiArcGauge();r.append(o?"g":"path").attr("class",Ve.chartArcsBackground).style("fill",!o&&e.gauge_background||null),e.gauge_units&&a(jn.chartArcsGaugeUnit),e.gauge_label_show&&(a(jn.chartArcsGaugeMin),!e.gauge_fullCircle&&a(jn.chartArcsGaugeMax))}},updateGaugeMax(){const t=this,{config:e,state:r}=t,o=t.hasMultiArcGauge()?t.getMinMaxData().max[0].value:t.getTotalDataSum(r.rendered);!e.gauge_enforceMinMax&&o+e.gauge_min*(e.gauge_min>0?-1:1)>e.gauge_max&&(e.gauge_max=o-e.gauge_min)},redrawArcGaugeLine(){const t=this,{config:e,state:r,$el:a}=t,{hiddenTargetIds:o}=t.state,i=a.main.selectAll(`.${Ve.arcs}`).selectAll(`.${Ve.arcLabelLine}`).data(t.arcData.bind(t));i.enter().append("rect").attr("class",l=>`${Ve.arcLabelLine} ${Se.target} ${Se.target}-${l.data.id}`).merge(i).style("fill",l=>t.levelColor?t.levelColor(l.data.values[0].value):t.color(l.data)).style("display",e.gauge_label_show?null:"none").each(function(l){let c=0;const f=2;let g=0,p=0,m="";if(o.indexOf(l.data.id)<0){const E=t.updateAngle(l),w=r.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length*(E.index+1),U=E.endAngle-Math.PI/2,N=r.radius-w,D=U-(N===0?0:1/N);c=r.radiusExpanded-r.radius+w,g=Math.cos(D)*N,p=Math.sin(D)*N,m=`rotate(${U*180/Math.PI}, ${g}, ${p})`}it(this).attr("x",g).attr("y",p).attr("width",c).attr("height",f).attr("transform",m).style("stroke-dasharray",`0, ${c+f}, 0`)})},textForGaugeMinMax(t,e){const r=this,{config:a}=r,o=a.gauge_label_extents;return he(o)?o.bind(r.api)(t,e):t},getGaugeLabelHeight(){const{config:t}=this;return this.config.gauge_label_show&&!t.gauge_fullCircle?20:0},getPaddingBottomForGauge(){const t=this;return t.getGaugeLabelHeight()*(t.config.gauge_label_show?2:2.5)}},Yx=Object.defineProperty,Kx=Object.defineProperties,Zx=Object.getOwnPropertyDescriptors,ef=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Qx=Object.prototype.propertyIsEnumerable,nf=(t,e,r)=>e in t?Yx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kx=(t,e)=>{for(var r in e||(e={}))Jx.call(e,r)&&nf(t,r,e[r]);if(ef)for(var r of ef(e))Qx.call(e,r)&&nf(t,r,e[r]);return t},qx=(t,e)=>Kx(t,Zx(e));function _x(t,e,r,a=!1){const o=t?[t,0]:r;for(let i=t||r.reduce((s,l)=>s+l);i<=e;)r.forEach(s=>{i+s<=e&&o.push(s),i+=s});return o.length%2!==0&&o.push(a?r[1]:0),{dash:o.join(" "),length:o.reduce((i,s)=>i+s,0)}}function t0(t,e,r){const a=this,o=[],i="2 2";if(Qe(e)){const s=(l,c)=>ln(l)?c:r?Zn.call(a,l):l;for(let l=0,c;c=e[l];l++){const f=s(c.start,t[0].x),g=s(c.end,t[t.length-1].x),p=c.style||{dasharray:i};o[l]={start:f,end:g,style:p}}}return o}var e0={initLine(){const{$el:t}=this;t.line=t.main.select(`.${Se.chart}`).append("g").attr("class",dr.chartLines).call(this.setCssRule(!1,`.${dr.chartLines}`,["pointer-events:none"]))},updateTargetsForLine(t){const e=this,{$el:{area:r,line:a,main:o}}=e,i=e.getChartClass("Line"),s=e.getClass("lines",!0),l=e.classFocus.bind(e);a||e.initLine();const c=t.filter(p=>!(e.isScatterType(p)||e.isBubbleType(p))),f=o.select(`.${dr.chartLines}`).selectAll(`.${dr.chartLine}`).data(e.filterNullish(c)).attr("class",p=>i(p)+l(p)),g=f.enter().append("g").attr("class",i).style("opacity","0").style("pointer-events",e.getStylePropValue("none"));if(g.append("g").attr("class",s),e.hasTypeOf("Area")){const p=(!r&&g.empty()?f:g).filter(e.isAreaType.bind(e));e.initArea(p)}e.updateTargetForCircle(c,g)},updateLine(t,e=!1){const r=this,{format:{extraLineClasses:a},$el:o,$T:i}=r,s=e?o.subchart:o,l=s.main.selectAll(`.${dr.lines}`).selectAll(`.${dr.line}`).data(r.lineData.bind(r));i(l.exit(),t).style("opacity","0").remove(),s.line=l.enter().append("path").attr("class",c=>`${r.getClass("line",!0)(c)} ${a(c)||""}`).style("stroke",r.color).merge(l).style("opacity",r.initialOpacity.bind(r)).attr("transform",null)},redrawLine(t,e,r=!1){const a=this,{$el:o,$T:i}=a,{line:s}=r?o.subchart:o;return[i(s,e,ar()).attr("d",t).style("stroke",this.color).style("opacity",null)]},getCurve(t){const e=this;return e.config.axis_rotated&&e.isStepType(t)?a=>{const o=e.getInterpolate(t)(a);return o.orgPoint=o.point,o.pointRotated=function(i,s){this._point===1&&(this._point=2);const l=this._y*(1-this._t)+s*this._t;this._context.lineTo(this._x,l),this._context.lineTo(i,l),this._x=i,this._y=s},o.point=function(i,s){this._point===0?this.orgPoint(i,s):this.pointRotated(i,s)},o}:e.getInterpolate(t)},generateDrawLine(t,e){const r=this,{config:a,scale:o}=r,i=a.line_connectNull,s=a.axis_rotated,l=r.generateGetLinePoints(t,e),c=r.getYScaleById.bind(r),f=E=>(e?r.subxx:r.xx).call(r,E),g=(E,w)=>r.isGrouped(E.id)?l(E,w)[0][1]:c(E.id,e)(r.getBaseValue(E));let p=Ku();p=s?p.x(g).y(f):p.x(f).y(g),i||(p=p.defined(E=>r.getBaseValue(E)!==null));const m=e?o.subX:o.x;return E=>{const w=c(E.id,e);let U=i?r.filterRemoveNull(E.values):E.values,N=0,D=0,Y;if(r.isLineType(E)){const J=a.data_regions[E.id];J?(r.isAreaRangeType(E)&&(U=U.map(K=>qx(kx({},K),{value:r.getRangedData(K,"mid")}))),Y=r.lineWithRegions(U,o.zoom||m,w,J)):(r.isStepType(E)&&(U=r.convertValuesToStep(U)),Y=p.curve(r.getCurve(E))(U))}else U[0]&&(N=m(U[0].x),D=w(U[0].value)),Y=s?`M ${D} ${N}`:`M ${N} ${D}`;return Y||"M 0 0"}},lineWithRegions(t,e,r,a){const o=this,{config:i}=o,s=i.axis_rotated,l=o.axis.isTimeSeries(),c="2 2",f=t0.bind(o)(t,a,l),g=o.hasNullDataValue(t);let p,m,E,w;const U=s?yt=>r(yt.value):yt=>e(yt.x),N=s?yt=>e(yt.x):yt=>r(yt.value),D=yt=>`M${yt[0][0]},${yt[0][1]}L${yt[1][0]},${yt[1][1]}`,Y=l?(yt,lt,jt,vt)=>{const tt=yt.x.getTime(),St=lt.x-yt.x,ct=new Date(tt+St*jt),At=new Date(tt+St*(jt+vt)),Wt=s?[[r(m(jt)),e(ct)],[r(m(jt+E)),e(At)]]:[[e(ct),r(m(jt))],[e(At),r(m(jt+E))]];return D(Wt)}:(yt,lt,jt,vt)=>{const tt=e(lt.x,!s),St=r(lt.value,s),ct=jt+vt,At=e(p(jt),!s),Wt=r(m(jt),s);let Dt=e(p(ct),!s),Zt=r(m(ct),s);Dt>tt&&(Dt=tt),yt.value>lt.value&&(s?Zt<St:Zt>St)&&(Zt=St);const re=[[At,Wt],[Dt,Zt]];return s&&re.forEach(ce=>ce.reverse()),D(re)},J={x:o.axis.getAxisType("x"),y:o.axis.getAxisType("y")};let K="";const nt=o.$el.line.filter(({id:yt})=>yt===t[0].id),Q=nt.clone().style("display","none"),ot=(yt,lt)=>yt.attr("d",lt).node().getTotalLength(),pt={dash:[],lastLength:0};let Tt=!1;for(let yt=0,lt;lt=t[yt];yt++){const jt=t[yt-1],vt=jt&&De(jt.value);let tt=o.isWithinRegions(lt.x,f);if(De(lt.value)){if(ln(f)||!tt||!vt)K+=`${yt&&vt?"L":"M"}${U(lt)},${N(lt)}`;else if(vt)if(tt=((tt==null?void 0:tt.dasharray)||c).split(" ").map(Number),p=jr(J.x,jt.x,lt.x),m=jr(J.y,jt.value,lt.value),g){const St=e(lt.x)-e(jt.x),ct=r(lt.value)-r(jt.value),At=Math.sqrt(Math.pow(St,2)+Math.pow(ct,2));E=tt[0]/At,w=E*tt[1];for(let Wt=E;Wt<=1;Wt+=w)K+=Y(jt,lt,Wt,E),Wt+w>=1&&(K+=Y(jt,lt,1,0))}else{let St=[];if(Tt=lt.x===t[t.length-1].x,l){const Dt=+jt.x,Zt=new Date(Dt),re=new Date(Dt+(+lt.x-Dt));St=[[e(Zt),r(m(0))],[e(re),r(m(1))]]}else St=[[e(p(0)),r(m(0))],[e(p(1)),r(m(1))]];s&&St.forEach(Dt=>Dt.reverse());const ct=ot(Q,K),At=ot(Q,K+=`L${St[1].join(",")}`),Wt=_x(ct-pt.lastLength,At-pt.lastLength,tt,Tt);pt.lastLength+=Wt.length,pt.dash.push(Wt.dash)}}}return pt.dash.length&&(!Tt&&pt.dash.push(ot(Q,K)),Q.remove(),nt.attr("stroke-dasharray",pt.dash.join(" "))),K},isWithinRegions(t,e){for(let r=0,a;a=e[r];r++)if(a.start<t&&t<=a.end)return a.style;return!1},isWithinStep(t,e){return Math.abs(e-Kn(this.state.event,t)[1])<30},shouldDrawPointsForLine(t){const e=this.config.line_point;return e===!0||Ge(e)&&e.indexOf(t.id)!==-1}};const ua=()=>ar();var qo={initialOpacityForCircle(t){const{config:e,state:{withoutFadeIn:r}}=this;let a=e.point_opacity;return ln(a)&&(a=this.getBaseValue(t)!==null&&r[t.id]?this.opacityForCircle(t):"0"),a},opacityForCircle(t){var e;const{config:r}=this;let a=r.point_opacity;return ln(a)&&(a=r.point_show&&!((e=this.isPointFocusOnly)!=null&&e.call(this))?null:"0",a=De(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":a:"0"),a},initCircle(){const t=this,{$el:{main:e}}=t;!t.point&&(t.point=t.generatePoint()),(t.hasType("bubble")||t.hasType("scatter"))&&e.select(`.${Se.chart} > .${An.chartCircles}`).empty()&&e.select(`.${Se.chart}`).append("g").attr("class",An.chartCircles)},updateTargetForCircle(t,e){const r=this,{config:a,data:o,$el:i}=r,s=a.interaction_enabled&&a.data_selection_enabled,l=s&&a.data_selection_isselectable,c=r.getClass("circles",!0);if(!a.point_show)return;r.initCircle();let f=t,g=e;if(!f){f=r.filterNullish(o.targets).filter(m=>this.isScatterType(m)||this.isBubbleType(m));const p=i.main.select(`.${An.chartCircles}`).style("pointer-events","none").selectAll(`.${An.circles}`).data(f);p.exit().remove(),g=p.enter()}s&&g.append("g").attr("class",p=>r.generateClass(tn.selectedCircles,p.id)),g.append("g").attr("class",c).call(p=>{r.setCssRule(!0,`.${An.circles}`,["cursor:pointer"],l)(p),r.setCssRule(!0,` .${An.circle}`,["fill","stroke"],r.color)(p)}).style("opacity",function(){return it(this.parentNode).attr("class").indexOf(An.chartCircles)>-1?"0":null}),s&&f.forEach(p=>{i.main.selectAll(`.${tn.selectedCircles}${r.getTargetSelectorSuffix(p.id)}`).selectAll(`${tn.selectedCircle}`).each(m=>{m.value=p.values[m.index].value})})},updateCircle(t=!1){const e=this,{config:r,state:a,$el:o}=e,i=e.isPointFocusOnly(),s=t?o.subchart:o;if(r.point_show&&!a.toggling){r.point_radialGradient&&e.updateLinearGradient();const l=s.main.selectAll(`.${An.circles}`).selectAll(`.${An.circle}`).data(c=>{const f=e.isLineType(c)&&e.shouldDrawPointsForLine(c)||e.isBubbleType(c)||e.isRadarType(c)||e.isScatterType(c)?i?[c.values[0]]:c.values:[];return e.filterNullish(f)});l.exit().remove(),l.enter().filter(Boolean).append(e.point("create",this,e.pointR.bind(e),e.updateCircleColor.bind(e))),s.circle=s.main.selectAll(`.${An.circles} .${An.circle}`).style("stroke",e.getStylePropValue(e.color)).style("opacity",e.initialOpacityForCircle.bind(e))}},updateCircleColor(t){const e=this,r=e.getStylePropValue(e.color);return e.config.point_radialGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawCircle(t,e,r,a,o=!1){const i=this,{state:{rendered:s},$el:l,$T:c}=i,f=o?l.subchart:l,g=f.main.selectAll(`.${tn.selectedCircle}`);if(!i.config.point_show)return[];const p=i.point("update",i,t,e,i.updateCircleColor.bind(i),r,a,g),m=i.isCirclePoint()?"c":"",E=ar(),w=i.opacityForCircle.bind(i),U=[];return f.circle.each(function(N){let D=p.bind(this)(N);D=c(D,r||!s,E).style("opacity",w),U.push(D)}),[U,c(g,r).attr(`${m}x`,t).attr(`${m}y`,e)]},showCircleFocus(t){const e=this,{state:{hasRadar:r,resizing:a,toggling:o,transiting:i},$el:s}=e;let{circle:l}=s;if(i===!1&&l&&e.isPointFocusOnly()){const c=(r?e.radarCircleX:e.circleX).bind(e),f=(r?e.radarCircleY:e.circleY).bind(e),g=o||ln(t),p=e.point("update",e,c,f,e.getStylePropValue(e.color),a?!1:g);t&&(l=l.filter(function(m){var E;const w=(E=t.filter)==null?void 0:E.call(t,U=>U.id===m.id);return w.length?it(this).datum(w[0]):!1})),l.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(m){const{id:E,index:w,value:U}=m;let N="hidden";De(U)&&(p.bind(this)(m),e.expandCircles(w,E),N=""),this.style.visibility=N})}},hideCircleFocus(){const t=this,{$el:{circle:e}}=t;t.isPointFocusOnly()&&e&&(t.unexpandCircles(),e.style("visibility","hidden"))},circleX(t){return this.xx(t)},updateCircleY(t=!1){const e=this,r=e.generateGetLinePoints(e.getShapeIndices(e.isLineType),t);return(a,o)=>{const i=a.id;return e.isGrouped(i)?r(a,o)[0][1]:e.getYScaleById(i,t)(e.getBaseValue(a))}},expandCircles(t,e,r){const a=this,o=a.pointExpandedR.bind(a);r&&a.unexpandCircles();const i=a.getShapeByIndex("circle",t,e).classed(Se.EXPANDED,!0),s=o(i)/a.config.point_r,l=1-s;a.isCirclePoint()?i.attr("r",o):i.each(function(){const c=it(this);if(this.tagName==="circle")c.attr("r",o);else{const{width:f,height:g}=na(this),p=l*(+c.attr("x")+f/2),m=l*(+c.attr("y")+g/2);c.attr("transform",`translate(${p} ${m}) scale(${s})`)}})},unexpandCircles(t){const e=this,r=e.pointR.bind(e),a=e.getShapeByIndex("circle",t).filter(function(){return it(this).classed(Se.EXPANDED)}).classed(Se.EXPANDED,!1);if(a.attr("r",r),!e.isCirclePoint()){const o=r(a)/e.config.point_r;a.attr("transform",o!==1?`scale(${o})`:null)}},pointR(t){const e=this,{config:r}=e,a=r.point_r;let o=a;return e.isBubbleType(t)?o=e.getBubbleR(t):he(a)&&(o=a.bind(e.api)(t)),t.r=o,o},pointExpandedR(t){const e=this,{config:r}=e,a=e.isBubbleType(t)?1.15:1.75;return r.point_focus_expand_enabled?r.point_focus_expand_r||e.pointR(t)*a:e.pointR(t)},pointSelectR(t){const e=this,r=e.config.point_select_r;return he(r)?r(t):r||e.pointR(t)*4},isPointFocusOnly(){const t=this;return t.config.point_focus_only&&!t.hasType("bubble")&&!t.hasType("scatter")&&!t.hasArcType(null,["radar"])},isWithinCircle(t,e){const{state:r}=this,a=Kn(r.event,t),o=it(t),i=this.isCirclePoint(t)?"c":"",s=this.getPointSensitivity(o==null?void 0:o.datum());let l=+o.attr(`${i}x`),c=+o.attr(`${i}y`);if(!(l||c)&&t.nodeType===1){const{x:f,y:g}=mn(t);l=f,c=g}return Math.sqrt(Math.pow(l-a[0],2)+Math.pow(c-a[1],2))<(e||s)},getPointSensitivity(t){const e=this;let r=e.config.point_sensitivity;if(t)he(r)?r=r.call(e.api,t):r==="radius"&&(r=t.r);else return r;return r},updatePointClass(t){const e=this,{circle:r}=e.$el;let a=!1;return(ze(t)||r)&&(a=t===!0?r.each(function(o){let i=e.getClass("circle",!0)(o);this.getAttribute("class").indexOf(Se.EXPANDED)>-1&&(i+=` ${Se.EXPANDED}`),this.setAttribute("class",i)}):e.getClass("circle",!0)(t)),a},generateGetLinePoints(t,e){const r=this,{config:a}=r,o=r.getShapeX(0,t,e),i=r.getShapeY(e),s=r.getShapeOffset(r.isLineType,t,e),l=r.getYScaleById.bind(r);return(c,f)=>{const g=l.call(r,c.id,e)(r.getShapeYMin(c.id)),p=s(c,f)||g,m=o(c);let E=i(c);a.axis_rotated&&(c.value>0&&E<g||c.value<0&&g<E)&&(E=g);const w=[m,E-(g-p)];return[w,w,w,w]}},custom:{create(t,e,r){return t.append("use").attr("xlink:href",`#${e}`).attr("class",this.updatePointClass.bind(this)).style("fill",r).node()},update(t,e,r,a,o,i,s){const l=this,{width:c,height:f}=na(t.node()),g=E=>De(E.value)?e(E)-c/2:0,p=E=>De(E.value)?r(E)-f/2:0;let m=t;return o&&(i&&m.attr("x",g),m=l.$T(m,o,ua()),s&&l.$T(s,o,ua())),m.attr("x",g).attr("y",p).style("fill",a)}},circle:{create(t,e,r){return t.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",e).style("fill",r).node()},update(t,e,r,a,o,i,s){const l=this;let c=t;return l.hasType("bubble")&&c.attr("r",l.pointR.bind(l)),o&&(i&&c.attr("cx",e),c.attr("cx")&&(c=l.$T(c,o,ua())),s&&l.$T(c,o,ua())),c.attr("cx",e).attr("cy",r).style("fill",a)}},rectangle:{create(t,e,r){const a=o=>e(o)*2;return t.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",a).attr("height",a).style("fill",r).node()},update(t,e,r,a,o,i,s){const l=this,c=l.config.point_r,f=m=>e(m)-c,g=m=>r(m)-c;let p=t;return o&&(i&&p.attr("x",f),p=l.$T(p,o,ua()),s&&l.$T(s,o,ua())),p.attr("x",f).attr("y",g).style("fill",a)}}};function n0(t){return rr(t)&&he(t.create)&&he(t.update)}function r0(t,e){var r;const a=this,o=(c,f)=>{const g=c.attributes;for(let p=0,m;m=g[p];p++)m=m.name,f.setAttribute(m,c.getAttribute(m))},s=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,l=pn.createElementNS(te.svg,s.nodeName.toLowerCase());if(l.id=e,l.style.fill="inherit",l.style.stroke="inherit",o(s,l),(r=s.childNodes)!=null&&r.length){const c=it(l);"innerHTML"in l?c.html(s.innerHTML):Lr(s.childNodes).forEach(f=>{o(f,c.append(f.tagName).node())})}a.$el.defs.node().appendChild(l)}var fa={hasValidPointType(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasLegendDefsPoint(){var t;const{config:e}=this;return e.legend_show&&((t=e.point_pattern)==null?void 0:t.length)&&e.legend_usePoint},getDefsPointId(t){const{state:{datetimeId:e}}=this;return`${e}-point${t}`},generatePoint(){const t=this,{$el:e,config:r}=t,a=[],o=cn(r.point_pattern)?r.point_pattern:[r.point_type];return function(i,s,...l){return function(c){var f,g,p,m;const E=t.getTargetSelectorSuffix(c.id||((f=c.data)==null?void 0:f.id)||c),w=it(this);a.indexOf(E)<0&&a.push(E);let U=o[a.indexOf(E)%o.length];if(t.hasValidPointType(U))U=t[U];else if(!n0(U||r.point_type)){const N=t.getDefsPointId(E);if(e.defs.select(`#${N}`).size()<1&&r0.bind(t)(U,N),i==="create")return(g=t.custom)==null?void 0:g.create.bind(s)(w,N,...l);if(i==="update")return(p=t.custom)==null?void 0:p.update.bind(s)(w,...l)}return(m=U[i])==null?void 0:m.bind(s)(w,...l)}}}};function rf(t){const e=t.config.polar_level_max;let r=t.getMinMaxData().max[0].value;return e&&e>r&&(r=e),r}var a0={initPolar(){const t=this,{$el:{arcs:e},config:r}=t,a=r.polar_level_text_show,o=r.polar_level_text_backgroundColor;e.levels=e.append("g").attr("class",Sr.levels),a&&o&&t.generateTextBGColorFilter(o)},getPolarOuterRadius(t,e){var r;const a=rf(this);return((r=t==null?void 0:t.data.values[0].value)!=null?r:0)/a*e},updateTargetsForPolar(t){this.updateTargetsForArc(t)},redrawPolar(){const t=this,{config:e}=t;e.polar_level_show&&t.updatePolarLevel()},updatePolarLevel(){const t=this,{config:e,state:r,$el:{arcs:{levels:a}}}=t,o=e.polar_level_depth,i=rf(t),s=Ro(0,o),l=r.radius,c=s.map(m=>l*((m+1)/o)),f=(e.polar_level_text_format||function(){}).bind(t.api),g=a.selectAll(`.${Sr.level}`).data(s);g.exit().remove();const p=g.enter().append("g").attr("class",(m,E)=>`${Sr.level} ${Sr.level}-${E}`);if(p.append("circle"),p.merge(g).selectAll("circle").style("visibility",e.polar_level_show?null:"hidden").attr("cx",0).attr("cy",0).attr("r",m=>c[m]),e.polar_level_text_show){const m=e.polar_level_text_backgroundColor,E=`#${r.datetimeId}-labels-bg${t.getTargetSelectorSuffix(m)}`;p.append("text").style("text-anchor","middle"),p.merge(g).selectAll("text").attr("dy",w=>-c[w]+5).attr("filter",m?`url(${E})`:null).text(w=>f(i/s.length*(w+1)))}}};function o0(t,e,r,a,o,i){const s=t&&a>0?r-a:a,l=2*Math.PI;return o*(1-i*(e==="x"?Math.sin:Math.cos)(s*l/r))}const da=Mn.radarPoints,af=Mn.radarTextWidth;var i0={initRadar(){const t=this,{config:e,state:{current:r},$el:a}=t;t.hasType("radar")&&(a.radar=a.main.select(`.${Se.chart}`).append("g").attr("class",qs.chartRadars),a.radar.levels=a.radar.append("g").attr("class",Sr.levels),a.radar.axes=a.radar.append("g").attr("class",vn.axis),a.radar.shapes=a.radar.append("g").attr("class",sn.shapes),r.dataMax=e.radar_axis_max||t.getMinMaxData().max[0].value,e.radar_axis_text_show&&(e.interaction_enabled&&t.bindRadarEvent(),t.updateRadarLevel(),t.updateRadarAxes()))},getRadarSize(){const t=this,{config:e,state:{arcWidth:r,arcHeight:a}}=t,o=e.axis_x_categories.length<4?-20:10,i=(Math.min(r,a)-o)/2;return[i,i]},updateTargetsForRadar(t){const e=this,{config:r}=e;Yn(r.axis_x_categories)&&(r.axis_x_categories=Ro(0,tr("max",t.map(a=>a.values.length)))),e.generateRadarPoints()},getRadarPosition(t,e,r,a){const o=this,{config:i}=o,[s,l]=o.getRadarSize(),c=i.axis_x_categories.length,f=i.radar_direction_clockwise,g=Lr(t).map(p=>o0(f,p,c,e,Qe(r)?r:t==="x"?s:l,pe(a)?a:i.radar_size_ratio));return g.length===1?g[0]:g},generateRadarPoints(){const t=this,e=t.data.targets,[r,a]=t.getRadarSize(),o=t.cache.get(da)||{},i=o._size;(!i||i.width!==r&&i.height!==a)&&(e.forEach(s=>{o[s.id]=s.values.map((l,c)=>t.getRadarPosition(["x","y"],c,void 0,t.getRatio("radar",l)))}),o._size={width:r,height:a},t.cache.add(da,o))},redrawRadar(){const t=this,{radar:e,main:r}=t.$el,a=t.getTranslate("radar");a&&(e.attr("transform",a),r.select(`.${gn.chartTexts}`).attr("transform",a),t.generateRadarPoints(),t.updateRadarLevel(),t.updateRadarAxes(),t.updateRadarShape())},generateGetRadarPoints(){const t=this.cache.get(da);return(e,r)=>{const a=t[e.id][r];return[a,a,a,a]}},updateRadarLevel(){const t=this,{config:e,state:r,$el:{radar:a}}=t,[o,i]=t.getRadarSize(),s=e.radar_level_depth,l=e.axis_x_categories.length,c=e.radar_level_text_show,f=a.levels,g=Ro(0,s),p=e.radar_size_ratio*Math.min(o,i),m=g.map(D=>p*((D+1)/s)),E=(e.radar_level_text_format||function(){}).bind(t.api),w=g.map(D=>{const Y=m[D];return Ro(0,l).map(K=>t.getRadarPosition(["x","y"],K,Y,1).join(",")).join(" ")}),U=f.selectAll(`.${Sr.level}`).data(g);U.exit().remove();const N=U.enter().append("g").attr("class",(D,Y)=>`${Sr.level} ${Sr.level}-${Y}`);N.append("polygon").style("visibility",e.radar_level_show?null:"hidden"),c&&(f.select("text").empty()&&f.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(()=>E(0)),N.append("text").attr("dx","-.5em").style("text-anchor","end").text(D=>E(r.current.dataMax/g.length*(D+1)))),N.merge(U).attr("transform",D=>`translate(${o-m[D]}, ${i-m[D]})`).selectAll("polygon").attr("points",D=>w[D]),c&&f.selectAll("text").attr("x",D=>ln(D)?o:w[D].split(",")[0]).attr("y",D=>ln(D)?i:0)},updateRadarAxes(){const t=this,{config:e,$el:{radar:r}}=t,[a,o]=t.getRadarSize(),i=e.axis_x_categories;let s=r.axes.selectAll("g").data(i);s.exit().remove();const l=s.enter().append("g").attr("class",(c,f)=>`${vn.axis}-${f}`);if(e.radar_axis_line_show&&l.append("line"),e.radar_axis_text_show&&l.append("text"),s=l.merge(s),e.radar_axis_line_show&&s.select("line").attr("x1",a).attr("y1",o).attr("x2",(c,f)=>t.getRadarPosition("x",f)).attr("y2",(c,f)=>t.getRadarPosition("y",f)),e.radar_axis_text_show){const{x:c=0,y:f=0}=e.radar_axis_text_position,g=t.cache.get(af)||0;if(s.select("text").style("text-anchor","middle").attr("dy",".5em").call(p=>{p.each(function(m){Da(it(this),String(m),[-.6,1.2])})}).datum((p,m)=>({index:m})).attr("transform",function(p){ln(this.width)&&(this.width=mn(this,!0).width/2);let m=t.getRadarPosition("x",p.index,void 0,1),E=Math.round(t.getRadarPosition("y",p.index,void 0,1));return m>a?m+=this.width+c:Math.round(m)<a&&(m-=this.width+c),E>o?(E/2===o&&this.firstChild.tagName==="tspan"&&this.firstChild.setAttribute("dy","0em"),E+=f):E<o&&(E-=f),`translate(${m} ${E})`}),!g){const p=[r.axes,r.levels].map(m=>Kl(m.node()).width);p.every(m=>m>0)&&t.cache.add(af,p[0]-p[1])}}},bindRadarEvent(){const t=this,{config:e,state:r,$el:{radar:a,svg:o}}=t,i=t.isPointFocusOnly(),{inputType:s,transiting:l}=r,c=s==="mouse",f=g=>{if(r.event=g,!e.interaction_onout)return;const p=t.getDataIndexFromEvent(g),m=ln(p);(c||m)&&(t.hideTooltip(),i?t.hideCircleFocus():t.unexpandCircles(),c?t.setOverOut(!1,p):m&&t.callOverOutForTouch())};a.axes.on(c?"mouseover ":"touchstart",g=>{if(l)return;r.event=g;const p=t.getDataIndexFromEvent(g);t.selectRectForSingle(o.node(),p),c?t.setOverOut(!0,p):t.callOverOutForTouch(p)}).on("mouseout",c?f:null),c||o.on("touchstart",f)},updateRadarShape(){const t=this,e=t.data.targets.filter(i=>t.isRadarType(i)),r=t.cache.get(da),a=t.$el.radar.shapes.selectAll("polygon").data(t.filterNullish(e)),o=a.enter().append("g").attr("class",t.getChartClass("Radar"));t.$T(a.exit()).remove(),o.append("polygon").merge(a).style("fill",t.color).style("stroke",t.color).attr("points",i=>r[i.id].join(" ")),t.updateTargetForCircle(e,o)},radarCircleX(t){return this.cache.get(da)[t.id][t.index][0]},radarCircleY(t){return this.cache.get(da)[t.id][t.index][1]}};function s0(t){var e=0,r=t.children,a=r&&r.length;if(!a)e=1;else for(;--a>=0;)e+=r[a].value;t.value=e}function l0(){return this.eachAfter(s0)}function c0(t,e){let r=-1;for(const a of this)t.call(e,a,++r,this);return this}function u0(t,e){for(var r=this,a=[r],o,i,s=-1;r=a.pop();)if(t.call(e,r,++s,this),o=r.children)for(i=o.length-1;i>=0;--i)a.push(o[i]);return this}function f0(t,e){for(var r=this,a=[r],o=[],i,s,l,c=-1;r=a.pop();)if(o.push(r),i=r.children)for(s=0,l=i.length;s<l;++s)a.push(i[s]);for(;r=o.pop();)t.call(e,r,++c,this);return this}function d0(t,e){let r=-1;for(const a of this)if(t.call(e,a,++r,this))return a}function h0(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,a=e.children,o=a&&a.length;--o>=0;)r+=a[o].value;e.value=r})}function v0(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function g0(t){for(var e=this,r=p0(e,t),a=[e];e!==r;)e=e.parent,a.push(e);for(var o=a.length;t!==r;)a.splice(o,0,t),t=t.parent;return a}function p0(t,e){if(t===e)return t;var r=t.ancestors(),a=e.ancestors(),o=null;for(t=r.pop(),e=a.pop();t===e;)o=t,t=r.pop(),e=a.pop();return o}function m0(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function y0(){return Array.from(this)}function x0(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function T0(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*S0(){var t=this,e,r=[t],a,o,i;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,a=t.children)for(o=0,i=a.length;o<i;++o)r.push(a[o]);while(r.length)}function Os(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=E0)):e===void 0&&(e=A0);for(var r=new _o(t),a,o=[r],i,s,l,c;a=o.pop();)if((s=e(a.data))&&(c=(s=Array.from(s)).length))for(a.children=s,l=c-1;l>=0;--l)o.push(i=s[l]=new _o(s[l])),i.parent=a,i.depth=a.depth+1;return r.eachBefore(I0)}function $0(){return Os(this).eachBefore(b0)}function A0(t){return t.children}function E0(t){return Array.isArray(t)?t[1]:null}function b0(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function I0(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function _o(t){this.data=t,this.depth=this.height=0,this.parent=null}_o.prototype=Os.prototype={constructor:_o,count:l0,each:c0,eachAfter:f0,eachBefore:u0,find:d0,sum:h0,sort:v0,path:g0,ancestors:m0,descendants:y0,leaves:x0,links:T0,copy:$0,[Symbol.iterator]:S0};function R0(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function ti(t,e,r,a,o){for(var i=t.children,s,l=-1,c=i.length,f=t.value&&(a-e)/t.value;++l<c;)s=i[l],s.y0=r,s.y1=o,s.x0=e,s.x1=e+=s.value*f}function ei(t,e,r,a,o){for(var i=t.children,s,l=-1,c=i.length,f=t.value&&(o-r)/t.value;++l<c;)s=i[l],s.x0=e,s.x1=a,s.y0=r,s.y1=r+=s.value*f}var of=(1+Math.sqrt(5))/2;function sf(t,e,r,a,o,i){for(var s=[],l=e.children,c,f,g=0,p=0,m=l.length,E,w,U=e.value,N,D,Y,J,K,nt,Q;g<m;){E=o-r,w=i-a;do N=l[p++].value;while(!N&&p<m);for(D=Y=N,nt=Math.max(w/E,E/w)/(U*t),Q=N*N*nt,K=Math.max(Y/Q,Q/D);p<m;++p){if(N+=f=l[p].value,f<D&&(D=f),f>Y&&(Y=f),Q=N*N*nt,J=Math.max(Y/Q,Q/D),J>K){N-=f;break}K=J}s.push(c={value:N,dice:E<w,children:l.slice(g,p)}),c.dice?ti(c,r,a,o,U?a+=w*N/U:i):ei(c,r,a,U?r+=E*N/U:o,i),U-=N,g=p}return s}var lf=(function t(e){function r(a,o,i,s,l){sf(e,a,o,i,s,l)}return r.ratio=function(a){return t((a=+a)>1?a:1)},r})(of);function J1(t){return t==null?null:cf(t)}function cf(t){if(typeof t!="function")throw new Error;return t}function Va(){return 0}function Xa(t){return function(){return t}}function O0(){var t=lf,e=!1,r=1,a=1,o=[0],i=Va,s=Va,l=Va,c=Va,f=Va;function g(m){return m.x0=m.y0=0,m.x1=r,m.y1=a,m.eachBefore(p),o=[0],e&&m.eachBefore(R0),m}function p(m){var E=o[m.depth],w=m.x0+E,U=m.y0+E,N=m.x1-E,D=m.y1-E;N<w&&(w=N=(w+N)/2),D<U&&(U=D=(U+D)/2),m.x0=w,m.y0=U,m.x1=N,m.y1=D,m.children&&(E=o[m.depth+1]=i(m)/2,w+=f(m)-E,U+=s(m)-E,N-=l(m)-E,D-=c(m)-E,N<w&&(w=N=(w+N)/2),D<U&&(U=D=(U+D)/2),t(m,w,U,N,D))}return g.round=function(m){return arguments.length?(e=!!m,g):e},g.size=function(m){return arguments.length?(r=+m[0],a=+m[1],g):[r,a]},g.tile=function(m){return arguments.length?(t=cf(m),g):t},g.padding=function(m){return arguments.length?g.paddingInner(m).paddingOuter(m):g.paddingInner()},g.paddingInner=function(m){return arguments.length?(i=typeof m=="function"?m:Xa(+m),g):i},g.paddingOuter=function(m){return arguments.length?g.paddingTop(m).paddingRight(m).paddingBottom(m).paddingLeft(m):g.paddingTop()},g.paddingTop=function(m){return arguments.length?(s=typeof m=="function"?m:Xa(+m),g):s},g.paddingRight=function(m){return arguments.length?(l=typeof m=="function"?m:Xa(+m),g):l},g.paddingBottom=function(m){return arguments.length?(c=typeof m=="function"?m:Xa(+m),g):c},g.paddingLeft=function(m){return arguments.length?(f=typeof m=="function"?m:Xa(+m),g):f},g}function uf(t,e,r,a,o){var i=t.children,s,l=i.length,c,f=new Array(l+1);for(f[0]=c=s=0;s<l;++s)f[s+1]=c+=i[s].value;g(0,l,t.value,e,r,a,o);function g(p,m,E,w,U,N,D){if(p>=m-1){var Y=i[p];Y.x0=w,Y.y0=U,Y.x1=N,Y.y1=D;return}for(var J=f[p],K=E/2+J,nt=p+1,Q=m-1;nt<Q;){var ot=nt+Q>>>1;f[ot]<K?nt=ot+1:Q=ot}K-f[nt-1]<f[nt]-K&&p+1<nt&&--nt;var pt=f[nt]-J,Tt=E-pt;if(N-w>D-U){var yt=E?(w*Tt+N*pt)/E:N;g(p,nt,pt,w,U,yt,D),g(nt,m,Tt,yt,U,N,D)}else{var lt=E?(U*Tt+D*pt)/E:D;g(p,nt,pt,w,U,N,lt),g(nt,m,Tt,w,lt,N,D)}}}function C0(t,e,r,a,o){(t.depth&1?ei:ti)(t,e,r,a,o)}var P0=(function t(e){function r(a,o,i,s,l){if((c=a._squarify)&&c.ratio===e)for(var c,f,g,p,m=-1,E,w=c.length,U=a.value;++m<w;){for(f=c[m],g=f.children,p=f.value=0,E=g.length;p<E;++p)f.value+=g[p].value;f.dice?ti(f,o,i,s,U?i+=(l-i)*f.value/U:l):ei(f,o,i,U?o+=(s-o)*f.value/U:s,l),U-=f.value}else a._squarify=c=sf(e,a,o,i,s,l),c.ratio=e}return r.ratio=function(a){return t((a=+a)>1?a:1)},r})(of);function M0(t,e){const r=this,{scale:{x:a,y:o},state:{width:i}}=r;t.selectAll("g").attr("transform",s=>`translate(${s===e?"0,0":`${a(s.x0)},${o(s.y0)}`})`).select("rect").attr("width",s=>s===e?i:a(s.x1)-a(s.x0)).attr("height",s=>s===e?0:o(s.y1)-o(s.y0))}function w0(t){const e=this;return t.map(r=>{const{id:a,values:o}=r,{value:i}=o[0];return{name:a,id:a,value:i,ratio:e.getRatio("treemap",o[0])}})}function D0(t){const e=this,r=Os(t).sum(o=>o.value),a=e.getSortCompareFn(!0);return[e.treemap(a?r.sort(a):r)]}var N0={initTreemap(){const t=this,{$el:e,state:{current:{width:r,height:a},clip:o,datetimeId:i}}=t;o.id=`${i}-clip`,t.treemap=O0().tile(t.getTreemapTile()),e.defs.append("clipPath").attr("id",o.id).append("rect").attr("width",r).attr("height",a),e.treemap=e.main.select(`.${Se.chart}`).attr("clip-path",`url(#${o.id})`).append("g").classed(tl.chartTreemaps,!0),t.bindTreemapEvent()},bindTreemapEvent(){const t=this,{$el:e,config:r,state:a}=t,o=i=>{var s;const l=i.isTrusted?i.target:(s=a.eventReceiver.rect)==null?void 0:s.node();let c;return/^rect$/i.test(l.tagName)&&(a.event=i,c=it(l).datum()),c==null?void 0:c.data};if(r.interaction_enabled){const i=a.inputType==="touch";e.treemap.on(i?"touchstart":"mouseover mousemove",s=>{const l=o(s);l&&(t.showTooltip([l],s.currentTarget),/^(touchstart|mouseover)$/.test(s.type)&&t.setOverOut(!0,l))}).on(i?"touchend":"mouseout",s=>{const l=o(s);r.interaction_onout&&(t.hideTooltip(),t.setOverOut(!1,l))})}},getTreemapTile(){var t,e;const r=this,{config:a,state:{current:{width:o,height:i}}}=r,s=(e={binary:uf,dice:ti,slice:ei,sliceDice:C0,squarify:lf,resquarify:P0}[(t=a.treemap_tile)!=null?t:"binary"])!=null?e:uf;return(l,c,f,g,p)=>{s(l,0,0,o,i);for(const m of l.children)m.x0=c+m.x0/o*(g-c),m.x1=c+m.x1/o*(g-c),m.y0=f+m.y0/i*(p-f),m.y1=f+m.y1/i*(p-f)}},getTreemapData(t){const e=this;return{name:"root",children:w0.bind(e)(e.filterTargetsToShow(t.filter(e.isTreemapType,e)))}},updateTargetsForTreemap(t){const e=this,{$el:{treemap:r}}=e,a=D0.call(e,e.getTreemapData(t!=null?t:e.data.targets));r.data(e.filterNullish(a))},updateTreemap(t){const e=this,{$el:r,$T:a}=e,o=r.treemap.datum(),i=e.getChartClass("Treemap"),s=e.getClass("treemap",!0),l=r.treemap.selectAll("g").data(o.children);a(l.exit(),t).style("opacity","0").remove(),l.enter().append("g").append("rect"),r.treemap.selectAll("g").attr("class",i).select("rect").attr("class",s).attr("fill",c=>e.color(c.data.name))},generateGetTreemapPoints(){const t=this,{$el:e,scale:{x:r,y:a}}=t,o={};return e.treemap.selectAll("g").each(i=>{o[i.data.name]=[[r(i.x0),a(i.y0)],[r(i.x1),a(i.y1)]]}),i=>o[i.id]},redrawTreemap(t){const e=this,{$el:r,state:{current:{width:a,height:o}}}=e;return r.defs.select("rect").attr("width",a).attr("height",o),[e.$T(r.treemap,t,ar()).call(M0.bind(e),r.treemap.datum())]},treemapDataLabelFormat(t){const e=this,{config:r}=e,{id:a,value:o}=t,i=r.treemap_label_format,s=e.getRatio("treemap",t),l=(s*100).toFixed(2),c=r.treemap_label_show&&cs.call(e,s,"treemap")?null:"0";return function(f){return f.style("opacity",c),he(i)?i.bind(e.api)(o,s,a):`${a}
|
|
58
|
+
${l}%`}}},Hr={point_show:!0,point_r:2.5,point_radialGradient:!1,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},ha={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},L0={bar_connectLine:!1,bar_front:!1,bar_indices_removeNull:!1,bar_label_threshold:0,bar_linearGradient:!1,bar_overlap:!1,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0},F0={bubble_maxR:35,bubble_zerobased:!1},B0={candlestick_width:void 0,candlestick_width_ratio:.6,candlestick_width_max:void 0,candlestick_color_down:"red"},U0={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0},z0={scatter_zerobased:!1},Cs={spline_interpolation_type:"cardinal"},ni={arc_cornerRadius:0,arc_cornerRadius_ratio:0,arc_needle_show:!1,arc_needle_color:void 0,arc_needle_value:void 0,arc_needle_path:void 0,arc_needle_length:100,arc_needle_top_rx:0,arc_needle_top_ry:0,arc_needle_top_width:0,arc_needle_bottom_rx:1,arc_needle_bottom_ry:1,arc_needle_bottom_width:15,arc_needle_bottom_len:0,arc_rangeText_values:void 0,arc_rangeText_unit:"absolute",arc_rangeText_fixed:!1,arc_rangeText_format:void 0,arc_rangeText_position:void 0},j0={donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_image:void 0,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_rate:.98,donut_expand_duration:50,donut_padAngle:0,donut_startingAngle:0},G0={funnel_neck_width:0,funnel_neck_height:0},V0={gauge_background:"",gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_extents:void 0,gauge_label_format:void 0,gauge_label_ratio:void 0,gauge_label_threshold:0,gauge_label_image:void 0,gauge_enforceMinMax:!1,gauge_min:0,gauge_max:100,gauge_type:"single",gauge_startingAngle:-1*Math.PI/2,gauge_arcLength:100,gauge_title:"",gauge_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,gauge_expand:{},gauge_expand_rate:.98,gauge_expand_duration:50},X0={pie_label_show:!0,pie_label_format:void 0,pie_label_ratio:void 0,pie_label_threshold:.05,pie_label_image:void 0,pie_expand:{},pie_expand_rate:.98,pie_expand_duration:50,pie_innerRadius:0,pie_outerRadius:void 0,pie_padAngle:0,pie_padding:0,pie_startingAngle:0},H0={polar_label_show:!0,polar_label_format:void 0,polar_label_threshold:.05,polar_label_image:void 0,polar_label_ratio:void 0,polar_level_depth:3,polar_level_max:void 0,polar_level_show:!0,polar_level_text_backgroundColor:"#fff",polar_level_text_format:t=>t%1===0?t:t.toFixed(2),polar_level_text_show:!0,polar_padAngle:0,polar_padding:0,polar_startingAngle:0},W0={radar_axis_max:void 0,radar_axis_line_show:!0,radar_axis_text_show:!0,radar_axis_text_position:{},radar_level_depth:3,radar_level_show:!0,radar_level_text_format:t=>t%1===0?t:t.toFixed(2),radar_level_text_show:!0,radar_size_ratio:.87,radar_direction_clockwise:!1},Y0={treemap_tile:"binary",treemap_label_format:void 0,treemap_label_threshold:.05,treemap_label_show:!0};function va(t,e){Sn(Vr.prototype,Object.values(Uu).concat(t)),Sn(br.prototype,lx),Fr.setOptions(Object.values(zu).concat(e||[]))}function yr(t,e){va([fa,qo,e0].concat(t||[])),Fr.setOptions([Hr,U0].concat(e||[]))}function ga(t,e){Sn(Vr.prototype,[Cx,fa].concat(t||[])),Fr.setOptions([Hr].concat(e||[]))}let ff=()=>(yr(ca,[ha]),(ff=()=>se.AREA)()),df=()=>(yr(ca,[ha]),(df=()=>se.AREA_LINE_RANGE)()),hf=()=>(yr(ca,[ha]),(hf=()=>se.AREA_STEP_RANGE)()),vf=()=>(yr(ca,[ha,Cs]),(vf=()=>se.AREA_SPLINE)()),gf=()=>(yr(ca,[ha,Cs]),(gf=()=>se.AREA_SPLINE_RANGE)()),pf=()=>(yr(ca,[ha]),(pf=()=>se.AREA_STEP)()),mf=()=>(yr(),(mf=()=>se.LINE)()),yf=()=>(yr(void 0,[Cs]),(yf=()=>se.SPLINE)()),xf=()=>(yr(),(xf=()=>se.STEP)()),Tf=()=>(ga(void 0,[ni,j0]),(Tf=()=>se.DONUT)()),Sf=()=>(ga([Wx],[ni,V0]),(Sf=()=>se.GAUGE)()),$f=()=>(ga(void 0,[ni,X0]),($f=()=>se.PIE)()),Af=()=>(ga([a0],[ni,H0]),(Af=()=>se.POLAR)()),Ef=()=>(ga([Uu.eventrect,qo,i0],[Hr,W0,{axis_x_categories:zu.optAxis.axis_x_categories}]),(Ef=()=>se.RADAR)()),bf=()=>(va([Mx,fa],[L0,Hr]),(bf=()=>se.BAR)()),If=()=>(va([fa,qo,wx],[F0,Hr]),(If=()=>se.BUBBLE)()),Rf=()=>(va([Bx,fa],[B0,Hr]),(Rf=()=>se.CANDLESTICK)()),Of=()=>(va([fa,qo],[Hr,z0]),(Of=()=>se.SCATTER)()),Cf=()=>(ga([Hx],[G0]),(Cf=()=>se.FUNNEL)()),Pf=()=>(va([N0],[Y0]),(Pf=()=>se.TREEMAP)()),Ps=Object.create(null);const Mf={version:"3.17.2",generate(t){const e=ra(Object.create(null),Ps,t),r=new br(e);return r.internal.charts=this.instance,this.instance.push(r),r},defaults(t){return ze(t)&&(Ps=t),Ps},instance:[],plugin:{}};Object.keys(d).forEach(t=>d[t]()),Object.keys(u).forEach(t=>u[t]())})],Wa={};function Gn(x){var b=Wa[x];if(b!==void 0)return b.exports;var n=Wa[x]={exports:{}};return Ms[x].call(n.exports,n,n.exports,Gn),n.exports}(function(){Gn.d=function(x,b){for(var n in b)Gn.o(b,n)&&!Gn.o(x,n)&&Object.defineProperty(x,n,{enumerable:!0,get:b[n]})}})(),(function(){Gn.o=function(x,b){return Object.prototype.hasOwnProperty.call(x,b)}})(),(function(){Gn.r=function(x){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})}})(),Gn(0);var Ya=Gn(616);return Ya})()});
|