diff --git a/dist/uPlot.cjs.js b/dist/uPlot.cjs.js index caaae3ec..9efdb7e0 100644 --- a/dist/uPlot.cjs.js +++ b/dist/uPlot.cjs.js @@ -1554,12 +1554,11 @@ function clipGaps(gaps, ori, plotLft, plotTop, plotWid, plotHgt) { for (let i = 0; i < gaps.length; i++) { let g = gaps[i]; - if (g[1] == g[0]) - continue; + if (g[1] > g[0]) { + rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - - prevGapEnd = g[1]; + prevGapEnd = g[1]; + } } rect(clip, prevGapEnd, plotTop, plotLft + plotWid - prevGapEnd, plotTop + plotHgt); diff --git a/dist/uPlot.esm.js b/dist/uPlot.esm.js index c2ecf77f..5047e819 100644 --- a/dist/uPlot.esm.js +++ b/dist/uPlot.esm.js @@ -1552,12 +1552,11 @@ function clipGaps(gaps, ori, plotLft, plotTop, plotWid, plotHgt) { for (let i = 0; i < gaps.length; i++) { let g = gaps[i]; - if (g[1] == g[0]) - continue; + if (g[1] > g[0]) { + rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - - prevGapEnd = g[1]; + prevGapEnd = g[1]; + } } rect(clip, prevGapEnd, plotTop, plotLft + plotWid - prevGapEnd, plotTop + plotHgt); diff --git a/dist/uPlot.iife.js b/dist/uPlot.iife.js index ff333a3f..2a3beb52 100644 --- a/dist/uPlot.iife.js +++ b/dist/uPlot.iife.js @@ -1565,12 +1565,11 @@ var uPlot = (function () { for (var i = 0; i < gaps.length; i++) { var g = gaps[i]; - if (g[1] == g[0]) - { continue; } + if (g[1] > g[0]) { + rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - - prevGapEnd = g[1]; + prevGapEnd = g[1]; + } } rect(clip, prevGapEnd, plotTop, plotLft + plotWid - prevGapEnd, plotTop + plotHgt); diff --git a/dist/uPlot.iife.min.js b/dist/uPlot.iife.min.js index 5dd49619..65f6f359 100644 --- a/dist/uPlot.iife.min.js +++ b/dist/uPlot.iife.min.js @@ -1,2 +1,2 @@ /*! https://github.com/leeoniya/uPlot (v1.6.13) */ -var uPlot=function(){"use strict";function n(n,e,r,t){var l;r=r||0;for(var a=2147483647>=(t=t||e.length-1);t-r>1;)n>e[l=a?r+t>>1:m((r+t)/2)]?r=l:t=l;return n-e[r]>e[t]-n?t:r}function e(n,e,r,t){for(var l=1==t?e:r;l>=e&&r>=l;l+=t)if(null!=n[l])return l;return-1}var r=[0,0];function t(n,e,t,l){return r[0]=0>t?H(n,-t):n,r[1]=0>l?H(e,-l):e,r}function l(n,e,r,l){var a,i,o,s=10==r?_:y;return n==e&&(n/=r,e*=r),l?(a=m(s(n)),i=x(s(e)),n=(o=t(k(r,a),k(r,i),a,i))[0],e=o[1]):(a=m(s(p(n))),i=m(s(p(e))),n=F(n,(o=t(k(r,a),k(r,i),a,i))[0]),e=C(e,o[1])),[n,e]}function a(n,e,r,t){var a=l(n,e,r,t);return 0==n&&(a[0]=0),0==e&&(a[1]=0),a}var i={mode:3,pad:.1},o={pad:0,soft:null,mode:0},s={min:o,max:o};function u(n,e,r,t){return N(r)?c(n,e,r):(o.pad=r,o.soft=t?0:null,o.mode=t?3:0,c(n,e,s))}function f(n,e){return null==n?e:n}function c(n,e,r){var t=r.min,l=r.max,a=f(t.pad,0),i=f(l.pad,0),o=f(t.hard,-S),s=f(l.hard,S),u=f(t.soft,S),c=f(l.soft,-S),v=f(t.mode,0),h=f(l.mode,0),d=e-n;1e-9>d&&(d=0,0!=n&&0!=e||(d=1e-9,2==v&&u!=S&&(a=0),2==h&&c!=-S&&(i=0)));var g=d||p(e)||1e3,x=_(g),y=k(10,m(x)),M=H(F(n-g*(0==d?0==n?.1:1:a),y/10),9),z=u>n||1!=v&&(3!=v||M>u)&&(2!=v||u>M)?S:u,D=b(o,z>M&&n>=z?z:w(z,M)),E=H(C(e+g*(0==d?0==e?.1:1:i),y/10),9),T=e>c||1!=h&&(3!=h||c>E)&&(2!=h||E>c)?-S:c,A=w(s,E>T&&T>=e?T:b(T,E));return D==A&&0==D&&(A=100),[D,A]}var v=new Intl.NumberFormat(navigator.language).format,h=Math,d=h.PI,p=h.abs,m=h.floor,g=h.round,x=h.ceil,w=h.min,b=h.max,k=h.pow,_=h.log10,y=h.log2,M=(n,e)=>(void 0===e&&(e=1),h.asinh(n/e)),S=1/0;function z(n,e){return g(n/e)*e}function D(n,e,r){return w(b(n,e),r)}function E(n){return"function"==typeof n?n:()=>n}var T=n=>n,A=(n,e)=>e,P=()=>null,W=()=>!0,Y=(n,e)=>n==e;function C(n,e){return x(n/e)*e}function F(n,e){return m(n/e)*e}function H(n,e){return g(n*(e=Math.pow(10,e)))/e}var R=new Map;function L(n){return((""+n).split(".")[1]||"").length}function I(n,e,r,t){for(var l=[],a=t.map(L),i=e;r>i;i++)for(var o=p(i),s=H(k(n,i),o),u=0;t.length>u;u++){var f=t[u]*s,c=(0>f||0>i?o:0)+(a[u]>i?a[u]:0),v=H(f,c);l.push(v),R.set(v,c)}return l}var G={},O=[null,null],j=Array.isArray;function B(n){return"string"==typeof n}function N(n){var e=!1;if(null!=n){var r=n.constructor;e=null==r||r==Object}return e}function V(n){return null!=n&&"object"==typeof n}function U(n,e){var r;if(e=e||N,j(n))r=n.map((n=>U(n,e)));else if(e(n))for(var t in r={},n)r[t]=U(n[t],e);else r=n;return r}function J(n){for(var e=arguments,r=1;e.length>r;r++){var t=e[r];for(var l in t)N(n[l])?J(n[l],U(t[l])):n[l]=U(t[l])}return n}function q(n,e,r){for(var t=0,l=void 0,a=-1;e.length>t;t++){var i=e[t];if(i>a){for(l=i-1;l>=0&&null==n[l];)n[l--]=null;for(l=i+1;r>l&&null==n[l];)n[a=l++]=null}}}var Z,K,X="undefined"==typeof queueMicrotask?n=>Promise.resolve().then(n):queueMicrotask,Q="width",$="height",nn="top",en="bottom",rn="left",tn="right",ln="#000",an="#0000",on="mousemove",sn="mousedown",un="mouseup",fn="mouseenter",cn="mouseleave",vn="dblclick",hn="change",dn="dppxchange",pn="u-off",mn="u-label",gn=document,xn=window;function wn(n,e){if(null!=e){var r=n.classList;!r.contains(e)&&r.add(e)}}function bn(n,e){var r=n.classList;r.contains(e)&&r.remove(e)}function kn(n,e,r){n.style[e]=r+"px"}function _n(n,e,r,t){var l=gn.createElement(n);return null!=e&&wn(l,e),null!=r&&r.insertBefore(l,t),l}function yn(n,e){return _n("div",n,e)}var Mn=new WeakMap;function Sn(n,e,r,t,l){var a="translate("+e+"px,"+r+"px)";a!=Mn.get(n)&&(n.style.transform=a,Mn.set(n,a),0>e||0>r||e>t||r>l?wn(n,pn):bn(n,pn))}var zn=new WeakMap;function Dn(n,e,r){var t=e+r;t!=zn.get(n)&&(zn.set(n,t),Object.assign(n.style,{background:e,borderColor:r}))}var En={passive:!0},Tn=J({capture:!0},En);function An(n,e,r,t){e.addEventListener(n,r,t?Tn:En)}function Pn(n,e,r,t){e.removeEventListener(n,r,t?Tn:En)}!function n(){Z=devicePixelRatio,K&&Pn(hn,K,n),K=matchMedia("screen and (min-resolution: "+(Z-.001)+"dppx) and (max-resolution: "+(Z+.001)+"dppx)"),An(hn,K,n),xn.dispatchEvent(new CustomEvent(dn))}();var Wn=["January","February","March","April","May","June","July","August","September","October","November","December"],Yn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Cn(n){return n.slice(0,3)}var Fn=Yn.map(Cn),Hn=Wn.map(Cn),Rn={MMMM:Wn,MMM:Hn,WWWW:Yn,WWW:Fn};function Ln(n){return(10>n?"0":"")+n}var In={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,e)=>e.MMMM[n.getMonth()],MMM:(n,e)=>e.MMM[n.getMonth()],MM:n=>Ln(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>Ln(n.getDate()),D:n=>n.getDate(),WWWW:(n,e)=>e.WWWW[n.getDay()],WWW:(n,e)=>e.WWW[n.getDay()],HH:n=>Ln(n.getHours()),H:n=>n.getHours(),h:n=>{var e=n.getHours();return 0==e?12:e>12?e-12:e},AA:n=>12>n.getHours()?"AM":"PM",aa:n=>12>n.getHours()?"am":"pm",a:n=>12>n.getHours()?"a":"p",mm:n=>Ln(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>Ln(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())};function Gn(n,e){e=e||Rn;for(var r,t=[],l=/\{([a-z]+)\}|[^{]+/gi;r=l.exec(n);)t.push("{"==r[0][0]?In[r[1]]:r[0]);return n=>{for(var r="",l=0;t.length>l;l++)r+="string"==typeof t[l]?t[l]:t[l](n,e);return r}}var On=(new Intl.DateTimeFormat).resolvedOptions().timeZone,jn=n=>n%1==0,Bn=[1,2,2.5,5],Nn=I(10,-16,0,Bn),Vn=I(10,0,16,Bn),Un=Vn.filter(jn),Jn=Nn.concat(Vn),qn="{YYYY}",Zn="\n"+qn,Kn="{M}/{D}",Xn="\n"+Kn,Qn=Xn+"/{YY}",$n="{aa}",ne="{h}:{mm}"+$n,ee="\n"+ne,re=":{ss}",te=null;function le(n){var e=1e3*n,r=60*e,t=60*r,l=24*t,a=30*l,i=365*l;return[(1==n?I(10,0,3,Bn).filter(jn):I(10,-3,0,Bn)).concat([e,5*e,10*e,15*e,30*e,r,5*r,10*r,15*r,30*r,t,2*t,3*t,4*t,6*t,8*t,12*t,l,2*l,3*l,4*l,5*l,6*l,7*l,8*l,9*l,10*l,15*l,a,2*a,3*a,4*a,6*a,i,2*i,5*i,10*i,25*i,50*i,100*i]),[[i,qn,te,te,te,te,te,te,1],[28*l,"{MMM}",Zn,te,te,te,te,te,1],[l,Kn,Zn,te,te,te,te,te,1],[t,"{h}"+$n,Qn,te,Xn,te,te,te,1],[r,ne,Qn,te,Xn,te,te,te,1],[e,re,Qn+" "+ne,te,Xn+" "+ne,te,ee,te,1],[n,re+".{fff}",Qn+" "+ne,te,Xn+" "+ne,te,ee,te,1]],function(e){return(o,s,u,f,c,v)=>{var h=[],d=c>=i,p=c>=a&&i>c,x=e(u),w=H(x*n,3),b=pe(x.getFullYear(),d?0:x.getMonth(),p||d?1:x.getDate()),k=H(b*n,3);if(p||d)for(var _=p?c/a:0,y=d?c/i:0,M=w==k?w:H(pe(b.getFullYear()+y,b.getMonth()+_,1)*n,3),S=new Date(g(M/n)),z=S.getFullYear(),D=S.getMonth(),E=0;f>=M;E++){var T=pe(z+y*E,D+_*E,1),A=T-e(H(T*n,3));(M=H((+T+A)*n,3))>f||h.push(M)}else{var P=l>c?c:l,W=k+(m(u)-m(w))+C(w-k,P);h.push(W);for(var Y=e(W),F=Y.getHours()+Y.getMinutes()/r+Y.getSeconds()/t,R=c/t,L=v/o.axes[s]._space;(W=H(W+c,1==n?0:3))<=f;)if(R>1){var I=m(H(F+R,6))%24,G=e(W).getHours()-I;G>1&&(G=-1),F=(F+R)%24,.7>H(((W-=G*t)-h[h.length-1])/c,3)*L||h.push(W)}else h.push(W)}return h}}]}var ae=le(1),ie=ae[0],oe=ae[1],se=ae[2],ue=le(.001),fe=ue[0],ce=ue[1],ve=ue[2];function he(n,e){return n.map((n=>n.map(((r,t)=>0==t||8==t||null==r?r:e(1==t||0==n[8]?r:n[1]+r)))))}function de(n,e){return(r,t,l,a,i)=>{var o,s,u,f,c,v,h=e.find((n=>i>=n[0]))||e[e.length-1];return t.map((e=>{var r=n(e),t=r.getFullYear(),l=r.getMonth(),a=r.getDate(),i=r.getHours(),d=r.getMinutes(),p=r.getSeconds(),m=t!=o&&h[2]||l!=s&&h[3]||a!=u&&h[4]||i!=f&&h[5]||d!=c&&h[6]||p!=v&&h[7]||h[1];return o=t,s=l,u=a,f=i,c=d,v=p,m(r)}))}}function pe(n,e,r){return new Date(n,e,r)}function me(n,e){return e(n)}function ge(n,e){return(r,t)=>e(n(t))}I(2,-53,53,[1]);var xe={show:!0,live:!0,isolate:!1,markers:{show:!0,width:2,stroke:function(n,e){var r=n.series[e];return r.width?r.stroke(n,e):r.points.width?r.points.stroke(n,e):null},fill:function(n,e){return n.series[e].fill(n,e)},dash:"solid"},idx:null,values:[]},we=[0,0];function be(n,e,r){return n=>{0==n.button&&r(n)}}function ke(n,e,r){return r}var _e={show:!0,x:!0,y:!0,lock:!1,move:function(n,e,r){return we[0]=e,we[1]=r,we},points:{show:function(n,e){var r=n.cursor.points,t=yn(),l=r.stroke(n,e),a=r.fill(n,e);t.style.background=a||l;var i=r.size(n,e),o=r.width(n,e,i);o&&(t.style.border=o+"px solid "+l);var s=i/-2;return kn(t,Q,i),kn(t,$,i),kn(t,"marginLeft",s),kn(t,"marginTop",s),t},size:function(n,e){return Ge(n.series[e].width,1)},width:0,stroke:function(n,e){return n.series[e].stroke(n,e)},fill:function(n,e){return n.series[e].stroke(n,e)}},bind:{mousedown:be,mouseup:be,click:be,dblclick:be,mousemove:ke,mouseleave:ke,mouseenter:ke},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(n,e,r){return r},idxs:[]},ye={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:A},Me=J({},ye,{size:10}),Se='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ze="bold "+Se,De={show:!0,scale:"x",stroke:ln,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ze,side:2,grid:ye,ticks:Me,font:Se,rotate:0},Ee={show:!0,scale:"x",auto:!1,sorted:1,min:S,max:-S,idxs:[]};function Te(n,e){return e.map((n=>null==n?"":v(n)))}function Ae(n,e,r,t,l,a,i){for(var o=[],s=R.get(l)||0,u=r=i?r:H(C(r,l),s);t>=u;u=H(u+l,s))o.push(Object.is(u,-0)?0:u);return o}function Pe(n,e,r,t,l){var a=[],i=n.scales[n.axes[e].scale].log,o=m((10==i?_:y)(r));l=k(i,o),0>o&&(l=H(l,-o));var s=r;do{a.push(s),l*i>(s=H(s+l,R.get(l)))||(l=s)}while(t>=s);return a}function We(n,e,r,t,l){var a=n.scales[n.axes[e].scale].asinh,i=t>a?Pe(n,e,b(a,r),t,l):[a],o=0>t||r>0?[]:[0];return(-a>r?Pe(n,e,b(a,-t),-r,l):[a]).reverse().map((n=>-n)).concat(o,i)}var Ye=/./,Ce=/[12357]/,Fe=/[125]/,He=/1/;function Re(n,e,r){var t=n.axes[r],l=t.scale,a=n.scales[l];if(3==a.distr&&2==a.log)return e;var i=n.valToPos,o=t._space,s=i(10,l),u=i(9,l)-s4==a.distr&&0==n||u.test(n)?n:null))}function Le(n,e){return null==e?"":v(e)}var Ie={show:!0,scale:"y",stroke:ln,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ze,side:3,grid:ye,ticks:Me,font:Se,rotate:0};function Ge(n,e){return H((3+2*(n||1))*e,3)}function Oe(n,e){var r=n.scales[n.series[e].scale],t=n.bands&&n.bands.some((n=>n.series[0]==e));return 3==r.distr||t?r.min:0}var je={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,alpha:1,points:{show:function(n,e){var r=n.series[0],t=r.scale,l=r.idxs,a=n.data[0],i=n.valToPos(a[l[0]],t,!0),o=n.valToPos(a[l[1]],t,!0);return p(o-i)/(n.series[e].points.space*Z)>=l[1]-l[0]},filter:null},values:null,min:S,max:-S,idxs:[],path:null,clip:null};function Be(n,e,r){return r/10}var Ne={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Ve=J({},Ne,{time:!1,ori:1}),Ue={};function Je(n){var e=Ue[n];return e||(e={key:n,plots:[],sub:function(n){e.plots.push(n)},unsub:function(n){e.plots=e.plots.filter((e=>e!=n))},pub:function(n,r,t,l,a,i,o){for(var s=0;e.plots.length>s;s++)e.plots[s]!=r&&e.plots[s].pub(n,r,t,l,a,i,o)}},null!=n&&(Ue[n]=e)),e}function qe(n,e,r){var t=n.series[e],l=n.scales,a=n.bbox,i=n._data[0],o=n._data[e],s=l[n.series[0].scale],u=l[t.scale],f=a.left,c=a.top,v=a.width,h=a.height,d=n.valToPosH,p=n.valToPosV;return 0==s.ori?r(t,i,o,s,u,d,p,f,c,v,h,$e,er,tr,ar,or):r(t,i,o,s,u,p,d,c,f,h,v,nr,rr,lr,ir,sr)}function Ze(n,e,r,t,l){return qe(n,e,((n,e,a,i,o,s,u,f,c,v,h)=>{var d,p,m=0==i.ori?er:rr;1==i.dir*(0==i.ori?1:-1)?(d=r,p=t):(d=t,p=r);var g=z(s(e[d],i,v,f),.5),x=z(u(a[d],o,h,c),.5),w=z(s(e[p],i,v,f),.5),b=z(u(o.max,o,h,c),.5),k=new Path2D(l);return m(k,w,b),m(k,g,b),m(k,g,x),k}))}function Ke(n,e,r,t,l,a){var i=null;if(n.length>0){i=new Path2D;for(var o=0==e?tr:lr,s=r,u=0;n.length>u;u++){var f=n[u];f[1]!=f[0]&&(o(i,s,t,f[0]-s,t+a),s=f[1])}o(i,s,t,r+l-s,t+a)}return i}function Xe(n,e,r){var t=n[n.length-1];t&&t[0]==e?t[1]=r:n.push([e,r])}function Qe(n){return 0==n?T:1==n?g:e=>z(e,n)}function $e(n,e,r){n.moveTo(e,r)}function nr(n,e,r){n.moveTo(r,e)}function er(n,e,r){n.lineTo(e,r)}function rr(n,e,r){n.lineTo(r,e)}function tr(n,e,r,t,l){n.rect(e,r,t,l)}function lr(n,e,r,t,l){n.rect(r,e,l,t)}function ar(n,e,r,t,l,a){n.arc(e,r,t,l,a)}function ir(n,e,r,t,l,a){n.arc(r,e,t,l,a)}function or(n,e,r,t,l,a,i){n.bezierCurveTo(e,r,t,l,a,i)}function sr(n,e,r,t,l,a,i){n.bezierCurveTo(r,e,l,t,i,a)}function ur(n){return(e,r,t,l,a,i)=>{t!=l&&(a!=t&&i!=t&&n(e,r,t),a!=l&&i!=l&&n(e,r,l),n(e,r,i))}}var fr=ur(er),cr=ur(rr);function vr(){return(n,r,t,l)=>qe(n,r,((a,i,o,s,u,f,c,v,h,d,p)=>{var m,g,x=a.pxRound;0==s.ori?(m=er,g=fr):(m=rr,g=cr);var k,_,y,M,D=s.dir*(0==s.ori?1:-1),E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:[],flags:1},T=E.stroke,A=S,P=-S,W=E.gaps,Y=x(f(i[1==D?t:l],s,d,v)),C=!1,F=!1,H=e(o,t,l,1*D),R=e(o,t,l,-1*D),L=z(f(i[H],s,d,v),.5),I=z(f(i[R],s,d,v),.5);L>v&&Xe(W,v,L);for(var G=1==D?t:l;G>=t&&l>=G;G+=D){var O=x(f(i[G],s,d,v));if(O==Y)null!=o[G]?(_=x(c(o[G],u,p,h)),A==S&&(m(T,O,_),k=_),A=w(_,A),P=b(_,P)):null===o[G]&&(C=F=!0);else{var j=!1;A!=S?(g(T,Y,A,P,k,_),y=M=Y):C&&(j=!0,C=!1),null!=o[G]?(m(T,O,_=x(c(o[G],u,p,h))),A=P=k=_,F&&O-Y>1&&(j=!0),F=!1):(A=S,P=-S,null===o[G]&&(C=!0,O-Y>1&&(j=!0))),j&&Xe(W,y,O),Y=O}}if(A!=S&&A!=P&&M!=Y&&g(T,Y,A,P,k,_),v+d>I&&Xe(W,I,v+d),null!=a.fill){var B=E.fill=new Path2D(T),N=x(c(a.fillTo(n,r,a.min,a.max),u,p,h));m(B,I,N),m(B,L,N)}return a.spanGaps||(E.clip=Ke(W,s.ori,v,h,d,p)),n.bands.length>0&&(E.band=Ze(n,r,t,l,T)),E}))}function hr(n,e,r,t,l){var a=n.length;if(2>a)return null;var i=new Path2D;if(r(i,n[0],e[0]),2==a)t(i,n[1],e[1]);else{for(var o=Array(a),s=Array(a-1),u=Array(a-1),f=Array(a-1),c=0;a-1>c;c++)u[c]=e[c+1]-e[c],f[c]=n[c+1]-n[c],s[c]=u[c]/f[c];o[0]=s[0];for(var v=1;a-1>v;v++)0===s[v]||0===s[v-1]||s[v-1]>0!=s[v]>0?o[v]=0:(o[v]=3*(f[v-1]+f[v])/((2*f[v]+f[v-1])/s[v-1]+(f[v]+2*f[v-1])/s[v]),isFinite(o[v])||(o[v]=0));o[a-1]=s[a-2];for(var h=0;a-1>h;h++)l(i,n[h]+f[h]/3,e[h]+o[h]*f[h]/3,n[h+1]-f[h]/3,e[h+1]-o[h+1]*f[h]/3,n[h+1],e[h+1])}return i}var dr=new Set;function pr(){dr.forEach((n=>{n.syncRect(!0)}))}An("resize",xn,pr),An("scroll",xn,pr,!0);var mr=vr(),gr=function(){return(n,e,r,t,l)=>qe(n,e,((e,a,i,o,s,u,f,c,v,h,p)=>{var m,g,x=e.pxRound,w=e.points;0==o.ori?(m=$e,g=ar):(m=nr,g=ir);var b=H(w.width*Z,3),k=(w.size-w.width)/2*Z,_=H(2*k,3),y=new Path2D,M=new Path2D,S=n.bbox;tr(M,S.left-_,S.top-_,S.width+2*_,S.height+2*_);var z=n=>{if(null!=i[n]){var e=x(u(a[n],o,h,c)),r=x(f(i[n],s,p,v));m(y,e+k,r),g(y,e,r,k,0,2*d)}};if(l)l.forEach(z);else for(var D=r;t>=D;D++)z(D);return{stroke:b>0?y:null,fill:y,clip:M,flags:3}}))}();function xr(n,e,r,t){return(t?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map(((n,t)=>wr(n,t,e,r)))}function wr(n,e,r,t){return J({},0==e?r:t,n)}function br(n,e,r){return null==e?O:[e,r]}var kr=br;function _r(n,e,r){return null==e?O:u(e,r,.1,!0)}function yr(n,e,r,t){return null==e?O:l(e,r,n.scales[t].log,!1)}var Mr=yr;function Sr(n,e,r,t){return null==e?O:a(e,r,n.scales[t].log,!1)}var zr=Sr;function Dr(n){var e,r;return[n=n.replace(/(\d+)px/,((n,t)=>(e=g((r=+t)*Z))+"px")),e,r]}function Er(n){n.show&&[n.font,n.labelFont].forEach((n=>{var e=H(n[2]*Z,1);n[0]=n[0].replace(/[0-9.]+px/,e+"px"),n[1]=e}))}function Tr(e,r,t){var o={};function s(n,e){return((3==e.distr?_(n>0?n:e.clamp(o,n,e.min,e.max,e.key)):4==e.distr?M(n,e.asinh):n)-e._min)/(e._max-e._min)}function c(n,e,r,t){var l=s(n,e);return t+r*(-1==e.dir?1-l:l)}function v(n,e,r,t){var l=s(n,e);return t+r*(-1==e.dir?l:1-l)}function y(n,e,r,t){return 0==e.ori?c(n,e,r,t):v(n,e,r,t)}o.valToPosH=c,o.valToPosV=v;var T=!1;o.status=0;var F=o.root=yn("uplot");null!=e.id&&(F.id=e.id),wn(F,e.class),e.title&&(yn("u-title",F).textContent=e.title);var L=_n("canvas"),I=o.ctx=L.getContext("2d"),q=yn("u-wrap",F),K=o.under=yn("u-under",q);q.appendChild(L);var ln=o.over=yn("u-over",q),hn=+f((e=U(e)).pxAlign,1),Mn=Qe(hn);(e.plugins||[]).forEach((n=>{n.opts&&(e=n.opts(o,e)||e)}));var zn=e.ms||.001,En=o.series=xr(e.series||[],Ee,je,!1),Tn=o.axes=xr(e.axes||[],De,Ie,!0),Wn=o.scales={},Yn=o.bands=e.bands||[];Yn.forEach((n=>{n.fill=E(n.fill||null)}));var Cn=En[0].scale,Fn={axes:function(){Tn.forEach(((n,e)=>{if(n.show&&n._show){var r,t,l=n.side,a=l%2,i=n.stroke(o,e),s=0==l||3==l?-1:1;if(n.label){var u=g((n._lpos+n.labelGap*s)*Z);I.save(),1==a?(r=t=0,I.translate(u,g(nr+rr/2)),I.rotate((3==l?-d:d)/2)):(r=g($e+er/2),t=u),I.font=n.labelFont[0],I.fillStyle=i,I.textAlign="center",I.textBaseline=2==l?nn:en,I.fillText(n.label,r,t),I.restore()}var f=n._found,c=f[0],v=f[1];if(0!=v){var h=Wn[n.scale],p=0==a?er:rr,m=0==a?$e:nr,x=g(n.gap*Z),w=n._splits,b=2==h.distr?w.map((n=>Lr[n])):w,k=2==h.distr?Lr[w[1]]-Lr[w[0]]:c,_=n.ticks,M=_.show?g(_.size*Z):0,S=n._rotate*-d/180,z=Mn(n._pos*Z),D=z+(M+x)*s;t=0==a?D:0,r=1==a?D:0,I.font=n.font[0],I.fillStyle=i,I.textAlign=1==n.align?rn:2==n.align?tn:S>0?rn:0>S?tn:0==a?"center":3==l?tn:rn,I.textBaseline=S||1==a?"middle":2==l?nn:en;var E=1.5*n.font[1],T=w.map((n=>Mn(y(n,h,p,m))));n._values.forEach(((n,e)=>{null!=n&&(0==a?r=T[e]:t=T[e],(""+n).split(/\n/gm).forEach(((n,e)=>{S?(I.save(),I.translate(r,t+e*E),I.rotate(S),I.fillText(n,0,0),I.restore()):I.fillText(n,r,t+e*E)})))})),_.show&&Jr(T,_.filter(o,b,e,v,k),a,l,z,M,H(_.width*Z,3),_.stroke(o,e),_.dash,_.cap);var A=n.grid;A.show&&Jr(T,A.filter(o,b,e,v,k),a,0==a?2:1,0==a?nr:$e,0==a?rr:er,H(A.width*Z,3),A.stroke(o,e),A.dash,A.cap)}}})),Ut("drawAxes")},series:function(){Wr>0&&(En.forEach(((n,e)=>{if(e>0&&n.show&&null==n._paths){var t=function(n){for(var e=D(Fr-1,0,Wr-1),r=D(Hr+1,0,Wr-1);null==n[e]&&e>0;)e--;for(;null==n[r]&&Wr-1>r;)r++;return[e,r]}(r[e]);n._paths=n.paths(o,e,t[0],t[1])}})),En.forEach(((n,e)=>{if(e>0&&n.show){n._paths&&Br(e,!1);var r=n.points.show(o,e,Fr,Hr),t=n.points.filter(o,e,r,n._paths?n._paths.gaps:null);(r||t)&&(n.points._paths=n.points.paths(o,e,Fr,Hr,t),Br(e,!0)),Ut("drawSeries",e)}})))}},Hn=(e.drawOrder||["axes","series"]).map((n=>Fn[n]));function Rn(n){var r=Wn[n];if(null==r){var t=(e.scales||G)[n]||G;if(null!=t.from)Rn(t.from),Wn[n]=J({},Wn[t.from],t);else{(r=Wn[n]=J({},n==Cn?Ne:Ve,t)).key=n;var l=r.time,a=r.range,o=j(a);if(n!=Cn&&(!o||null!=a[0]&&null!=a[1]||(a={min:null==a[0]?i:{mode:1,hard:a[0],soft:a[0]},max:null==a[1]?i:{mode:1,hard:a[1],soft:a[1]}},o=!1),!o&&N(a))){var s=a;a=(n,e,r)=>null==e?O:u(e,r,s)}r.range=E(a||(l?kr:n==Cn?3==r.distr?Mr:4==r.distr?zr:br:3==r.distr?yr:4==r.distr?Sr:_r)),r.auto=E(!o&&r.auto),r.clamp=E(r.clamp||Be),r._min=r._max=null}}}for(var Ln in Rn("x"),Rn("y"),En.forEach((n=>{Rn(n.scale)})),Tn.forEach((n=>{Rn(n.scale)})),e.scales)Rn(Ln);var In,On,jn=Wn[Cn],Bn=jn.distr;0==jn.ori?(wn(F,"u-hz"),In=c,On=v):(wn(F,"u-vt"),In=v,On=c);var Nn={};for(var Vn in Wn){var qn=Wn[Vn];null==qn.min&&null==qn.max||(Nn[Vn]={min:qn.min,max:qn.max},qn.min=qn.max=null)}var Zn,Kn=e.tzDate||(n=>new Date(g(n/zn))),Xn=e.fmtDate||Gn,Qn=1==zn?se(Kn):ve(Kn),$n=de(Kn,he(1==zn?oe:ce,Xn)),ne=ge(Kn,me("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Xn)),ee=o.legend=J({},xe,e.legend),re=ee.show,te=ee.markers;te.width=E(te.width),te.dash=E(te.dash),te.stroke=E(te.stroke),te.fill=E(te.fill);var le,ae=[],ue=[],pe=!1,we={};if(ee.live){var be=En[1]?En[1].values:null;for(var ke in le=(pe=null!=be)?be(o,1,0):{_:0})we[ke]="--"}if(re)if(Zn=_n("table","u-legend",F),pe){var ye=_n("tr","u-thead",Zn);for(var Me in _n("th",null,ye),le)_n("th",mn,ye).textContent=Me}else wn(Zn,"u-inline"),ee.live&&wn(Zn,"u-live");var Se={show:!0},ze={show:!1},Ye=new Map;function Ce(n,e,r){var t=Ye.get(e)||{},l=fr.bind[n](o,e,r);l&&(An(n,e,t[n]=l),Ye.set(e,t))}function Fe(n,e){var r=Ye.get(e)||{};for(var t in r)null!=n&&t!=n||(Pn(t,e,r[t]),delete r[t]);null==n&&Ye.delete(e)}var He=0,Ue=0,qe=0,Ze=0,Ke=0,Xe=0,$e=0,nr=0,er=0,rr=0;o.bbox={};var tr=!1,lr=!1,ar=!1,ir=!1,or=!1;function sr(n,e,r){(r||n!=o.width||e!=o.height)&&ur(n,e),Kr(!1),ar=!0,lr=!0,ir=fr.left>=0,or=!0,ft()}function ur(n,e){o.width=He=qe=n,o.height=Ue=Ze=e,Ke=Xe=0,function(){var n=!1,e=!1,r=!1,t=!1;Tn.forEach((l=>{if(l.show&&l._show){var a=l.side,i=a%2,o=l._size+(l.labelSize=null!=l.label?l.labelSize||30:0);o>0&&(i?(qe-=o,3==a?(Ke+=o,t=!0):r=!0):(Ze-=o,0==a?(Xe+=o,n=!0):e=!0))}})),Ar[0]=n,Ar[1]=r,Ar[2]=e,Ar[3]=t,qe-=Cr[1]+Cr[3],Ke+=Cr[3],Ze-=Cr[2]+Cr[0],Xe+=Cr[0]}(),function(){var n=Ke+qe,e=Xe+Ze,r=Ke,t=Xe;function l(l,a){switch(l){case 1:return(n+=a)-a;case 2:return(e+=a)-a;case 3:return(r-=a)+a;case 0:return(t-=a)+a}}Tn.forEach((n=>{if(n.show&&n._show){var e=n.side;n._pos=l(e,n._size),null!=n.label&&(n._lpos=l(e,n.labelSize))}}))}();var r=o.bbox;$e=r.left=z(Ke*Z,.5),nr=r.top=z(Xe*Z,.5),er=r.width=z(qe*Z,.5),rr=r.height=z(Ze*Z,.5)}o.setSize=function(n){sr(n.width,n.height)};var fr=o.cursor=J({},_e,e.cursor);fr._lock=!1;var cr=fr.points;cr.show=E(cr.show),cr.size=E(cr.size),cr.stroke=E(cr.stroke),cr.width=E(cr.width),cr.fill=E(cr.fill);var vr=o.focus=J({},e.focus||{alpha:.3},fr.focus),hr=vr.prox>=0,pr=[null];function Tr(n,e){var r=Wn[n.scale].time,t=n.value;if(n.value=r?B(t)?ge(Kn,me(t,Xn)):t||ne:t||Le,n.label=n.label||(r?"Time":"Value"),e>0){n.width=null==n.width?1:n.width,n.paths=n.paths||mr||P,n.fillTo=E(n.fillTo||Oe),n.pxAlign=+f(n.pxAlign,hn),n.pxRound=Qe(n.pxAlign),n.stroke=E(n.stroke||null),n.fill=E(n.fill||null),n._stroke=n._fill=n._paths=n._focus=null;var l=Ge(n.width,1),a=n.points=J({},{size:l,width:b(1,.2*l),stroke:n.stroke,space:2*l,paths:gr,_stroke:null,_fill:null},n.points);a.show=E(a.show),a.filter=E(a.filter),a.fill=E(a.fill),a.stroke=E(a.stroke),a.paths=E(a.paths),a.pxAlign=n.pxAlign}if(re){var i=function(n,e){if(0==e&&(pe||!ee.live))return O;var r=[],t=_n("tr","u-series",Zn,Zn.childNodes[e]);wn(t,n.class),n.show||wn(t,pn);var l=_n("th",null,t);if(te.show){var a=yn("u-marker",l);if(e>0){var i=te.width(o,e);i&&(a.style.border=i+"px "+te.dash(o,e)+" "+te.stroke(o,e)),a.style.background=te.fill(o,e)}}var s=yn(mn,l);for(var u in s.textContent=n.label,e>0&&(te.show||(s.style.color=n.width>0?te.stroke(o,e):te.fill(o,e)),Ce("click",l,(e=>{if(!fr._lock){var r=En.indexOf(n);if(e.ctrlKey!=ee.isolate){var t=En.some(((n,e)=>e>0&&e!=r&&n.show));En.forEach(((n,e)=>{e>0&&Mt(e,t?e==r?Se:ze:Se,Jt.setSeries)}))}else Mt(r,{show:!n.show},Jt.setSeries)}})),hr&&Ce(fn,l,(()=>{fr._lock||Mt(En.indexOf(n),St,Jt.setSeries)}))),le){var f=_n("td","u-value",t);f.textContent="--",r.push(f)}return[t,r]}(n,e);ae.splice(e,0,i[0]),ue.splice(e,0,i[1]),ee.values.push(null)}if(fr.show){fr.idxs.splice(e,0,null);var s=function(n,e){if(e>0){var r=fr.points.show(o,e);if(r)return wn(r,"u-cursor-pt"),wn(r,n.class),Sn(r,-10,-10,qe,Ze),ln.insertBefore(r,pr[e]),r}}(n,e);s&&pr.splice(e,0,s)}}o.addSeries=function(n,e){n=wr(n,e=null==e?En.length:e,Ee,je),En.splice(e,0,n),Tr(En[e],e)},o.delSeries=function(n){if(En.splice(n,1),re){ee.values.splice(n,1),ue.splice(n,1);var e=ae.splice(n,1)[0];Fe(null,e.firstChild),e.remove()}fr.show&&(fr.idxs.splice(n,1),pr.length>1&&pr.splice(n,1)[0].remove())};var Ar=[!1,!1,!1,!1];function Pr(n,e,r){var t=r[0],l=r[1],a=r[2],i=r[3],o=e%2,s=0;return 0==o&&(i||l)&&(s=0==e&&!t||2==e&&!a?g(De.size/3):0),1==o&&(t||a)&&(s=1==e&&!l||3==e&&!i?g(Ie.size/2):0),s}var Wr,Yr=o.padding=(e.padding||[Pr,Pr,Pr,Pr]).map((n=>E(f(n,Pr)))),Cr=o._padding=Yr.map(((n,e)=>n(o,e,Ar,0))),Fr=null,Hr=null,Rr=En[0].idxs,Lr=null,Ir=!1;function Gr(n,e){if((r=(n||[]).slice())[0]=r[0]||[],o.data=r.slice(),Wr=(Lr=r[0]).length,2==Bn&&(r[0]=Lr.map(((n,e)=>e))),o._data=r,Kr(!0),Ut("setData"),!1!==e){var t=jn;t.auto(o,Ir)?Or():yt(Cn,t.min,t.max),ir=fr.left>=0,or=!0,ft()}}function Or(){var n,e,t,i,o;Ir=!0,Wr>0?(Fr=Rr[0]=0,Hr=Rr[1]=Wr-1,i=r[0][Fr],o=r[0][Hr],2==Bn?(i=Fr,o=Hr):1==Wr&&(3==Bn?(i=(n=l(i,i,jn.log,!1))[0],o=n[1]):4==Bn?(i=(e=a(i,i,jn.log,!1))[0],o=e[1]):jn.time?o=i+g(86400/zn):(i=(t=u(i,o,.1,!0))[0],o=t[1]))):(Fr=Rr[0]=i=null,Hr=Rr[1]=o=null),yt(Cn,i,o)}function jr(n,e,r,t,l){I.strokeStyle=n||an,I.lineWidth=e,I.lineJoin="round",I.lineCap=t||"butt",I.setLineDash(r||[]),I.fillStyle=l||an}function Br(n,e){var r=e?En[n].points:En[n],t=r._paths,l=t.stroke,a=t.fill,i=t.clip,s=t.flags,u=H(r.width*Z,3),f=u%2/2,c=r._stroke=r.stroke(o,n),v=r._fill=r.fill(o,n);e&&null==v&&(v=u>0?"#fff":c),I.globalAlpha=r.alpha;var h=1==r.pxAlign;if(h&&I.translate(f,f),I.save(),!e){var d=$e,p=nr,m=er,g=rr,x=u*Z/2;0==r.min&&(g+=x),0==r.max&&(p-=x,g+=x),I.beginPath(),I.rect(d,p,m,g),I.clip()}i&&I.clip(i),e?Nr(c,u,r.dash,r.cap,v,l,a,null,s):function(n,e,r,t,l,a,i,s,u){var f=!1;Yn.forEach(((c,v)=>{if(c.series[0]==n){var h=En[c.series[1]],d=(h._paths||G).band;I.save();var p=null;h.show&&d?p=c.fill(o,v)||a:d=null,Nr(e,r,t,l,p,i,s,d,u),I.restore(),f=!0}})),f||Nr(e,r,t,l,a,i,s,null,u)}(n,c,u,r.dash,r.cap,v,l,a,s),I.restore(),h&&I.translate(-f,-f),I.globalAlpha=1}function Nr(n,e,r,t,l,a,i,o,s){jr(n,e,r,t,l),o?3==(3&s)?(I.clip(o),Ur(l,i),Vr(n,a,e)):2&s?(Ur(l,i),I.clip(o),Vr(n,a,e)):1&s&&(I.save(),I.clip(o),Ur(l,i),I.restore(),Vr(n,a,e)):(Ur(l,i),Vr(n,a,e))}function Vr(n,e,r){n&&e&&r&&I.stroke(e)}function Ur(n,e){n&&e&&I.fill(e)}function Jr(n,e,r,t,l,a,i,o,s,u){var f=i%2/2;1==hn&&I.translate(f,f),jr(o,i,s,u),I.beginPath();var c,v,h,d,p=l+(0==t||3==t?-a:a);0==r?(v=l,d=p):(c=l,h=p),n.forEach(((n,t)=>{null!=e[t]&&(0==r?c=h=n:v=d=n,I.moveTo(c,v),I.lineTo(h,d))})),I.stroke(),1==hn&&I.translate(-f,-f)}function qr(n){var e=!0;return Tn.forEach(((r,t)=>{if(r.show){var l=Wn[r.scale];if(null!=l.min){r._show||(e=!1,r._show=!0,Kr(!1));var a=r.side,i=l.min,s=l.max,u=function(n,e,r,t){var l,a=Tn[n];if(t>0){var i=a._space=a.space(o,n,e,r,t),s=a._incrs=a.incrs(o,n,e,r,t,i);l=a._found=function(n,e,r,t,l){for(var a=t/(e-n),i=(""+m(n)).length,o=0;r.length>o;o++){var s=r[o]*a,u=10>r[o]?R.get(r[o]):0;if(s>=l&&17>i+u)return[r[o],s]}return[0,0]}(e,r,s,t,i)}else l=[0,0];return l}(t,i,s,0==a%2?qe:Ze),f=u[0],c=u[1];if(0!=c){var v=r._splits=r.splits(o,t,i,s,f,c,2==l.distr),h=2==l.distr?v.map((n=>Lr[n])):v,d=2==l.distr?Lr[v[1]]-Lr[v[0]]:f,p=r._values=r.values(o,r.filter(o,h,t,c,d),t,c,d);r._rotate=2==a?r.rotate(o,p,t,c):0;var g=r._size;r._size=x(r.size(o,p,t,n)),null!=g&&r._size!=g&&(e=!1)}}else r._show&&(e=!1,r._show=!1,Kr(!1))}})),e}function Zr(n){var e=!0;return Yr.forEach(((r,t)=>{var l=r(o,t,Ar,n);l!=Cr[t]&&(e=!1),Cr[t]=l})),e}function Kr(n){En.forEach(((e,r)=>{r>0&&(e._paths=null,n&&(e.min=null,e.max=null))}))}o.setData=Gr;var Xr,Qr,$r,nt,et,rt,tt,lt,at,it,ot,st,ut=!1;function ft(){ut||(X(ct),ut=!0)}function ct(){tr&&(function(){var e=U(Wn,V);for(var t in e){var l=e[t],a=Nn[t];if(null!=a&&null!=a.min)J(l,a),t==Cn&&Kr(!0);else if(t!=Cn)if(0==Wr&&null==l.from){var i=l.range(o,null,null,t);l.min=i[0],l.max=i[1]}else l.min=S,l.max=-S}if(Wr>0)for(var s in En.forEach(((t,l)=>{var a=t.scale,i=e[a],s=Nn[a];if(0==l){var u=i.range(o,i.min,i.max,a);i.min=u[0],i.max=u[1],Fr=n(i.min,r[0]),Hr=n(i.max,r[0]),i.min>r[0][Fr]&&Fr++,r[0][Hr]>i.max&&Hr--,t.min=Lr[Fr],t.max=Lr[Hr]}else if(t.show&&t.auto&&i.auto(o,Ir)&&(null==s||null==s.min)){var f=null==t.min?3==i.distr?function(n,e,r){for(var t=S,l=-S,a=e;r>=a;a++)n[a]>0&&(t=w(t,n[a]),l=b(l,n[a]));return[t==S?1:t,l==-S?10:l]}(r[l],Fr,Hr):function(n,e,r,t){var l=S,a=-S;if(1==t)l=n[e],a=n[r];else if(-1==t)l=n[r],a=n[e];else for(var i=e;r>=i;i++)null!=n[i]&&(l=w(l,n[i]),a=b(a,n[i]));return[l,a]}(r[l],Fr,Hr,t.sorted):[t.min,t.max];i.min=w(i.min,t.min=f[0]),i.max=b(i.max,t.max=f[1])}t.idxs[0]=Fr,t.idxs[1]=Hr})),e){var u=e[s],f=Nn[s];if(null==u.from&&(null==f||null==f.min)){var c=u.range(o,u.min==S?null:u.min,u.max==-S?null:u.max,s);u.min=c[0],u.max=c[1]}}for(var v in e){var h=e[v];if(null!=h.from){var d=e[h.from],p=h.range(o,d.min,d.max,v);h.min=p[0],h.max=p[1]}}var m={},g=!1;for(var x in e){var k=e[x],y=Wn[x];if(y.min!=k.min||y.max!=k.max){y.min=k.min,y.max=k.max;var z=y.distr;y._min=3==z?_(y.min):4==z?M(y.min,y.asinh):y.min,y._max=3==z?_(y.max):4==z?M(y.max,y.asinh):y.max,m[x]=g=!0}}if(g){for(var D in En.forEach((n=>{m[n.scale]&&(n._paths=null)})),m)ar=!0,Ut("setScale",D);fr.show&&(ir=fr.left>=0)}for(var E in Nn)Nn[E]=null}(),tr=!1),ar&&(function(){for(var n=!1,e=0;!n;){var r=qr(++e),t=Zr(e);(n=3==e||r&&t)||(ur(o.width,o.height),lr=!0)}}(),ar=!1),lr&&(kn(K,rn,Ke),kn(K,nn,Xe),kn(K,Q,qe),kn(K,$,Ze),kn(ln,rn,Ke),kn(ln,nn,Xe),kn(ln,Q,qe),kn(ln,$,Ze),kn(q,Q,He),kn(q,$,Ue),L.width=g(He*Z),L.height=g(Ue*Z),Ht(!1),Ut("setSize"),lr=!1),He>0&&Ue>0&&(I.clearRect(0,0,L.width,L.height),Ut("drawClear"),Hn.forEach((n=>n())),Ut("draw")),fr.show&&ir&&(Ct(),ir=!1),T||(T=!0,o.status=1,Ut("ready")),Ir=!1,ut=!1}function vt(e,t){var l=Wn[e];if(null==l.from){if(0==Wr){var a=l.range(o,t.min,t.max,e);t.min=a[0],t.max=a[1]}if(t.min>t.max){var i=t.min;t.min=t.max,t.max=i}if(Wr>1&&null!=t.min&&null!=t.max&&1e-16>t.max-t.min)return;e==Cn&&2==l.distr&&Wr>0&&(t.min=n(t.min,r[0]),t.max=n(t.max,r[0])),Nn[e]=t,tr=!0,ft()}}o.redraw=(n,e)=>{ar=e||!1,!1!==n?yt(Cn,jn.min,jn.max):ft()},o.setScale=vt;var ht=!1,dt=fr.drag,pt=dt.x,mt=dt.y;fr.show&&(fr.x&&(Xr=yn("u-cursor-x",ln)),fr.y&&(Qr=yn("u-cursor-y",ln)),0==jn.ori?($r=Xr,nt=Qr):($r=Qr,nt=Xr),ot=fr.left,st=fr.top);var gt,xt,wt,bt=o.select=J({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),kt=bt.show?yn("u-select",bt.over?ln:K):null;function _t(n,e){if(bt.show){for(var r in n)kn(kt,r,bt[r]=n[r]);!1!==e&&Ut("setSelect")}}function yt(n,e,r){vt(n,{min:e,max:r})}function Mt(n,e,r){var t=En[n];null!=e.focus&&function(n){if(n!=wt){var e=null==n,r=1!=vr.alpha;En.forEach(((t,l)=>{var a=e||0==l||l==n;t._focus=e?null:a,r&&function(n,e){En[n].alpha=e,fr.show&&pr[n]&&(pr[n].style.opacity=e),re&&ae[n]&&(ae[n].style.opacity=e)}(l,a?1:vr.alpha)})),wt=n,r&&ft()}}(n),null!=e.show&&(t.show=e.show,function(n){var e=re?ae[n]:null;En[n].show?e&&bn(e,pn):(e&&wn(e,pn),pr.length>1&&Sn(pr[n],-10,-10,qe,Ze))}(n),yt(t.scale,null,null),ft()),Ut("setSeries",n,e),r&&Kt("setSeries",o,n,e)}o.setSelect=_t,o.setSeries=Mt,o.addBand=function(n,e){n.fill=E(n.fill||null),Yn.splice(e=null==e?Yn.length:e,0,n)},o.setBand=function(n,e){J(Yn[n],e)},o.delBand=function(n){null==n?Yn.length=0:Yn.splice(n,1)};var St={focus:!0},zt={focus:!1};function Dt(n,e,r){var t=Wn[e];r&&(n=n/Z-(1==t.ori?Xe:Ke));var l=qe;1==t.ori&&(n=(l=Ze)-n),-1==t.dir&&(n=l-n);var a=t._min,i=a+n/l*(t._max-a),o=t.distr;return 3==o?k(10,i):4==o?((n,e)=>(void 0===e&&(e=1),h.sinh(n/e)))(i,t.asinh):i}function Et(n,e){kn(kt,rn,bt.left=n),kn(kt,Q,bt.width=e)}function Tt(n,e){kn(kt,nn,bt.top=n),kn(kt,$,bt.height=e)}re&&hr&&An(cn,Zn,(()=>{fr._lock||(Mt(null,zt,Jt.setSeries),Ct())})),o.valToIdx=e=>n(e,r[0]),o.posToIdx=function(e,t){return n(Dt(e,Cn,t),r[0],Fr,Hr)},o.posToVal=Dt,o.valToPos=(n,e,r)=>0==Wn[e].ori?c(n,Wn[e],r?er:qe,r?$e:0):v(n,Wn[e],r?rr:Ze,r?nr:0),o.batch=function(n){n(o),ft()},o.setCursor=(n,e)=>{ot=n.left,st=n.top,Ct(null,null,e)};var At=0==jn.ori?Et:Tt,Pt=1==jn.ori?Et:Tt;function Wt(n,e){if(null!=n){var r=n.idx;ee.idx=r,En.forEach(((n,e)=>{(e>0||!pe)&&Yt(e,r)}))}re&&ee.live&&function(){if(re&&ee.live)for(var n=0;En.length>n;n++)if(0!=n||!pe){var e=ee.values[n],r=0;for(var t in e)ue[n][r++].firstChild.nodeValue=e[t]}}(),or=!1,!1!==e&&Ut("setLegend")}function Yt(n,e){var t;if(null==e)t=we;else{var l=En[n],a=0==n&&2==Bn?Lr:r[n];t=pe?l.values(o,n,e):{_:l.value(o,a[e],n,e)}}ee.values[n]=t}function Ct(e,t,l){var a,i;at=ot,it=st,a=fr.move(o,ot,st),ot=a[0],st=a[1],fr.show&&($r&&Sn($r,g(ot),0,qe,Ze),nt&&Sn(nt,0,g(st),qe,Ze));var s=!1;gt=S;var u=0==jn.ori?qe:Ze,f=1==jn.ori?qe:Ze;if(0>ot||0==Wr||Fr>Hr){i=null;for(var c=0;En.length>c;c++)c>0&&pr.length>1&&Sn(pr[c],-10,-10,qe,Ze);if(hr&&Mt(null,St,Jt.setSeries),ee.live){s=!0;for(var v=0;En.length>v;v++)ee.values[v]=we}}else{var h=Dt(0==jn.ori?ot:st,Cn);i=n(h,r[0],Fr,Hr);for(var d=C(In(r[0][i],jn,u,0),.5),m=0;En.length>m;m++){var x=En[m],b=fr.dataIdx(o,m,i,h);fr.idxs[m]=b;var k=b==i?d:C(In(r[0][b],jn,u,0),.5);if(m>0&&x.show){var _=r[m][b],y=null==_?-10:C(On(_,Wn[x.scale],f,0),.5);if(y>0){var M=p(y-st);M>gt||(gt=M,xt=m)}var z=void 0,D=void 0;0==jn.ori?(z=k,D=y):(z=y,D=k),pr.length>1&&(Sn(pr[m],z,D,qe,Ze),Dn(pr[m],fr.points.fill(o,m),fr.points.stroke(o,m)))}if(ee.live){if(b==fr.idx&&!or||0==m&&pe)continue;s=!0,Yt(m,b)}}}if(s&&(ee.idx=i,Wt()),bt.show&&ht)if(null!=t){var E=Jt.scales,A=E[0],P=E[1],W=Jt.match,Y=W[1],F=t.cursor.sync.scales,H=F[0],R=F[1],L=t.cursor.drag;pt=L._x,mt=L._y;var I,G,O,j,B,N=t.select,V=N.left,U=N.top,J=N.width,q=N.height,Z=t.scales[A].ori,K=t.posToVal,X=null!=A&&(0,W[0])(A,H),Q=null!=P&&Y(P,R);X&&(0==Z?(I=V,G=J):(I=U,G=q),pt?(O=Wn[A],j=In(K(I,H),O,u,0),B=In(K(I+G,H),O,u,0),At(w(j,B),p(B-j))):At(0,u),Q||Pt(0,f)),Q&&(1==Z?(I=V,G=J):(I=U,G=q),mt?(O=Wn[P],j=On(K(I,R),O,f,0),B=On(K(I+G,R),O,f,0),Pt(w(j,B),p(B-j))):Pt(0,f),X||At(0,u))}else{var $=p(at-et),nn=p(it-rt);if(1==jn.ori){var en=$;$=nn,nn=en}pt=dt.x&&$>=dt.dist,mt=dt.y&&nn>=dt.dist;var rn,tn,ln=dt.uni;null!=ln?pt&&mt&&(mt=nn>=ln,(pt=$>=ln)||mt||(nn>$?mt=!0:pt=!0)):dt.x&&dt.y&&(pt||mt)&&(pt=mt=!0),pt&&(0==jn.ori?(rn=tt,tn=ot):(rn=lt,tn=st),At(w(rn,tn),p(tn-rn)),mt||Pt(0,f)),mt&&(1==jn.ori?(rn=tt,tn=ot):(rn=lt,tn=st),Pt(w(rn,tn),p(tn-rn)),pt||At(0,u)),pt||mt||(At(0,0),Pt(0,0))}if(fr.idx=i,fr.left=ot,fr.top=st,dt._x=pt,dt._y=mt,null!=e){if(null!=qt){var an=Jt.scales,sn=an[0],un=an[1];Jt.values[0]=null!=sn?Dt(0==jn.ori?ot:st,sn):null,Jt.values[1]=null!=un?Dt(1==jn.ori?ot:st,un):null}if(Kt(on,o,ot,st,qe,Ze,i),hr){var fn=Jt.setSeries,cn=vr.prox;null==wt?gt>cn||Mt(xt,St,fn):gt>cn?Mt(null,St,fn):xt!=wt&&Mt(xt,St,fn)}}T&&!1!==l&&Ut("setCursor")}o.setLegend=Wt;var Ft=null;function Ht(n){!0===n?Ft=null:Ut("syncRect",Ft=ln.getBoundingClientRect())}function Rt(n,e,r,t,l,a){fr._lock||(Lt(n,e,r,t,l,a,0,!1,null!=n),null!=n?Ct(1):Ct(null,e))}function Lt(n,e,r,t,l,a,i,s,u){var f;if(null==Ft&&Ht(!1),null!=n)r=n.clientX-Ft.left,t=n.clientY-Ft.top;else{if(0>r||0>t)return ot=-10,void(st=-10);var c=Jt.scales,v=c[0],h=c[1],d=e.cursor.sync,p=d.values,m=p[0],g=p[1],x=d.scales,w=x[0],b=x[1],k=Jt.match,_=k[1],M=1==e.scales[w].ori,S=0==jn.ori?qe:Ze,D=1==jn.ori?qe:Ze,E=M?a:l,T=M?l:a,A=M?t:r,P=M?r:t;if(r=null!=w?(0,k[0])(v,w)?y(m,Wn[v],S,0):-10:S*(A/E),t=null!=b?_(h,b)?y(g,Wn[h],D,0):-10:D*(P/T),1==jn.ori){var W=r;r=t,t=W}}u&&(r>1&&qe-1>r||(r=z(r,qe)),t>1&&Ze-1>t||(t=z(t,Ze))),s?(et=r,rt=t,f=fr.move(o,r,t),tt=f[0],lt=f[1]):(ot=r,st=t)}function It(){_t({width:0,height:0},!1)}function Gt(n,e,r,t,l,a){ht=!0,pt=mt=dt._x=dt._y=!1,Lt(n,e,r,t,l,a,0,!0,!1),null!=n&&(Ce(un,gn,Ot),Kt(sn,o,tt,lt,qe,Ze,null))}function Ot(n,e,r,t,l,a){ht=dt._x=dt._y=!1,Lt(n,e,r,t,l,a,0,!1,!0);var i=bt.left,s=bt.top,u=bt.width,f=bt.height,c=u>0||f>0;if(c&&_t(bt),dt.setScale&&c){var v=i,h=u,d=s,p=f;if(1==jn.ori&&(v=s,h=f,d=i,p=u),pt&&yt(Cn,Dt(v,Cn),Dt(v+h,Cn)),mt)for(var m in Wn){var g=Wn[m];m!=Cn&&null==g.from&&g.min!=S&&yt(m,Dt(d+p,m),Dt(d,m))}It()}else fr.lock&&(fr._lock=!fr._lock,fr._lock||Ct());null!=n&&(Fe(un,gn),Kt(un,o,ot,st,qe,Ze,null))}function jt(n){Or(),It(),null!=n&&Kt(vn,o,ot,st,qe,Ze,null)}function Bt(){Tn.forEach(Er),sr(o.width,o.height,!0)}An(dn,xn,Bt);var Nt={};Nt.mousedown=Gt,Nt.mousemove=Rt,Nt.mouseup=Ot,Nt.dblclick=jt,Nt.setSeries=(n,e,r,t)=>{Mt(r,t)},fr.show&&(Ce(sn,ln,Gt),Ce(on,ln,Rt),Ce(fn,ln,Ht),Ce(cn,ln,(function(){if(!fr._lock){var n=ht;if(ht){var e,r,t=!0,l=!0;0==jn.ori?(e=pt,r=mt):(e=mt,r=pt),e&&r&&(t=10>=ot||ot>=qe-10,l=10>=st||st>=Ze-10),e&&t&&(ot=tt>ot?0:qe),r&&l&&(st=lt>st?0:Ze),Ct(1),ht=!1}ot=-10,st=-10,Ct(1),n&&(ht=n)}})),Ce(vn,ln,jt),dr.add(o),o.syncRect=Ht);var Vt=o.hooks=e.hooks||{};function Ut(n,e,r){n in Vt&&Vt[n].forEach((n=>{n.call(null,o,e,r)}))}(e.plugins||[]).forEach((n=>{for(var e in n.hooks)Vt[e]=(Vt[e]||[]).concat(n.hooks[e])}));var Jt=J({key:null,setSeries:!1,filters:{pub:W,sub:W},scales:[Cn,En[1]?En[1].scale:null],match:[Y,Y],values:[null,null]},fr.sync);fr.sync=Jt;var qt=Jt.key,Zt=Je(qt);function Kt(n,e,r,t,l,a,i){Jt.filters.pub(n,e,r,t,l,a,i)&&Zt.pub(n,e,r,t,l,a,i)}function Xt(){Ut("init",e,r),Gr(r||e.data,!1),Nn[Cn]?vt(Cn,Nn[Cn]):Or(),sr(e.width,e.height),Ct(),_t(bt,!1)}return Zt.sub(o),o.pub=function(n,e,r,t,l,a,i){Jt.filters.sub(n,e,r,t,l,a,i)&&Nt[n](null,e,r,t,l,a,i)},o.destroy=function(){Zt.unsub(o),dr.delete(o),Ye.clear(),Pn(dn,xn,Bt),F.remove(),Ut("destroy")},En.forEach(Tr),Tn.forEach((function(n,e){if(n._show=n.show,n.show){var r=Wn[n.scale];null==r&&(n.scale=n.side%2?En[1].scale:Cn,r=Wn[n.scale]);var t=r.time;n.size=E(n.size),n.space=E(n.space),n.rotate=E(n.rotate),n.incrs=E(n.incrs||(2==r.distr?Un:t?1==zn?ie:fe:Jn)),n.splits=E(n.splits||(t&&1==r.distr?Qn:3==r.distr?Pe:4==r.distr?We:Ae)),n.stroke=E(n.stroke),n.grid.stroke=E(n.grid.stroke),n.ticks.stroke=E(n.ticks.stroke);var l=n.values;n.values=j(l)&&!j(l[0])?E(l):t?j(l)?de(Kn,he(l,Xn)):B(l)?function(n,e){var r=Gn(e);return(e,t)=>t.map((e=>r(n(e))))}(Kn,l):l||$n:l||Te,n.filter=E(n.filter||(3>r.distr?A:Re)),n.font=Dr(n.font),n.labelFont=Dr(n.labelFont),n._size=n.size(o,null,e,0),n._space=n._rotate=n._incrs=n._found=n._splits=n._values=null,n._size>0&&(Ar[e]=!0)}})),t?t instanceof HTMLElement?(t.appendChild(F),Xt()):t(o,Xt):Xt(),o}Tr.assign=J,Tr.fmtNum=v,Tr.rangeNum=u,Tr.rangeLog=l,Tr.rangeAsinh=a,Tr.orient=qe,Tr.join=function(n,e){for(var r=new Set,t=0;n.length>t;t++)for(var l=n[t][0],a=l.length,i=0;a>i;i++)r.add(l[i]);for(var o=[Array.from(r).sort(((n,e)=>n-e))],s=o[0].length,u=new Map,f=0;s>f;f++)u.set(o[0][f],f);for(var c=0;n.length>c;c++)for(var v=n[c],h=v[0],d=1;v.length>d;d++){for(var p=v[d],m=Array(s).fill(void 0),g=e?e[c][d]:1,x=[],w=0;p.length>w;w++){var b=p[w],k=u.get(h[w]);null===b?0!=g&&(m[k]=b,2==g&&x.push(k)):m[k]=b}q(m,x,s),o.push(m)}return o},Tr.fmtDate=Gn,Tr.tzDate=function(n,e){var r;return"UTC"==e||"Etc/UTC"==e?r=new Date(+n+6e4*n.getTimezoneOffset()):e==On?r=n:(r=new Date(n.toLocaleString("en-US",{timeZone:e}))).setMilliseconds(n.getMilliseconds()),r},Tr.sync=Je,Tr.addGap=Xe,Tr.clipGaps=Ke;var Ar=Tr.paths={};return Ar.linear=vr,Ar.stepped=function(n){var r=f(n.align,1),t=f(n.ascDesc,!1);return(n,l,a,i)=>qe(n,l,((o,s,u,f,c,v,h,d,p,m,g)=>{var x=o.pxRound,w=0==f.ori?er:rr,b={stroke:new Path2D,fill:null,clip:null,band:null,gaps:[],flags:1},k=b.stroke,_=1*f.dir*(0==f.ori?1:-1);a=e(u,a,i,1),i=e(u,a,i,-1);var y=b.gaps,M=!1,S=x(h(u[1==_?a:i],c,g,p)),z=x(v(s[1==_?a:i],f,m,d)),D=z;w(k,z,S);for(var E=1==_?a:i;E>=a&&i>=E;E+=_){var T=u[E],A=x(v(s[E],f,m,d));if(null!=T){var P=x(h(T,c,g,p));if(M){if(Xe(y,D,A),S!=P){var W=o.width*Z/2,Y=y[y.length-1];Y[0]+=t||1==r?W:-W,Y[1]-=t||-1==r?W:-W}M=!1}1==r?w(k,A,S):w(k,D,P),w(k,A,P),S=P,D=A}else null===T&&(Xe(y,D,A),M=!0)}if(null!=o.fill){var C=b.fill=new Path2D(k),F=x(h(o.fillTo(n,l,o.min,o.max),c,g,p));w(C,D,F),w(C,z,F)}return o.spanGaps||(b.clip=Ke(y,f.ori,d,p,m,g)),n.bands.length>0&&(b.band=Ze(n,l,a,i,k)),b}))},Ar.bars=function(n){var r=f((n=n||G).size,[.6,S,1]),t=n.align||0,l=(n.gap||0)*Z,a=1-r[0],i=f(r[1],S)*Z,o=f(r[2],1)*Z,s=n.disp,u=f(n.each,(()=>{}));return(n,r,f,c)=>qe(n,r,((v,h,d,m,g,x,k,_,y,M,S)=>{var D,E,T=v.pxRound,A=m.dir*(0==m.ori?1:-1),P=g.dir*(1==g.ori?1:-1),W=0==m.ori?tr:lr,Y=0==m.ori?u:(n,e,r,t,l,a,i)=>{u(n,e,r,l,t,i,a)},C=k(v.fillTo(n,r,v.min,v.max),g,S,y),F=T(v.width*Z);if(null!=s){h=s.x0.values(n,r,f,c),2==s.x0.unit&&(h=h.map((e=>n.posToVal(_+e*M,m.key,!0))));var H=s.size.values(n,r,f,c);E=T((E=2==s.size.unit?H[0]*M:x(H[0],m,M,_)-x(0,m,M,_))-F),D=1==A?-F/2:E+F/2}else{var R=M;if(h.length>1)for(var L=1,I=1/0;h.length>L;L++){var G=p(h[L]-h[L-1]);I>G&&(I=G,R=p(x(h[L],m,M,_)-x(h[L-1],m,M,_)))}E=T(w(i,b(o,R-R*a))-F-l),D=(0==t?E/2:t==A?0:E)-t*A*l/2}var O,j={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:3},B=n.bands.length>0;B&&(j.band=new Path2D,O=z(k(g.max,g,S,y),.5));for(var N=j.stroke,V=j.band,U=1==A?f:c;U>=f&&c>=U;U+=A){var J=d[U];if(null==J){if(!B)continue;var q=e(d,1==A?f:c,U,-A),K=e(d,U,1==A?c:f,A),X=d[q];J=X+(U-q)/(K-q)*(d[K]-X)}var Q=x(2!=m.distr||null!=s?h[U]:U,m,M,_),$=k(J,g,S,y),nn=T(Q-D),en=T(b($,C)),rn=T(w($,C)),tn=en-rn;null!=d[U]&&(W(N,nn,rn,E,tn),Y(n,r,U,nn-F/2,rn-F/2,E+F,tn+F)),B&&(1==P?(en=rn,rn=O):(rn=en,en=O),W(V,nn-F/2,rn+F/2,E+F,(tn=en-rn)-F))}return null!=v.fill&&(j.fill=new Path2D(N)),j}))},Ar.spline=function(){return function(n){return(r,t,l,a)=>qe(r,t,((i,o,s,u,f,c,v,h,d,p,m)=>{var g,x,w,b=i.pxRound;0==u.ori?(g=$e,w=er,x=or):(g=nr,w=rr,x=sr);var k=1*u.dir*(0==u.ori?1:-1);l=e(s,l,a,1),a=e(s,l,a,-1);for(var _=[],y=!1,M=b(c(o[1==k?l:a],u,p,h)),S=M,z=[],D=[],E=1==k?l:a;E>=l&&a>=E;E+=k){var T=s[E],A=c(o[E],u,p,h);null!=T?(y&&(Xe(_,S,A),y=!1),z.push(S=A),D.push(v(s[E],f,m,d))):null===T&&(Xe(_,S,A),y=!0)}var P={stroke:n(z,D,g,w,x,b),fill:null,clip:null,band:null,gaps:_,flags:1},W=P.stroke;if(null!=i.fill&&null!=W){var Y=P.fill=new Path2D(W),C=b(v(i.fillTo(r,t,i.min,i.max),f,m,d));w(Y,S,C),w(Y,M,C)}return i.spanGaps||(P.clip=Ke(_,u.ori,h,d,p,m)),r.bands.length>0&&(P.band=Ze(r,t,l,a,W)),P}))}(hr)},Tr}(); +var uPlot=function(){"use strict";function n(n,e,r,t){var l;r=r||0;for(var a=2147483647>=(t=t||e.length-1);t-r>1;)n>e[l=a?r+t>>1:m((r+t)/2)]?r=l:t=l;return n-e[r]>e[t]-n?t:r}function e(n,e,r,t){for(var l=1==t?e:r;l>=e&&r>=l;l+=t)if(null!=n[l])return l;return-1}var r=[0,0];function t(n,e,t,l){return r[0]=0>t?H(n,-t):n,r[1]=0>l?H(e,-l):e,r}function l(n,e,r,l){var a,i,o,s=10==r?_:y;return n==e&&(n/=r,e*=r),l?(a=m(s(n)),i=x(s(e)),n=(o=t(k(r,a),k(r,i),a,i))[0],e=o[1]):(a=m(s(p(n))),i=m(s(p(e))),n=F(n,(o=t(k(r,a),k(r,i),a,i))[0]),e=C(e,o[1])),[n,e]}function a(n,e,r,t){var a=l(n,e,r,t);return 0==n&&(a[0]=0),0==e&&(a[1]=0),a}var i={mode:3,pad:.1},o={pad:0,soft:null,mode:0},s={min:o,max:o};function u(n,e,r,t){return N(r)?c(n,e,r):(o.pad=r,o.soft=t?0:null,o.mode=t?3:0,c(n,e,s))}function f(n,e){return null==n?e:n}function c(n,e,r){var t=r.min,l=r.max,a=f(t.pad,0),i=f(l.pad,0),o=f(t.hard,-S),s=f(l.hard,S),u=f(t.soft,S),c=f(l.soft,-S),v=f(t.mode,0),h=f(l.mode,0),d=e-n;1e-9>d&&(d=0,0!=n&&0!=e||(d=1e-9,2==v&&u!=S&&(a=0),2==h&&c!=-S&&(i=0)));var g=d||p(e)||1e3,x=_(g),y=k(10,m(x)),M=H(F(n-g*(0==d?0==n?.1:1:a),y/10),9),z=u>n||1!=v&&(3!=v||M>u)&&(2!=v||u>M)?S:u,D=b(o,z>M&&n>=z?z:w(z,M)),E=H(C(e+g*(0==d?0==e?.1:1:i),y/10),9),T=e>c||1!=h&&(3!=h||c>E)&&(2!=h||E>c)?-S:c,A=w(s,E>T&&T>=e?T:b(T,E));return D==A&&0==D&&(A=100),[D,A]}var v=new Intl.NumberFormat(navigator.language).format,h=Math,d=h.PI,p=h.abs,m=h.floor,g=h.round,x=h.ceil,w=h.min,b=h.max,k=h.pow,_=h.log10,y=h.log2,M=(n,e)=>(void 0===e&&(e=1),h.asinh(n/e)),S=1/0;function z(n,e){return g(n/e)*e}function D(n,e,r){return w(b(n,e),r)}function E(n){return"function"==typeof n?n:()=>n}var T=n=>n,A=(n,e)=>e,P=()=>null,W=()=>!0,Y=(n,e)=>n==e;function C(n,e){return x(n/e)*e}function F(n,e){return m(n/e)*e}function H(n,e){return g(n*(e=Math.pow(10,e)))/e}var R=new Map;function L(n){return((""+n).split(".")[1]||"").length}function I(n,e,r,t){for(var l=[],a=t.map(L),i=e;r>i;i++)for(var o=p(i),s=H(k(n,i),o),u=0;t.length>u;u++){var f=t[u]*s,c=(0>f||0>i?o:0)+(a[u]>i?a[u]:0),v=H(f,c);l.push(v),R.set(v,c)}return l}var G={},O=[null,null],j=Array.isArray;function B(n){return"string"==typeof n}function N(n){var e=!1;if(null!=n){var r=n.constructor;e=null==r||r==Object}return e}function V(n){return null!=n&&"object"==typeof n}function U(n,e){var r;if(e=e||N,j(n))r=n.map((n=>U(n,e)));else if(e(n))for(var t in r={},n)r[t]=U(n[t],e);else r=n;return r}function J(n){for(var e=arguments,r=1;e.length>r;r++){var t=e[r];for(var l in t)N(n[l])?J(n[l],U(t[l])):n[l]=U(t[l])}return n}function q(n,e,r){for(var t=0,l=void 0,a=-1;e.length>t;t++){var i=e[t];if(i>a){for(l=i-1;l>=0&&null==n[l];)n[l--]=null;for(l=i+1;r>l&&null==n[l];)n[a=l++]=null}}}var Z,K,X="undefined"==typeof queueMicrotask?n=>Promise.resolve().then(n):queueMicrotask,Q="width",$="height",nn="top",en="bottom",rn="left",tn="right",ln="#000",an="#0000",on="mousemove",sn="mousedown",un="mouseup",fn="mouseenter",cn="mouseleave",vn="dblclick",hn="change",dn="dppxchange",pn="u-off",mn="u-label",gn=document,xn=window;function wn(n,e){if(null!=e){var r=n.classList;!r.contains(e)&&r.add(e)}}function bn(n,e){var r=n.classList;r.contains(e)&&r.remove(e)}function kn(n,e,r){n.style[e]=r+"px"}function _n(n,e,r,t){var l=gn.createElement(n);return null!=e&&wn(l,e),null!=r&&r.insertBefore(l,t),l}function yn(n,e){return _n("div",n,e)}var Mn=new WeakMap;function Sn(n,e,r,t,l){var a="translate("+e+"px,"+r+"px)";a!=Mn.get(n)&&(n.style.transform=a,Mn.set(n,a),0>e||0>r||e>t||r>l?wn(n,pn):bn(n,pn))}var zn=new WeakMap;function Dn(n,e,r){var t=e+r;t!=zn.get(n)&&(zn.set(n,t),Object.assign(n.style,{background:e,borderColor:r}))}var En={passive:!0},Tn=J({capture:!0},En);function An(n,e,r,t){e.addEventListener(n,r,t?Tn:En)}function Pn(n,e,r,t){e.removeEventListener(n,r,t?Tn:En)}!function n(){Z=devicePixelRatio,K&&Pn(hn,K,n),K=matchMedia("screen and (min-resolution: "+(Z-.001)+"dppx) and (max-resolution: "+(Z+.001)+"dppx)"),An(hn,K,n),xn.dispatchEvent(new CustomEvent(dn))}();var Wn=["January","February","March","April","May","June","July","August","September","October","November","December"],Yn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Cn(n){return n.slice(0,3)}var Fn=Yn.map(Cn),Hn=Wn.map(Cn),Rn={MMMM:Wn,MMM:Hn,WWWW:Yn,WWW:Fn};function Ln(n){return(10>n?"0":"")+n}var In={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,e)=>e.MMMM[n.getMonth()],MMM:(n,e)=>e.MMM[n.getMonth()],MM:n=>Ln(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>Ln(n.getDate()),D:n=>n.getDate(),WWWW:(n,e)=>e.WWWW[n.getDay()],WWW:(n,e)=>e.WWW[n.getDay()],HH:n=>Ln(n.getHours()),H:n=>n.getHours(),h:n=>{var e=n.getHours();return 0==e?12:e>12?e-12:e},AA:n=>12>n.getHours()?"AM":"PM",aa:n=>12>n.getHours()?"am":"pm",a:n=>12>n.getHours()?"a":"p",mm:n=>Ln(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>Ln(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>function(n){return(10>n?"00":100>n?"0":"")+n}(n.getMilliseconds())};function Gn(n,e){e=e||Rn;for(var r,t=[],l=/\{([a-z]+)\}|[^{]+/gi;r=l.exec(n);)t.push("{"==r[0][0]?In[r[1]]:r[0]);return n=>{for(var r="",l=0;t.length>l;l++)r+="string"==typeof t[l]?t[l]:t[l](n,e);return r}}var On=(new Intl.DateTimeFormat).resolvedOptions().timeZone,jn=n=>n%1==0,Bn=[1,2,2.5,5],Nn=I(10,-16,0,Bn),Vn=I(10,0,16,Bn),Un=Vn.filter(jn),Jn=Nn.concat(Vn),qn="{YYYY}",Zn="\n"+qn,Kn="{M}/{D}",Xn="\n"+Kn,Qn=Xn+"/{YY}",$n="{aa}",ne="{h}:{mm}"+$n,ee="\n"+ne,re=":{ss}",te=null;function le(n){var e=1e3*n,r=60*e,t=60*r,l=24*t,a=30*l,i=365*l;return[(1==n?I(10,0,3,Bn).filter(jn):I(10,-3,0,Bn)).concat([e,5*e,10*e,15*e,30*e,r,5*r,10*r,15*r,30*r,t,2*t,3*t,4*t,6*t,8*t,12*t,l,2*l,3*l,4*l,5*l,6*l,7*l,8*l,9*l,10*l,15*l,a,2*a,3*a,4*a,6*a,i,2*i,5*i,10*i,25*i,50*i,100*i]),[[i,qn,te,te,te,te,te,te,1],[28*l,"{MMM}",Zn,te,te,te,te,te,1],[l,Kn,Zn,te,te,te,te,te,1],[t,"{h}"+$n,Qn,te,Xn,te,te,te,1],[r,ne,Qn,te,Xn,te,te,te,1],[e,re,Qn+" "+ne,te,Xn+" "+ne,te,ee,te,1],[n,re+".{fff}",Qn+" "+ne,te,Xn+" "+ne,te,ee,te,1]],function(e){return(o,s,u,f,c,v)=>{var h=[],d=c>=i,p=c>=a&&i>c,x=e(u),w=H(x*n,3),b=pe(x.getFullYear(),d?0:x.getMonth(),p||d?1:x.getDate()),k=H(b*n,3);if(p||d)for(var _=p?c/a:0,y=d?c/i:0,M=w==k?w:H(pe(b.getFullYear()+y,b.getMonth()+_,1)*n,3),S=new Date(g(M/n)),z=S.getFullYear(),D=S.getMonth(),E=0;f>=M;E++){var T=pe(z+y*E,D+_*E,1),A=T-e(H(T*n,3));(M=H((+T+A)*n,3))>f||h.push(M)}else{var P=l>c?c:l,W=k+(m(u)-m(w))+C(w-k,P);h.push(W);for(var Y=e(W),F=Y.getHours()+Y.getMinutes()/r+Y.getSeconds()/t,R=c/t,L=v/o.axes[s]._space;(W=H(W+c,1==n?0:3))<=f;)if(R>1){var I=m(H(F+R,6))%24,G=e(W).getHours()-I;G>1&&(G=-1),F=(F+R)%24,.7>H(((W-=G*t)-h[h.length-1])/c,3)*L||h.push(W)}else h.push(W)}return h}}]}var ae=le(1),ie=ae[0],oe=ae[1],se=ae[2],ue=le(.001),fe=ue[0],ce=ue[1],ve=ue[2];function he(n,e){return n.map((n=>n.map(((r,t)=>0==t||8==t||null==r?r:e(1==t||0==n[8]?r:n[1]+r)))))}function de(n,e){return(r,t,l,a,i)=>{var o,s,u,f,c,v,h=e.find((n=>i>=n[0]))||e[e.length-1];return t.map((e=>{var r=n(e),t=r.getFullYear(),l=r.getMonth(),a=r.getDate(),i=r.getHours(),d=r.getMinutes(),p=r.getSeconds(),m=t!=o&&h[2]||l!=s&&h[3]||a!=u&&h[4]||i!=f&&h[5]||d!=c&&h[6]||p!=v&&h[7]||h[1];return o=t,s=l,u=a,f=i,c=d,v=p,m(r)}))}}function pe(n,e,r){return new Date(n,e,r)}function me(n,e){return e(n)}function ge(n,e){return(r,t)=>e(n(t))}I(2,-53,53,[1]);var xe={show:!0,live:!0,isolate:!1,markers:{show:!0,width:2,stroke:function(n,e){var r=n.series[e];return r.width?r.stroke(n,e):r.points.width?r.points.stroke(n,e):null},fill:function(n,e){return n.series[e].fill(n,e)},dash:"solid"},idx:null,values:[]},we=[0,0];function be(n,e,r){return n=>{0==n.button&&r(n)}}function ke(n,e,r){return r}var _e={show:!0,x:!0,y:!0,lock:!1,move:function(n,e,r){return we[0]=e,we[1]=r,we},points:{show:function(n,e){var r=n.cursor.points,t=yn(),l=r.stroke(n,e),a=r.fill(n,e);t.style.background=a||l;var i=r.size(n,e),o=r.width(n,e,i);o&&(t.style.border=o+"px solid "+l);var s=i/-2;return kn(t,Q,i),kn(t,$,i),kn(t,"marginLeft",s),kn(t,"marginTop",s),t},size:function(n,e){return Ge(n.series[e].width,1)},width:0,stroke:function(n,e){return n.series[e].stroke(n,e)},fill:function(n,e){return n.series[e].stroke(n,e)}},bind:{mousedown:be,mouseup:be,click:be,dblclick:be,mousemove:ke,mouseleave:ke,mouseenter:ke},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(n,e,r){return r},idxs:[]},ye={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:A},Me=J({},ye,{size:10}),Se='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ze="bold "+Se,De={show:!0,scale:"x",stroke:ln,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ze,side:2,grid:ye,ticks:Me,font:Se,rotate:0},Ee={show:!0,scale:"x",auto:!1,sorted:1,min:S,max:-S,idxs:[]};function Te(n,e){return e.map((n=>null==n?"":v(n)))}function Ae(n,e,r,t,l,a,i){for(var o=[],s=R.get(l)||0,u=r=i?r:H(C(r,l),s);t>=u;u=H(u+l,s))o.push(Object.is(u,-0)?0:u);return o}function Pe(n,e,r,t,l){var a=[],i=n.scales[n.axes[e].scale].log,o=m((10==i?_:y)(r));l=k(i,o),0>o&&(l=H(l,-o));var s=r;do{a.push(s),l*i>(s=H(s+l,R.get(l)))||(l=s)}while(t>=s);return a}function We(n,e,r,t,l){var a=n.scales[n.axes[e].scale].asinh,i=t>a?Pe(n,e,b(a,r),t,l):[a],o=0>t||r>0?[]:[0];return(-a>r?Pe(n,e,b(a,-t),-r,l):[a]).reverse().map((n=>-n)).concat(o,i)}var Ye=/./,Ce=/[12357]/,Fe=/[125]/,He=/1/;function Re(n,e,r){var t=n.axes[r],l=t.scale,a=n.scales[l];if(3==a.distr&&2==a.log)return e;var i=n.valToPos,o=t._space,s=i(10,l),u=i(9,l)-s4==a.distr&&0==n||u.test(n)?n:null))}function Le(n,e){return null==e?"":v(e)}var Ie={show:!0,scale:"y",stroke:ln,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ze,side:3,grid:ye,ticks:Me,font:Se,rotate:0};function Ge(n,e){return H((3+2*(n||1))*e,3)}function Oe(n,e){var r=n.scales[n.series[e].scale],t=n.bands&&n.bands.some((n=>n.series[0]==e));return 3==r.distr||t?r.min:0}var je={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,alpha:1,points:{show:function(n,e){var r=n.series[0],t=r.scale,l=r.idxs,a=n.data[0],i=n.valToPos(a[l[0]],t,!0),o=n.valToPos(a[l[1]],t,!0);return p(o-i)/(n.series[e].points.space*Z)>=l[1]-l[0]},filter:null},values:null,min:S,max:-S,idxs:[],path:null,clip:null};function Be(n,e,r){return r/10}var Ne={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Ve=J({},Ne,{time:!1,ori:1}),Ue={};function Je(n){var e=Ue[n];return e||(e={key:n,plots:[],sub:function(n){e.plots.push(n)},unsub:function(n){e.plots=e.plots.filter((e=>e!=n))},pub:function(n,r,t,l,a,i,o){for(var s=0;e.plots.length>s;s++)e.plots[s]!=r&&e.plots[s].pub(n,r,t,l,a,i,o)}},null!=n&&(Ue[n]=e)),e}function qe(n,e,r){var t=n.series[e],l=n.scales,a=n.bbox,i=n._data[0],o=n._data[e],s=l[n.series[0].scale],u=l[t.scale],f=a.left,c=a.top,v=a.width,h=a.height,d=n.valToPosH,p=n.valToPosV;return 0==s.ori?r(t,i,o,s,u,d,p,f,c,v,h,$e,er,tr,ar,or):r(t,i,o,s,u,p,d,c,f,h,v,nr,rr,lr,ir,sr)}function Ze(n,e,r,t,l){return qe(n,e,((n,e,a,i,o,s,u,f,c,v,h)=>{var d,p,m=0==i.ori?er:rr;1==i.dir*(0==i.ori?1:-1)?(d=r,p=t):(d=t,p=r);var g=z(s(e[d],i,v,f),.5),x=z(u(a[d],o,h,c),.5),w=z(s(e[p],i,v,f),.5),b=z(u(o.max,o,h,c),.5),k=new Path2D(l);return m(k,w,b),m(k,g,b),m(k,g,x),k}))}function Ke(n,e,r,t,l,a){var i=null;if(n.length>0){i=new Path2D;for(var o=0==e?tr:lr,s=r,u=0;n.length>u;u++){var f=n[u];f[1]>f[0]&&(o(i,s,t,f[0]-s,t+a),s=f[1])}o(i,s,t,r+l-s,t+a)}return i}function Xe(n,e,r){var t=n[n.length-1];t&&t[0]==e?t[1]=r:n.push([e,r])}function Qe(n){return 0==n?T:1==n?g:e=>z(e,n)}function $e(n,e,r){n.moveTo(e,r)}function nr(n,e,r){n.moveTo(r,e)}function er(n,e,r){n.lineTo(e,r)}function rr(n,e,r){n.lineTo(r,e)}function tr(n,e,r,t,l){n.rect(e,r,t,l)}function lr(n,e,r,t,l){n.rect(r,e,l,t)}function ar(n,e,r,t,l,a){n.arc(e,r,t,l,a)}function ir(n,e,r,t,l,a){n.arc(r,e,t,l,a)}function or(n,e,r,t,l,a,i){n.bezierCurveTo(e,r,t,l,a,i)}function sr(n,e,r,t,l,a,i){n.bezierCurveTo(r,e,l,t,i,a)}function ur(n){return(e,r,t,l,a,i)=>{t!=l&&(a!=t&&i!=t&&n(e,r,t),a!=l&&i!=l&&n(e,r,l),n(e,r,i))}}var fr=ur(er),cr=ur(rr);function vr(){return(n,r,t,l)=>qe(n,r,((a,i,o,s,u,f,c,v,h,d,p)=>{var m,g,x=a.pxRound;0==s.ori?(m=er,g=fr):(m=rr,g=cr);var k,_,y,M,D=s.dir*(0==s.ori?1:-1),E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:[],flags:1},T=E.stroke,A=S,P=-S,W=E.gaps,Y=x(f(i[1==D?t:l],s,d,v)),C=!1,F=!1,H=e(o,t,l,1*D),R=e(o,t,l,-1*D),L=z(f(i[H],s,d,v),.5),I=z(f(i[R],s,d,v),.5);L>v&&Xe(W,v,L);for(var G=1==D?t:l;G>=t&&l>=G;G+=D){var O=x(f(i[G],s,d,v));if(O==Y)null!=o[G]?(_=x(c(o[G],u,p,h)),A==S&&(m(T,O,_),k=_),A=w(_,A),P=b(_,P)):null===o[G]&&(C=F=!0);else{var j=!1;A!=S?(g(T,Y,A,P,k,_),y=M=Y):C&&(j=!0,C=!1),null!=o[G]?(m(T,O,_=x(c(o[G],u,p,h))),A=P=k=_,F&&O-Y>1&&(j=!0),F=!1):(A=S,P=-S,null===o[G]&&(C=!0,O-Y>1&&(j=!0))),j&&Xe(W,y,O),Y=O}}if(A!=S&&A!=P&&M!=Y&&g(T,Y,A,P,k,_),v+d>I&&Xe(W,I,v+d),null!=a.fill){var B=E.fill=new Path2D(T),N=x(c(a.fillTo(n,r,a.min,a.max),u,p,h));m(B,I,N),m(B,L,N)}return a.spanGaps||(E.clip=Ke(W,s.ori,v,h,d,p)),n.bands.length>0&&(E.band=Ze(n,r,t,l,T)),E}))}function hr(n,e,r,t,l){var a=n.length;if(2>a)return null;var i=new Path2D;if(r(i,n[0],e[0]),2==a)t(i,n[1],e[1]);else{for(var o=Array(a),s=Array(a-1),u=Array(a-1),f=Array(a-1),c=0;a-1>c;c++)u[c]=e[c+1]-e[c],f[c]=n[c+1]-n[c],s[c]=u[c]/f[c];o[0]=s[0];for(var v=1;a-1>v;v++)0===s[v]||0===s[v-1]||s[v-1]>0!=s[v]>0?o[v]=0:(o[v]=3*(f[v-1]+f[v])/((2*f[v]+f[v-1])/s[v-1]+(f[v]+2*f[v-1])/s[v]),isFinite(o[v])||(o[v]=0));o[a-1]=s[a-2];for(var h=0;a-1>h;h++)l(i,n[h]+f[h]/3,e[h]+o[h]*f[h]/3,n[h+1]-f[h]/3,e[h+1]-o[h+1]*f[h]/3,n[h+1],e[h+1])}return i}var dr=new Set;function pr(){dr.forEach((n=>{n.syncRect(!0)}))}An("resize",xn,pr),An("scroll",xn,pr,!0);var mr=vr(),gr=function(){return(n,e,r,t,l)=>qe(n,e,((e,a,i,o,s,u,f,c,v,h,p)=>{var m,g,x=e.pxRound,w=e.points;0==o.ori?(m=$e,g=ar):(m=nr,g=ir);var b=H(w.width*Z,3),k=(w.size-w.width)/2*Z,_=H(2*k,3),y=new Path2D,M=new Path2D,S=n.bbox;tr(M,S.left-_,S.top-_,S.width+2*_,S.height+2*_);var z=n=>{if(null!=i[n]){var e=x(u(a[n],o,h,c)),r=x(f(i[n],s,p,v));m(y,e+k,r),g(y,e,r,k,0,2*d)}};if(l)l.forEach(z);else for(var D=r;t>=D;D++)z(D);return{stroke:b>0?y:null,fill:y,clip:M,flags:3}}))}();function xr(n,e,r,t){return(t?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map(((n,t)=>wr(n,t,e,r)))}function wr(n,e,r,t){return J({},0==e?r:t,n)}function br(n,e,r){return null==e?O:[e,r]}var kr=br;function _r(n,e,r){return null==e?O:u(e,r,.1,!0)}function yr(n,e,r,t){return null==e?O:l(e,r,n.scales[t].log,!1)}var Mr=yr;function Sr(n,e,r,t){return null==e?O:a(e,r,n.scales[t].log,!1)}var zr=Sr;function Dr(n){var e,r;return[n=n.replace(/(\d+)px/,((n,t)=>(e=g((r=+t)*Z))+"px")),e,r]}function Er(n){n.show&&[n.font,n.labelFont].forEach((n=>{var e=H(n[2]*Z,1);n[0]=n[0].replace(/[0-9.]+px/,e+"px"),n[1]=e}))}function Tr(e,r,t){var o={};function s(n,e){return((3==e.distr?_(n>0?n:e.clamp(o,n,e.min,e.max,e.key)):4==e.distr?M(n,e.asinh):n)-e._min)/(e._max-e._min)}function c(n,e,r,t){var l=s(n,e);return t+r*(-1==e.dir?1-l:l)}function v(n,e,r,t){var l=s(n,e);return t+r*(-1==e.dir?l:1-l)}function y(n,e,r,t){return 0==e.ori?c(n,e,r,t):v(n,e,r,t)}o.valToPosH=c,o.valToPosV=v;var T=!1;o.status=0;var F=o.root=yn("uplot");null!=e.id&&(F.id=e.id),wn(F,e.class),e.title&&(yn("u-title",F).textContent=e.title);var L=_n("canvas"),I=o.ctx=L.getContext("2d"),q=yn("u-wrap",F),K=o.under=yn("u-under",q);q.appendChild(L);var ln=o.over=yn("u-over",q),hn=+f((e=U(e)).pxAlign,1),Mn=Qe(hn);(e.plugins||[]).forEach((n=>{n.opts&&(e=n.opts(o,e)||e)}));var zn=e.ms||.001,En=o.series=xr(e.series||[],Ee,je,!1),Tn=o.axes=xr(e.axes||[],De,Ie,!0),Wn=o.scales={},Yn=o.bands=e.bands||[];Yn.forEach((n=>{n.fill=E(n.fill||null)}));var Cn=En[0].scale,Fn={axes:function(){Tn.forEach(((n,e)=>{if(n.show&&n._show){var r,t,l=n.side,a=l%2,i=n.stroke(o,e),s=0==l||3==l?-1:1;if(n.label){var u=g((n._lpos+n.labelGap*s)*Z);I.save(),1==a?(r=t=0,I.translate(u,g(nr+rr/2)),I.rotate((3==l?-d:d)/2)):(r=g($e+er/2),t=u),I.font=n.labelFont[0],I.fillStyle=i,I.textAlign="center",I.textBaseline=2==l?nn:en,I.fillText(n.label,r,t),I.restore()}var f=n._found,c=f[0],v=f[1];if(0!=v){var h=Wn[n.scale],p=0==a?er:rr,m=0==a?$e:nr,x=g(n.gap*Z),w=n._splits,b=2==h.distr?w.map((n=>Lr[n])):w,k=2==h.distr?Lr[w[1]]-Lr[w[0]]:c,_=n.ticks,M=_.show?g(_.size*Z):0,S=n._rotate*-d/180,z=Mn(n._pos*Z),D=z+(M+x)*s;t=0==a?D:0,r=1==a?D:0,I.font=n.font[0],I.fillStyle=i,I.textAlign=1==n.align?rn:2==n.align?tn:S>0?rn:0>S?tn:0==a?"center":3==l?tn:rn,I.textBaseline=S||1==a?"middle":2==l?nn:en;var E=1.5*n.font[1],T=w.map((n=>Mn(y(n,h,p,m))));n._values.forEach(((n,e)=>{null!=n&&(0==a?r=T[e]:t=T[e],(""+n).split(/\n/gm).forEach(((n,e)=>{S?(I.save(),I.translate(r,t+e*E),I.rotate(S),I.fillText(n,0,0),I.restore()):I.fillText(n,r,t+e*E)})))})),_.show&&Jr(T,_.filter(o,b,e,v,k),a,l,z,M,H(_.width*Z,3),_.stroke(o,e),_.dash,_.cap);var A=n.grid;A.show&&Jr(T,A.filter(o,b,e,v,k),a,0==a?2:1,0==a?nr:$e,0==a?rr:er,H(A.width*Z,3),A.stroke(o,e),A.dash,A.cap)}}})),Ut("drawAxes")},series:function(){Wr>0&&(En.forEach(((n,e)=>{if(e>0&&n.show&&null==n._paths){var t=function(n){for(var e=D(Fr-1,0,Wr-1),r=D(Hr+1,0,Wr-1);null==n[e]&&e>0;)e--;for(;null==n[r]&&Wr-1>r;)r++;return[e,r]}(r[e]);n._paths=n.paths(o,e,t[0],t[1])}})),En.forEach(((n,e)=>{if(e>0&&n.show){n._paths&&Br(e,!1);var r=n.points.show(o,e,Fr,Hr),t=n.points.filter(o,e,r,n._paths?n._paths.gaps:null);(r||t)&&(n.points._paths=n.points.paths(o,e,Fr,Hr,t),Br(e,!0)),Ut("drawSeries",e)}})))}},Hn=(e.drawOrder||["axes","series"]).map((n=>Fn[n]));function Rn(n){var r=Wn[n];if(null==r){var t=(e.scales||G)[n]||G;if(null!=t.from)Rn(t.from),Wn[n]=J({},Wn[t.from],t);else{(r=Wn[n]=J({},n==Cn?Ne:Ve,t)).key=n;var l=r.time,a=r.range,o=j(a);if(n!=Cn&&(!o||null!=a[0]&&null!=a[1]||(a={min:null==a[0]?i:{mode:1,hard:a[0],soft:a[0]},max:null==a[1]?i:{mode:1,hard:a[1],soft:a[1]}},o=!1),!o&&N(a))){var s=a;a=(n,e,r)=>null==e?O:u(e,r,s)}r.range=E(a||(l?kr:n==Cn?3==r.distr?Mr:4==r.distr?zr:br:3==r.distr?yr:4==r.distr?Sr:_r)),r.auto=E(!o&&r.auto),r.clamp=E(r.clamp||Be),r._min=r._max=null}}}for(var Ln in Rn("x"),Rn("y"),En.forEach((n=>{Rn(n.scale)})),Tn.forEach((n=>{Rn(n.scale)})),e.scales)Rn(Ln);var In,On,jn=Wn[Cn],Bn=jn.distr;0==jn.ori?(wn(F,"u-hz"),In=c,On=v):(wn(F,"u-vt"),In=v,On=c);var Nn={};for(var Vn in Wn){var qn=Wn[Vn];null==qn.min&&null==qn.max||(Nn[Vn]={min:qn.min,max:qn.max},qn.min=qn.max=null)}var Zn,Kn=e.tzDate||(n=>new Date(g(n/zn))),Xn=e.fmtDate||Gn,Qn=1==zn?se(Kn):ve(Kn),$n=de(Kn,he(1==zn?oe:ce,Xn)),ne=ge(Kn,me("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Xn)),ee=o.legend=J({},xe,e.legend),re=ee.show,te=ee.markers;te.width=E(te.width),te.dash=E(te.dash),te.stroke=E(te.stroke),te.fill=E(te.fill);var le,ae=[],ue=[],pe=!1,we={};if(ee.live){var be=En[1]?En[1].values:null;for(var ke in le=(pe=null!=be)?be(o,1,0):{_:0})we[ke]="--"}if(re)if(Zn=_n("table","u-legend",F),pe){var ye=_n("tr","u-thead",Zn);for(var Me in _n("th",null,ye),le)_n("th",mn,ye).textContent=Me}else wn(Zn,"u-inline"),ee.live&&wn(Zn,"u-live");var Se={show:!0},ze={show:!1},Ye=new Map;function Ce(n,e,r){var t=Ye.get(e)||{},l=fr.bind[n](o,e,r);l&&(An(n,e,t[n]=l),Ye.set(e,t))}function Fe(n,e){var r=Ye.get(e)||{};for(var t in r)null!=n&&t!=n||(Pn(t,e,r[t]),delete r[t]);null==n&&Ye.delete(e)}var He=0,Ue=0,qe=0,Ze=0,Ke=0,Xe=0,$e=0,nr=0,er=0,rr=0;o.bbox={};var tr=!1,lr=!1,ar=!1,ir=!1,or=!1;function sr(n,e,r){(r||n!=o.width||e!=o.height)&&ur(n,e),Kr(!1),ar=!0,lr=!0,ir=fr.left>=0,or=!0,ft()}function ur(n,e){o.width=He=qe=n,o.height=Ue=Ze=e,Ke=Xe=0,function(){var n=!1,e=!1,r=!1,t=!1;Tn.forEach((l=>{if(l.show&&l._show){var a=l.side,i=a%2,o=l._size+(l.labelSize=null!=l.label?l.labelSize||30:0);o>0&&(i?(qe-=o,3==a?(Ke+=o,t=!0):r=!0):(Ze-=o,0==a?(Xe+=o,n=!0):e=!0))}})),Ar[0]=n,Ar[1]=r,Ar[2]=e,Ar[3]=t,qe-=Cr[1]+Cr[3],Ke+=Cr[3],Ze-=Cr[2]+Cr[0],Xe+=Cr[0]}(),function(){var n=Ke+qe,e=Xe+Ze,r=Ke,t=Xe;function l(l,a){switch(l){case 1:return(n+=a)-a;case 2:return(e+=a)-a;case 3:return(r-=a)+a;case 0:return(t-=a)+a}}Tn.forEach((n=>{if(n.show&&n._show){var e=n.side;n._pos=l(e,n._size),null!=n.label&&(n._lpos=l(e,n.labelSize))}}))}();var r=o.bbox;$e=r.left=z(Ke*Z,.5),nr=r.top=z(Xe*Z,.5),er=r.width=z(qe*Z,.5),rr=r.height=z(Ze*Z,.5)}o.setSize=function(n){sr(n.width,n.height)};var fr=o.cursor=J({},_e,e.cursor);fr._lock=!1;var cr=fr.points;cr.show=E(cr.show),cr.size=E(cr.size),cr.stroke=E(cr.stroke),cr.width=E(cr.width),cr.fill=E(cr.fill);var vr=o.focus=J({},e.focus||{alpha:.3},fr.focus),hr=vr.prox>=0,pr=[null];function Tr(n,e){var r=Wn[n.scale].time,t=n.value;if(n.value=r?B(t)?ge(Kn,me(t,Xn)):t||ne:t||Le,n.label=n.label||(r?"Time":"Value"),e>0){n.width=null==n.width?1:n.width,n.paths=n.paths||mr||P,n.fillTo=E(n.fillTo||Oe),n.pxAlign=+f(n.pxAlign,hn),n.pxRound=Qe(n.pxAlign),n.stroke=E(n.stroke||null),n.fill=E(n.fill||null),n._stroke=n._fill=n._paths=n._focus=null;var l=Ge(n.width,1),a=n.points=J({},{size:l,width:b(1,.2*l),stroke:n.stroke,space:2*l,paths:gr,_stroke:null,_fill:null},n.points);a.show=E(a.show),a.filter=E(a.filter),a.fill=E(a.fill),a.stroke=E(a.stroke),a.paths=E(a.paths),a.pxAlign=n.pxAlign}if(re){var i=function(n,e){if(0==e&&(pe||!ee.live))return O;var r=[],t=_n("tr","u-series",Zn,Zn.childNodes[e]);wn(t,n.class),n.show||wn(t,pn);var l=_n("th",null,t);if(te.show){var a=yn("u-marker",l);if(e>0){var i=te.width(o,e);i&&(a.style.border=i+"px "+te.dash(o,e)+" "+te.stroke(o,e)),a.style.background=te.fill(o,e)}}var s=yn(mn,l);for(var u in s.textContent=n.label,e>0&&(te.show||(s.style.color=n.width>0?te.stroke(o,e):te.fill(o,e)),Ce("click",l,(e=>{if(!fr._lock){var r=En.indexOf(n);if(e.ctrlKey!=ee.isolate){var t=En.some(((n,e)=>e>0&&e!=r&&n.show));En.forEach(((n,e)=>{e>0&&Mt(e,t?e==r?Se:ze:Se,Jt.setSeries)}))}else Mt(r,{show:!n.show},Jt.setSeries)}})),hr&&Ce(fn,l,(()=>{fr._lock||Mt(En.indexOf(n),St,Jt.setSeries)}))),le){var f=_n("td","u-value",t);f.textContent="--",r.push(f)}return[t,r]}(n,e);ae.splice(e,0,i[0]),ue.splice(e,0,i[1]),ee.values.push(null)}if(fr.show){fr.idxs.splice(e,0,null);var s=function(n,e){if(e>0){var r=fr.points.show(o,e);if(r)return wn(r,"u-cursor-pt"),wn(r,n.class),Sn(r,-10,-10,qe,Ze),ln.insertBefore(r,pr[e]),r}}(n,e);s&&pr.splice(e,0,s)}}o.addSeries=function(n,e){n=wr(n,e=null==e?En.length:e,Ee,je),En.splice(e,0,n),Tr(En[e],e)},o.delSeries=function(n){if(En.splice(n,1),re){ee.values.splice(n,1),ue.splice(n,1);var e=ae.splice(n,1)[0];Fe(null,e.firstChild),e.remove()}fr.show&&(fr.idxs.splice(n,1),pr.length>1&&pr.splice(n,1)[0].remove())};var Ar=[!1,!1,!1,!1];function Pr(n,e,r){var t=r[0],l=r[1],a=r[2],i=r[3],o=e%2,s=0;return 0==o&&(i||l)&&(s=0==e&&!t||2==e&&!a?g(De.size/3):0),1==o&&(t||a)&&(s=1==e&&!l||3==e&&!i?g(Ie.size/2):0),s}var Wr,Yr=o.padding=(e.padding||[Pr,Pr,Pr,Pr]).map((n=>E(f(n,Pr)))),Cr=o._padding=Yr.map(((n,e)=>n(o,e,Ar,0))),Fr=null,Hr=null,Rr=En[0].idxs,Lr=null,Ir=!1;function Gr(n,e){if((r=(n||[]).slice())[0]=r[0]||[],o.data=r.slice(),Wr=(Lr=r[0]).length,2==Bn&&(r[0]=Lr.map(((n,e)=>e))),o._data=r,Kr(!0),Ut("setData"),!1!==e){var t=jn;t.auto(o,Ir)?Or():yt(Cn,t.min,t.max),ir=fr.left>=0,or=!0,ft()}}function Or(){var n,e,t,i,o;Ir=!0,Wr>0?(Fr=Rr[0]=0,Hr=Rr[1]=Wr-1,i=r[0][Fr],o=r[0][Hr],2==Bn?(i=Fr,o=Hr):1==Wr&&(3==Bn?(i=(n=l(i,i,jn.log,!1))[0],o=n[1]):4==Bn?(i=(e=a(i,i,jn.log,!1))[0],o=e[1]):jn.time?o=i+g(86400/zn):(i=(t=u(i,o,.1,!0))[0],o=t[1]))):(Fr=Rr[0]=i=null,Hr=Rr[1]=o=null),yt(Cn,i,o)}function jr(n,e,r,t,l){I.strokeStyle=n||an,I.lineWidth=e,I.lineJoin="round",I.lineCap=t||"butt",I.setLineDash(r||[]),I.fillStyle=l||an}function Br(n,e){var r=e?En[n].points:En[n],t=r._paths,l=t.stroke,a=t.fill,i=t.clip,s=t.flags,u=H(r.width*Z,3),f=u%2/2,c=r._stroke=r.stroke(o,n),v=r._fill=r.fill(o,n);e&&null==v&&(v=u>0?"#fff":c),I.globalAlpha=r.alpha;var h=1==r.pxAlign;if(h&&I.translate(f,f),I.save(),!e){var d=$e,p=nr,m=er,g=rr,x=u*Z/2;0==r.min&&(g+=x),0==r.max&&(p-=x,g+=x),I.beginPath(),I.rect(d,p,m,g),I.clip()}i&&I.clip(i),e?Nr(c,u,r.dash,r.cap,v,l,a,null,s):function(n,e,r,t,l,a,i,s,u){var f=!1;Yn.forEach(((c,v)=>{if(c.series[0]==n){var h=En[c.series[1]],d=(h._paths||G).band;I.save();var p=null;h.show&&d?p=c.fill(o,v)||a:d=null,Nr(e,r,t,l,p,i,s,d,u),I.restore(),f=!0}})),f||Nr(e,r,t,l,a,i,s,null,u)}(n,c,u,r.dash,r.cap,v,l,a,s),I.restore(),h&&I.translate(-f,-f),I.globalAlpha=1}function Nr(n,e,r,t,l,a,i,o,s){jr(n,e,r,t,l),o?3==(3&s)?(I.clip(o),Ur(l,i),Vr(n,a,e)):2&s?(Ur(l,i),I.clip(o),Vr(n,a,e)):1&s&&(I.save(),I.clip(o),Ur(l,i),I.restore(),Vr(n,a,e)):(Ur(l,i),Vr(n,a,e))}function Vr(n,e,r){n&&e&&r&&I.stroke(e)}function Ur(n,e){n&&e&&I.fill(e)}function Jr(n,e,r,t,l,a,i,o,s,u){var f=i%2/2;1==hn&&I.translate(f,f),jr(o,i,s,u),I.beginPath();var c,v,h,d,p=l+(0==t||3==t?-a:a);0==r?(v=l,d=p):(c=l,h=p),n.forEach(((n,t)=>{null!=e[t]&&(0==r?c=h=n:v=d=n,I.moveTo(c,v),I.lineTo(h,d))})),I.stroke(),1==hn&&I.translate(-f,-f)}function qr(n){var e=!0;return Tn.forEach(((r,t)=>{if(r.show){var l=Wn[r.scale];if(null!=l.min){r._show||(e=!1,r._show=!0,Kr(!1));var a=r.side,i=l.min,s=l.max,u=function(n,e,r,t){var l,a=Tn[n];if(t>0){var i=a._space=a.space(o,n,e,r,t),s=a._incrs=a.incrs(o,n,e,r,t,i);l=a._found=function(n,e,r,t,l){for(var a=t/(e-n),i=(""+m(n)).length,o=0;r.length>o;o++){var s=r[o]*a,u=10>r[o]?R.get(r[o]):0;if(s>=l&&17>i+u)return[r[o],s]}return[0,0]}(e,r,s,t,i)}else l=[0,0];return l}(t,i,s,0==a%2?qe:Ze),f=u[0],c=u[1];if(0!=c){var v=r._splits=r.splits(o,t,i,s,f,c,2==l.distr),h=2==l.distr?v.map((n=>Lr[n])):v,d=2==l.distr?Lr[v[1]]-Lr[v[0]]:f,p=r._values=r.values(o,r.filter(o,h,t,c,d),t,c,d);r._rotate=2==a?r.rotate(o,p,t,c):0;var g=r._size;r._size=x(r.size(o,p,t,n)),null!=g&&r._size!=g&&(e=!1)}}else r._show&&(e=!1,r._show=!1,Kr(!1))}})),e}function Zr(n){var e=!0;return Yr.forEach(((r,t)=>{var l=r(o,t,Ar,n);l!=Cr[t]&&(e=!1),Cr[t]=l})),e}function Kr(n){En.forEach(((e,r)=>{r>0&&(e._paths=null,n&&(e.min=null,e.max=null))}))}o.setData=Gr;var Xr,Qr,$r,nt,et,rt,tt,lt,at,it,ot,st,ut=!1;function ft(){ut||(X(ct),ut=!0)}function ct(){tr&&(function(){var e=U(Wn,V);for(var t in e){var l=e[t],a=Nn[t];if(null!=a&&null!=a.min)J(l,a),t==Cn&&Kr(!0);else if(t!=Cn)if(0==Wr&&null==l.from){var i=l.range(o,null,null,t);l.min=i[0],l.max=i[1]}else l.min=S,l.max=-S}if(Wr>0)for(var s in En.forEach(((t,l)=>{var a=t.scale,i=e[a],s=Nn[a];if(0==l){var u=i.range(o,i.min,i.max,a);i.min=u[0],i.max=u[1],Fr=n(i.min,r[0]),Hr=n(i.max,r[0]),i.min>r[0][Fr]&&Fr++,r[0][Hr]>i.max&&Hr--,t.min=Lr[Fr],t.max=Lr[Hr]}else if(t.show&&t.auto&&i.auto(o,Ir)&&(null==s||null==s.min)){var f=null==t.min?3==i.distr?function(n,e,r){for(var t=S,l=-S,a=e;r>=a;a++)n[a]>0&&(t=w(t,n[a]),l=b(l,n[a]));return[t==S?1:t,l==-S?10:l]}(r[l],Fr,Hr):function(n,e,r,t){var l=S,a=-S;if(1==t)l=n[e],a=n[r];else if(-1==t)l=n[r],a=n[e];else for(var i=e;r>=i;i++)null!=n[i]&&(l=w(l,n[i]),a=b(a,n[i]));return[l,a]}(r[l],Fr,Hr,t.sorted):[t.min,t.max];i.min=w(i.min,t.min=f[0]),i.max=b(i.max,t.max=f[1])}t.idxs[0]=Fr,t.idxs[1]=Hr})),e){var u=e[s],f=Nn[s];if(null==u.from&&(null==f||null==f.min)){var c=u.range(o,u.min==S?null:u.min,u.max==-S?null:u.max,s);u.min=c[0],u.max=c[1]}}for(var v in e){var h=e[v];if(null!=h.from){var d=e[h.from],p=h.range(o,d.min,d.max,v);h.min=p[0],h.max=p[1]}}var m={},g=!1;for(var x in e){var k=e[x],y=Wn[x];if(y.min!=k.min||y.max!=k.max){y.min=k.min,y.max=k.max;var z=y.distr;y._min=3==z?_(y.min):4==z?M(y.min,y.asinh):y.min,y._max=3==z?_(y.max):4==z?M(y.max,y.asinh):y.max,m[x]=g=!0}}if(g){for(var D in En.forEach((n=>{m[n.scale]&&(n._paths=null)})),m)ar=!0,Ut("setScale",D);fr.show&&(ir=fr.left>=0)}for(var E in Nn)Nn[E]=null}(),tr=!1),ar&&(function(){for(var n=!1,e=0;!n;){var r=qr(++e),t=Zr(e);(n=3==e||r&&t)||(ur(o.width,o.height),lr=!0)}}(),ar=!1),lr&&(kn(K,rn,Ke),kn(K,nn,Xe),kn(K,Q,qe),kn(K,$,Ze),kn(ln,rn,Ke),kn(ln,nn,Xe),kn(ln,Q,qe),kn(ln,$,Ze),kn(q,Q,He),kn(q,$,Ue),L.width=g(He*Z),L.height=g(Ue*Z),Ht(!1),Ut("setSize"),lr=!1),He>0&&Ue>0&&(I.clearRect(0,0,L.width,L.height),Ut("drawClear"),Hn.forEach((n=>n())),Ut("draw")),fr.show&&ir&&(Ct(),ir=!1),T||(T=!0,o.status=1,Ut("ready")),Ir=!1,ut=!1}function vt(e,t){var l=Wn[e];if(null==l.from){if(0==Wr){var a=l.range(o,t.min,t.max,e);t.min=a[0],t.max=a[1]}if(t.min>t.max){var i=t.min;t.min=t.max,t.max=i}if(Wr>1&&null!=t.min&&null!=t.max&&1e-16>t.max-t.min)return;e==Cn&&2==l.distr&&Wr>0&&(t.min=n(t.min,r[0]),t.max=n(t.max,r[0])),Nn[e]=t,tr=!0,ft()}}o.redraw=(n,e)=>{ar=e||!1,!1!==n?yt(Cn,jn.min,jn.max):ft()},o.setScale=vt;var ht=!1,dt=fr.drag,pt=dt.x,mt=dt.y;fr.show&&(fr.x&&(Xr=yn("u-cursor-x",ln)),fr.y&&(Qr=yn("u-cursor-y",ln)),0==jn.ori?($r=Xr,nt=Qr):($r=Qr,nt=Xr),ot=fr.left,st=fr.top);var gt,xt,wt,bt=o.select=J({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),kt=bt.show?yn("u-select",bt.over?ln:K):null;function _t(n,e){if(bt.show){for(var r in n)kn(kt,r,bt[r]=n[r]);!1!==e&&Ut("setSelect")}}function yt(n,e,r){vt(n,{min:e,max:r})}function Mt(n,e,r){var t=En[n];null!=e.focus&&function(n){if(n!=wt){var e=null==n,r=1!=vr.alpha;En.forEach(((t,l)=>{var a=e||0==l||l==n;t._focus=e?null:a,r&&function(n,e){En[n].alpha=e,fr.show&&pr[n]&&(pr[n].style.opacity=e),re&&ae[n]&&(ae[n].style.opacity=e)}(l,a?1:vr.alpha)})),wt=n,r&&ft()}}(n),null!=e.show&&(t.show=e.show,function(n){var e=re?ae[n]:null;En[n].show?e&&bn(e,pn):(e&&wn(e,pn),pr.length>1&&Sn(pr[n],-10,-10,qe,Ze))}(n),yt(t.scale,null,null),ft()),Ut("setSeries",n,e),r&&Kt("setSeries",o,n,e)}o.setSelect=_t,o.setSeries=Mt,o.addBand=function(n,e){n.fill=E(n.fill||null),Yn.splice(e=null==e?Yn.length:e,0,n)},o.setBand=function(n,e){J(Yn[n],e)},o.delBand=function(n){null==n?Yn.length=0:Yn.splice(n,1)};var St={focus:!0},zt={focus:!1};function Dt(n,e,r){var t=Wn[e];r&&(n=n/Z-(1==t.ori?Xe:Ke));var l=qe;1==t.ori&&(n=(l=Ze)-n),-1==t.dir&&(n=l-n);var a=t._min,i=a+n/l*(t._max-a),o=t.distr;return 3==o?k(10,i):4==o?((n,e)=>(void 0===e&&(e=1),h.sinh(n/e)))(i,t.asinh):i}function Et(n,e){kn(kt,rn,bt.left=n),kn(kt,Q,bt.width=e)}function Tt(n,e){kn(kt,nn,bt.top=n),kn(kt,$,bt.height=e)}re&&hr&&An(cn,Zn,(()=>{fr._lock||(Mt(null,zt,Jt.setSeries),Ct())})),o.valToIdx=e=>n(e,r[0]),o.posToIdx=function(e,t){return n(Dt(e,Cn,t),r[0],Fr,Hr)},o.posToVal=Dt,o.valToPos=(n,e,r)=>0==Wn[e].ori?c(n,Wn[e],r?er:qe,r?$e:0):v(n,Wn[e],r?rr:Ze,r?nr:0),o.batch=function(n){n(o),ft()},o.setCursor=(n,e)=>{ot=n.left,st=n.top,Ct(null,null,e)};var At=0==jn.ori?Et:Tt,Pt=1==jn.ori?Et:Tt;function Wt(n,e){if(null!=n){var r=n.idx;ee.idx=r,En.forEach(((n,e)=>{(e>0||!pe)&&Yt(e,r)}))}re&&ee.live&&function(){if(re&&ee.live)for(var n=0;En.length>n;n++)if(0!=n||!pe){var e=ee.values[n],r=0;for(var t in e)ue[n][r++].firstChild.nodeValue=e[t]}}(),or=!1,!1!==e&&Ut("setLegend")}function Yt(n,e){var t;if(null==e)t=we;else{var l=En[n],a=0==n&&2==Bn?Lr:r[n];t=pe?l.values(o,n,e):{_:l.value(o,a[e],n,e)}}ee.values[n]=t}function Ct(e,t,l){var a,i;at=ot,it=st,a=fr.move(o,ot,st),ot=a[0],st=a[1],fr.show&&($r&&Sn($r,g(ot),0,qe,Ze),nt&&Sn(nt,0,g(st),qe,Ze));var s=!1;gt=S;var u=0==jn.ori?qe:Ze,f=1==jn.ori?qe:Ze;if(0>ot||0==Wr||Fr>Hr){i=null;for(var c=0;En.length>c;c++)c>0&&pr.length>1&&Sn(pr[c],-10,-10,qe,Ze);if(hr&&Mt(null,St,Jt.setSeries),ee.live){s=!0;for(var v=0;En.length>v;v++)ee.values[v]=we}}else{var h=Dt(0==jn.ori?ot:st,Cn);i=n(h,r[0],Fr,Hr);for(var d=C(In(r[0][i],jn,u,0),.5),m=0;En.length>m;m++){var x=En[m],b=fr.dataIdx(o,m,i,h);fr.idxs[m]=b;var k=b==i?d:C(In(r[0][b],jn,u,0),.5);if(m>0&&x.show){var _=r[m][b],y=null==_?-10:C(On(_,Wn[x.scale],f,0),.5);if(y>0){var M=p(y-st);M>gt||(gt=M,xt=m)}var z=void 0,D=void 0;0==jn.ori?(z=k,D=y):(z=y,D=k),pr.length>1&&(Sn(pr[m],z,D,qe,Ze),Dn(pr[m],fr.points.fill(o,m),fr.points.stroke(o,m)))}if(ee.live){if(b==fr.idx&&!or||0==m&&pe)continue;s=!0,Yt(m,b)}}}if(s&&(ee.idx=i,Wt()),bt.show&&ht)if(null!=t){var E=Jt.scales,A=E[0],P=E[1],W=Jt.match,Y=W[1],F=t.cursor.sync.scales,H=F[0],R=F[1],L=t.cursor.drag;pt=L._x,mt=L._y;var I,G,O,j,B,N=t.select,V=N.left,U=N.top,J=N.width,q=N.height,Z=t.scales[A].ori,K=t.posToVal,X=null!=A&&(0,W[0])(A,H),Q=null!=P&&Y(P,R);X&&(0==Z?(I=V,G=J):(I=U,G=q),pt?(O=Wn[A],j=In(K(I,H),O,u,0),B=In(K(I+G,H),O,u,0),At(w(j,B),p(B-j))):At(0,u),Q||Pt(0,f)),Q&&(1==Z?(I=V,G=J):(I=U,G=q),mt?(O=Wn[P],j=On(K(I,R),O,f,0),B=On(K(I+G,R),O,f,0),Pt(w(j,B),p(B-j))):Pt(0,f),X||At(0,u))}else{var $=p(at-et),nn=p(it-rt);if(1==jn.ori){var en=$;$=nn,nn=en}pt=dt.x&&$>=dt.dist,mt=dt.y&&nn>=dt.dist;var rn,tn,ln=dt.uni;null!=ln?pt&&mt&&(mt=nn>=ln,(pt=$>=ln)||mt||(nn>$?mt=!0:pt=!0)):dt.x&&dt.y&&(pt||mt)&&(pt=mt=!0),pt&&(0==jn.ori?(rn=tt,tn=ot):(rn=lt,tn=st),At(w(rn,tn),p(tn-rn)),mt||Pt(0,f)),mt&&(1==jn.ori?(rn=tt,tn=ot):(rn=lt,tn=st),Pt(w(rn,tn),p(tn-rn)),pt||At(0,u)),pt||mt||(At(0,0),Pt(0,0))}if(fr.idx=i,fr.left=ot,fr.top=st,dt._x=pt,dt._y=mt,null!=e){if(null!=qt){var an=Jt.scales,sn=an[0],un=an[1];Jt.values[0]=null!=sn?Dt(0==jn.ori?ot:st,sn):null,Jt.values[1]=null!=un?Dt(1==jn.ori?ot:st,un):null}if(Kt(on,o,ot,st,qe,Ze,i),hr){var fn=Jt.setSeries,cn=vr.prox;null==wt?gt>cn||Mt(xt,St,fn):gt>cn?Mt(null,St,fn):xt!=wt&&Mt(xt,St,fn)}}T&&!1!==l&&Ut("setCursor")}o.setLegend=Wt;var Ft=null;function Ht(n){!0===n?Ft=null:Ut("syncRect",Ft=ln.getBoundingClientRect())}function Rt(n,e,r,t,l,a){fr._lock||(Lt(n,e,r,t,l,a,0,!1,null!=n),null!=n?Ct(1):Ct(null,e))}function Lt(n,e,r,t,l,a,i,s,u){var f;if(null==Ft&&Ht(!1),null!=n)r=n.clientX-Ft.left,t=n.clientY-Ft.top;else{if(0>r||0>t)return ot=-10,void(st=-10);var c=Jt.scales,v=c[0],h=c[1],d=e.cursor.sync,p=d.values,m=p[0],g=p[1],x=d.scales,w=x[0],b=x[1],k=Jt.match,_=k[1],M=1==e.scales[w].ori,S=0==jn.ori?qe:Ze,D=1==jn.ori?qe:Ze,E=M?a:l,T=M?l:a,A=M?t:r,P=M?r:t;if(r=null!=w?(0,k[0])(v,w)?y(m,Wn[v],S,0):-10:S*(A/E),t=null!=b?_(h,b)?y(g,Wn[h],D,0):-10:D*(P/T),1==jn.ori){var W=r;r=t,t=W}}u&&(r>1&&qe-1>r||(r=z(r,qe)),t>1&&Ze-1>t||(t=z(t,Ze))),s?(et=r,rt=t,f=fr.move(o,r,t),tt=f[0],lt=f[1]):(ot=r,st=t)}function It(){_t({width:0,height:0},!1)}function Gt(n,e,r,t,l,a){ht=!0,pt=mt=dt._x=dt._y=!1,Lt(n,e,r,t,l,a,0,!0,!1),null!=n&&(Ce(un,gn,Ot),Kt(sn,o,tt,lt,qe,Ze,null))}function Ot(n,e,r,t,l,a){ht=dt._x=dt._y=!1,Lt(n,e,r,t,l,a,0,!1,!0);var i=bt.left,s=bt.top,u=bt.width,f=bt.height,c=u>0||f>0;if(c&&_t(bt),dt.setScale&&c){var v=i,h=u,d=s,p=f;if(1==jn.ori&&(v=s,h=f,d=i,p=u),pt&&yt(Cn,Dt(v,Cn),Dt(v+h,Cn)),mt)for(var m in Wn){var g=Wn[m];m!=Cn&&null==g.from&&g.min!=S&&yt(m,Dt(d+p,m),Dt(d,m))}It()}else fr.lock&&(fr._lock=!fr._lock,fr._lock||Ct());null!=n&&(Fe(un,gn),Kt(un,o,ot,st,qe,Ze,null))}function jt(n){Or(),It(),null!=n&&Kt(vn,o,ot,st,qe,Ze,null)}function Bt(){Tn.forEach(Er),sr(o.width,o.height,!0)}An(dn,xn,Bt);var Nt={};Nt.mousedown=Gt,Nt.mousemove=Rt,Nt.mouseup=Ot,Nt.dblclick=jt,Nt.setSeries=(n,e,r,t)=>{Mt(r,t)},fr.show&&(Ce(sn,ln,Gt),Ce(on,ln,Rt),Ce(fn,ln,Ht),Ce(cn,ln,(function(){if(!fr._lock){var n=ht;if(ht){var e,r,t=!0,l=!0;0==jn.ori?(e=pt,r=mt):(e=mt,r=pt),e&&r&&(t=10>=ot||ot>=qe-10,l=10>=st||st>=Ze-10),e&&t&&(ot=tt>ot?0:qe),r&&l&&(st=lt>st?0:Ze),Ct(1),ht=!1}ot=-10,st=-10,Ct(1),n&&(ht=n)}})),Ce(vn,ln,jt),dr.add(o),o.syncRect=Ht);var Vt=o.hooks=e.hooks||{};function Ut(n,e,r){n in Vt&&Vt[n].forEach((n=>{n.call(null,o,e,r)}))}(e.plugins||[]).forEach((n=>{for(var e in n.hooks)Vt[e]=(Vt[e]||[]).concat(n.hooks[e])}));var Jt=J({key:null,setSeries:!1,filters:{pub:W,sub:W},scales:[Cn,En[1]?En[1].scale:null],match:[Y,Y],values:[null,null]},fr.sync);fr.sync=Jt;var qt=Jt.key,Zt=Je(qt);function Kt(n,e,r,t,l,a,i){Jt.filters.pub(n,e,r,t,l,a,i)&&Zt.pub(n,e,r,t,l,a,i)}function Xt(){Ut("init",e,r),Gr(r||e.data,!1),Nn[Cn]?vt(Cn,Nn[Cn]):Or(),sr(e.width,e.height),Ct(),_t(bt,!1)}return Zt.sub(o),o.pub=function(n,e,r,t,l,a,i){Jt.filters.sub(n,e,r,t,l,a,i)&&Nt[n](null,e,r,t,l,a,i)},o.destroy=function(){Zt.unsub(o),dr.delete(o),Ye.clear(),Pn(dn,xn,Bt),F.remove(),Ut("destroy")},En.forEach(Tr),Tn.forEach((function(n,e){if(n._show=n.show,n.show){var r=Wn[n.scale];null==r&&(n.scale=n.side%2?En[1].scale:Cn,r=Wn[n.scale]);var t=r.time;n.size=E(n.size),n.space=E(n.space),n.rotate=E(n.rotate),n.incrs=E(n.incrs||(2==r.distr?Un:t?1==zn?ie:fe:Jn)),n.splits=E(n.splits||(t&&1==r.distr?Qn:3==r.distr?Pe:4==r.distr?We:Ae)),n.stroke=E(n.stroke),n.grid.stroke=E(n.grid.stroke),n.ticks.stroke=E(n.ticks.stroke);var l=n.values;n.values=j(l)&&!j(l[0])?E(l):t?j(l)?de(Kn,he(l,Xn)):B(l)?function(n,e){var r=Gn(e);return(e,t)=>t.map((e=>r(n(e))))}(Kn,l):l||$n:l||Te,n.filter=E(n.filter||(3>r.distr?A:Re)),n.font=Dr(n.font),n.labelFont=Dr(n.labelFont),n._size=n.size(o,null,e,0),n._space=n._rotate=n._incrs=n._found=n._splits=n._values=null,n._size>0&&(Ar[e]=!0)}})),t?t instanceof HTMLElement?(t.appendChild(F),Xt()):t(o,Xt):Xt(),o}Tr.assign=J,Tr.fmtNum=v,Tr.rangeNum=u,Tr.rangeLog=l,Tr.rangeAsinh=a,Tr.orient=qe,Tr.join=function(n,e){for(var r=new Set,t=0;n.length>t;t++)for(var l=n[t][0],a=l.length,i=0;a>i;i++)r.add(l[i]);for(var o=[Array.from(r).sort(((n,e)=>n-e))],s=o[0].length,u=new Map,f=0;s>f;f++)u.set(o[0][f],f);for(var c=0;n.length>c;c++)for(var v=n[c],h=v[0],d=1;v.length>d;d++){for(var p=v[d],m=Array(s).fill(void 0),g=e?e[c][d]:1,x=[],w=0;p.length>w;w++){var b=p[w],k=u.get(h[w]);null===b?0!=g&&(m[k]=b,2==g&&x.push(k)):m[k]=b}q(m,x,s),o.push(m)}return o},Tr.fmtDate=Gn,Tr.tzDate=function(n,e){var r;return"UTC"==e||"Etc/UTC"==e?r=new Date(+n+6e4*n.getTimezoneOffset()):e==On?r=n:(r=new Date(n.toLocaleString("en-US",{timeZone:e}))).setMilliseconds(n.getMilliseconds()),r},Tr.sync=Je,Tr.addGap=Xe,Tr.clipGaps=Ke;var Ar=Tr.paths={};return Ar.linear=vr,Ar.stepped=function(n){var r=f(n.align,1),t=f(n.ascDesc,!1);return(n,l,a,i)=>qe(n,l,((o,s,u,f,c,v,h,d,p,m,g)=>{var x=o.pxRound,w=0==f.ori?er:rr,b={stroke:new Path2D,fill:null,clip:null,band:null,gaps:[],flags:1},k=b.stroke,_=1*f.dir*(0==f.ori?1:-1);a=e(u,a,i,1),i=e(u,a,i,-1);var y=b.gaps,M=!1,S=x(h(u[1==_?a:i],c,g,p)),z=x(v(s[1==_?a:i],f,m,d)),D=z;w(k,z,S);for(var E=1==_?a:i;E>=a&&i>=E;E+=_){var T=u[E],A=x(v(s[E],f,m,d));if(null!=T){var P=x(h(T,c,g,p));if(M){if(Xe(y,D,A),S!=P){var W=o.width*Z/2,Y=y[y.length-1];Y[0]+=t||1==r?W:-W,Y[1]-=t||-1==r?W:-W}M=!1}1==r?w(k,A,S):w(k,D,P),w(k,A,P),S=P,D=A}else null===T&&(Xe(y,D,A),M=!0)}if(null!=o.fill){var C=b.fill=new Path2D(k),F=x(h(o.fillTo(n,l,o.min,o.max),c,g,p));w(C,D,F),w(C,z,F)}return o.spanGaps||(b.clip=Ke(y,f.ori,d,p,m,g)),n.bands.length>0&&(b.band=Ze(n,l,a,i,k)),b}))},Ar.bars=function(n){var r=f((n=n||G).size,[.6,S,1]),t=n.align||0,l=(n.gap||0)*Z,a=1-r[0],i=f(r[1],S)*Z,o=f(r[2],1)*Z,s=n.disp,u=f(n.each,(()=>{}));return(n,r,f,c)=>qe(n,r,((v,h,d,m,g,x,k,_,y,M,S)=>{var D,E,T=v.pxRound,A=m.dir*(0==m.ori?1:-1),P=g.dir*(1==g.ori?1:-1),W=0==m.ori?tr:lr,Y=0==m.ori?u:(n,e,r,t,l,a,i)=>{u(n,e,r,l,t,i,a)},C=k(v.fillTo(n,r,v.min,v.max),g,S,y),F=T(v.width*Z);if(null!=s){h=s.x0.values(n,r,f,c),2==s.x0.unit&&(h=h.map((e=>n.posToVal(_+e*M,m.key,!0))));var H=s.size.values(n,r,f,c);E=T((E=2==s.size.unit?H[0]*M:x(H[0],m,M,_)-x(0,m,M,_))-F),D=1==A?-F/2:E+F/2}else{var R=M;if(h.length>1)for(var L=1,I=1/0;h.length>L;L++){var G=p(h[L]-h[L-1]);I>G&&(I=G,R=p(x(h[L],m,M,_)-x(h[L-1],m,M,_)))}E=T(w(i,b(o,R-R*a))-F-l),D=(0==t?E/2:t==A?0:E)-t*A*l/2}var O,j={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:3},B=n.bands.length>0;B&&(j.band=new Path2D,O=z(k(g.max,g,S,y),.5));for(var N=j.stroke,V=j.band,U=1==A?f:c;U>=f&&c>=U;U+=A){var J=d[U];if(null==J){if(!B)continue;var q=e(d,1==A?f:c,U,-A),K=e(d,U,1==A?c:f,A),X=d[q];J=X+(U-q)/(K-q)*(d[K]-X)}var Q=x(2!=m.distr||null!=s?h[U]:U,m,M,_),$=k(J,g,S,y),nn=T(Q-D),en=T(b($,C)),rn=T(w($,C)),tn=en-rn;null!=d[U]&&(W(N,nn,rn,E,tn),Y(n,r,U,nn-F/2,rn-F/2,E+F,tn+F)),B&&(1==P?(en=rn,rn=O):(rn=en,en=O),W(V,nn-F/2,rn+F/2,E+F,(tn=en-rn)-F))}return null!=v.fill&&(j.fill=new Path2D(N)),j}))},Ar.spline=function(){return function(n){return(r,t,l,a)=>qe(r,t,((i,o,s,u,f,c,v,h,d,p,m)=>{var g,x,w,b=i.pxRound;0==u.ori?(g=$e,w=er,x=or):(g=nr,w=rr,x=sr);var k=1*u.dir*(0==u.ori?1:-1);l=e(s,l,a,1),a=e(s,l,a,-1);for(var _=[],y=!1,M=b(c(o[1==k?l:a],u,p,h)),S=M,z=[],D=[],E=1==k?l:a;E>=l&&a>=E;E+=k){var T=s[E],A=c(o[E],u,p,h);null!=T?(y&&(Xe(_,S,A),y=!1),z.push(S=A),D.push(v(s[E],f,m,d))):null===T&&(Xe(_,S,A),y=!0)}var P={stroke:n(z,D,g,w,x,b),fill:null,clip:null,band:null,gaps:_,flags:1},W=P.stroke;if(null!=i.fill&&null!=W){var Y=P.fill=new Path2D(W),C=b(v(i.fillTo(r,t,i.min,i.max),f,m,d));w(Y,S,C),w(Y,M,C)}return i.spanGaps||(P.clip=Ke(_,u.ori,h,d,p,m)),r.bands.length>0&&(P.band=Ze(r,t,l,a,W)),P}))}(hr)},Tr}(); diff --git a/src/paths/utils.js b/src/paths/utils.js index 0e31132c..7466e12f 100644 --- a/src/paths/utils.js +++ b/src/paths/utils.js @@ -109,12 +109,11 @@ export function clipGaps(gaps, ori, plotLft, plotTop, plotWid, plotHgt) { for (let i = 0; i < gaps.length; i++) { let g = gaps[i]; - if (g[1] == g[0]) - continue; + if (g[1] > g[0]) { + rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - rect(clip, prevGapEnd, plotTop, g[0] - prevGapEnd, plotTop + plotHgt); - - prevGapEnd = g[1]; + prevGapEnd = g[1]; + } } rect(clip, prevGapEnd, plotTop, plotLft + plotWid - prevGapEnd, plotTop + plotHgt);